upgrade for xorg-server 1.12.99.905 (for 1.13 RC) 2.0-panda accepted/tizen/2.0/panda accepted/2.0-panda/20131114.030943 submit/2.0-panda/20131114.030045
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 3 Sep 2012 04:49:35 +0000 (13:49 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 3 Sep 2012 04:49:35 +0000 (13:49 +0900)
Change-Id: I2558f492e0dbb69994ab1d5269f52784d7d13fa7

671 files changed:
Makefile.am
Xext/Makefile.am
Xext/bigreq.c
Xext/dpms.c
Xext/geext.c
Xext/geext.h
Xext/hashtable.c [new file with mode: 0644]
Xext/hashtable.h [new file with mode: 0644]
Xext/panoramiX.c
Xext/panoramiXprocs.c
Xext/saver.c
Xext/security.c
Xext/shape.c
Xext/shm.c
Xext/sync.c
Xext/syncsrv.h
Xext/xcmisc.c
Xext/xf86bigfont.c
Xext/xf86bigfontsrv.h
Xext/xres.c
Xext/xselinux_ext.c
Xext/xtest.c
Xext/xvdisp.c
Xext/xvdix.h
Xext/xvmain.c
Xext/xvmc.c
Xext/xvmcext.h
Xi/chgdctl.c
Xi/chgptr.h
Xi/exevents.c
Xi/extinit.c
Xi/getbmap.c
Xi/getdctl.c
Xi/getfctl.c
Xi/getfocus.c
Xi/getkmap.c
Xi/getmmap.c
Xi/getprop.c
Xi/getselev.c
Xi/getvers.c
Xi/grabdev.c
Xi/grabdevb.c
Xi/grabdevk.c
Xi/gtmotion.c
Xi/listdev.c
Xi/opendev.c
Xi/queryst.c
Xi/setbmap.c
Xi/setdval.c
Xi/setmmap.c
Xi/setmode.c
Xi/stubs.c
Xi/xichangehierarchy.c
Xi/xigetclientpointer.c
Xi/xigrabdev.c
Xi/xipassivegrab.c
Xi/xiproperty.c
Xi/xiquerydevice.c
Xi/xiquerypointer.c
Xi/xiqueryversion.c
Xi/xiselectev.c
Xi/xisetdevfocus.c
compile [deleted file]
composite/compalloc.c
composite/compext.c
composite/compinit.c
composite/compint.h
composite/compositeext.h
composite/compwindow.c
config/config-backends.h
config/config.c
config/dbus-api [new file with mode: 0644]
config/udev.c
config/wscons.c
configure.ac
damageext/Makefile.am
damageext/damageext.c
damageext/damageextint.h
dbe/dbe.c
dbe/dbestruct.h
debian/README.source [deleted file]
debian/changelog [deleted file]
debian/compat [deleted file]
debian/control [deleted file]
debian/copyright [deleted file]
debian/gbp.conf [deleted file]
debian/inputabiver [deleted file]
debian/install_orig/xdmx-tools.install [deleted file]
debian/install_orig/xdmx.install [deleted file]
debian/install_orig/xnest.install [deleted file]
debian/install_orig/xserver-xephyr.docs [deleted file]
debian/install_orig/xserver-xephyr.install [deleted file]
debian/install_orig/xserver-xfbdev.install [deleted file]
debian/install_orig/xserver-xorg-core-udeb.install [deleted file]
debian/install_orig/xvfb.install [deleted file]
debian/jobs [deleted file]
debian/local/10-kbd.conf [deleted file]
debian/local/10-mouse.conf [deleted file]
debian/local/64-xorg-xkb.rules [deleted file]
debian/local/xvfb-run [deleted file]
debian/local/xvfb-run.1 [deleted file]
debian/patches/001_fedora_extramodes.patch [deleted file]
debian/patches/02_Add-libnettle-as-option-for-sha1.diff [deleted file]
debian/patches/06_dont_trap_access_to_timer_and_keyboard.diff [deleted file]
debian/patches/07-xfree86-fix-build-with-xv-disabled.diff [deleted file]
debian/patches/100_rethrow_signals.patch [deleted file]
debian/patches/104_nvidia_autodetect.patch [deleted file]
debian/patches/105_fglrx_autodetect.patch [deleted file]
debian/patches/111_armel-drv-fallbacks.patch [deleted file]
debian/patches/121_only_switch_vt_when_active.diff [deleted file]
debian/patches/122_xext_fix_card32_overflow_in_xauth.patch [deleted file]
debian/patches/13_debian_add_xkbpath_env_variable.diff [deleted file]
debian/patches/143_default_to_vesa.patch [deleted file]
debian/patches/15-nouveau.diff [deleted file]
debian/patches/157_check_null_modes.patch [deleted file]
debian/patches/158_raise_maxclients.patch [deleted file]
debian/patches/16-xaa-fbcomposite-fix-negative-size.diff [deleted file]
debian/patches/162_null_crtc_in_rotation.patch [deleted file]
debian/patches/165_man_xorg_conf_no_device_ident.patch [deleted file]
debian/patches/166_nullptr_xinerama_keyrepeat.patch [deleted file]
debian/patches/167_nullptr_xisbread.patch [deleted file]
debian/patches/168_glibc_trace_to_stderr.patch [deleted file]
debian/patches/169_mipointer_nullptr_checks.patch [deleted file]
debian/patches/172_cwgetbackingpicture_nullptr_check.patch [deleted file]
debian/patches/187_edid_quirk_hp_nc8430.patch [deleted file]
debian/patches/188_default_primary_to_first_busid.patch [deleted file]
debian/patches/189_xserver_1.5.0_bg_none_root.patch [deleted file]
debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch [deleted file]
debian/patches/191-Xorg-add-an-extra-module-path.patch [deleted file]
debian/patches/197_xvfb-randr.patch [deleted file]
debian/patches/198_nohwaccess.patch [deleted file]
debian/patches/200_randr-null.patch [deleted file]
debian/patches/201_report-real-dpi.patch [deleted file]
debian/patches/202_xf86CoordinationsToWindows.patch [deleted file]
debian/patches/203_gestures-extension.patch [deleted file]
debian/patches/204_fix-neg-sync-transition.patch [deleted file]
debian/patches/205_udev-product-ids.patch [deleted file]
debian/patches/206_intel_8xx_default_to_fbdev.patch [deleted file]
debian/patches/series [deleted file]
debian/rules [deleted file]
debian/serverminver [deleted file]
debian/videoabiver [deleted file]
debian/watch [deleted file]
debian/xserver-common.install [deleted file]
debian/xserver-xorg-core.NEWS [deleted file]
debian/xserver-xorg-core.bug.script [deleted file]
debian/xserver-xorg-core.install [deleted file]
debian/xserver-xorg-core.postinst.in [deleted file]
debian/xserver-xorg-core.postrm.in [deleted file]
debian/xserver-xorg-core.preinst.in [deleted file]
debian/xserver-xorg-dev.install [deleted file]
debian/xserver-xorg-tools.install [deleted file]
debian/xsfbs/repack.sh [deleted file]
debian/xsfbs/xsfbs.mk [deleted file]
debian/xsfbs/xsfbs.sh [deleted file]
dix/Xserver-dtrace.h.in
dix/Xserver.d
dix/colormap.c
dix/devices.c
dix/dispatch.c
dix/dixfonts.c
dix/dixutils.c
dix/enterleave.c
dix/enterleave.h
dix/events.c
dix/extension.c
dix/gc.c
dix/getevents.c [changed mode: 0755->0644]
dix/globals.c
dix/grabs.c
dix/inpututils.c
dix/main.c
dix/pixmap.c
dix/privates.c
dix/property.c
dix/ptrveloc.c
dix/registry.c
dix/resource.c
dix/selection.c
dix/swaprep.c
dix/swapreq.c
dix/tables.c
dix/touch.c
dix/window.c
doc/Xserver-spec.xml
doc/c-extensions [new file with mode: 0644]
doc/dtrace/Xserver-DTrace.xml
exa/exa.c
exa/exa.h
exa/exa_glyphs.c
exa/exa_mixed.c
exa/exa_offscreen.c
exa/exa_priv.h
fb/fb.h
fb/fballpriv.c
fb/fboverlay.c
fb/fboverlay.h
fb/fbscreen.c
fb/fbseg.c
fb/fbwindow.c
fb/wfbrename.h
fix-miregion [new file with mode: 0755]
fix-miregion-private [new file with mode: 0755]
fix-patch-whitespace [new file with mode: 0755]
fix-region [new file with mode: 0755]
glx/Makefile.am
glx/clientinfo.c
glx/createcontext.c
glx/extension_string.c
glx/extension_string.h
glx/glxcmds.c
glx/glxcmdsswap.c
glx/glxcontext.h
glx/glxdri.c
glx/glxdri2.c
glx/glxdricommon.c
glx/glxdriswrast.c
glx/glxext.c
glx/glxext.h
glx/glxscreens.c
glx/glxscreens.h
glx/glxserver.h
glx/indirect_util.c
glx/single2.c
glx/single2swap.c
glx/unpack.h
hw/dmx/config/parser.c [deleted file]
hw/dmx/config/parser.h [deleted file]
hw/dmx/config/scanner.c [deleted file]
hw/dmx/dmx.c
hw/dmx/dmxextension.c
hw/dmx/dmxinit.c
hw/dmx/dmxlog.c
hw/dmx/dmxscrinit.c
hw/dmx/dmxscrinit.h
hw/dmx/glxProxy/glxcmds.c
hw/dmx/glxProxy/glxcmdsswap.c
hw/dmx/glxProxy/glxext.c
hw/dmx/glxProxy/glxext.h
hw/dmx/glxProxy/glxsingle.c
hw/dmx/glxProxy/glxvendor.c
hw/dmx/glxProxy/unpack.h
hw/dmx/input/dmxconsole.c
hw/dmx/input/dmxevents.c
hw/dmx/input/dmxsigio.c
hw/dmx/input/dmxsigio.h
hw/kdrive/Xkdrive.man [new file with mode: 0644]
hw/kdrive/ephyr/Makefile.am
hw/kdrive/ephyr/ephyr.c
hw/kdrive/ephyr/ephyrdriext.c
hw/kdrive/ephyr/ephyrglxext.c
hw/kdrive/ephyr/ephyrhostproxy.c [new file with mode: 0644]
hw/kdrive/ephyr/ephyrhostproxy.h [new file with mode: 0644]
hw/kdrive/ephyr/ephyrinit.c
hw/kdrive/ephyr/ephyrproxyext.c [new file with mode: 0644]
hw/kdrive/ephyr/ephyrproxyext.h [new file with mode: 0644]
hw/kdrive/ephyr/hostx.c
hw/kdrive/ephyr/hostx.h
hw/kdrive/fbdev/Xfbdev.man [new file with mode: 0644]
hw/kdrive/src/kdrive.c
hw/kdrive/src/kdrive.h
hw/kdrive/src/kinput.c
hw/kdrive/src/kxv.c
hw/vfb/InitOutput.c
hw/vfb/Makefile.am
hw/xfree86/Makefile.am
hw/xfree86/common/Makefile.am
hw/xfree86/common/compiler.h
hw/xfree86/common/dgaproc.h [moved from hw/xfree86/dixmods/extmod/dgaproc.h with 96% similarity]
hw/xfree86/common/vidmodeproc.h
hw/xfree86/common/xaarop.h [moved from hw/xfree86/xaa/xaarop.h with 79% similarity]
hw/xfree86/common/xf86.h
hw/xfree86/common/xf86AutoConfig.c
hw/xfree86/common/xf86Bus.c
hw/xfree86/common/xf86Bus.h
hw/xfree86/common/xf86Config.c
hw/xfree86/common/xf86Cursor.c
hw/xfree86/common/xf86DGA.c
hw/xfree86/common/xf86DPMS.c
hw/xfree86/common/xf86Events.c
hw/xfree86/common/xf86Extensions.c [new file with mode: 0644]
hw/xfree86/common/xf86Extensions.h [new file with mode: 0644]
hw/xfree86/common/xf86Globals.c
hw/xfree86/common/xf86Helper.c
hw/xfree86/common/xf86Init.c
hw/xfree86/common/xf86Mode.c
hw/xfree86/common/xf86Module.h
hw/xfree86/common/xf86PM.c
hw/xfree86/common/xf86Priv.h
hw/xfree86/common/xf86Privstr.h
hw/xfree86/common/xf86RandR.c
hw/xfree86/common/xf86VGAarbiter.c
hw/xfree86/common/xf86VGAarbiterPriv.h
hw/xfree86/common/xf86VidMode.c
hw/xfree86/common/xf86Xinput.c
hw/xfree86/common/xf86Xinput.h
hw/xfree86/common/xf86cmap.c
hw/xfree86/common/xf86fbBus.c
hw/xfree86/common/xf86fbman.c
hw/xfree86/common/xf86pciBus.c
hw/xfree86/common/xf86pciBus.h
hw/xfree86/common/xf86platformBus.c [new file with mode: 0644]
hw/xfree86/common/xf86platformBus.h [new file with mode: 0644]
hw/xfree86/common/xf86sbusBus.c
hw/xfree86/common/xf86str.h
hw/xfree86/common/xf86vmode.c [moved from hw/xfree86/dixmods/extmod/xf86vmode.c with 92% similarity]
hw/xfree86/common/xf86xv.c
hw/xfree86/common/xf86xv.h
hw/xfree86/common/xf86xvmc.c
hw/xfree86/common/xf86xvmc.h
hw/xfree86/common/xf86xvpriv.h
hw/xfree86/ddc/ddc.c
hw/xfree86/ddc/xf86DDC.h
hw/xfree86/dixmods/Makefile.am
hw/xfree86/dixmods/dbemodule.c [deleted file]
hw/xfree86/dixmods/extmod/Makefile.am [deleted file]
hw/xfree86/dixmods/extmod/modinit.c [deleted file]
hw/xfree86/dixmods/extmod/modinit.h
hw/xfree86/dixmods/extmod/xf86dga2.c [deleted file]
hw/xfree86/dixmods/extmod/xvmod.c [deleted file]
hw/xfree86/dixmods/extmod/xvmodproc.h [deleted file]
hw/xfree86/dixmods/glxmodule.c
hw/xfree86/dixmods/recordmod.c [deleted file]
hw/xfree86/doc/README.modes
hw/xfree86/doc/ddxDesign.xml
hw/xfree86/doc/exa-driver.txt
hw/xfree86/dri/Makefile.am
hw/xfree86/dri/dri.c
hw/xfree86/dri/dri.h
hw/xfree86/dri/drimodule.c [deleted file]
hw/xfree86/dri/xf86dri.c
hw/xfree86/dri2/Makefile.am
hw/xfree86/dri2/dri2.c
hw/xfree86/dri2/dri2.h
hw/xfree86/dri2/dri2ext.c
hw/xfree86/dri2/dri2int.h [new file with mode: 0644]
hw/xfree86/exa/Makefile.am
hw/xfree86/exa/examodule.c
hw/xfree86/exa/man/exa.man
hw/xfree86/fbdevhw/Makefile.am
hw/xfree86/fbdevhw/fbdevhw.c
hw/xfree86/fbdevhw/fbdevhw.h
hw/xfree86/fbdevhw/fbdevhwstub.c
hw/xfree86/fbdevhw/man/fbdevhw.man
hw/xfree86/i2c/Makefile.am
hw/xfree86/i2c/xf86i2c.c
hw/xfree86/i2c/xf86i2c.h
hw/xfree86/int10/generic.c
hw/xfree86/int10/helper_exec.c
hw/xfree86/int10/helper_mem.c
hw/xfree86/int10/xf86int10.c
hw/xfree86/int10/xf86int10.h
hw/xfree86/loader/Makefile.am
hw/xfree86/loader/loader.c
hw/xfree86/loader/loader.h
hw/xfree86/loader/loaderProcs.h
hw/xfree86/loader/loadext.c [deleted file]
hw/xfree86/loader/loadmod.c
hw/xfree86/man/Xorg.man
hw/xfree86/man/xorg.conf.man
hw/xfree86/modes/xf86Crtc.c
hw/xfree86/modes/xf86Crtc.h
hw/xfree86/modes/xf86Cursors.c
hw/xfree86/modes/xf86DiDGA.c
hw/xfree86/modes/xf86DisplayIDModes.c
hw/xfree86/modes/xf86EdidModes.c
hw/xfree86/modes/xf86Modes.c
hw/xfree86/modes/xf86RandR12.c
hw/xfree86/modes/xf86Rotate.c
hw/xfree86/os-support/bsd/bsd_apm.c
hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
hw/xfree86/os-support/bus/Sbus.c
hw/xfree86/os-support/linux/Makefile.am
hw/xfree86/os-support/linux/int10/linux.c
hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
hw/xfree86/os-support/linux/lnx_apm.c
hw/xfree86/os-support/linux/lnx_init.c
hw/xfree86/os-support/linux/lnx_platform.c [new file with mode: 0644]
hw/xfree86/os-support/shared/platform_noop.c [new file with mode: 0644]
hw/xfree86/os-support/shared/sigio.c
hw/xfree86/os-support/shared/vidmem.c
hw/xfree86/os-support/solaris/sun_apm.c
hw/xfree86/os-support/xf86_OSlib.h
hw/xfree86/os-support/xf86_OSproc.h
hw/xfree86/parser/Device.c
hw/xfree86/parser/Files.c
hw/xfree86/parser/Flags.c
hw/xfree86/parser/Input.c
hw/xfree86/parser/InputClass.c
hw/xfree86/parser/Layout.c
hw/xfree86/parser/Module.c
hw/xfree86/parser/Monitor.c
hw/xfree86/parser/Pointer.c
hw/xfree86/parser/Screen.c
hw/xfree86/parser/Vendor.c
hw/xfree86/parser/Video.c
hw/xfree86/parser/read.c
hw/xfree86/parser/scan.c
hw/xfree86/parser/write.c
hw/xfree86/ramdac/Makefile.am
hw/xfree86/ramdac/xf86BitOrder.c [deleted file]
hw/xfree86/ramdac/xf86Cursor.c
hw/xfree86/ramdac/xf86CursorPriv.h
hw/xfree86/ramdac/xf86HWCurs.c
hw/xfree86/ramdac/xf86RamDacCmap.c
hw/xfree86/sdksyms.sh
hw/xfree86/shadowfb/Makefile.am
hw/xfree86/shadowfb/shadow.c
hw/xfree86/utils/man/cvt.man
hw/xfree86/utils/man/gtf.man
hw/xfree86/vbe/Makefile.am
hw/xfree86/vbe/vbe.c
hw/xfree86/vbe/vbe.h
hw/xfree86/vgahw/vgaCmap.c
hw/xfree86/vgahw/vgaHW.c
hw/xfree86/xaa/Makefile.am [deleted file]
hw/xfree86/xaa/XAA.HOWTO [deleted file]
hw/xfree86/xaa/l-xaaBitmap.c [deleted file]
hw/xfree86/xaa/l-xaaStipple.c [deleted file]
hw/xfree86/xaa/l-xaaTEGlyph.c [deleted file]
hw/xfree86/xaa/l3-xaaBitmap.c [deleted file]
hw/xfree86/xaa/l3-xaaStipple.c [deleted file]
hw/xfree86/xaa/lf-xaaBitmap.c [deleted file]
hw/xfree86/xaa/lf-xaaStipple.c [deleted file]
hw/xfree86/xaa/lf-xaaTEGlyph.c [deleted file]
hw/xfree86/xaa/lf3-xaaBitmap.c [deleted file]
hw/xfree86/xaa/lf3-xaaStipple.c [deleted file]
hw/xfree86/xaa/m-xaaBitmap.c [deleted file]
hw/xfree86/xaa/m-xaaStipple.c [deleted file]
hw/xfree86/xaa/m-xaaTEGlyph.c [deleted file]
hw/xfree86/xaa/m3-xaaBitmap.c [deleted file]
hw/xfree86/xaa/m3-xaaStipple.c [deleted file]
hw/xfree86/xaa/mf-xaaBitmap.c [deleted file]
hw/xfree86/xaa/mf-xaaStipple.c [deleted file]
hw/xfree86/xaa/mf-xaaTEGlyph.c [deleted file]
hw/xfree86/xaa/mf3-xaaBitmap.c [deleted file]
hw/xfree86/xaa/mf3-xaaStipple.c [deleted file]
hw/xfree86/xaa/s-xaaDashLine.c [deleted file]
hw/xfree86/xaa/s-xaaLine.c [deleted file]
hw/xfree86/xaa/xaa.h [deleted file]
hw/xfree86/xaa/xaaBitBlt.c [deleted file]
hw/xfree86/xaa/xaaBitOrder.c [deleted file]
hw/xfree86/xaa/xaaBitmap.c [deleted file]
hw/xfree86/xaa/xaaCpyArea.c [deleted file]
hw/xfree86/xaa/xaaCpyPlane.c [deleted file]
hw/xfree86/xaa/xaaCpyWin.c [deleted file]
hw/xfree86/xaa/xaaDashLine.c [deleted file]
hw/xfree86/xaa/xaaFallback.c [deleted file]
hw/xfree86/xaa/xaaFillArc.c [deleted file]
hw/xfree86/xaa/xaaFillPoly.c [deleted file]
hw/xfree86/xaa/xaaFillRect.c [deleted file]
hw/xfree86/xaa/xaaGC.c [deleted file]
hw/xfree86/xaa/xaaGCmisc.c [deleted file]
hw/xfree86/xaa/xaaImage.c [deleted file]
hw/xfree86/xaa/xaaInit.c [deleted file]
hw/xfree86/xaa/xaaInitAccel.c [deleted file]
hw/xfree86/xaa/xaaLine.c [deleted file]
hw/xfree86/xaa/xaaLineMisc.c [deleted file]
hw/xfree86/xaa/xaaNonTEGlyph.c [deleted file]
hw/xfree86/xaa/xaaNonTEText.c [deleted file]
hw/xfree86/xaa/xaaOffscreen.c [deleted file]
hw/xfree86/xaa/xaaOverlay.c [deleted file]
hw/xfree86/xaa/xaaOverlayDF.c [deleted file]
hw/xfree86/xaa/xaaPCache.c [deleted file]
hw/xfree86/xaa/xaaPict.c [deleted file]
hw/xfree86/xaa/xaaROP.c [deleted file]
hw/xfree86/xaa/xaaRect.c [deleted file]
hw/xfree86/xaa/xaaSpans.c [deleted file]
hw/xfree86/xaa/xaaStateChange.c [deleted file]
hw/xfree86/xaa/xaaStipple.c [deleted file]
hw/xfree86/xaa/xaaTEGlyph.c [deleted file]
hw/xfree86/xaa/xaaTEText.c [deleted file]
hw/xfree86/xaa/xaaTables.c [deleted file]
hw/xfree86/xaa/xaaWideLine.c [deleted file]
hw/xfree86/xaa/xaacexp.h [deleted file]
hw/xfree86/xaa/xaalocal.h [deleted file]
hw/xfree86/xaa/xaawrap.h [deleted file]
hw/xnest/Init.c
hw/xnest/Makefile.am
hw/xnest/Screen.c
hw/xnest/Screen.h
hw/xquartz/GL/glcontextmodes.c [new file with mode: 0644]
hw/xquartz/GL/glcontextmodes.h [new file with mode: 0644]
hw/xquartz/GL/indirect.c
hw/xquartz/X11Application.h
hw/xquartz/X11Application.m
hw/xquartz/X11Controller.m
hw/xquartz/applewm.c
hw/xquartz/bundle/Info.plist.cpp
hw/xquartz/bundle/Resources/English.lproj/Localizable.strings
hw/xquartz/console_redirect.c
hw/xquartz/darwin.c
hw/xquartz/mach-startup/bundle-main.c
hw/xquartz/pbproxy/x-selection.m
hw/xquartz/pseudoramiX.c
hw/xquartz/pseudoramiX.h
hw/xquartz/quartz.c
hw/xquartz/xpr/appledri.c
hw/xquartz/xpr/dri.c
hw/xquartz/xpr/xprEvent.c
hw/xwin/InitOutput.c
hw/xwin/Makefile.am
hw/xwin/README [deleted file]
hw/xwin/glx/Makefile.am
hw/xwin/glx/gen_gl_wrappers.py
hw/xwin/glx/indirect.c
hw/xwin/glx/wgl_ext_api.h [new file with mode: 0644]
hw/xwin/man/XWin.man
hw/xwin/win.h
hw/xwin/winblock.c
hw/xwin/winclipboard.h
hw/xwin/winclipboardinit.c
hw/xwin/winclipboardthread.c
hw/xwin/winclipboardunicode.c [deleted file]
hw/xwin/winclipboardwndproc.c
hw/xwin/winclipboardwrappers.c
hw/xwin/winclipboardxevents.c
hw/xwin/wincreatewnd.c
hw/xwin/windialogs.c
hw/xwin/winerror.c
hw/xwin/winglobals.h [new file with mode: 0644]
hw/xwin/winkeyhook.c
hw/xwin/winmonitors.c
hw/xwin/winmonitors.h [new file with mode: 0644]
hw/xwin/winmultiwindowicons.c
hw/xwin/winmultiwindowicons.h [new file with mode: 0644]
hw/xwin/winmultiwindowwindow.c
hw/xwin/winmultiwindowwm.c
hw/xwin/winnativegdi.c
hw/xwin/winpfbdd.c
hw/xwin/winprefs.c
hw/xwin/winprefs.h
hw/xwin/winprefslex.c [deleted file]
hw/xwin/winprefsyacc.c [deleted file]
hw/xwin/winprefsyacc.h [deleted file]
hw/xwin/winprocarg.c
hw/xwin/winscrinit.c
hw/xwin/winshaddd.c
hw/xwin/winshadddnl.c
hw/xwin/winshadgdi.c
hw/xwin/winwakeup.c
hw/xwin/winwin32rootless.c
hw/xwin/winwin32rootlesswindow.c
hw/xwin/winwindow.h
hw/xwin/winwindowswm.c
hw/xwin/winwndproc.c
include/Makefile.am
include/dix-config.h.in
include/dix.h
include/dixevents.h
include/dixfont.h
include/dixstruct.h
include/do-not-use-config.h.in [deleted file]
include/exevents.h
include/extension.h
include/extinit.h
include/globals.h
include/glx_extinit.h [new file with mode: 0644]
include/hotplug.h
include/input.h
include/inputstr.h
include/list.h
include/misc.h
include/opaque.h
include/os.h
include/pixmap.h
include/pixmapstr.h
include/privates.h
include/protocol-versions.h
include/ptrveloc.h
include/resource.h
include/screenint.h
include/scrnintstr.h
include/window.h
include/xkbsrv.h
include/xorg-config.h.in
include/xorg-server.h.in
m4/libtool.m4 [deleted file]
m4/ltoptions.m4 [deleted file]
m4/ltsugar.m4 [deleted file]
m4/ltversion.m4 [deleted file]
m4/lt~obsolete.m4 [deleted file]
man/Xserver.man
mi/mibstore.c [new file with mode: 0644]
mi/midispcur.c
mi/mieq.c
mi/miexpose.c
mi/miinitext.c
mi/mioverlay.c
mi/mipointer.c
mi/miscrinit.c
mi/misprite.c
miext/Makefile.am
miext/cw/Makefile.am [deleted file]
miext/cw/cw.c [deleted file]
miext/cw/cw.h [deleted file]
miext/cw/cw_ops.c [deleted file]
miext/cw/cw_render.c [deleted file]
miext/damage/damage.c
miext/rootless/rootlessScreen.c
miext/shadow/shadow.c
miext/shadow/shrotpackYX.h
miext/sync/misync.c
os/WaitFor.c
os/backtrace.c
os/connection.c
os/io.c
os/log.c
os/osinit.c
os/utils.c
os/xdmcp.c
os/xsha1.c
packaging/xorg-x11-server.spec
randr/Makefile.am
randr/randr.c
randr/randrstr.h
randr/rrcrtc.c
randr/rrdispatch.c
randr/rrinfo.c
randr/rrmode.c
randr/rroutput.c
randr/rrproperty.c
randr/rrprovider.c [new file with mode: 0644]
randr/rrproviderproperty.c [new file with mode: 0644]
randr/rrscreen.c
randr/rrtransform.h
randr/rrxinerama.c
record/record.c
render/animcur.c
render/filter.c
render/glyph.c
render/glyphstr.h
render/picture.c
render/picturestr.h
render/render.c
test/Makefile.am
test/ddxstubs.c
test/hashtabletest.c [new file with mode: 0644]
test/input.c
test/os.c [new file with mode: 0644]
test/signal-logging.c [new file with mode: 0644]
test/touch.c
test/xi2/Makefile.am
test/xi2/protocol-common.c
test/xi2/protocol-common.h
test/xi2/protocol-xipassivegrabdevice.c
test/xi2/protocol-xiquerydevice.c
test/xi2/protocol-xiquerypointer.c
test/xi2/protocol-xiqueryversion.c
test/xi2/protocol-xiselectevents.c
test/xi2/protocol-xisetclientpointer.c
test/xi2/protocol-xiwarppointer.c
test/xtest.c
xfixes/cursor.c
xfixes/region.c
xfixes/select.c
xfixes/xfixes.c
xfixes/xfixesint.h
xkb/XKBGAlloc.c
xkb/XKBMAlloc.c
xkb/XKM_file_format.txt [new file with mode: 0644]
xkb/ddxList.c
xkb/ddxLoad.c
xkb/xkb.c
xkb/xkb.h
xkb/xkbAccessX.c
xkb/xkbActions.c
xkb/xkbEvents.c
xkb/xkbgeom.h
xorg-server.pc.in
ylwrap [deleted file]

index 0166b9d..5ce1430 100644 (file)
@@ -90,10 +90,16 @@ DIST_SUBDIRS = \
        glx \
        exa \
        config \
-       gesture \
        hw \
        test
 
 # gross hack
 relink: all
        $(AM_V_at)$(MAKE) -C hw relink
+
+install-headers: Makefile
+       +find . -name Makefile | while read m; do                       \
+               if grep -q install-sdkHEADERS $$m; then                 \
+                       (cd `dirname "$$m"` && make install-sdkHEADERS) \
+               fi                                                      \
+       done
index cb432e0..8e31f13 100644 (file)
@@ -1,16 +1,4 @@
-# libXext.la:        includes all extensions and should be linked into Xvfb,
-#                    Xnest, Xdmx and Xprt
-# libXextbuiltin.la: includes those extensions that are built directly into
-#                    Xorg by default
-# libXextmodule.la:  includes those extensions that are built into a module
-#                    that Xorg loads
-if XORG
-noinst_LTLIBRARIES = libXext.la libXextbuiltin.la libXextmodule.la
-else
 noinst_LTLIBRARIES = libXext.la
-endif
-
-INCLUDES = -I$(top_srcdir)/hw/xfree86/dixmods/extmod
 
 AM_CFLAGS = $(DIX_CFLAGS)
 
@@ -30,10 +18,7 @@ BUILTIN_SRCS =                       \
        syncsrv.h               \
        xcmisc.c                \
        xtest.c
-
-# Sources always included in libXextmodule.la & libXext.la. That's right, zero.
-MODULE_SRCS =
-MODULE_LIBS =
+BUILTIN_LIBS =
 
 # Optional sources included if extension enabled by configure.ac rules
 
@@ -46,19 +31,19 @@ endif
 # XVideo extension
 XV_SRCS = xvmain.c xvdisp.c xvmc.c xvdix.h xvmcext.h xvdisp.h
 if XV
-MODULE_SRCS  += $(XV_SRCS)
+BUILTIN_SRCS  += $(XV_SRCS)
 endif
 
 # XResource extension: lets clients get data about per-client resource usage
-RES_SRCS = xres.c
+RES_SRCS = hashtable.c hashtable.h xres.c
 if RES
-MODULE_SRCS  += $(RES_SRCS)
+BUILTIN_SRCS  += $(RES_SRCS)
 endif
 
 # MIT ScreenSaver extension
 SCREENSAVER_SRCS = saver.c
 if SCREENSAVER
-MODULE_SRCS  += $(SCREENSAVER_SRCS)
+BUILTIN_SRCS  += $(SCREENSAVER_SRCS)
 endif
 
 # Xinerama extension: making multiple video devices act as one virtual screen
@@ -84,8 +69,8 @@ endif
 # requires X-ACE extension
 XSELINUX_SRCS = xselinux_ext.c xselinux_hooks.c xselinux_label.c xselinux.h xselinuxint.h
 if XSELINUX
-MODULE_SRCS += $(XSELINUX_SRCS)
-MODULE_LIBS += $(SELINUX_LIBS)
+BUILTIN_SRCS += $(XSELINUX_SRCS)
+BUILTIN_LIBS += $(SELINUX_LIBS)
 endif
 
 # Security extension: multi-level security to protect clients from each other
@@ -103,20 +88,13 @@ endif
 # DPMS extension
 DPMS_SRCS = dpms.c dpmsproc.h
 if DPMSExtension
-MODULE_SRCS += $(DPMS_SRCS)
+BUILTIN_SRCS += $(DPMS_SRCS)
 endif
 
 # Now take all of the above, mix well, bake for 10 minutes and get libXext*.la
 
-libXext_la_SOURCES =           $(BUILTIN_SRCS) $(MODULE_SRCS)
-libXext_la_LIBADD =            $(MODULE_LIBS)
-
-if XORG
-libXextbuiltin_la_SOURCES =    $(BUILTIN_SRCS)
-
-libXextmodule_la_SOURCES =     $(MODULE_SRCS)
-libXextmodule_la_LIBADD =      $(MODULE_LIBS)
-endif
+libXext_la_SOURCES =           $(BUILTIN_SRCS)
+libXext_la_LIBADD =            $(BUILTIN_LIBS)
 
 EXTRA_DIST = \
        $(MITSHM_SRCS) \
index 49355c4..c78a1e4 100644 (file)
@@ -38,9 +38,7 @@ from The Open Group.
 #include "extnsionst.h"
 #include <X11/extensions/bigreqsproto.h>
 #include "opaque.h"
-#include "modinit.h"
-
-void BigReqExtensionInit(INITARGS);
+#include "extinit.h"
 
 static int
 ProcBigReqDispatch(ClientPtr client)
@@ -55,21 +53,22 @@ ProcBigReqDispatch(ClientPtr client)
         return BadRequest;
     REQUEST_SIZE_MATCH(xBigReqEnableReq);
     client->big_requests = TRUE;
-    memset(&rep, 0, sizeof(xBigReqEnableReply));
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.max_request_size = maxBigRequestSize;
+    rep = (xBigReqEnableReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .max_request_size = maxBigRequestSize
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.max_request_size);
     }
-    WriteToClient(client, sizeof(xBigReqEnableReply), (char *) &rep);
+    WriteToClient(client, sizeof(xBigReqEnableReply), &rep);
     return Success;
 }
 
 void
-BigReqExtensionInit(INITARGS)
+BigReqExtensionInit(void)
 {
     AddExtension(XBigReqExtensionName, 0, 0,
                  ProcBigReqDispatch, ProcBigReqDispatch,
index 348c872..5f1a35d 100644 (file)
@@ -39,27 +39,28 @@ Equipment Corporation.
 #include "opaque.h"
 #include <X11/extensions/dpmsproto.h>
 #include "dpmsproc.h"
-#include "modinit.h"
+#include "extinit.h"
 
 static int
 ProcDPMSGetVersion(ClientPtr client)
 {
     /* REQUEST(xDPMSGetVersionReq); */
-    xDPMSGetVersionReply rep;
+    xDPMSGetVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = DPMSMajorVersion,
+        .minorVersion = DPMSMinorVersion
+    };
 
     REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = DPMSMajorVersion;
-    rep.minorVersion = DPMSMinorVersion;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swaps(&rep.majorVersion);
         swaps(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDPMSGetVersionReply), &rep);
     return Success;
 }
 
@@ -67,19 +68,19 @@ static int
 ProcDPMSCapable(ClientPtr client)
 {
     /* REQUEST(xDPMSCapableReq); */
-    xDPMSCapableReply rep;
+    xDPMSCapableReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .capable = DPMSCapableFlag
+    };
 
     REQUEST_SIZE_MATCH(xDPMSCapableReq);
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.capable = DPMSCapableFlag;
-
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
     }
-    WriteToClient(client, sizeof(xDPMSCapableReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDPMSCapableReply), &rep);
     return Success;
 }
 
@@ -87,24 +88,24 @@ static int
 ProcDPMSGetTimeouts(ClientPtr client)
 {
     /* REQUEST(xDPMSGetTimeoutsReq); */
-    xDPMSGetTimeoutsReply rep;
+    xDPMSGetTimeoutsReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .standby = DPMSStandbyTime / MILLI_PER_SECOND,
+        .suspend = DPMSSuspendTime / MILLI_PER_SECOND,
+        .off = DPMSOffTime / MILLI_PER_SECOND
+    };
 
     REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.standby = DPMSStandbyTime / MILLI_PER_SECOND;
-    rep.suspend = DPMSSuspendTime / MILLI_PER_SECOND;
-    rep.off = DPMSOffTime / MILLI_PER_SECOND;
-
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swaps(&rep.standby);
         swaps(&rep.suspend);
         swaps(&rep.off);
     }
-    WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), &rep);
     return Success;
 }
 
@@ -188,21 +189,21 @@ static int
 ProcDPMSInfo(ClientPtr client)
 {
     /* REQUEST(xDPMSInfoReq); */
-    xDPMSInfoReply rep;
+    xDPMSInfoReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .power_level = DPMSPowerLevel,
+        .state = DPMSEnabled
+    };
 
     REQUEST_SIZE_MATCH(xDPMSInfoReq);
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.power_level = DPMSPowerLevel;
-    rep.state = DPMSEnabled;
-
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swaps(&rep.power_level);
     }
-    WriteToClient(client, sizeof(xDPMSInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDPMSInfoReply), &rep);
     return Success;
 }
 
@@ -354,7 +355,7 @@ SProcDPMSDispatch(ClientPtr client)
 }
 
 void
-DPMSExtensionInit(INITARGS)
+DPMSExtensionInit(void)
 {
     AddExtension(DPMSExtensionName, 0, 0,
                  ProcDPMSDispatch, SProcDPMSDispatch,
index 0702823..1e5ae6f 100644 (file)
 #include "geint.h"
 #include "geext.h"
 #include "protocol-versions.h"
+#include "extinit.h"
 
 DevPrivateKeyRec GEClientPrivateKeyRec;
 
-int RT_GECLIENT = 0;
-
 GEExtension GEExtensions[MAXEXTENSIONS];
 
 /* Major available requests */
@@ -65,14 +64,16 @@ ProcGEQueryVersion(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xGEQueryVersionReq);
 
-    rep.repType = X_Reply;
-    rep.RepType = X_GEQueryVersion;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xGEQueryVersionReply) {
+        .repType = X_Reply,
+        .RepType = X_GEQueryVersion,
+        .sequenceNumber = client->sequence,
+        .length = 0,
 
-    /* return the supported version by the server */
-    rep.majorVersion = SERVER_GE_MAJOR_VERSION;
-    rep.minorVersion = SERVER_GE_MINOR_VERSION;
+        /* return the supported version by the server */
+        .majorVersion = SERVER_GE_MAJOR_VERSION,
+        .minorVersion = SERVER_GE_MINOR_VERSION
+    };
 
     /* Remember version the client requested */
     pGEClient->major_version = stuff->majorVersion;
@@ -85,7 +86,7 @@ ProcGEQueryVersion(ClientPtr client)
         swaps(&rep.minorVersion);
     }
 
-    WriteToClient(client, sizeof(xGEQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xGEQueryVersionReply), &rep);
     return Success;
 }
 
index d2a15dc..f468979 100644 (file)
@@ -78,6 +78,4 @@ extern _X_EXPORT void GERegisterExtension(int extension,
 
 extern _X_EXPORT void GEInitEvent(xGenericEvent *ev, int extension);
 
-extern _X_EXPORT void GEExtensionInit(void);
-
 #endif                          /* _GEEXT_H_ */
diff --git a/Xext/hashtable.c b/Xext/hashtable.c
new file mode 100644 (file)
index 0000000..9d9ef89
--- /dev/null
@@ -0,0 +1,295 @@
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <stdlib.h>
+#include "misc.h"
+#include "hashtable.h"
+
+/* HashResourceID */
+#include "resource.h"
+
+#define INITHASHSIZE 6
+#define MAXHASHSIZE 11
+
+struct HashTableRec {
+    int             keySize;
+    int             dataSize;
+
+    int             elements;   /* number of elements inserted */
+    int             bucketBits; /* number of buckets is 1 << bucketBits */
+    struct xorg_list *buckets;  /* array of bucket list heads */
+
+    HashFunc        hash;
+    HashCompareFunc compare;
+
+    pointer         cdata;
+};
+
+typedef struct {
+    struct xorg_list l;
+    void *key;
+    void *data;
+} BucketRec, *BucketPtr;
+
+HashTable
+ht_create(int             keySize,
+          int             dataSize,
+          HashFunc        hash,
+          HashCompareFunc compare,
+          pointer         cdata)
+{
+    int c;
+    int numBuckets;
+    HashTable ht = malloc(sizeof(struct HashTableRec));
+
+    if (!ht) {
+        return NULL;
+    }
+
+    ht->keySize = keySize;
+    ht->dataSize = dataSize;
+    ht->hash = hash;
+    ht->compare = compare;
+    ht->elements = 0;
+    ht->bucketBits = INITHASHSIZE;
+    numBuckets = 1 << ht->bucketBits;
+    ht->buckets = malloc(numBuckets * sizeof(*ht->buckets));
+    ht->cdata = cdata;
+
+    if (ht->buckets) {
+        for (c = 0; c < numBuckets; ++c) {
+            xorg_list_init(&ht->buckets[c]);
+        }
+        return ht;
+    } else {
+        free(ht);
+        return NULL;
+    }
+}
+
+void
+ht_destroy(HashTable ht)
+{
+    int c;
+    BucketPtr it, tmp;
+    int numBuckets = 1 << ht->bucketBits;
+    for (c = 0; c < numBuckets; ++c) {
+        xorg_list_for_each_entry_safe(it, tmp, &ht->buckets[c], l) {
+            xorg_list_del(&it->l);
+            free(it);
+        }
+    }
+    free(ht->buckets);
+}
+
+static Bool
+double_size(HashTable ht)
+{
+    struct xorg_list *newBuckets;
+    int numBuckets = 1 << ht->bucketBits;
+    int newBucketBits = ht->bucketBits + 1;
+    int newNumBuckets = 1 << newBucketBits;
+    int c;
+
+    newBuckets = malloc(newNumBuckets * sizeof(*ht->buckets));
+    if (newBuckets) {
+        for (c = 0; c < newNumBuckets; ++c) {
+            xorg_list_init(&newBuckets[c]);
+        }
+
+        for (c = 0; c < numBuckets; ++c) {
+            BucketPtr it, tmp;
+            xorg_list_for_each_entry_safe(it, tmp, &ht->buckets[c], l) {
+                struct xorg_list *newBucket =
+                    &newBuckets[ht->hash(ht->cdata, it->key, newBucketBits)];
+                xorg_list_del(&it->l);
+                xorg_list_add(&it->l, newBucket);
+            }
+        }
+        free(ht->buckets);
+
+        ht->buckets = newBuckets;
+        ht->bucketBits = newBucketBits;
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+}
+
+pointer
+ht_add(HashTable ht, pointer key)
+{
+    unsigned index = ht->hash(ht->cdata, key, ht->bucketBits);
+    struct xorg_list *bucket = &ht->buckets[index];
+    BucketRec *elem = calloc(1, sizeof(BucketRec));
+    if (!elem) {
+        goto outOfMemory;
+    }
+    elem->key = malloc(ht->keySize);
+    if (!elem->key) {
+        goto outOfMemory;
+    }
+    /* we avoid signaling an out-of-memory error if dataSize is 0 */
+    elem->data = calloc(1, ht->dataSize);
+    if (ht->dataSize && !elem->data) {
+        goto outOfMemory;
+    }
+    xorg_list_add(&elem->l, bucket);
+    ++ht->elements;
+
+    memcpy(elem->key, key, ht->keySize);
+
+    if (ht->elements > 4 * (1 << ht->bucketBits) &&
+        ht->bucketBits < MAXHASHSIZE) {
+        if (!double_size(ht)) {
+            --ht->elements;
+            xorg_list_del(&elem->l);
+            goto outOfMemory;
+        }
+    }
+
+    /* if memory allocation has failed due to dataSize being 0, return
+       a "dummy" pointer pointing at the of the key */
+    return elem->data ? elem->data : ((char*) elem->key + ht->keySize);
+
+ outOfMemory:
+    if (elem) {
+        free(elem->key);
+        free(elem->data);
+        free(elem);
+    }
+
+    return NULL;
+}
+
+void
+ht_remove(HashTable ht, pointer key)
+{
+    unsigned index = ht->hash(ht->cdata, key, ht->bucketBits);
+    struct xorg_list *bucket = &ht->buckets[index];
+    BucketPtr it;
+
+    xorg_list_for_each_entry(it, bucket, l) {
+        if (ht->compare(ht->cdata, key, it->key) == 0) {
+            xorg_list_del(&it->l);
+            --ht->elements;
+            free(it->key);
+            free(it->data);
+            free(it);
+            return;
+        }
+    }
+}
+
+pointer
+ht_find(HashTable ht, pointer key)
+{
+    unsigned index = ht->hash(ht->cdata, key, ht->bucketBits);
+    struct xorg_list *bucket = &ht->buckets[index];
+    BucketPtr it;
+
+    xorg_list_for_each_entry(it, bucket, l) {
+        if (ht->compare(ht->cdata, key, it->key) == 0) {
+            return it->data ? it->data : ((char*) it->key + ht->keySize);
+        }
+    }
+
+    return NULL;
+}
+
+void
+ht_dump_distribution(HashTable ht)
+{
+    int c;
+    int numBuckets = 1 << ht->bucketBits;
+    for (c = 0; c < numBuckets; ++c) {
+        BucketPtr it;
+        int n = 0;
+
+        xorg_list_for_each_entry(it, &ht->buckets[c], l) {
+            ++n;
+        }
+        printf("%d: %d\n", c, n);
+    }
+}
+
+/* Picked the function from http://burtleburtle.net/bob/hash/doobs.html by
+   Bob Jenkins, which is released in public domain */
+static CARD32
+one_at_a_time_hash(const void *data, int len)
+{
+    CARD32 hash;
+    int i;
+    const char *key = data;
+    for (hash=0, i=0; i<len; ++i) {
+        hash += key[i];
+        hash += (hash << 10);
+        hash ^= (hash >> 6);
+    }
+    hash += (hash << 3);
+    hash ^= (hash >> 11);
+    hash += (hash << 15);
+    return hash;
+}
+
+unsigned
+ht_generic_hash(void *cdata, const void *ptr, int numBits)
+{
+    HtGenericHashSetupPtr setup = cdata;
+    return one_at_a_time_hash(ptr, setup->keySize) & ~((~0) << numBits);
+}
+
+int
+ht_generic_compare(void *cdata, const void *l, const void *r)
+{
+    HtGenericHashSetupPtr setup = cdata;
+    return memcmp(l, r, setup->keySize);
+}
+
+unsigned
+ht_resourceid_hash(void * cdata, const void * data, int numBits)
+{
+    const XID* idPtr = data;
+    XID id = *idPtr & RESOURCE_ID_MASK;
+    (void) cdata;
+    return HashResourceID(id, numBits);
+}
+
+int
+ht_resourceid_compare(void* cdata, const void* a, const void* b)
+{
+    const XID* xa = a;
+    const XID* xb = b;
+    (void) cdata;
+    return
+        *xa < *xb ? -1 :
+        *xa > *xb ? 1 :
+        0;
+}
+
+void
+ht_dump_contents(HashTable ht,
+                 void (*print_key)(void *opaque, void *key),
+                 void (*print_value)(void *opaque, void *value),
+                 void* opaque)
+{
+    int c;
+    int numBuckets = 1 << ht->bucketBits;
+    for (c = 0; c < numBuckets; ++c) {
+        BucketPtr it;
+        int n = 0;
+
+        printf("%d: ", c);
+        xorg_list_for_each_entry(it, &ht->buckets[c], l) {
+            if (n > 0) {
+                printf(", ");
+            }
+            print_key(opaque, it->key);
+            printf("->");
+            print_value(opaque, it->data);
+            ++n;
+        }
+        printf("\n");
+    }
+}
diff --git a/Xext/hashtable.h b/Xext/hashtable.h
new file mode 100644 (file)
index 0000000..5d15984
--- /dev/null
@@ -0,0 +1,137 @@
+#ifndef HASHTABLE_H
+#define HASHTABLE_H 1
+
+#include <dix-config.h>
+#include <X11/Xfuncproto.h>
+#include <X11/Xdefs.h>
+#include "list.h"
+
+/** @brief A hashing function.
+
+  @param[in/out] cdata  Opaque data that can be passed to HtInit that will
+                        eventually end up here
+  @param[in] ptr        The data to be hashed. The size of the data, if
+                        needed, can be configured via a record that can be
+                        passed via cdata.
+  @param[in] numBits    The number of bits this hash needs to have in the
+                        resulting hash
+
+  @return  A numBits-bit hash of the data
+*/
+typedef unsigned (*HashFunc)(void * cdata, const void * ptr, int numBits);
+
+/** @brief A comparison function for hashed keys.
+
+  @param[in/out] cdata  Opaque data that ca be passed to Htinit that will
+                        eventually end up here
+  @param[in] l          The left side data to be compared
+  @param[in] r          The right side data to be compared
+
+  @return -1 if l < r, 0 if l == r, 1 if l > r
+*/
+typedef int (*HashCompareFunc)(void * cdata, const void * l, const void * r);
+
+struct HashTableRec;
+
+typedef struct HashTableRec *HashTable;
+
+/** @brief  A configuration for HtGenericHash */
+typedef struct {
+    int             keySize;
+} HtGenericHashSetupRec, *HtGenericHashSetupPtr;
+
+/** @brief  ht_create initalizes a hash table for a certain hash table
+            configuration
+
+    @param[out] ht       The hash table structure to initialize
+    @param[in] keySize   The key size in bytes
+    @param[in] dataSize  The data size in bytes
+    @param[in] hash      The hash function to use for hashing keys
+    @param[in] compare   The comparison function for hashing keys
+    @param[in] cdata     Opaque data that will be passed to hash and
+                         comparison functions
+*/
+extern _X_EXPORT HashTable ht_create(int             keySize,
+                                     int             dataSize,
+                                     HashFunc        hash,
+                                     HashCompareFunc compare,
+                                     pointer         cdata);
+/** @brief  HtDestruct deinitializes the structure. It does not free the
+            memory allocated to HashTableRec
+*/
+extern _X_EXPORT void ht_destroy(HashTable ht);
+
+/** @brief  Adds a new key to the hash table. The key will be copied
+            and a pointer to the value will be returned. The data will
+            be initialized with zeroes.
+
+  @param[in/out] ht  The hash table
+  @param[key] key    The key. The contents of the key will be copied.
+
+  @return On error NULL is returned, otherwise a pointer to the data
+          associated with the newly inserted key.
+
+  @note  If dataSize is 0, a pointer to the end of the key may be returned
+         to avoid returning NULL. Obviously the data pointed cannot be
+         modified, as implied by dataSize being 0.
+*/
+extern _X_EXPORT pointer ht_add(HashTable ht, pointer key);
+
+/** @brief  Removes a key from the hash table along with its
+            associated data, which will be free'd.
+*/
+extern _X_EXPORT void ht_remove(HashTable ht, pointer key);
+
+/** @brief  Finds the associated data of a key from the hash table.
+
+   @return  If the key cannot be found, the function returns NULL.
+            Otherwise it returns a pointer to the data associated
+            with the key.
+
+   @note  If dataSize == 0, this function may return NULL
+          even if the key has been inserted! If dataSize == NULL,
+          use HtMember instead to determine if a key has been
+          inserted.
+*/
+extern _X_EXPORT pointer ht_find(HashTable ht, pointer key);
+
+/** @brief  A generic hash function */
+extern _X_EXPORT unsigned ht_generic_hash(void *cdata,
+                                          const void *ptr,
+                                          int numBits);
+
+/** @brief  A generic comparison function. It compares data byte-wise. */
+extern _X_EXPORT int ht_generic_compare(void *cdata,
+                                        const void *l,
+                                        const void *r);
+
+/** @brief  A debugging function that dumps the distribution of the
+            hash table: for each bucket, list the number of elements
+            contained within. */
+extern _X_EXPORT void ht_dump_distribution(HashTable ht);
+
+/** @brief  A debugging function that dumps the contents of the hash
+            table: for each bucket, list the elements contained
+            within. */
+extern _X_EXPORT void ht_dump_contents(HashTable ht,
+                                       void (*print_key)(void *opaque, void *key),
+                                       void (*print_value)(void *opaque, void *value),
+                                       void* opaque);
+
+/** @brief  A hashing function to be used for hashing resource IDs when
+            used with HashTables. It makes no use of cdata, so that can
+            be NULL. It uses HashXID underneath, and should HashXID be
+            unable to hash the value, it switches into using the generic
+            hash function. */
+extern _X_EXPORT unsigned ht_resourceid_hash(void *cdata,
+                                             const void * data,
+                                             int numBits);
+
+/** @brief  A comparison function to be used for comparing resource
+            IDs when used with HashTables. It makes no use of cdata,
+            so that can be NULL. */
+extern _X_EXPORT int ht_resourceid_compare(void *cdata,
+                                           const void *a,
+                                           const void *b);
+
+#endif // HASHTABLE_H
index 98d327f..1c7197d 100644 (file)
@@ -59,7 +59,7 @@ Equipment Corporation.
 #ifdef COMPOSITE
 #include "compint.h"
 #endif
-#include "modinit.h"
+#include "extinit.h"
 #include "protocol-versions.h"
 
 #ifdef GLXPROXY
@@ -150,7 +150,7 @@ static GCFuncs XineramaGCFuncs = {
     (pGC)->funcs = &XineramaGCFuncs;
 
 static Bool
-XineramaCloseScreen(int i, ScreenPtr pScreen)
+XineramaCloseScreen(ScreenPtr pScreen)
 {
     PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
         dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
@@ -163,7 +163,7 @@ XineramaCloseScreen(int i, ScreenPtr pScreen)
 
     free((pointer) pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static Bool
@@ -434,7 +434,7 @@ XineramaReinitData(void)
  */
 
 void
-PanoramiXExtensionInit(int argc, char *argv[])
+PanoramiXExtensionInit(void)
 {
     int i;
     Bool success = FALSE;
@@ -895,6 +895,9 @@ PanoramiXResetProc(ExtensionEntry * extEntry)
 #ifdef XFIXES
     PanoramiXFixesReset();
 #endif
+#ifdef COMPOSITE
+    PanoramiXCompositeReset ();
+#endif
     screenInfo.numScreens = PanoramiXNumScreens;
     for (i = 256; i--;)
         ProcVector[i] = SavedProcVector[i];
@@ -904,21 +907,22 @@ int
 ProcPanoramiXQueryVersion(ClientPtr client)
 {
     /* REQUEST(xPanoramiXQueryVersionReq); */
-    xPanoramiXQueryVersionReply rep;
+    xPanoramiXQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_PANORAMIX_MAJOR_VERSION,
+        .minorVersion = SERVER_PANORAMIX_MINOR_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION;
-    rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swaps(&rep.majorVersion);
         swaps(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
     return Success;
 }
 
@@ -935,17 +939,19 @@ ProcPanoramiXGetState(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.state = !noPanoramiXExtension;
-    rep.window = stuff->window;
+    rep = (xPanoramiXGetStateReply) {
+        .type = X_Reply,
+        .state = !noPanoramiXExtension,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .window = stuff->window
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.window);
     }
-    WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep);
+    WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
     return Success;
 
 }
@@ -963,17 +969,19 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.ScreenCount = PanoramiXNumScreens;
-    rep.window = stuff->window;
+    rep = (xPanoramiXGetScreenCountReply) {
+        .type = X_Reply,
+        .ScreenCount = PanoramiXNumScreens,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .window = stuff->window
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.window);
     }
-    WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep);
+    WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
     return Success;
 }
 
@@ -993,14 +1001,16 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xPanoramiXGetScreenSizeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
     /* screen dimensions */
-    rep.width = screenInfo.screens[stuff->screen]->width;
-    rep.height = screenInfo.screens[stuff->screen]->height;
-    rep.window = stuff->window;
-    rep.screen = stuff->screen;
+        .width = screenInfo.screens[stuff->screen]->width,
+        .height = screenInfo.screens[stuff->screen]->height,
+        .window = stuff->window,
+        .screen = stuff->screen
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -1009,7 +1019,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
         swapl(&rep.window);
         swapl(&rep.screen);
     }
-    WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep);
+    WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
     return Success;
 }
 
@@ -1021,24 +1031,24 @@ ProcXineramaIsActive(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xXineramaIsActiveReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
 #if 1
-    {
         /* The following hack fools clients into thinking that Xinerama
          * is disabled even though it is not. */
-        rep.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack;
-    }
+        .state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack
 #else
-    rep.state = !noPanoramiXExtension;
+        .state = !noPanoramiXExtension;
 #endif
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.state);
     }
-    WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
     return Success;
 }
 
@@ -1046,20 +1056,22 @@ int
 ProcXineramaQueryScreens(ClientPtr client)
 {
     /* REQUEST(xXineramaQueryScreensReq); */
-    xXineramaQueryScreensReply rep;
+    CARD32 number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
+    xXineramaQueryScreensReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(number * sz_XineramaScreenInfo),
+        .number = number
+    };
 
     REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
-    rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.number);
     }
-    WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
 
     if (!noPanoramiXExtension) {
         xXineramaScreenInfo scratch;
@@ -1077,7 +1089,7 @@ ProcXineramaQueryScreens(ClientPtr client)
                 swaps(&scratch.width);
                 swaps(&scratch.height);
             }
-            WriteToClient(client, sz_XineramaScreenInfo, (char *) &scratch);
+            WriteToClient(client, sz_XineramaScreenInfo, &scratch);
         }
     }
 
index 12d6163..576844c 100644 (file)
@@ -566,14 +566,18 @@ PanoramiXGetGeometry(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.root = screenInfo.screens[0]->root->drawable.id;
-    rep.depth = pDraw->depth;
-    rep.width = pDraw->width;
-    rep.height = pDraw->height;
-    rep.x = rep.y = rep.borderWidth = 0;
+    rep = (xGetGeometryReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .root = screenInfo.screens[0]->root->drawable.id,
+        .depth = pDraw->depth,
+        .width = pDraw->width,
+        .height = pDraw->height,
+        .x = 0,
+        .y = 0,
+        .borderWidth = 0
+    };
 
     if (stuff->id == rep.root) {
         xWindowRoot *root = (xWindowRoot *)
@@ -617,11 +621,13 @@ PanoramiXTranslateCoords(ClientPtr client)
     rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess);
     if (rc != Success)
         return rc;
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.sameScreen = xTrue;
-    rep.child = None;
+    rep = (xTranslateCoordsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .sameScreen = xTrue,
+        .child = None
+    };
 
     if ((pWin == screenInfo.screens[0]->root) ||
         (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid)) {
@@ -1954,10 +1960,12 @@ PanoramiXGetImage(ClientPtr client)
             return rc;
     }
 
-    xgi.visual = wVisual(((WindowPtr) pDraw));
-    xgi.type = X_Reply;
-    xgi.sequenceNumber = client->sequence;
-    xgi.depth = pDraw->depth;
+    xgi = (xGetImageReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .visual = wVisual(((WindowPtr) pDraw)),
+        .depth = pDraw->depth
+    };
     if (format == ZPixmap) {
         widthBytesLine = PixmapBytePad(w, pDraw->depth);
         length = widthBytesLine * h;
@@ -2003,7 +2011,7 @@ PanoramiXGetImage(ClientPtr client)
                                  format, planemask, pBuf, widthBytesLine,
                                  isRoot);
 
-            (void) WriteToClient(client, (int) (nlines * widthBytesLine), pBuf);
+            WriteToClient(client, (int) (nlines * widthBytesLine), pBuf);
             linesDone += nlines;
         }
     }
@@ -2020,8 +2028,7 @@ PanoramiXGetImage(ClientPtr client)
                                          nlines, format, plane, pBuf,
                                          widthBytesLine, isRoot);
 
-                    (void) WriteToClient(client,
-                                         (int) (nlines * widthBytesLine), pBuf);
+                    WriteToClient(client, (int)(nlines * widthBytesLine), pBuf);
 
                     linesDone += nlines;
                 }
index 159153c..ac4a633 100644 (file)
@@ -46,6 +46,7 @@ in this Software without prior written authorization from the X Consortium.
 #include "cursorstr.h"
 #include "colormapst.h"
 #include "xace.h"
+#include "inputstr.h"
 #ifdef PANORAMIX
 #include "panoramiX.h"
 #include "panoramiXsrv.h"
@@ -57,7 +58,7 @@ in this Software without prior written authorization from the X Consortium.
 
 #include <stdio.h>
 
-#include "modinit.h"
+#include "extinit.h"
 
 static int ScreenSaverEventBase = 0;
 
@@ -388,8 +389,10 @@ ScreenSaverFreeSuspend(pointer value, XID id)
         if (screenIsSaved != SCREEN_SAVER_ON)
 #endif
         {
+            DeviceIntPtr dev;
             UpdateCurrentTimeIf();
-            lastDeviceEventTime = currentTime;
+            nt_list_for_each_entry(dev, inputInfo.devices, next)
+                lastDeviceEventTime[dev->id] = currentTime;
             SetScreenSaverTimer();
         }
     }
@@ -403,7 +406,6 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced)
     ScreenSaverScreenPrivatePtr pPriv;
     ScreenSaverEventPtr pEv;
     unsigned long mask;
-    xScreenSaverNotifyEvent ev;
     int kind;
 
     UpdateCurrentTimeIf();
@@ -421,16 +423,18 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced)
     else
         kind = ScreenSaverInternal;
     for (pEv = pPriv->events; pEv; pEv = pEv->next) {
-        if (!(pEv->mask & mask))
-            continue;
-        ev.type = ScreenSaverNotify + ScreenSaverEventBase;
-        ev.state = state;
-        ev.timestamp = currentTime.milliseconds;
-        ev.root = pScreen->root->drawable.id;
-        ev.window = pScreen->screensaver.wid;
-        ev.kind = kind;
-        ev.forced = forced;
-        WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
+        if (pEv->mask & mask) {
+            xScreenSaverNotifyEvent ev = {
+                .type = ScreenSaverNotify + ScreenSaverEventBase,
+                .state = state,
+                .timestamp = currentTime.milliseconds,
+                .root = pScreen->root->drawable.id,
+                .window = pScreen->screensaver.wid,
+                .kind = kind,
+                .forced = forced
+            };
+            WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
+        }
     }
 }
 
@@ -631,19 +635,21 @@ ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force)
 static int
 ProcScreenSaverQueryVersion(ClientPtr client)
 {
-    xScreenSaverQueryVersionReply rep;
+    xScreenSaverQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_SAVER_MAJOR_VERSION,
+        .minorVersion = SERVER_SAVER_MINOR_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SERVER_SAVER_MAJOR_VERSION;
-    rep.minorVersion = SERVER_SAVER_MINOR_VERSION;
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
     }
-    WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep);
     return Success;
 }
 
@@ -672,12 +678,14 @@ ProcScreenSaverQueryInfo(ClientPtr client)
     pPriv = GetScreenPrivate(pDraw->pScreen);
 
     UpdateCurrentTime();
-    lastInput = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
-
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.window = pSaver->wid;
+    lastInput = GetTimeInMillis() - lastDeviceEventTime[XIAllDevices].milliseconds;
+
+    rep = (xScreenSaverQueryInfoReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .window = pSaver->wid
+    };
     if (screenIsSaved != SCREEN_SAVER_OFF) {
         rep.state = ScreenSaverOn;
         if (ScreenSaverTime)
@@ -714,7 +722,7 @@ ProcScreenSaverQueryInfo(ClientPtr client)
         swapl(&rep.idle);
         swapl(&rep.eventMask);
     }
-    WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), &rep);
     return Success;
 }
 
@@ -1381,7 +1389,7 @@ SProcScreenSaverDispatch(ClientPtr client)
 }
 
 void
-ScreenSaverExtensionInit(INITARGS)
+ScreenSaverExtensionInit(void)
 {
     ExtensionEntry *extEntry;
     int i;
index 3699510..6cc9aa0 100644 (file)
@@ -38,7 +38,7 @@ in this Software without prior written authorization from The Open Group.
 #include "xacestr.h"
 #include "securitysrv.h"
 #include <X11/extensions/securproto.h>
-#include "modinit.h"
+#include "extinit.h"
 #include "protocol-versions.h"
 
 /* Extension stuff */
@@ -192,10 +192,10 @@ SecurityDeleteAuthorization(pointer value, XID id)
 
     while ((pEventClient = pAuth->eventClients)) {
         /* send revocation event event */
-        xSecurityAuthorizationRevokedEvent are;
-
-        are.type = SecurityEventBase + XSecurityAuthorizationRevoked;
-        are.authId = pAuth->id;
+        xSecurityAuthorizationRevokedEvent are = {
+            .type = SecurityEventBase + XSecurityAuthorizationRevoked,
+            .authId = pAuth->id
+        };
         WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are);
         FreeResource(pEventClient->resource, RT_NONE);
     }
@@ -338,21 +338,22 @@ static int
 ProcSecurityQueryVersion(ClientPtr client)
 {
     /* REQUEST(xSecurityQueryVersionReq); */
-    xSecurityQueryVersionReply rep;
+    xSecurityQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_SECURITY_MAJOR_VERSION,
+        .minorVersion = SERVER_SECURITY_MINOR_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION;
-    rep.minorVersion = SERVER_SECURITY_MINOR_VERSION;
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swaps(&rep.majorVersion);
         swaps(&rep.minorVersion);
     }
-    (void) WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
-                         (char *) &rep);
+    WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), &rep);
     return Success;
 }                               /* ProcSecurityQueryVersion */
 
@@ -528,11 +529,13 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
 
     /* tell client the auth id and data */
 
-    rep.type = X_Reply;
-    rep.length = bytes_to_int32(authdata_len);
-    rep.sequenceNumber = client->sequence;
-    rep.authId = authId;
-    rep.dataLength = authdata_len;
+    rep = (xSecurityGenerateAuthorizationReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(authdata_len),
+        .authId = authId,
+        .dataLength = authdata_len
+    };
 
     if (client->swapped) {
         swapl(&rep.length);
@@ -541,8 +544,7 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
         swaps(&rep.dataLength);
     }
 
-    WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply),
-                  (char *) &rep);
+    WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), &rep);
     WriteToClient(client, authdata_len, pAuthdata);
 
     SecurityAudit
@@ -1025,7 +1027,7 @@ SecurityResetProc(ExtensionEntry * extEntry)
  */
 
 void
-SecurityExtensionInit(INITARGS)
+SecurityExtensionInit(void)
 {
     ExtensionEntry *extEntry;
     int ret = TRUE;
index cc5214a..d36867c 100644 (file)
@@ -44,7 +44,7 @@ in this Software without prior written authorization from The Open Group.
 #include <X11/extensions/shapeproto.h>
 #include "regionstr.h"
 #include "gcstruct.h"
-#include "modinit.h"
+#include "extinit.h"
 #include "protocol-versions.h"
 
 typedef RegionPtr (*CreateDftPtr) (WindowPtr    /* pWin */
@@ -204,22 +204,23 @@ CreateClipShape(WindowPtr pWin)
 static int
 ProcShapeQueryVersion(ClientPtr client)
 {
-    xShapeQueryVersionReply rep;
+    xShapeQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_SHAPE_MAJOR_VERSION,
+        .minorVersion = SERVER_SHAPE_MINOR_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xShapeQueryVersionReq);
-    memset(&rep, 0, sizeof(xShapeQueryVersionReply));
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION;
-    rep.minorVersion = SERVER_SHAPE_MINOR_VERSION;
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swaps(&rep.majorVersion);
         swaps(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xShapeQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xShapeQueryVersionReply), &rep);
     return Success;
 }
 
@@ -631,12 +632,13 @@ ProcShapeQueryExtents(ClientPtr client)
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
         return rc;
-    memset(&rep, 0, sizeof(xShapeQueryExtentsReply));
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.boundingShaped = (wBoundingShape(pWin) != 0);
-    rep.clipShaped = (wClipShape(pWin) != 0);
+    rep = (xShapeQueryExtentsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .boundingShaped = (wBoundingShape(pWin) != 0),
+        .clipShaped = (wClipShape(pWin) != 0)
+    };
     if ((region = wBoundingShape(pWin))) {
         /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
         pExtents = RegionExtents(region);
@@ -679,7 +681,7 @@ ProcShapeQueryExtents(ClientPtr client)
         swaps(&rep.widthClipShape);
         swaps(&rep.heightClipShape);
     }
-    WriteToClient(client, sizeof(xShapeQueryExtentsReply), (char *) &rep);
+    WriteToClient(client, sizeof(xShapeQueryExtentsReply), &rep);
     return Success;
 }
 
@@ -824,7 +826,6 @@ void
 SendShapeNotify(WindowPtr pWin, int which)
 {
     ShapeEventPtr *pHead, pShapeEvent;
-    xShapeNotifyEvent se;
     BoxRec extents;
     RegionPtr region;
     BYTE shaped;
@@ -881,15 +882,17 @@ SendShapeNotify(WindowPtr pWin, int which)
         return;
     }
     for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
-        se.type = ShapeNotify + ShapeEventBase;
-        se.kind = which;
-        se.window = pWin->drawable.id;
-        se.x = extents.x1;
-        se.y = extents.y1;
-        se.width = extents.x2 - extents.x1;
-        se.height = extents.y2 - extents.y1;
-        se.time = currentTime.milliseconds;
-        se.shaped = shaped;
+        xShapeNotifyEvent se = {
+            .type = ShapeNotify + ShapeEventBase,
+            .kind = which,
+            .window = pWin->drawable.id,
+            .x = extents.x1,
+            .y = extents.y1,
+            .width = extents.x2 - extents.x1,
+            .height = extents.y2 - extents.y1,
+            .time = currentTime.milliseconds,
+            .shaped = shaped
+        };
         WriteEventsToClient(pShapeEvent->client, 1, (xEvent *) &se);
     }
 }
@@ -920,15 +923,17 @@ ProcShapeInputSelected(ClientPtr client)
             }
         }
     }
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.enabled = enabled;
+    rep = (xShapeInputSelectedReply) {
+        .type = X_Reply,
+        .enabled = enabled,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
     }
-    WriteToClient(client, sizeof(xShapeInputSelectedReply), (char *) &rep);
+    WriteToClient(client, sizeof(xShapeInputSelectedReply), &rep);
     return Success;
 }
 
@@ -1001,19 +1006,21 @@ ProcShapeGetRectangles(ClientPtr client)
             rects[i].height = box->y2 - box->y1;
         }
     }
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = bytes_to_int32(nrects * sizeof(xRectangle));
-    rep.ordering = YXBanded;
-    rep.nrects = nrects;
+    rep = (xShapeGetRectanglesReply) {
+        .type = X_Reply,
+        .ordering = YXBanded,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(nrects * sizeof(xRectangle)),
+        .nrects = nrects
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.nrects);
         SwapShorts((short *) rects, (unsigned long) nrects * 4);
     }
-    WriteToClient(client, sizeof(rep), (char *) &rep);
-    WriteToClient(client, nrects * sizeof(xRectangle), (char *) rects);
+    WriteToClient(client, sizeof(rep), &rep);
+    WriteToClient(client, nrects * sizeof(xRectangle), rects);
     free(rects);
     return Success;
 }
index de48020..3fa04b9 100644 (file)
@@ -87,7 +87,7 @@ in this Software without prior written authorization from The Open Group.
 #include "panoramiXsrv.h"
 #endif
 
-#include "modinit.h"
+#include "extinit.h"
 
 typedef struct _ShmDesc {
     struct _ShmDesc *next;
@@ -202,14 +202,14 @@ CheckForShmSyscall(void)
 #endif
 
 static Bool
-ShmCloseScreen(int i, ScreenPtr pScreen)
+ShmCloseScreen(ScreenPtr pScreen)
 {
     ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
 
     pScreen->CloseScreen = screen_priv->CloseScreen;
     dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL);
     free(screen_priv);
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static ShmScrPrivateRec *
@@ -285,19 +285,20 @@ ShmRegisterFbFuncs(ScreenPtr pScreen)
 static int
 ProcShmQueryVersion(ClientPtr client)
 {
-    xShmQueryVersionReply rep;
+    xShmQueryVersionReply rep = {
+        .type = X_Reply,
+        .sharedPixmaps = sharedPixmaps,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_SHM_MAJOR_VERSION,
+        .minorVersion = SERVER_SHM_MINOR_VERSION,
+        .uid = geteuid(),
+        .gid = getegid(),
+        .pixmapFormat = sharedPixmaps ? ZPixmap : 0
+    };
 
     REQUEST_SIZE_MATCH(xShmQueryVersionReq);
-    memset(&rep, 0, sizeof(xShmQueryVersionReply));
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.sharedPixmaps = sharedPixmaps;
-    rep.pixmapFormat = sharedPixmaps ? ZPixmap : 0;
-    rep.majorVersion = SERVER_SHM_MAJOR_VERSION;
-    rep.minorVersion = SERVER_SHM_MINOR_VERSION;
-    rep.uid = geteuid();
-    rep.gid = getegid();
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -306,7 +307,7 @@ ProcShmQueryVersion(ClientPtr client)
         swaps(&rep.uid);
         swaps(&rep.gid);
     }
-    WriteToClient(client, sizeof(xShmQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xShmQueryVersionReply), &rep);
     return Success;
 }
 
@@ -594,14 +595,14 @@ ProcShmPutImage(ClientPtr client)
                       stuff->dstX, stuff->dstY, shmdesc->addr + stuff->offset);
 
     if (stuff->sendEvent) {
-        xShmCompletionEvent ev;
-
-        ev.type = ShmCompletionCode;
-        ev.drawable = stuff->drawable;
-        ev.minorEvent = X_ShmPutImage;
-        ev.majorEvent = ShmReqCode;
-        ev.shmseg = stuff->shmseg;
-        ev.offset = stuff->offset;
+        xShmCompletionEvent ev = {
+            .type = ShmCompletionCode,
+            .drawable = stuff->drawable,
+            .minorEvent = X_ShmPutImage,
+            .majorEvent = ShmReqCode,
+            .shmseg = stuff->shmseg,
+            .offset = stuff->offset
+        };
         WriteEventsToClient(client, 1, (xEvent *) &ev);
     }
 
@@ -616,6 +617,7 @@ ProcShmGetImage(ClientPtr client)
     Mask plane = 0;
     xShmGetImageReply xgi;
     ShmDescPtr shmdesc;
+    VisualID visual = None;
     int rc;
 
     REQUEST(xShmGetImageReq);
@@ -630,7 +632,7 @@ ProcShmGetImage(ClientPtr client)
         return rc;
     VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
     if (pDraw->type == DRAWABLE_WINDOW) {
-        if (                    /* check for being viewable */
+        if (   /* check for being viewable */
                !((WindowPtr) pDraw)->realized ||
                /* check for being on screen */
                pDraw->x + stuff->x < 0 ||
@@ -646,19 +648,22 @@ ProcShmGetImage(ClientPtr client)
                stuff->y + (int) stuff->height >
                wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height)
             return BadMatch;
-        xgi.visual = wVisual(((WindowPtr) pDraw));
+        visual = wVisual(((WindowPtr) pDraw));
     }
     else {
         if (stuff->x < 0 ||
             stuff->x + (int) stuff->width > pDraw->width ||
             stuff->y < 0 || stuff->y + (int) stuff->height > pDraw->height)
             return BadMatch;
-        xgi.visual = None;
+        visual = None;
     }
-    xgi.type = X_Reply;
-    xgi.length = 0;
-    xgi.sequenceNumber = client->sequence;
-    xgi.depth = pDraw->depth;
+    xgi = (xShmGetImageReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .visual = visual,
+        .depth = pDraw->depth
+    };
     if (stuff->format == ZPixmap) {
         length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
     }
@@ -702,7 +707,7 @@ ProcShmGetImage(ClientPtr client)
         swapl(&xgi.visual);
         swapl(&xgi.size);
     }
-    WriteToClient(client, sizeof(xShmGetImageReply), (char *) &xgi);
+    WriteToClient(client, sizeof(xShmGetImageReply), &xgi);
 
     return Success;
 }
@@ -830,11 +835,13 @@ ProcPanoramiXShmGetImage(ClientPtr client)
         }
     }
 
-    xgi.visual = wVisual(((WindowPtr) pDraw));
-    xgi.type = X_Reply;
-    xgi.length = 0;
-    xgi.sequenceNumber = client->sequence;
-    xgi.depth = pDraw->depth;
+    xgi = (xShmGetImageReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .visual = wVisual(((WindowPtr) pDraw)),
+        .depth = pDraw->depth
+    };
 
     if (format == ZPixmap) {
         widthBytesLine = PixmapBytePad(w, pDraw->depth);
@@ -877,7 +884,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
         swapl(&xgi.visual);
         swapl(&xgi.size);
     }
-    WriteToClient(client, sizeof(xShmGetImageReply), (char *) &xgi);
+    WriteToClient(client, sizeof(xShmGetImageReply), &xgi);
 
     return Success;
 }
@@ -1241,7 +1248,7 @@ SProcShmDispatch(ClientPtr client)
 }
 
 void
-ShmExtensionInit(INITARGS)
+ShmExtensionInit(void)
 {
     ExtensionEntry *extEntry;
     int i;
index 37c59c2..4d11992 100644 (file)
@@ -69,13 +69,14 @@ PERFORMANCE OF THIS SOFTWARE.
 #include "syncsrv.h"
 #include "syncsdk.h"
 #include "protocol-versions.h"
+#include "inputstr.h"
 
 #include <stdio.h>
 #if !defined(WIN32)
 #include <sys/time.h>
 #endif
 
-#include "modinit.h"
+#include "extinit.h"
 
 /*
  * Local Global Variables
@@ -87,8 +88,7 @@ static RESTYPE RTAwait;
 static RESTYPE RTAlarm;
 static RESTYPE RTAlarmClient;
 static RESTYPE RTFence;
-static int SyncNumSystemCounters = 0;
-static SyncCounter **SysCounterList = NULL;
+static struct xorg_list SysCounterList;
 static int SyncNumInvalidCounterWarnings = 0;
 
 #define MAX_INVALID_COUNTER_WARNINGS      5
@@ -114,6 +114,14 @@ static void SyncInitServerTime(void);
 
 static void SyncInitIdleTime(void);
 
+static inline void*
+SysCounterGetPrivate(SyncCounter *counter)
+{
+    BUG_WARN(!IsSystemCounter(counter));
+
+    return counter->pSysCounterInfo ? counter->pSysCounterInfo->private : NULL;
+}
+
 static Bool
 SyncCheckWarnIsCounter(const SyncObject * pSync, const char *warning)
 {
@@ -429,22 +437,25 @@ SyncSendAlarmNotifyEvents(SyncAlarm * pAlarm)
 
     UpdateCurrentTime();
 
-    ane.type = SyncEventBase + XSyncAlarmNotify;
-    ane.kind = XSyncAlarmNotify;
-    ane.alarm = pAlarm->alarm_id;
+    ane = (xSyncAlarmNotifyEvent) {
+        .type = SyncEventBase + XSyncAlarmNotify,
+        .kind = XSyncAlarmNotify,
+        .alarm = pAlarm->alarm_id,
+        .alarm_value_hi = XSyncValueHigh32(pTrigger->test_value),
+        .alarm_value_lo = XSyncValueLow32(pTrigger->test_value),
+        .time = currentTime.milliseconds,
+        .state = pAlarm->state
+    };
+
     if (pTrigger->pSync && SYNC_COUNTER == pTrigger->pSync->type) {
         ane.counter_value_hi = XSyncValueHigh32(pCounter->value);
         ane.counter_value_lo = XSyncValueLow32(pCounter->value);
     }
-    else {                      /* XXX what else can we do if there's no counter? */
+    else {
+        /* XXX what else can we do if there's no counter? */
         ane.counter_value_hi = ane.counter_value_lo = 0;
     }
 
-    ane.alarm_value_hi = XSyncValueHigh32(pTrigger->test_value);
-    ane.alarm_value_lo = XSyncValueLow32(pTrigger->test_value);
-    ane.time = currentTime.milliseconds;
-    ane.state = pAlarm->state;
-
     /* send to owner */
     if (pAlarm->events)
         WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane);
@@ -466,7 +477,7 @@ SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait ** ppAwait,
 
     if (client->clientGone)
         return;
-    pev = pEvents = malloc(num_events * sizeof(xSyncCounterNotifyEvent));
+    pev = pEvents = calloc(num_events, sizeof(xSyncCounterNotifyEvent));
     if (!pEvents)
         return;
     UpdateCurrentTime();
@@ -921,26 +932,17 @@ static int FreeCounter(void *, XID);
  * ***** System Counter utilities
  */
 
-pointer
+SyncCounter*
 SyncCreateSystemCounter(const char *name,
                         CARD64 initial,
                         CARD64 resolution,
                         SyncCounterType counterType,
-                        void (*QueryValue) (pointer /* pCounter */ ,
-                                            CARD64 * /* pValue_return */ ),
-                        void (*BracketValues) (pointer /* pCounter */ ,
-                                               CARD64 * /* pbracket_less */ ,
-                                               CARD64 * /* pbracket_greater */ )
+                        SyncSystemCounterQueryValue QueryValue,
+                        SyncSystemCounterBracketValues BracketValues
     )
 {
     SyncCounter *pCounter;
 
-    SysCounterList = realloc(SysCounterList,
-                             (SyncNumSystemCounters +
-                              1) * sizeof(SyncCounter *));
-    if (!SysCounterList)
-        return NULL;
-
     /* this function may be called before SYNC has been initialized, so we
      * have to make sure RTCounter is created.
      */
@@ -949,6 +951,7 @@ SyncCreateSystemCounter(const char *name,
         if (RTCounter == 0) {
             return NULL;
         }
+        xorg_list_init(&SysCounterList);
     }
 
     pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
@@ -962,14 +965,16 @@ SyncCreateSystemCounter(const char *name,
             return pCounter;
         }
         pCounter->pSysCounterInfo = psci;
-        psci->name = name;
+        psci->pCounter = pCounter;
+        psci->name = strdup(name);
         psci->resolution = resolution;
         psci->counterType = counterType;
         psci->QueryValue = QueryValue;
         psci->BracketValues = BracketValues;
+        psci->private = NULL;
         XSyncMaxValue(&psci->bracket_greater);
         XSyncMinValue(&psci->bracket_less);
-        SysCounterList[SyncNumSystemCounters++] = pCounter;
+        xorg_list_add(&psci->entry, &SysCounterList);
     }
     return pCounter;
 }
@@ -1033,15 +1038,15 @@ SyncComputeBracketValues(SyncCounter * pCounter)
                 pnewltval = &psci->bracket_less;
             }
             else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
-                     XSyncValueLessThan(pTrigger->test_value,
-                                        psci->bracket_greater)) {
+                     XSyncValueGreaterThan(pTrigger->test_value,
+                                           psci->bracket_less)) {
                 /*
                  * The value is exactly equal to our threshold.  We want one
-                 * more event in the positive direction to ensure we pick up
-                 * when the value *exceeds* this threshold.
+                 * more event in the negative direction to ensure we pick up
+                 * when the value is less than this threshold.
                  */
-                psci->bracket_greater = pTrigger->test_value;
-                pnewgtval = &psci->bracket_greater;
+                psci->bracket_less = pTrigger->test_value;
+                pnewltval = &psci->bracket_less;
             }
         }
         else if (pTrigger->test_type == XSyncPositiveTransition &&
@@ -1053,15 +1058,15 @@ SyncComputeBracketValues(SyncCounter * pCounter)
                 pnewgtval = &psci->bracket_greater;
             }
             else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
-                     XSyncValueGreaterThan(pTrigger->test_value,
-                                           psci->bracket_less)) {
+                     XSyncValueLessThan(pTrigger->test_value,
+                                        psci->bracket_greater)) {
                 /*
                  * The value is exactly equal to our threshold.  We want one
-                 * more event in the negative direction to ensure we pick up
-                 * when the value is less than this threshold.
+                 * more event in the positive direction to ensure we pick up
+                 * when the value *exceeds* this threshold.
                  */
-                psci->bracket_less = pTrigger->test_value;
-                pnewltval = &psci->bracket_less;
+                psci->bracket_greater = pTrigger->test_value;
+                pnewgtval = &psci->bracket_greater;
             }
         }
     }                           /* end for each trigger */
@@ -1114,26 +1119,10 @@ FreeCounter(void *env, XID id)
         free(ptl);              /* destroy the trigger list as we go */
     }
     if (IsSystemCounter(pCounter)) {
-        int i, found = 0;
-
+        xorg_list_del(&pCounter->pSysCounterInfo->entry);
+        free(pCounter->pSysCounterInfo->name);
+        free(pCounter->pSysCounterInfo->private);
         free(pCounter->pSysCounterInfo);
-
-        /* find the counter in the list of system counters and remove it */
-
-        if (SysCounterList) {
-            for (i = 0; i < SyncNumSystemCounters; i++) {
-                if (SysCounterList[i] == pCounter) {
-                    found = i;
-                    break;
-                }
-            }
-            if (found < (SyncNumSystemCounters - 1)) {
-                for (i = found; i < SyncNumSystemCounters - 1; i++) {
-                    SysCounterList[i] = SysCounterList[i + 1];
-                }
-            }
-        }
-        SyncNumSystemCounters--;
     }
     free(pCounter);
     return Success;
@@ -1199,21 +1188,20 @@ FreeAlarmClient(void *value, XID id)
 static int
 ProcSyncInitialize(ClientPtr client)
 {
-    xSyncInitializeReply rep;
+    xSyncInitializeReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_SYNC_MAJOR_VERSION,
+        .minorVersion = SERVER_SYNC_MINOR_VERSION,
+    };
 
     REQUEST_SIZE_MATCH(xSyncInitializeReq);
 
-    memset(&rep, 0, sizeof(xSyncInitializeReply));
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SERVER_SYNC_MAJOR_VERSION;
-    rep.minorVersion = SERVER_SYNC_MINOR_VERSION;
-    rep.length = 0;
-
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
     }
-    WriteToClient(client, sizeof(rep), (char *) &rep);
+    WriteToClient(client, sizeof(rep), &rep);
     return Success;
 }
 
@@ -1223,21 +1211,21 @@ ProcSyncInitialize(ClientPtr client)
 static int
 ProcSyncListSystemCounters(ClientPtr client)
 {
-    xSyncListSystemCountersReply rep;
-    int i, len;
+    xSyncListSystemCountersReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .nCounters = 0,
+    };
+    SysCounterInfo *psci;
+    int len = 0;
     xSyncSystemCounter *list = NULL, *walklist = NULL;
 
     REQUEST_SIZE_MATCH(xSyncListSystemCountersReq);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.nCounters = SyncNumSystemCounters;
-
-    for (i = len = 0; i < SyncNumSystemCounters; i++) {
-        const char *name = SysCounterList[i]->pSysCounterInfo->name;
-
+    xorg_list_for_each_entry(psci, &SysCounterList, entry) {
         /* pad to 4 byte boundary */
-        len += pad_to_int32(sz_xSyncSystemCounter + strlen(name));
+        len += pad_to_int32(sz_xSyncSystemCounter + strlen(psci->name));
+        ++rep.nCounters;
     }
 
     if (len) {
@@ -1254,12 +1242,11 @@ ProcSyncListSystemCounters(ClientPtr client)
         swapl(&rep.nCounters);
     }
 
-    for (i = 0; i < SyncNumSystemCounters; i++) {
+    xorg_list_for_each_entry(psci, &SysCounterList, entry) {
         int namelen;
         char *pname_in_reply;
-        SysCounterInfo *psci = SysCounterList[i]->pSysCounterInfo;
 
-        walklist->counter = SysCounterList[i]->sync.id;
+        walklist->counter = psci->pCounter->sync.id;
         walklist->resolution_hi = XSyncValueHigh32(psci->resolution);
         walklist->resolution_lo = XSyncValueLow32(psci->resolution);
         namelen = strlen(psci->name);
@@ -1279,9 +1266,9 @@ ProcSyncListSystemCounters(ClientPtr client)
                                                         namelen));
     }
 
-    WriteToClient(client, sizeof(rep), (char *) &rep);
+    WriteToClient(client, sizeof(rep), &rep);
     if (len) {
-        WriteToClient(client, len, (char *) list);
+        WriteToClient(client, len, list);
         free(list);
     }
 
@@ -1344,17 +1331,19 @@ ProcSyncGetPriority(ClientPtr client)
             return rc;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.priority = priorityclient->priority;
+    rep = (xSyncGetPriorityReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .priority = priorityclient->priority
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.priority);
     }
 
-    WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep);
+    WriteToClient(client, sizeof(xSyncGetPriorityReply), &rep);
 
     return Success;
 }
@@ -1621,26 +1610,27 @@ ProcSyncQueryCounter(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     /* if system counter, ask it what the current value is */
-
     if (IsSystemCounter(pCounter)) {
         (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter,
                                                   &pCounter->value);
     }
 
-    rep.value_hi = XSyncValueHigh32(pCounter->value);
-    rep.value_lo = XSyncValueLow32(pCounter->value);
+    rep = (xSyncQueryCounterReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .value_hi = XSyncValueHigh32(pCounter->value),
+        .value_lo = XSyncValueLow32(pCounter->value)
+    };
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.value_hi);
         swapl(&rep.value_lo);
     }
-    WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep);
+    WriteToClient(client, sizeof(xSyncQueryCounterReply), &rep);
     return Success;
 }
 
@@ -1787,32 +1777,33 @@ ProcSyncQueryAlarm(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.length =
-        bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply));
-    rep.sequenceNumber = client->sequence;
-
     pTrigger = &pAlarm->trigger;
-    rep.counter = (pTrigger->pSync) ? pTrigger->pSync->id : None;
-
-#if 0                           /* XXX unclear what to do, depends on whether relative value-types
-                                 * are "consumed" immediately and are considered absolute from then
-                                 * on.
-                                 */
-    rep.value_type = pTrigger->value_type;
-    rep.wait_value_hi = XSyncValueHigh32(pTrigger->wait_value);
-    rep.wait_value_lo = XSyncValueLow32(pTrigger->wait_value);
+    rep = (xSyncQueryAlarmReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length =
+          bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)),
+        .counter = (pTrigger->pSync) ? pTrigger->pSync->id : None,
+
+#if 0  /* XXX unclear what to do, depends on whether relative value-types
+        * are "consumed" immediately and are considered absolute from then
+        * on.
+        */
+        .value_type = pTrigger->value_type,
+        .wait_value_hi = XSyncValueHigh32(pTrigger->wait_value),
+        .wait_value_lo = XSyncValueLow32(pTrigger->wait_value),
 #else
-    rep.value_type = XSyncAbsolute;
-    rep.wait_value_hi = XSyncValueHigh32(pTrigger->test_value);
-    rep.wait_value_lo = XSyncValueLow32(pTrigger->test_value);
+        .value_type = XSyncAbsolute,
+        .wait_value_hi = XSyncValueHigh32(pTrigger->test_value),
+        .wait_value_lo = XSyncValueLow32(pTrigger->test_value),
 #endif
 
-    rep.test_type = pTrigger->test_type;
-    rep.delta_hi = XSyncValueHigh32(pAlarm->delta);
-    rep.delta_lo = XSyncValueLow32(pAlarm->delta);
-    rep.events = pAlarm->events;
-    rep.state = pAlarm->state;
+        .test_type = pTrigger->test_type,
+        .delta_hi = XSyncValueHigh32(pAlarm->delta),
+        .delta_lo = XSyncValueLow32(pAlarm->delta),
+        .events = pAlarm->events,
+        .state = pAlarm->state
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
@@ -1825,7 +1816,7 @@ ProcSyncQueryAlarm(ClientPtr client)
         swapl(&rep.delta_lo);
     }
 
-    WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep);
+    WriteToClient(client, sizeof(xSyncQueryAlarmReply), &rep);
     return Success;
 }
 
@@ -1971,18 +1962,20 @@ ProcSyncQueryFence(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xSyncQueryFenceReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
 
-    rep.triggered = pFence->funcs.CheckTriggered(pFence);
+        .triggered = pFence->funcs.CheckTriggered(pFence)
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
     }
 
-    WriteToClient(client, sizeof(xSyncQueryFenceReply), (char *) &rep);
+    WriteToClient(client, sizeof(xSyncQueryFenceReply), &rep);
     return client->noClientException;
 }
 
@@ -2444,8 +2437,6 @@ SAlarmNotifyEvent(xSyncAlarmNotifyEvent * from, xSyncAlarmNotifyEvent * to)
 static void
 SyncResetProc(ExtensionEntry * extEntry)
 {
-    free(SysCounterList);
-    SysCounterList = NULL;
     RTCounter = 0;
 }
 
@@ -2463,6 +2454,7 @@ SyncExtensionInit(void)
 
     if (RTCounter == 0) {
         RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
+        xorg_list_init(&SysCounterList);
     }
     RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm");
     RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait");
@@ -2608,33 +2600,48 @@ SyncInitServerTime(void)
  * IDLETIME implementation
  */
 
-static SyncCounter *IdleTimeCounter;
-static XSyncValue *pIdleTimeValueLess;
-static XSyncValue *pIdleTimeValueGreater;
+typedef struct {
+    XSyncValue *value_less;
+    XSyncValue *value_greater;
+    int deviceid;
+} IdleCounterPriv;
 
 static void
 IdleTimeQueryValue(pointer pCounter, CARD64 * pValue_return)
 {
-    CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
+    int deviceid;
+    CARD32 idle;
 
+    if (pCounter) {
+        SyncCounter *counter = pCounter;
+        IdleCounterPriv *priv = SysCounterGetPrivate(counter);
+        deviceid = priv->deviceid;
+    }
+    else
+        deviceid = XIAllDevices;
+    idle = GetTimeInMillis() - lastDeviceEventTime[deviceid].milliseconds;
     XSyncIntsToValue(pValue_return, idle, 0);
 }
 
 static void
-IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
+IdleTimeBlockHandler(pointer pCounter, struct timeval **wt, pointer LastSelectMask)
 {
+    SyncCounter *counter = pCounter;
+    IdleCounterPriv *priv = SysCounterGetPrivate(counter);
+    XSyncValue *less = priv->value_less,
+               *greater = priv->value_greater;
     XSyncValue idle, old_idle;
-    SyncTriggerList *list = IdleTimeCounter->sync.pTriglist;
+    SyncTriggerList *list = counter->sync.pTriglist;
     SyncTrigger *trig;
 
-    if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
+    if (!less && !greater)
         return;
 
-    old_idle = IdleTimeCounter->value;
+    old_idle = counter->value;
     IdleTimeQueryValue(NULL, &idle);
-    IdleTimeCounter->value = idle;      /* push, so CheckTrigger works */
+    counter->value = idle;      /* push, so CheckTrigger works */
 
-    if (pIdleTimeValueLess && XSyncValueLessOrEqual(idle, *pIdleTimeValueLess)) {
+    if (less && XSyncValueLessOrEqual(idle, *less)) {
         /*
          * We've been idle for less than the threshold value, and someone
          * wants to know about that, but now we need to know whether they
@@ -2643,7 +2650,7 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
          * immediately so we can reschedule.
          */
 
-        for (list = IdleTimeCounter->sync.pTriglist; list; list = list->next) {
+        for (list = counter->sync.pTriglist; list; list = list->next) {
             trig = list->pTrigger;
             if (trig->CheckTrigger(trig, old_idle)) {
                 AdjustWaitForDelay(wt, 0);
@@ -2656,10 +2663,10 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
          * idle time greater than this.  Schedule a wakeup for the next
          * millisecond so we won't miss a transition.
          */
-        if (XSyncValueEqual(idle, *pIdleTimeValueLess))
+        if (XSyncValueEqual(idle, *less))
             AdjustWaitForDelay(wt, 1);
     }
-    else if (pIdleTimeValueGreater) {
+    else if (greater) {
         /*
          * There's a threshold in the positive direction.  If we've been
          * idle less than it, schedule a wakeup for sometime in the future.
@@ -2668,15 +2675,15 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
          */
         unsigned long timeout = -1;
 
-        if (XSyncValueLessThan(idle, *pIdleTimeValueGreater)) {
+        if (XSyncValueLessThan(idle, *greater)) {
             XSyncValue value;
             Bool overflow;
 
-            XSyncValueSubtract(&value, *pIdleTimeValueGreater, idle, &overflow);
+            XSyncValueSubtract(&value, *greater, idle, &overflow);
             timeout = min(timeout, XSyncValueLow32(value));
         }
         else {
-            for (list = IdleTimeCounter->sync.pTriglist; list;
+            for (list = counter->sync.pTriglist; list;
                  list = list->next) {
                 trig = list->pTrigger;
                 if (trig->CheckTrigger(trig, old_idle)) {
@@ -2689,24 +2696,26 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
         AdjustWaitForDelay(wt, timeout);
     }
 
-    IdleTimeCounter->value = old_idle;  /* pop */
+    counter->value = old_idle;  /* pop */
 }
 
 static void
-IdleTimeWakeupHandler(pointer env, int rc, pointer LastSelectMask)
+IdleTimeWakeupHandler(pointer pCounter, int rc, pointer LastSelectMask)
 {
+    SyncCounter *counter = pCounter;
+    IdleCounterPriv *priv = SysCounterGetPrivate(counter);
+    XSyncValue *less = priv->value_less,
+               *greater = priv->value_greater;
     XSyncValue idle;
 
-    if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
+    if (!less && !greater)
         return;
 
-    IdleTimeQueryValue(NULL, &idle);
+    IdleTimeQueryValue(pCounter, &idle);
 
-    if ((pIdleTimeValueGreater &&
-         XSyncValueGreaterOrEqual(idle, *pIdleTimeValueGreater)) ||
-        (pIdleTimeValueLess &&
-         XSyncValueLessOrEqual(idle, *pIdleTimeValueLess))) {
-        SyncChangeCounter(IdleTimeCounter, idle);
+    if ((greater && XSyncValueGreaterOrEqual(idle, *greater)) ||
+        (less && XSyncValueLessOrEqual(idle, *less))) {
+        SyncChangeCounter(counter, idle);
     }
 }
 
@@ -2714,34 +2723,69 @@ static void
 IdleTimeBracketValues(pointer pCounter, CARD64 * pbracket_less,
                       CARD64 * pbracket_greater)
 {
-    Bool registered = (pIdleTimeValueLess || pIdleTimeValueGreater);
+    SyncCounter *counter = pCounter;
+    IdleCounterPriv *priv = SysCounterGetPrivate(counter);
+    XSyncValue *less = priv->value_less,
+               *greater = priv->value_greater;
+    Bool registered = (less || greater);
 
     if (registered && !pbracket_less && !pbracket_greater) {
         RemoveBlockAndWakeupHandlers(IdleTimeBlockHandler,
-                                     IdleTimeWakeupHandler, NULL);
+                                     IdleTimeWakeupHandler, pCounter);
     }
     else if (!registered && (pbracket_less || pbracket_greater)) {
         RegisterBlockAndWakeupHandlers(IdleTimeBlockHandler,
-                                       IdleTimeWakeupHandler, NULL);
+                                       IdleTimeWakeupHandler, pCounter);
     }
 
-    pIdleTimeValueGreater = pbracket_greater;
-    pIdleTimeValueLess = pbracket_less;
+    priv->value_greater = pbracket_greater;
+    priv->value_less = pbracket_less;
 }
 
-static void
-SyncInitIdleTime(void)
+static SyncCounter*
+init_system_idle_counter(const char *name, int deviceid)
 {
     CARD64 resolution;
     XSyncValue idle;
+    IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
+    SyncCounter *idle_time_counter;
 
     IdleTimeQueryValue(NULL, &idle);
     XSyncIntToValue(&resolution, 4);
 
-    IdleTimeCounter = SyncCreateSystemCounter("IDLETIME", idle, resolution,
-                                              XSyncCounterUnrestricted,
-                                              IdleTimeQueryValue,
-                                              IdleTimeBracketValues);
+    idle_time_counter = SyncCreateSystemCounter(name, idle, resolution,
+                                                XSyncCounterUnrestricted,
+                                                IdleTimeQueryValue,
+                                                IdleTimeBracketValues);
+
+    priv->deviceid = deviceid;
+    priv->value_less = priv->value_greater = NULL;
+
+    idle_time_counter->pSysCounterInfo->private = priv;
 
-    pIdleTimeValueLess = pIdleTimeValueGreater = NULL;
+    return idle_time_counter;
+}
+
+static void
+SyncInitIdleTime(void)
+{
+    init_system_idle_counter("IDLETIME", XIAllDevices);
+}
+
+SyncCounter*
+SyncInitDeviceIdleTime(DeviceIntPtr dev)
+{
+    char timer_name[64];
+    sprintf(timer_name, "DEVICEIDLETIME %d", dev->id);
+
+    return init_system_idle_counter(timer_name, dev->id);
+}
+
+void SyncRemoveDeviceIdleTime(SyncCounter *counter)
+{
+    /* FreeAllResources() frees all system counters before the devices are
+       shut down, check if there are any left before freeing the device's
+       counter */
+    if (!xorg_list_is_empty(&SysCounterList))
+        xorg_list_del(&counter->pSysCounterInfo->entry);
 }
index b0464b3..c68229f 100644 (file)
@@ -51,6 +51,7 @@ PERFORMANCE OF THIS SOFTWARE.
 #ifndef _SYNCSRV_H_
 #define _SYNCSRV_H_
 
+#include "list.h"
 #include "misync.h"
 #include "misyncstr.h"
 
@@ -65,19 +66,25 @@ typedef enum {
     XSyncCounterUnrestricted
 } SyncCounterType;
 
+typedef void (*SyncSystemCounterQueryValue)(pointer counter,
+                                            CARD64 *value_return
+    );
+typedef void (*SyncSystemCounterBracketValues)(pointer counter,
+                                               CARD64 *pbracket_less,
+                                               CARD64 *pbracket_greater
+    );
+
 typedef struct _SysCounterInfo {
-    const char *name;
+    SyncCounter *pCounter;
+    char *name;
     CARD64 resolution;
     CARD64 bracket_greater;
     CARD64 bracket_less;
     SyncCounterType counterType;        /* how can this counter change */
-    void (*QueryValue) (pointer /*pCounter */ ,
-                        CARD64 *        /*freshvalue */
-        );
-    void (*BracketValues) (pointer /*pCounter */ ,
-                           CARD64 * /*lessthan */ ,
-                           CARD64 *     /*greaterthan */
-        );
+    SyncSystemCounterQueryValue QueryValue;
+    SyncSystemCounterBracketValues BracketValues;
+    void *private;
+    struct xorg_list entry;
 } SysCounterInfo;
 
 typedef struct _SyncAlarmClientList {
@@ -113,33 +120,20 @@ typedef union {
     SyncAwait await;
 } SyncAwaitUnion;
 
-extern pointer SyncCreateSystemCounter(const char * /* name */ ,
-                                       CARD64 /* inital_value */ ,
-                                       CARD64 /* resolution */ ,
-                                       SyncCounterType
-                                       /* change characterization */ ,
-                                       void (* /*QueryValue */ )(
-                                                                    pointer
-                                                                    /* pCounter */
-                                                                    ,
-                                                                    CARD64 * /* pValue_return */ ),     /* XXX prototype */
-                                       void (* /*BracketValues */ )(
-                                                                       pointer
-                                                                       /* pCounter */
-                                                                       ,
-                                                                       CARD64 *
-                                                                       /* pbracket_less */
-                                                                       ,
-                                                                       CARD64 *
-                                                                       /* pbracket_greater */
-                                                                       )
+extern SyncCounter* SyncCreateSystemCounter(const char *name,
+                                            CARD64 initial_value,
+                                            CARD64 resolution,
+                                            SyncCounterType counterType,
+                                            SyncSystemCounterQueryValue QueryValue,
+                                            SyncSystemCounterBracketValues BracketValues
     );
 
-extern void SyncChangeCounter(SyncCounter * /* pCounter */ ,
-                              CARD64    /* new_value */
+extern void SyncChangeCounter(SyncCounter *pCounter,
+                              CARD64 new_value
     );
 
 extern void SyncDestroySystemCounter(pointer pCounter);
 
-extern void SyncExtensionInit(void);
+extern SyncCounter *SyncInitDeviceIdleTime(DeviceIntPtr dev);
+extern void SyncRemoveDeviceIdleTime(SyncCounter *counter);
 #endif                          /* _SYNCSRV_H_ */
index 99a6ece..034bfb6 100644 (file)
@@ -38,27 +38,29 @@ from The Open Group.
 #include "extnsionst.h"
 #include "swaprep.h"
 #include <X11/extensions/xcmiscproto.h>
-#include "modinit.h"
+#include "extinit.h"
 
 #include <stdint.h>
 
 static int
 ProcXCMiscGetVersion(ClientPtr client)
 {
-    xXCMiscGetVersionReply rep;
+    xXCMiscGetVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = XCMiscMajorVersion,
+        .minorVersion = XCMiscMinorVersion
+    };
 
     REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = XCMiscMajorVersion;
-    rep.minorVersion = XCMiscMinorVersion;
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swaps(&rep.majorVersion);
         swaps(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXCMiscGetVersionReply), &rep);
     return Success;
 }
 
@@ -70,17 +72,19 @@ ProcXCMiscGetXIDRange(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
     GetXIDRange(client->index, FALSE, &min_id, &max_id);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.start_id = min_id;
-    rep.count = max_id - min_id + 1;
+    rep = (xXCMiscGetXIDRangeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .start_id = min_id,
+        .count = max_id - min_id + 1
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.start_id);
         swapl(&rep.count);
     }
-    WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), &rep);
     return Success;
 }
 
@@ -102,16 +106,18 @@ ProcXCMiscGetXIDList(ClientPtr client)
         return BadAlloc;
     }
     count = GetXIDList(client, stuff->count, pids);
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = count;
-    rep.count = count;
+    rep = (xXCMiscGetXIDListReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = count,
+        .count = count
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.count);
     }
-    WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXCMiscGetXIDListReply), &rep);
     if (count) {
         client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
         WriteSwappedDataToClient(client, count * sizeof(XID), pids);
@@ -184,7 +190,7 @@ SProcXCMiscDispatch(ClientPtr client)
 }
 
 void
-XCMiscExtensionInit(INITARGS)
+XCMiscExtensionInit(void)
 {
     AddExtension(XCMiscExtensionName, 0, 0,
                  ProcXCMiscDispatch, SProcXCMiscDispatch,
index 9de7856..b4ef5e4 100644 (file)
@@ -71,6 +71,7 @@
 #include "gcstruct.h"
 #include "dixfontstr.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include "protocol-versions.h"
 
 #include <X11/extensions/xf86bigfproto.h>
@@ -277,25 +278,23 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
     xXF86BigfontQueryVersionReply reply;
 
     REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq);
-    reply.type = X_Reply;
-    reply.length = 0;
-    reply.sequenceNumber = client->sequence;
-    reply.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION;
-    reply.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION;
-    reply.uid = geteuid();
-    reply.gid = getegid();
+    reply = (xXF86BigfontQueryVersionReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION,
+        .minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION,
+        .uid = geteuid(),
+        .gid = getegid(),
 #ifdef HAS_SHM
-    reply.signature = signature;
+        .signature = signature,
+        .capabilities = (LocalClient(client) && !client->swapped)
+                         ? XF86Bigfont_CAP_LocalShm : 0
 #else
-    reply.signature = 0;        /* This is redundant. Avoids uninitialized memory. */
+        .signature = 0,
+        .capabilities = 0
 #endif
-    reply.capabilities =
-#ifdef HAS_SHM
-        (LocalClient(client) && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0)
-#else
-        0
-#endif
-        ;                       /* may add more bits here in future versions */
+    };
     if (client->swapped) {
         char tmp;
 
@@ -307,8 +306,7 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
         swapl(&reply.gid);
         swapl(&reply.signature);
     }
-    WriteToClient(client,
-                  sizeof(xXF86BigfontQueryVersionReply), (char *) &reply);
+    WriteToClient(client, sizeof(xXF86BigfontQueryVersionReply), &reply);
     return Success;
 }
 
@@ -555,7 +553,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
                ? nUniqCharInfos * sizeof(xCharInfo)
                + (nCharInfos + 1) / 2 * 2 * sizeof(CARD16)
                : 0);
-        xXF86BigfontQueryFontReply *reply = malloc(rlength);
+        xXF86BigfontQueryFontReply *reply = calloc(1, rlength);
         char *p;
 
         if (!reply) {
@@ -644,7 +642,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
                 }
             }
         }
-        WriteToClient(client, rlength, (char *) reply);
+        WriteToClient(client, rlength, reply);
         free(reply);
         if (nCharInfos > 0) {
             if (shmid == -1)
index 2c78dc4..eab5287 100644 (file)
@@ -27,7 +27,6 @@
 
 #include <X11/fonts/font.h>
 
-extern void XFree86BigfontExtensionInit(void);
 extern void XF86BigfontFreeFontShm(FontPtr);
 extern void XF86BigfontCleanup(void);
 
index 9d89b65..7d21ad7 100644 (file)
@@ -10,6 +10,7 @@
 #include <string.h>
 #include <X11/X.h>
 #include <X11/Xproto.h>
+#include <assert.h>
 #include "misc.h"
 #include "os.h"
 #include "dixstruct.h"
 #include "pixmapstr.h"
 #include "windowstr.h"
 #include "gcstruct.h"
-#include "modinit.h"
+#include "extinit.h"
 #include "protocol-versions.h"
+#include "client.h"
+#include "list.h"
+#include "misc.h"
+#include <string.h>
+#include "hashtable.h"
+#include "picturestr.h"
+
+#ifdef COMPOSITE
+#include "compint.h"
+#endif
+
+/** @brief Holds fragments of responses for ConstructClientIds.
+ *
+ *  note: there is no consideration for data alignment */
+typedef struct {
+    struct xorg_list l;
+    int   bytes;
+    /* data follows */
+} FragmentList;
+
+#define FRAGMENT_DATA(ptr) ((void*) ((char*) (ptr) + sizeof(FragmentList)))
+
+/** @brief Holds structure for the generated response to
+           ProcXResQueryClientIds; used by ConstructClientId* -functions */
+typedef struct {
+    int           numIds;
+    int           resultBytes;
+    struct xorg_list   response;
+    int           sentClientMasks[MAXCLIENTS];
+} ConstructClientIdCtx;
+
+/** @brief Holds the structure for information required to
+           generate the response to XResQueryResourceBytes. In addition
+           to response it contains information on the query as well,
+           as well as some volatile information required by a few
+           functions that cannot take that information directly
+           via a parameter, as they are called via already-existing
+           higher order functions. */
+typedef struct {
+    ClientPtr     sendClient;
+    int           numSizes;
+    int           resultBytes;
+    struct xorg_list response;
+    int           status;
+    long          numSpecs;
+    xXResResourceIdSpec *specs;
+    HashTable     visitedResources;
+
+    /* Used by AddSubResourceSizeSpec when AddResourceSizeValue is
+       handling crossreferences */
+    HashTable     visitedSubResources;
+
+    /* used when ConstructResourceBytesCtx is passed to
+       AddResourceSizeValue2 via FindClientResourcesByType */
+    RESTYPE       resType;
+
+    /* used when ConstructResourceBytesCtx is passed to
+       AddResourceSizeValueByResource from ConstructResourceBytesByResource */
+    xXResResourceIdSpec       *curSpec;
+
+    /** Used when iterating through a single resource's subresources
+
+        @see AddSubResourceSizeSpec */
+    xXResResourceSizeValue    *sizeValue;
+} ConstructResourceBytesCtx;
+
+/** @brief Allocate and add a sequence of bytes at the end of a fragment list.
+           Call DestroyFragments to release the list.
+
+    @param frags A pointer to head of an initialized linked list
+    @param bytes Number of bytes to allocate
+    @return Returns a pointer to the allocated non-zeroed region
+            that is to be filled by the caller. On error (out of memory)
+            returns NULL and makes no changes to the list.
+*/
+static void *
+AddFragment(struct xorg_list *frags, int bytes)
+{
+    FragmentList *f = malloc(sizeof(FragmentList) + bytes);
+    if (!f) {
+        return NULL;
+    } else {
+        f->bytes = bytes;
+        xorg_list_add(&f->l, frags->prev);
+        return (char*) f + sizeof(*f);
+    }
+}
+
+/** @brief Sends all fragments in the list to the client. Does not
+           free anything.
+
+    @param client The client to send the fragments to
+    @param frags The head of the list of fragments
+*/
+static void
+WriteFragmentsToClient(ClientPtr client, struct xorg_list *frags)
+{
+    FragmentList *it;
+    xorg_list_for_each_entry(it, frags, l) {
+        WriteToClient(client, it->bytes, (char*) it + sizeof(*it));
+    }
+}
+
+/** @brief Frees a list of fragments. Does not free() root node.
+
+    @param frags The head of the list of fragments
+*/
+static void
+DestroyFragments(struct xorg_list *frags)
+{
+    FragmentList *it, *tmp;
+    xorg_list_for_each_entry_safe(it, tmp, frags, l) {
+        xorg_list_del(&it->l);
+        free(it);
+    }
+}
+
+/** @brief Constructs a context record for ConstructClientId* functions
+           to use */
+static void
+InitConstructClientIdCtx(ConstructClientIdCtx *ctx)
+{
+    ctx->numIds = 0;
+    ctx->resultBytes = 0;
+    xorg_list_init(&ctx->response);
+    memset(ctx->sentClientMasks, 0, sizeof(ctx->sentClientMasks));
+}
+
+/** @brief Destroys a context record, releases all memory (except the storage
+           for *ctx itself) */
+static void
+DestroyConstructClientIdCtx(ConstructClientIdCtx *ctx)
+{
+    DestroyFragments(&ctx->response);
+}
+
+static Bool
+InitConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx,
+                              ClientPtr                  sendClient,
+                              long                       numSpecs,
+                              xXResResourceIdSpec       *specs)
+{
+    ctx->sendClient = sendClient;
+    ctx->numSizes = 0;
+    ctx->resultBytes = 0;
+    xorg_list_init(&ctx->response);
+    ctx->status = Success;
+    ctx->numSpecs = numSpecs;
+    ctx->specs = specs;
+    ctx->visitedResources = ht_create(sizeof(XID), 0,
+                                      ht_resourceid_hash, ht_resourceid_compare,
+                                      NULL);
+
+    if (!ctx->visitedResources) {
+        return FALSE;
+    } else {
+        return TRUE;
+    }
+}
+
+static void
+DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx)
+{
+    DestroyFragments(&ctx->response);
+    ht_destroy(ctx->visitedResources);
+}
+
+extern void ResExtensionInit(void);
 
 static int
 ProcXResQueryVersion(ClientPtr client)
 {
     REQUEST(xXResQueryVersionReq);
-    xXResQueryVersionReply rep;
+    xXResQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .server_major = SERVER_XRES_MAJOR_VERSION,
+        .server_minor = SERVER_XRES_MINOR_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xXResQueryVersionReq);
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.server_major = SERVER_XRES_MAJOR_VERSION;
-    rep.server_minor = SERVER_XRES_MINOR_VERSION;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swaps(&rep.server_major);
         swaps(&rep.server_minor);
     }
-    WriteToClient(client, sizeof(xXResQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXResQueryVersionReply), &rep);
     return Success;
 }
 
@@ -66,16 +236,18 @@ ProcXResQueryClients(ClientPtr client)
         }
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.num_clients = num_clients;
-    rep.length = bytes_to_int32(rep.num_clients * sz_xXResClient);
+    rep = (xXResQueryClientsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(num_clients * sz_xXResClient),
+        .num_clients = num_clients
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.num_clients);
     }
-    WriteToClient(client, sizeof(xXResQueryClientsReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXResQueryClientsReply), &rep);
 
     if (num_clients) {
         xXResClient scratch;
@@ -88,7 +260,7 @@ ProcXResQueryClients(ClientPtr client)
                 swapl(&scratch.resource_base);
                 swapl(&scratch.resource_mask);
             }
-            WriteToClient(client, sz_xXResClient, (char *) &scratch);
+            WriteToClient(client, sz_xXResClient, &scratch);
         }
     }
 
@@ -133,18 +305,19 @@ ProcXResQueryClientResources(ClientPtr client)
             num_types++;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.num_types = num_types;
-    rep.length = bytes_to_int32(rep.num_types * sz_xXResType);
+    rep = (xXResQueryClientResourcesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(num_types * sz_xXResType),
+        .num_types = num_types
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.num_types);
     }
 
-    WriteToClient(client, sizeof(xXResQueryClientResourcesReply),
-                  (char *) &rep);
+    WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep);
 
     if (num_types) {
         xXResType scratch;
@@ -170,7 +343,7 @@ ProcXResQueryClientResources(ClientPtr client)
                 swapl(&scratch.resource_type);
                 swapl(&scratch.count);
             }
-            WriteToClient(client, sz_xXResType, (char *) &scratch);
+            WriteToClient(client, sz_xXResType, &scratch);
         }
     }
 
@@ -195,6 +368,17 @@ ResGetApproxPixmapBytes(PixmapPtr pix)
 }
 
 static void
+ResFindResourcePixmaps(pointer value, XID id, RESTYPE type, pointer cdata)
+{
+    SizeType sizeFunc = GetResourceTypeSizeFunc(type);
+    ResourceSizeRec size = { 0, 0, 0 };
+    unsigned long *bytes = cdata;
+
+    sizeFunc(value, id, &size);
+    *bytes += size.pixmapRefSize;
+}
+
+static void 
 ResFindPixmaps(pointer value, XID id, pointer cdata)
 {
     unsigned long *bytes = (unsigned long *) cdata;
@@ -229,6 +413,22 @@ ResFindGCPixmaps(pointer value, XID id, pointer cdata)
         *bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap);
 }
 
+static void
+ResFindPicturePixmaps(pointer value, XID id, pointer cdata)
+{
+#ifdef RENDER
+    ResFindResourcePixmaps(value, id, PictureType, cdata);
+#endif
+}
+
+static void
+ResFindCompositeClientWindowPixmaps (pointer value, XID id, pointer cdata)
+{
+#ifdef COMPOSITE
+    ResFindResourcePixmaps(value, id, CompositeClientWindowType, cdata);
+#endif
+}
+
 static int
 ProcXResQueryClientPixmapBytes(ClientPtr client)
 {
@@ -263,31 +463,622 @@ ProcXResQueryClientPixmapBytes(ClientPtr client)
     FindClientResourcesByType(clients[clientID], RT_GC,
                               ResFindGCPixmaps, (pointer) (&bytes));
 
+#ifdef RENDER
+    /* Render extension picture pixmaps. */
+    FindClientResourcesByType(clients[clientID], PictureType,
+                              ResFindPicturePixmaps,
+                              (pointer)(&bytes));
+#endif
+
 #ifdef COMPOSITE
-    /* FIXME: include composite pixmaps too */
+    /* Composite extension client window pixmaps. */
+    FindClientResourcesByType(clients[clientID], CompositeClientWindowType,
+                              ResFindCompositeClientWindowPixmaps,
+                              (pointer)(&bytes));
 #endif
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.bytes = bytes;
+    rep = (xXResQueryClientPixmapBytesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .bytes = bytes,
 #ifdef _XSERVER64
-    rep.bytes_overflow = bytes >> 32;
+        .bytes_overflow = bytes >> 32
 #else
-    rep.bytes_overflow = 0;
+        .bytes_overflow = 0
 #endif
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.bytes);
         swapl(&rep.bytes_overflow);
     }
-    WriteToClient(client, sizeof(xXResQueryClientPixmapBytesReply),
-                  (char *) &rep);
+    WriteToClient(client, sizeof(xXResQueryClientPixmapBytesReply), &rep);
+
+    return Success;
+}
+
+/** @brief Finds out if a client's information need to be put into the
+    response; marks client having been handled, if that is the case.
+
+    @param client   The client to send information about
+    @param mask     The request mask (0 to send everything, otherwise a
+                    bitmask of X_XRes*Mask)
+    @param ctx      The context record that tells which clients and id types
+                    have been already handled
+    @param sendMask Which id type are we now considering. One of X_XRes*Mask.
+
+    @return Returns TRUE if the client information needs to be on the
+            response, otherwise FALSE.
+*/
+static Bool
+WillConstructMask(ClientPtr client, CARD32 mask,
+                  ConstructClientIdCtx *ctx, int sendMask)
+{
+    if ((!mask || (mask & sendMask))
+        && !(ctx->sentClientMasks[client->index] & sendMask)) {
+        ctx->sentClientMasks[client->index] |= sendMask;
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+}
+
+/** @brief Constructs a response about a single client, based on a certain
+           client id spec
+
+    @param sendClient Which client wishes to receive this answer. Used for
+                      byte endianess.
+    @param client     Which client are we considering.
+    @param mask       The client id spec mask indicating which information
+                      we want about this client.
+    @param ctx        The context record containing the constructed response
+                      and information on which clients and masks have been
+                      already handled.
+
+    @return Return TRUE if everything went OK, otherwise FALSE which indicates
+            a memory allocation problem.
+*/
+static Bool
+ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
+                       ConstructClientIdCtx *ctx)
+{
+    xXResClientIdValue rep;
+
+    rep.spec.client = client->clientAsMask;
+    if (client->swapped) {
+        swapl (&rep.spec.client);
+    }
+
+    if (WillConstructMask(client, mask, ctx, X_XResClientXIDMask)) {
+        void *ptr = AddFragment(&ctx->response, sizeof(rep));
+        if (!ptr) {
+            return FALSE;
+        }
+
+        rep.spec.mask = X_XResClientXIDMask;
+        rep.length = 0;
+        if (sendClient->swapped) {
+            swapl (&rep.spec.mask);
+            /* swapl (&rep.length, n); - not required for rep.length = 0 */
+        }
+
+        memcpy(ptr, &rep, sizeof(rep));
+
+        ctx->resultBytes += sizeof(rep);
+        ++ctx->numIds;
+    }
+    if (WillConstructMask(client, mask, ctx, X_XResLocalClientPIDMask)) {
+        pid_t pid = GetClientPid(client);
+
+        if (pid != -1) {
+            void *ptr = AddFragment(&ctx->response,
+                                    sizeof(rep) + sizeof(CARD32));
+            CARD32 *value = (void*) ((char*) ptr + sizeof(rep));
+
+            if (!ptr) {
+                return FALSE;
+            }
+
+            rep.spec.mask = X_XResLocalClientPIDMask;
+            rep.length = 4;
+
+            if (sendClient->swapped) {
+                swapl (&rep.spec.mask);
+                swapl (&rep.length);
+            }
+
+            if (sendClient->swapped) {
+                swapl (value);
+            }
+            memcpy(ptr, &rep, sizeof(rep));
+            *value = pid;
+
+            ctx->resultBytes += sizeof(rep) + sizeof(CARD32);
+            ++ctx->numIds;
+        }
+    }
+
+    /* memory allocation errors earlier may return with FALSE */
+    return TRUE;
+}
+
+/** @brief Constructs a response about all clients, based on a client id specs
+
+    @param client   Which client which we are constructing the response for.
+    @param numSpecs Number of client id specs in specs
+    @param specs    Client id specs
+
+    @return Return Success if everything went OK, otherwise a Bad* (currently
+            BadAlloc or BadValue)
+*/
+static int
+ConstructClientIds(ClientPtr client,
+                   int numSpecs, xXResClientIdSpec* specs,
+                   ConstructClientIdCtx *ctx)
+{
+    int specIdx;
+
+    for (specIdx = 0; specIdx < numSpecs; ++specIdx) {
+        if (specs[specIdx].client == 0) {
+            int c;
+            for (c = 0; c < currentMaxClients; ++c) {
+                if (clients[c]) {
+                    if (!ConstructClientIdValue(client, clients[c],
+                                                specs[specIdx].mask, ctx)) {
+                        return BadAlloc;
+                    }
+                }
+            }
+        } else {
+            int clientID = CLIENT_ID(specs[specIdx].client);
+
+            if ((clientID < currentMaxClients) && clients[clientID]) {
+                if (!ConstructClientIdValue(client, clients[clientID],
+                                            specs[specIdx].mask, ctx)) {
+                    return BadAlloc;
+                }
+            }
+        }
+    }
 
+    /* memory allocation errors earlier may return with BadAlloc */
     return Success;
 }
 
+/** @brief Response to XResQueryClientIds request introduced in XResProto v1.2
+
+    @param client Which client which we are constructing the response for.
+
+    @return Returns the value returned from ConstructClientIds with the same
+            semantics
+*/
+static int
+ProcXResQueryClientIds (ClientPtr client)
+{
+    REQUEST(xXResQueryClientIdsReq);
+
+    xXResClientIdSpec        *specs = (void*) ((char*) stuff + sizeof(*stuff));
+    int                       rc;
+    ConstructClientIdCtx      ctx;
+
+    InitConstructClientIdCtx(&ctx);
+
+    REQUEST_AT_LEAST_SIZE(xXResQueryClientIdsReq);
+    REQUEST_FIXED_SIZE(xXResQueryClientIdsReq,
+                       stuff->numSpecs * sizeof(specs[0]));
+
+    rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
+
+    if (rc == Success) {
+        xXResQueryClientIdsReply  rep = {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = bytes_to_int32(ctx.resultBytes),
+            .numIds = ctx.numIds
+        };
+
+        assert((ctx.resultBytes & 3) == 0);
+
+        if (client->swapped) {
+            swaps (&rep.sequenceNumber);
+            swapl (&rep.length);
+            swapl (&rep.numIds);
+        }
+
+        WriteToClient(client, sizeof(rep), &rep);
+        WriteFragmentsToClient(client, &ctx.response);
+    }
+
+    DestroyConstructClientIdCtx(&ctx);
+
+    return rc;
+}
+
+/** @brief Swaps xXResResourceIdSpec endianess */
+static void
+SwapXResResourceIdSpec(xXResResourceIdSpec *spec)
+{
+    swapl(&spec->resource);
+    swapl(&spec->type);
+}
+
+/** @brief Swaps xXResResourceSizeSpec endianess */
+static void
+SwapXResResourceSizeSpec(xXResResourceSizeSpec *size)
+{
+    SwapXResResourceIdSpec(&size->spec);
+    swapl(&size->bytes);
+    swapl(&size->refCount);
+    swapl(&size->useCount);
+}
+
+/** @brief Swaps xXResResourceSizeValue endianess */
+static void
+SwapXResResourceSizeValue(xXResResourceSizeValue *rep)
+{
+    SwapXResResourceSizeSpec(&rep->size);
+    swapl(&rep->numCrossReferences);
+}
+
+/** @brief Swaps the response bytes */
+static void
+SwapXResQueryResourceBytes(struct xorg_list *response)
+{
+    struct xorg_list *it = response->next;
+    int c;
+
+    while (it != response) {
+        xXResResourceSizeValue *value = FRAGMENT_DATA(it);
+        it = it->next;
+        for (c = 0; c < value->numCrossReferences; ++c) {
+            xXResResourceSizeSpec *spec = FRAGMENT_DATA(it);
+            SwapXResResourceSizeSpec(spec);
+            it = it->next;
+        }
+        SwapXResResourceSizeValue(value);
+    }
+}
+
+/** @brief Adds xXResResourceSizeSpec describing a resource's size into
+           the buffer contained in the context. The resource is considered
+           to be a subresource.
+
+   @see AddResourceSizeValue
+
+   @param[in] value     The X resource object on which to add information
+                        about to the buffer
+   @param[in] id        The ID of the X resource
+   @param[in] type      The type of the X resource
+   @param[in/out] cdata The context object of type ConstructResourceBytesCtx.
+                        Void pointer type is used here to satisfy the type
+                        FindRes
+*/
+static void
+AddSubResourceSizeSpec(pointer value,
+                       XID id,
+                       RESTYPE type,
+                       pointer cdata)
+{
+    ConstructResourceBytesCtx *ctx = cdata;
+
+    if (ctx->status == Success) {
+        xXResResourceSizeSpec **prevCrossRef =
+          ht_find(ctx->visitedSubResources, &value);
+        if (!prevCrossRef) {
+            Bool ok = TRUE;
+            xXResResourceSizeSpec *crossRef =
+                AddFragment(&ctx->response, sizeof(xXResResourceSizeSpec));
+            ok = ok && crossRef != NULL;
+            if (ok) {
+                xXResResourceSizeSpec **p;
+                p = ht_add(ctx->visitedSubResources, &value);
+                if (!p) {
+                    ok = FALSE;
+                } else {
+                    *p = crossRef;
+                }
+            }
+            if (!ok) {
+                ctx->status = BadAlloc;
+            } else {
+                SizeType sizeFunc = GetResourceTypeSizeFunc(type);
+                ResourceSizeRec size = { 0, 0, 0 };
+                sizeFunc(value, id, &size);
+
+                crossRef->spec.resource = id;
+                crossRef->spec.type = type;
+                crossRef->bytes = size.resourceSize;
+                crossRef->refCount = size.refCnt;
+                crossRef->useCount = 1;
+
+                ++ctx->sizeValue->numCrossReferences;
+
+                ctx->resultBytes += sizeof(*crossRef);
+            }
+        } else {
+            /* if we have visited the subresource earlier (from current parent
+               resource), just increase its use count by one */
+            ++(*prevCrossRef)->useCount;
+        }
+    }
+}
+
+/** @brief Adds xXResResourceSizeValue describing a resource's size into
+           the buffer contained in the context. In addition, the
+           subresources are iterated and added as xXResResourceSizeSpec's
+           by using AddSubResourceSizeSpec
+
+   @see AddSubResourceSizeSpec
+
+   @param[in] value     The X resource object on which to add information
+                        about to the buffer
+   @param[in] id        The ID of the X resource
+   @param[in] type      The type of the X resource
+   @param[in/out] cdata The context object of type ConstructResourceBytesCtx.
+                        Void pointer type is used here to satisfy the type
+                        FindRes
+*/
+static void
+AddResourceSizeValue(pointer ptr, XID id, RESTYPE type, pointer cdata)
+{
+    ConstructResourceBytesCtx *ctx = cdata;
+    if (ctx->status == Success &&
+        !ht_find(ctx->visitedResources, &id)) {
+        Bool ok = TRUE;
+        HashTable ht;
+        HtGenericHashSetupRec htSetup = {
+            .keySize = sizeof(void*)
+        };
+
+        /* it doesn't matter that we don't undo the work done here
+         * immediately. All but ht_init will be undone at the end
+         * of the request and there can happen no failure after
+         * ht_init, so we don't need to clean it up here in any
+         * special way */
+
+        xXResResourceSizeValue *value =
+            AddFragment(&ctx->response, sizeof(xXResResourceSizeValue));
+        if (!value) {
+            ok = FALSE;
+        }
+        ok = ok && ht_add(ctx->visitedResources, &id);
+        if (ok) {
+            ht = ht_create(htSetup.keySize,
+                           sizeof(xXResResourceSizeSpec*),
+                           ht_generic_hash, ht_generic_compare,
+                           &htSetup);
+            ok = ok && ht;
+        }
+
+        if (!ok) {
+            ctx->status = BadAlloc;
+        } else {
+            SizeType sizeFunc = GetResourceTypeSizeFunc(type);
+            ResourceSizeRec size = { 0, 0, 0 };
+
+            sizeFunc(ptr, id, &size);
+
+            value->size.spec.resource = id;
+            value->size.spec.type = type;
+            value->size.bytes = size.resourceSize;
+            value->size.refCount = size.refCnt;
+            value->size.useCount = 1;
+            value->numCrossReferences = 0;
+
+            ctx->sizeValue = value;
+            ctx->visitedSubResources = ht;
+            FindSubResources(ptr, type, AddSubResourceSizeSpec, ctx);
+            ctx->visitedSubResources = NULL;
+            ctx->sizeValue = NULL;
+
+            ctx->resultBytes += sizeof(*value);
+            ++ctx->numSizes;
+
+            ht_destroy(ht);
+        }
+    }
+}
+
+/** @brief A variant of AddResourceSizeValue that passes the resource type
+           through the context object to satisfy the type FindResType
+
+   @see AddResourceSizeValue
+
+   @param[in] ptr        The resource
+   @param[in] id         The resource ID
+   @param[in/out] cdata  The context object that contains the resource type
+*/
+static void
+AddResourceSizeValueWithResType(pointer ptr, XID id, pointer cdata)
+{
+    ConstructResourceBytesCtx *ctx = cdata;
+    AddResourceSizeValue(ptr, id, ctx->resType, cdata);
+}
+
+/** @brief Adds the information of a resource into the buffer if it matches
+           the match condition.
+
+   @see AddResourceSizeValue
+
+   @param[in] ptr        The resource
+   @param[in] id         The resource ID
+   @param[in] type       The resource type
+   @param[in/out] cdata  The context object as a void pointer to satisfy the
+                         type FindAllRes
+*/
+static void
+AddResourceSizeValueByResource(pointer ptr, XID id, RESTYPE type, pointer cdata)
+{
+    ConstructResourceBytesCtx *ctx = cdata;
+    xXResResourceIdSpec *spec = ctx->curSpec;
+
+    if ((!spec->type || spec->type == type) &&
+        (!spec->resource || spec->resource == id)) {
+        AddResourceSizeValue(ptr, id, type, ctx);
+    }
+}
+
+/** @brief Add all resources of the client into the result buffer
+           disregarding all those specifications that specify the
+           resource by its ID. Those are handled by
+           ConstructResourceBytesByResource
+
+   @see ConstructResourceBytesByResource
+
+   @param[in] aboutClient  Which client is being considered
+   @param[in/out] ctx      The context that contains the resource id
+                           specifications as well as the result buffer
+*/
+static void
+ConstructClientResourceBytes(ClientPtr aboutClient,
+                             ConstructResourceBytesCtx *ctx)
+{
+    int specIdx;
+    for (specIdx = 0; specIdx < ctx->numSpecs; ++specIdx) {
+        xXResResourceIdSpec* spec = ctx->specs + specIdx;
+        if (spec->resource) {
+            /* these specs are handled elsewhere */
+        } else if (spec->type) {
+            ctx->resType = spec->type;
+            FindClientResourcesByType(aboutClient, spec->type,
+                                      AddResourceSizeValueWithResType, ctx);
+        } else {
+            FindAllClientResources(aboutClient, AddResourceSizeValue, ctx);
+        }
+    }
+}
+
+/** @brief Add the sizes of all such resources that can are specified by
+           their ID in the resource id specification. The scan can
+           by limited to a client with the aboutClient parameter
+
+   @see ConstructResourceBytesByResource
+
+   @param[in] aboutClient  Which client is being considered. This may be None
+                           to mean all clients.
+   @param[in/out] ctx      The context that contains the resource id
+                           specifications as well as the result buffer. In
+                           addition this function uses the curSpec field to
+                           keep a pointer to the current resource id
+                           specification in it, which can be used by
+                           AddResourceSizeValueByResource .
+*/
+static void
+ConstructResourceBytesByResource(XID aboutClient, ConstructResourceBytesCtx *ctx)
+{
+    int specIdx;
+    for (specIdx = 0; specIdx < ctx->numSpecs; ++specIdx) {
+        xXResResourceIdSpec *spec = ctx->specs + specIdx;
+        if (spec->resource) {
+            int cid = CLIENT_ID(spec->resource);
+            if (cid < currentMaxClients &&
+                (aboutClient == None || cid == aboutClient)) {
+                ClientPtr client = clients[cid];
+                if (client) {
+                    ctx->curSpec = spec;
+                    FindAllClientResources(client,
+                                           AddResourceSizeValueByResource,
+                                           ctx);
+                }
+            }
+        }
+    }
+}
+
+/** @brief Build the resource size response for the given client
+           (or all if not specified) per the parameters set up
+           in the context object.
+
+  @param[in] aboutClient  Which client to consider or None for all clients
+  @param[in/out] ctx      The context object that contains the request as well
+                          as the response buffer.
+*/
+static int
+ConstructResourceBytes(XID aboutClient,
+                       ConstructResourceBytesCtx *ctx)
+{
+    if (aboutClient) {
+        int clientIdx = CLIENT_ID(aboutClient);
+        ClientPtr client = NullClient;
+
+        if ((clientIdx >= currentMaxClients) || !clients[clientIdx]) {
+            ctx->sendClient->errorValue = aboutClient;
+            return BadValue;
+        }
+
+        client = clients[clientIdx];
+
+        ConstructClientResourceBytes(client, ctx);
+        ConstructResourceBytesByResource(aboutClient, ctx);
+    } else {
+        int clientIdx;
+
+        ConstructClientResourceBytes(NULL, ctx);
+
+        for (clientIdx = 0; clientIdx < currentMaxClients; ++clientIdx) {
+            ClientPtr client = clients[clientIdx];
+
+            if (client) {
+                ConstructClientResourceBytes(client, ctx);
+            }
+        }
+
+        ConstructResourceBytesByResource(None, ctx);
+    }
+
+
+    return ctx->status;
+}
+
+/** @brief Implements the XResQueryResourceBytes of XResProto v1.2 */
+static int
+ProcXResQueryResourceBytes (ClientPtr client)
+{
+    REQUEST(xXResQueryResourceBytesReq);
+
+    int                          rc;
+    ConstructResourceBytesCtx    ctx;
+
+    REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
+    REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
+                       stuff->numSpecs * sizeof(ctx.specs[0]));
+
+    if (!InitConstructResourceBytesCtx(&ctx, client,
+                                       stuff->numSpecs,
+                                       (void*) ((char*) stuff +
+                                                sz_xXResQueryResourceBytesReq))) {
+        return BadAlloc;
+    }
+
+    rc = ConstructResourceBytes(stuff->client, &ctx);
+
+    if (rc == Success) {
+        xXResQueryResourceBytesReply rep = {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = bytes_to_int32(ctx.resultBytes),
+            .numSizes = ctx.numSizes
+        };
+
+        if (client->swapped) {
+            swaps (&rep.sequenceNumber);
+            swapl (&rep.length);
+            swapl (&rep.numSizes);
+
+            SwapXResQueryResourceBytes(&ctx.response);
+        }
+
+        WriteToClient(client, sizeof(rep), &rep);
+        WriteFragmentsToClient(client, &ctx.response);
+    }
+
+    DestroyConstructResourceBytesCtx(&ctx);
+
+    return rc;
+}
+
 static int
 ProcResDispatch(ClientPtr client)
 {
@@ -301,8 +1092,11 @@ ProcResDispatch(ClientPtr client)
         return ProcXResQueryClientResources(client);
     case X_XResQueryClientPixmapBytes:
         return ProcXResQueryClientPixmapBytes(client);
-    default:
-        break;
+    case X_XResQueryClientIds:
+        return ProcXResQueryClientIds(client);
+    case X_XResQueryResourceBytes:
+        return ProcXResQueryResourceBytes(client);
+    default: break;
     }
 
     return BadRequest;
@@ -335,7 +1129,39 @@ SProcXResQueryClientPixmapBytes(ClientPtr client)
 }
 
 static int
-SProcResDispatch(ClientPtr client)
+SProcXResQueryClientIds (ClientPtr client)
+{
+    REQUEST(xXResQueryClientIdsReq);
+
+    REQUEST_AT_LEAST_SIZE (xXResQueryClientIdsReq);
+    swapl(&stuff->numSpecs);
+    return ProcXResQueryClientIds(client);
+}
+
+/** @brief Implements the XResQueryResourceBytes of XResProto v1.2.
+    This variant byteswaps request contents before issuing the
+    rest of the work to ProcXResQueryResourceBytes */
+static int
+SProcXResQueryResourceBytes (ClientPtr client)
+{
+    REQUEST(xXResQueryResourceBytesReq);
+    int c;
+    xXResResourceIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff));
+
+    swapl(&stuff->numSpecs);
+    REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
+    REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
+                       stuff->numSpecs * sizeof(specs[0]));
+
+    for (c = 0; c < stuff->numSpecs; ++c) {
+        SwapXResResourceIdSpec(specs + c);
+    }
+
+    return ProcXResQueryResourceBytes(client);
+}
+
+static int
+SProcResDispatch (ClientPtr client)
 {
     REQUEST(xReq);
     swaps(&stuff->length);
@@ -349,15 +1175,18 @@ SProcResDispatch(ClientPtr client)
         return SProcXResQueryClientResources(client);
     case X_XResQueryClientPixmapBytes:
         return SProcXResQueryClientPixmapBytes(client);
-    default:
-        break;
+    case X_XResQueryClientIds:
+        return SProcXResQueryClientIds(client);
+    case X_XResQueryResourceBytes:
+        return SProcXResQueryResourceBytes(client);
+    default: break;
     }
 
     return BadRequest;
 }
 
 void
-ResExtensionInit(INITARGS)
+ResExtensionInit(void)
 {
     (void) AddExtension(XRES_NAME, 0, 0,
                         ProcResDispatch, SProcResDispatch,
index 342abb1..3115f03 100644 (file)
@@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "windowstr.h"
 #include "propertyst.h"
 #include "extnsionst.h"
-#include "modinit.h"
+#include "extinit.h"
 #include "xselinuxint.h"
 
 #define CTX_DEV offsetof(SELinuxSubjectRec, dev_create_sid)
@@ -63,20 +63,20 @@ SELinuxCopyContext(char *ptr, unsigned len)
 static int
 ProcSELinuxQueryVersion(ClientPtr client)
 {
-    SELinuxQueryVersionReply rep;
-
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.server_major = SELINUX_MAJOR_VERSION;
-    rep.server_minor = SELINUX_MINOR_VERSION;
+    SELinuxQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .server_major = SELINUX_MAJOR_VERSION,
+        .server_minor = SELINUX_MINOR_VERSION
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swaps(&rep.server_major);
         swaps(&rep.server_minor);
     }
-    WriteToClient(client, sizeof(rep), (char *) &rep);
+    WriteToClient(client, sizeof(rep), &rep);
     return Success;
 }
 
@@ -93,10 +93,12 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
         len = strlen(ctx) + 1;
     }
 
-    rep.type = X_Reply;
-    rep.length = bytes_to_int32(len);
-    rep.sequenceNumber = client->sequence;
-    rep.context_len = len;
+    rep = (SELinuxGetContextReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(len),
+        .context_len = len
+    };
 
     if (client->swapped) {
         swapl(&rep.length);
@@ -104,7 +106,7 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
         swapl(&rep.context_len);
     }
 
-    WriteToClient(client, sizeof(SELinuxGetContextReply), (char *) &rep);
+    WriteToClient(client, sizeof(SELinuxGetContextReply), &rep);
     WriteToClient(client, len, ctx);
     freecon(ctx);
     return Success;
@@ -372,10 +374,12 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
     }
 
     /* Send reply to client */
-    rep.type = X_Reply;
-    rep.length = size;
-    rep.sequenceNumber = client->sequence;
-    rep.count = count;
+    rep = (SELinuxListItemsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = size,
+        .count = count
+    };
 
     if (client->swapped) {
         swapl(&rep.length);
@@ -383,8 +387,8 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
         swapl(&rep.count);
     }
 
-    WriteToClient(client, sizeof(SELinuxListItemsReply), (char *) &rep);
-    WriteToClient(client, size * 4, (char *) buf);
+    WriteToClient(client, sizeof(SELinuxListItemsReply), &rep);
+    WriteToClient(client, size * 4, buf);
 
     /* Free stuff and return */
     rc = Success;
@@ -683,7 +687,7 @@ SELinuxResetProc(ExtensionEntry * extEntry)
 }
 
 void
-SELinuxExtensionInit(INITARGS)
+SELinuxExtensionInit(void)
 {
     ExtensionEntry *extEntry;
 
index e659b41..c593372 100644 (file)
@@ -55,7 +55,7 @@
 #include "eventstr.h"
 #include "inpututils.h"
 
-#include "modinit.h"
+#include "extinit.h"
 
 extern int DeviceValuator;
 
@@ -88,19 +88,21 @@ static int XTestSwapFakeInput(ClientPtr /* client */ ,
 static int
 ProcXTestGetVersion(ClientPtr client)
 {
-    xXTestGetVersionReply rep;
+    xXTestGetVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = XTestMajorVersion,
+        .minorVersion = XTestMinorVersion
+    };
 
     REQUEST_SIZE_MATCH(xXTestGetVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = XTestMajorVersion;
-    rep.minorVersion = XTestMinorVersion;
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swaps(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xXTestGetVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXTestGetVersionReply), &rep);
     return Success;
 }
 
@@ -134,14 +136,16 @@ ProcXTestCompareCursor(ClientPtr client)
             return rc;
         }
     }
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.same = (wCursor(pWin) == pCursor);
+    rep = (xXTestCompareCursorReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .same = (wCursor(pWin) == pCursor)
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
     }
-    WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXTestCompareCursorReply), &rep);
     return Success;
 }
 
@@ -675,7 +679,7 @@ XTestExtensionTearDown(ExtensionEntry * e)
 }
 
 void
-XTestExtensionInit(INITARGS)
+XTestExtensionInit(void)
 {
     AddExtension(XTestExtensionName, 0, 0,
                  ProcXTestDispatch, SProcXTestDispatch,
index 8abd51c..31b7783 100644 (file)
@@ -62,7 +62,7 @@ SWriteQueryExtensionReply(ClientPtr client, xvQueryExtensionReply * rep)
     swaps(&rep->version);
     swaps(&rep->revision);
 
-    (void) WriteToClient(client, sz_xvQueryExtensionReply, (char *) rep);
+    WriteToClient(client, sz_xvQueryExtensionReply, rep);
 
     return Success;
 }
@@ -74,7 +74,7 @@ SWriteQueryAdaptorsReply(ClientPtr client, xvQueryAdaptorsReply * rep)
     swapl(&rep->length);
     swaps(&rep->num_adaptors);
 
-    (void) WriteToClient(client, sz_xvQueryAdaptorsReply, (char *) rep);
+    WriteToClient(client, sz_xvQueryAdaptorsReply, rep);
 
     return Success;
 }
@@ -86,7 +86,7 @@ SWriteQueryEncodingsReply(ClientPtr client, xvQueryEncodingsReply * rep)
     swapl(&rep->length);
     swaps(&rep->num_encodings);
 
-    (void) WriteToClient(client, sz_xvQueryEncodingsReply, (char *) rep);
+    WriteToClient(client, sz_xvQueryEncodingsReply, rep);
 
     return Success;
 }
@@ -99,7 +99,7 @@ SWriteAdaptorInfo(ClientPtr client, xvAdaptorInfo * pAdaptor)
     swaps(&pAdaptor->num_ports);
     swaps(&pAdaptor->num_formats);
 
-    (void) WriteToClient(client, sz_xvAdaptorInfo, (char *) pAdaptor);
+    WriteToClient(client, sz_xvAdaptorInfo, pAdaptor);
 
     return Success;
 }
@@ -114,7 +114,7 @@ SWriteEncodingInfo(ClientPtr client, xvEncodingInfo * pEncoding)
     swaps(&pEncoding->height);
     swapl(&pEncoding->rate.numerator);
     swapl(&pEncoding->rate.denominator);
-    (void) WriteToClient(client, sz_xvEncodingInfo, (char *) pEncoding);
+    WriteToClient(client, sz_xvEncodingInfo, pEncoding);
 
     return Success;
 }
@@ -123,7 +123,7 @@ static int
 SWriteFormat(ClientPtr client, xvFormat * pFormat)
 {
     swapl(&pFormat->visual);
-    (void) WriteToClient(client, sz_xvFormat, (char *) pFormat);
+    WriteToClient(client, sz_xvFormat, pFormat);
 
     return Success;
 }
@@ -135,7 +135,7 @@ SWriteAttributeInfo(ClientPtr client, xvAttributeInfo * pAtt)
     swapl(&pAtt->size);
     swapl(&pAtt->min);
     swapl(&pAtt->max);
-    (void) WriteToClient(client, sz_xvAttributeInfo, (char *) pAtt);
+    WriteToClient(client, sz_xvAttributeInfo, pAtt);
 
     return Success;
 }
@@ -157,7 +157,7 @@ SWriteImageFormatInfo(ClientPtr client, xvImageFormatInfo * pImage)
     swapl(&pImage->vert_u_period);
     swapl(&pImage->vert_v_period);
 
-    (void) WriteToClient(client, sz_xvImageFormatInfo, (char *) pImage);
+    WriteToClient(client, sz_xvImageFormatInfo, pImage);
 
     return Success;
 }
@@ -168,7 +168,7 @@ SWriteGrabPortReply(ClientPtr client, xvGrabPortReply * rep)
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
 
-    (void) WriteToClient(client, sz_xvGrabPortReply, (char *) rep);
+    WriteToClient(client, sz_xvGrabPortReply, rep);
 
     return Success;
 }
@@ -180,7 +180,7 @@ SWriteGetPortAttributeReply(ClientPtr client, xvGetPortAttributeReply * rep)
     swapl(&rep->length);
     swapl(&rep->value);
 
-    (void) WriteToClient(client, sz_xvGetPortAttributeReply, (char *) rep);
+    WriteToClient(client, sz_xvGetPortAttributeReply, rep);
 
     return Success;
 }
@@ -193,7 +193,7 @@ SWriteQueryBestSizeReply(ClientPtr client, xvQueryBestSizeReply * rep)
     swaps(&rep->actual_width);
     swaps(&rep->actual_height);
 
-    (void) WriteToClient(client, sz_xvQueryBestSizeReply, (char *) rep);
+    WriteToClient(client, sz_xvQueryBestSizeReply, rep);
 
     return Success;
 }
@@ -207,7 +207,7 @@ SWriteQueryPortAttributesReply(ClientPtr client,
     swapl(&rep->num_attributes);
     swapl(&rep->text_size);
 
-    (void) WriteToClient(client, sz_xvQueryPortAttributesReply, (char *) rep);
+    WriteToClient(client, sz_xvQueryPortAttributesReply, rep);
 
     return Success;
 }
@@ -223,7 +223,7 @@ SWriteQueryImageAttributesReply(ClientPtr client,
     swaps(&rep->width);
     swaps(&rep->height);
 
-    (void) WriteToClient(client, sz_xvQueryImageAttributesReply, (char *) rep);
+    WriteToClient(client, sz_xvQueryImageAttributesReply, rep);
 
     return Success;
 }
@@ -235,66 +235,66 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
     swapl(&rep->length);
     swapl(&rep->num_formats);
 
-    (void) WriteToClient(client, sz_xvListImageFormatsReply, (char *) rep);
+    WriteToClient(client, sz_xvListImageFormatsReply, rep);
 
     return Success;
 }
 
 #define _WriteQueryAdaptorsReply(_c,_d) \
   if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \
-  else WriteToClient(_c, sz_xvQueryAdaptorsReply, (char*)_d)
+  else WriteToClient(_c, sz_xvQueryAdaptorsReply, _d)
 
 #define _WriteQueryExtensionReply(_c,_d) \
   if ((_c)->swapped) SWriteQueryExtensionReply(_c, _d); \
-  else WriteToClient(_c, sz_xvQueryExtensionReply, (char*)_d)
+  else WriteToClient(_c, sz_xvQueryExtensionReply, _d)
 
 #define _WriteQueryEncodingsReply(_c,_d) \
   if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \
-  else WriteToClient(_c, sz_xvQueryEncodingsReply, (char*)_d)
+  else WriteToClient(_c, sz_xvQueryEncodingsReply, _d)
 
 #define _WriteAdaptorInfo(_c,_d) \
   if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \
-  else WriteToClient(_c, sz_xvAdaptorInfo, (char*)_d)
+  else WriteToClient(_c, sz_xvAdaptorInfo, _d)
 
 #define _WriteAttributeInfo(_c,_d) \
   if ((_c)->swapped) SWriteAttributeInfo(_c, _d); \
-  else WriteToClient(_c, sz_xvAttributeInfo, (char*)_d)
+  else WriteToClient(_c, sz_xvAttributeInfo, _d)
 
 #define _WriteEncodingInfo(_c,_d) \
   if ((_c)->swapped) SWriteEncodingInfo(_c, _d); \
-  else WriteToClient(_c, sz_xvEncodingInfo, (char*)_d)
+  else WriteToClient(_c, sz_xvEncodingInfo, _d)
 
 #define _WriteFormat(_c,_d) \
   if ((_c)->swapped) SWriteFormat(_c, _d); \
-  else WriteToClient(_c, sz_xvFormat, (char*)_d)
+  else WriteToClient(_c, sz_xvFormat, _d)
 
 #define _WriteGrabPortReply(_c,_d) \
   if ((_c)->swapped) SWriteGrabPortReply(_c, _d); \
-  else WriteToClient(_c, sz_xvGrabPortReply, (char*)_d)
+  else WriteToClient(_c, sz_xvGrabPortReply, _d)
 
 #define _WriteGetPortAttributeReply(_c,_d) \
   if ((_c)->swapped) SWriteGetPortAttributeReply(_c, _d); \
-  else WriteToClient(_c, sz_xvGetPortAttributeReply, (char*)_d)
+  else WriteToClient(_c, sz_xvGetPortAttributeReply, _d)
 
 #define _WriteQueryBestSizeReply(_c,_d) \
   if ((_c)->swapped) SWriteQueryBestSizeReply(_c, _d); \
-  else WriteToClient(_c, sz_xvQueryBestSizeReply,(char*) _d)
+  else WriteToClient(_c, sz_xvQueryBestSizeReply, _d)
 
 #define _WriteQueryPortAttributesReply(_c,_d) \
   if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \
-  else WriteToClient(_c, sz_xvQueryPortAttributesReply,(char*) _d)
+  else WriteToClient(_c, sz_xvQueryPortAttributesReply, _d)
 
 #define _WriteQueryImageAttributesReply(_c,_d) \
   if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \
-  else WriteToClient(_c, sz_xvQueryImageAttributesReply,(char*) _d)
+  else WriteToClient(_c, sz_xvQueryImageAttributesReply, _d)
 
 #define _WriteListImageFormatsReply(_c,_d) \
   if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \
-  else WriteToClient(_c, sz_xvListImageFormatsReply,(char*) _d)
+  else WriteToClient(_c, sz_xvListImageFormatsReply, _d)
 
 #define _WriteImageFormatInfo(_c,_d) \
   if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \
-  else WriteToClient(_c, sz_xvImageFormatInfo, (char*)_d)
+  else WriteToClient(_c, sz_xvImageFormatInfo, _d)
 
 #define _AllocatePort(_i,_p) \
   ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success
@@ -302,17 +302,17 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
 static int
 ProcXvQueryExtension(ClientPtr client)
 {
-    xvQueryExtensionReply rep;
+    xvQueryExtensionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .version = XvVersion,
+        .revision = XvRevision
+    };
 
     /* REQUEST(xvQueryExtensionReq); */
     REQUEST_SIZE_MATCH(xvQueryExtensionReq);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.version = XvVersion;
-    rep.revision = XvRevision;
-
     _WriteQueryExtensionReply(client, &rep);
 
     return Success;
@@ -343,10 +343,12 @@ ProcXvQueryAdaptors(ClientPtr client)
     pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                           XvGetScreenKey());
     if (!pxvs) {
-        rep.type = X_Reply;
-        rep.sequenceNumber = client->sequence;
-        rep.num_adaptors = 0;
-        rep.length = 0;
+        rep = (xvQueryAdaptorsReply) {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = 0,
+            .num_adaptors = 0
+        };
 
         _WriteQueryAdaptorsReply(client, &rep);
 
@@ -355,9 +357,11 @@ ProcXvQueryAdaptors(ClientPtr client)
 
     (*pxvs->ddQueryAdaptors) (pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.num_adaptors = pxvs->nAdaptors;
+    rep = (xvQueryAdaptorsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .num_adaptors = pxvs->nAdaptors
+    };
 
     /* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */
 
@@ -429,9 +433,11 @@ ProcXvQueryEncodings(ClientPtr client)
         return status;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.num_encodings = pPort->pAdaptor->nEncodings;
+    rep = (xvQueryEncodingsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .num_encodings = pPort->pAdaptor->nEncodings
+    };
 
     /* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */
 
@@ -662,11 +668,12 @@ ProcXvGrabPort(ClientPtr client)
     if (status != Success) {
         return status;
     }
-
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.result = result;
+    rep = (xvGrabPortReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .result = result
+    };
 
     _WriteGrabPortReply(client, &rep);
 
@@ -777,10 +784,12 @@ ProcXvGetPortAttribute(ClientPtr client)
         return status;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.value = value;
+    rep = (xvGetPortAttributeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .value = value
+    };
 
     _WriteGetPortAttributeReply(client, &rep);
 
@@ -805,17 +814,18 @@ ProcXvQueryBestSize(ClientPtr client)
         return status;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-
     (*pPort->pAdaptor->ddQueryBestSize) (client, pPort, stuff->motion,
                                          stuff->vid_w, stuff->vid_h,
                                          stuff->drw_w, stuff->drw_h,
                                          &actual_width, &actual_height);
 
-    rep.actual_width = actual_width;
-    rep.actual_height = actual_height;
+    rep = (xvQueryBestSizeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .actual_width = actual_width,
+        .actual_height = actual_height
+    };
 
     _WriteQueryBestSizeReply(client, &rep);
 
@@ -841,10 +851,12 @@ ProcXvQueryPortAttributes(ClientPtr client)
         return status;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.num_attributes = pPort->pAdaptor->nAttributes;
-    rep.text_size = 0;
+    rep = (xvQueryPortAttributesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .num_attributes = pPort->pAdaptor->nAttributes,
+        .text_size = 0
+    };
 
     for (i = 0, pAtt = pPort->pAdaptor->pAttributes;
          i < pPort->pAdaptor->nAttributes; i++, pAtt++) {
@@ -1017,14 +1029,14 @@ ProcXvShmPutImage(ClientPtr client)
                           stuff->send_event, stuff->width, stuff->height);
 
     if ((status == Success) && stuff->send_event) {
-        xShmCompletionEvent ev;
-
-        ev.type = ShmCompletionCode;
-        ev.drawable = stuff->drawable;
-        ev.minorEvent = xv_ShmPutImage;
-        ev.majorEvent = XvReqCode;
-        ev.shmseg = stuff->shmseg;
-        ev.offset = stuff->offset;
+        xShmCompletionEvent ev = {
+            .type = ShmCompletionCode,
+            .drawable = stuff->drawable,
+            .minorEvent = xv_ShmPutImage,
+            .majorEvent = XvReqCode,
+            .shmseg = stuff->shmseg,
+            .offset = stuff->offset
+        };
         WriteEventsToClient(client, 1, (xEvent *) &ev);
     }
 
@@ -1089,18 +1101,20 @@ ProcXvQueryImageAttributes(ClientPtr client)
                                                        &width, &height, offsets,
                                                        pitches);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = planeLength = num_planes << 1;
-    rep.num_planes = num_planes;
-    rep.width = width;
-    rep.height = height;
-    rep.data_size = size;
+    rep = (xvQueryImageAttributesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = planeLength = num_planes << 1,
+        .num_planes = num_planes,
+        .width = width,
+        .height = height,
+        .data_size = size
+    };
 
     _WriteQueryImageAttributesReply(client, &rep);
     if (client->swapped)
         SwapLongs((CARD32 *) offsets, planeLength);
-    WriteToClient(client, planeLength << 2, (char *) offsets);
+    WriteToClient(client, planeLength << 2, offsets);
 
     free(offsets);
 
@@ -1122,11 +1136,13 @@ ProcXvListImageFormats(ClientPtr client)
 
     VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.num_formats = pPort->pAdaptor->nImages;
-    rep.length =
-        bytes_to_int32(pPort->pAdaptor->nImages * sz_xvImageFormatInfo);
+    rep = (xvListImageFormatsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .num_formats = pPort->pAdaptor->nImages,
+        .length =
+            bytes_to_int32(pPort->pAdaptor->nImages * sz_xvImageFormatInfo)
+    };
 
     _WriteListImageFormatsReply(client, &rep);
 
index 15f3ea0..40309c1 100644 (file)
@@ -55,7 +55,6 @@ SOFTWARE.
 #include "scrnintstr.h"
 #include <X11/extensions/Xvproto.h>
 
-#ifndef XorgLoader
 extern _X_EXPORT unsigned long XvExtensionGeneration;
 extern _X_EXPORT unsigned long XvScreenGeneration;
 extern _X_EXPORT unsigned long XvResourceGeneration;
@@ -70,7 +69,6 @@ extern _X_EXPORT RESTYPE XvRTGrab;
 extern _X_EXPORT RESTYPE XvRTVideoNotify;
 extern _X_EXPORT RESTYPE XvRTVideoNotifyList;
 extern _X_EXPORT RESTYPE XvRTPortNotify;
-#endif
 
 typedef struct {
     int numerator;
@@ -219,7 +217,7 @@ typedef struct {
     DestroyWindowProcPtr DestroyWindow;
     DestroyPixmapProcPtr DestroyPixmap;
     CloseScreenProcPtr CloseScreen;
-    Bool (*ddCloseScreen) (int, ScreenPtr);
+    Bool (*ddCloseScreen) (ScreenPtr);
     int (*ddQueryAdaptors) (ScreenPtr, XvAdaptorPtr *, int *);
     DevUnion devPriv;
 } XvScreenRec, *XvScreenPtr;
@@ -235,11 +233,9 @@ typedef struct {
 #define _XvBadPort (XvBadPort+XvErrorBase)
 #define _XvBadEncoding (XvBadEncoding+XvErrorBase)
 
-#ifndef XorgLoader
 extern _X_EXPORT int ProcXvDispatch(ClientPtr);
 extern _X_EXPORT int SProcXvDispatch(ClientPtr);
 
-extern _X_EXPORT void XvExtensionInit(void);
 extern _X_EXPORT int XvScreenInit(ScreenPtr);
 extern _X_EXPORT DevPrivateKey XvGetScreenKey(void);
 extern _X_EXPORT unsigned long XvGetRTPort(void);
@@ -272,6 +268,4 @@ extern _X_EXPORT int XvdiPreemptVideo(ClientPtr, XvPortPtr, DrawablePtr);
 extern _X_EXPORT int XvdiMatchPort(XvPortPtr, DrawablePtr);
 extern _X_EXPORT int XvdiGrabPort(ClientPtr, XvPortPtr, Time, int *);
 extern _X_EXPORT int XvdiUngrabPort(ClientPtr, XvPortPtr, Time);
-#endif                          /* XorgLoader */
-
 #endif                          /* XVDIX_H */
index 79dc50b..1ea3ac2 100644 (file)
@@ -88,6 +88,7 @@ SOFTWARE.
 #include "pixmapstr.h"
 #include "gc.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include "dixstruct.h"
 #include "resource.h"
 #include "opaque.h"
@@ -129,7 +130,7 @@ static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *);
 static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *);
 static Bool CreateResourceTypes(void);
 
-static Bool XvCloseScreen(int, ScreenPtr);
+static Bool XvCloseScreen(ScreenPtr);
 static Bool XvDestroyPixmap(PixmapPtr);
 static Bool XvDestroyWindow(WindowPtr);
 static void XvResetProc(ExtensionEntry *);
@@ -290,7 +291,7 @@ XvScreenInit(ScreenPtr pScreen)
 }
 
 static Bool
-XvCloseScreen(int ii, ScreenPtr pScreen)
+XvCloseScreen(ScreenPtr pScreen)
 {
 
     XvScreenPtr pxvs;
@@ -301,13 +302,13 @@ XvCloseScreen(int ii, ScreenPtr pScreen)
     pScreen->DestroyWindow = pxvs->DestroyWindow;
     pScreen->CloseScreen = pxvs->CloseScreen;
 
-    (*pxvs->ddCloseScreen) (ii, pScreen);
+    (*pxvs->ddCloseScreen) (pScreen);
 
     free(pxvs);
 
     dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
 
-    return (*pScreen->CloseScreen) (ii, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
@@ -507,19 +508,20 @@ XvdiDestroyEncoding(pointer value, XID id)
 static int
 XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
 {
-    xvEvent event;
     XvVideoNotifyPtr pn;
 
     dixLookupResourceByType((pointer *) &pn, pDraw->id, XvRTVideoNotifyList,
                             serverClient, DixReadAccess);
 
     while (pn) {
+        xvEvent event = {
+            .u.videoNotify.reason = reason,
+            .u.videoNotify.time = currentTime.milliseconds,
+            .u.videoNotify.drawable = pDraw->id,
+            .u.videoNotify.port = pPort->id
+        };
         event.u.u.type = XvEventBase + XvVideoNotify;
-        event.u.videoNotify.time = currentTime.milliseconds;
-        event.u.videoNotify.drawable = pDraw->id;
-        event.u.videoNotify.port = pPort->id;
-        event.u.videoNotify.reason = reason;
-        WriteEventsToClient(pn->client, 1, (xEventPtr) & event);
+        WriteEventsToClient(pn->client, 1, (xEventPtr) &event);
         pn = pn->next;
     }
 
@@ -530,18 +532,19 @@ XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
 int
 XvdiSendPortNotify(XvPortPtr pPort, Atom attribute, INT32 value)
 {
-    xvEvent event;
     XvPortNotifyPtr pn;
 
     pn = pPort->pNotify;
 
     while (pn) {
+        xvEvent event = {
+            .u.portNotify.time = currentTime.milliseconds,
+            .u.portNotify.port = pPort->id,
+            .u.portNotify.attribute = attribute,
+            .u.portNotify.value = value
+        };
         event.u.u.type = XvEventBase + XvPortNotify;
-        event.u.portNotify.time = currentTime.milliseconds;
-        event.u.portNotify.port = pPort->id;
-        event.u.portNotify.attribute = attribute;
-        event.u.portNotify.value = value;
-        WriteEventsToClient(pn->client, 1, (xEventPtr) & event);
+        WriteEventsToClient(pn->client, 1, (xEventPtr) &event);
         pn = pn->next;
     }
 
index 8a1d940..5f0123b 100644 (file)
@@ -13,6 +13,7 @@
 #include "resource.h"
 #include "scrnintstr.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include "servermd.h"
 #include <X11/Xfuncproto.h>
 #include "xvdix.h"
@@ -36,8 +37,6 @@ static DevPrivateKeyRec XvMCScreenKeyRec;
 #define XvMCScreenKey (&XvMCScreenKeyRec)
 static Bool XvMCInUse;
 
-unsigned long XvMCGeneration = 0;
-
 int XvMCReqCode;
 int XvMCEventBase;
 
@@ -45,6 +44,8 @@ static RESTYPE XvMCRTContext;
 static RESTYPE XvMCRTSurface;
 static RESTYPE XvMCRTSubpicture;
 
+int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = NULL;
+
 typedef struct {
     int num_adaptors;
     XvMCAdaptorPtr adaptors;
@@ -109,16 +110,18 @@ XvMCDestroySubpictureRes(pointer data, XID id)
 static int
 ProcXvMCQueryVersion(ClientPtr client)
 {
-    xvmcQueryVersionReply rep;
+    xvmcQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .major = SERVER_XVMC_MAJOR_VERSION,
+        .minor = SERVER_XVMC_MINOR_VERSION
+    };
 
     /* REQUEST(xvmcQueryVersionReq); */
     REQUEST_SIZE_MATCH(xvmcQueryVersionReq);
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.major = SERVER_XVMC_MAJOR_VERSION;
-    rep.minor = SERVER_XVMC_MINOR_VERSION;
-    WriteToClient(client, sizeof(xvmcQueryVersionReply), (char *) &rep);
+
+    WriteToClient(client, sizeof(xvmcQueryVersionReply), &rep);
     return Success;
 }
 
@@ -132,6 +135,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
     xvmcSurfaceInfo info;
     XvMCAdaptorPtr adaptor = NULL;
     XvMCSurfaceInfoPtr surface;
+    int num_surfaces;
 
     REQUEST(xvmcListSurfaceTypesReq);
     REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq);
@@ -151,14 +155,17 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
         }
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.num = (adaptor) ? adaptor->num_surfaces : 0;
-    rep.length = bytes_to_int32(rep.num * sizeof(xvmcSurfaceInfo));
+    num_surfaces = (adaptor) ? adaptor->num_surfaces : 0;
+    rep = (xvmcListSurfaceTypesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .num = num_surfaces,
+        .length = bytes_to_int32(num_surfaces * sizeof(xvmcSurfaceInfo)),
+    };
 
-    WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), (char *) &rep);
+    WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep);
 
-    for (i = 0; i < rep.num; i++) {
+    for (i = 0; i < num_surfaces; i++) {
         surface = adaptor->surfaces[i];
         info.surface_type_id = surface->surface_type_id;
         info.chroma_format = surface->chroma_format;
@@ -168,7 +175,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
         info.subpicture_max_height = surface->subpicture_max_height;
         info.mc_type = surface->mc_type;
         info.flags = surface->flags;
-        WriteToClient(client, sizeof(xvmcSurfaceInfo), (char *) &info);
+        WriteToClient(client, sizeof(xvmcSurfaceInfo), &info);
     }
 
     return Success;
@@ -247,16 +254,18 @@ ProcXvMCCreateContext(ClientPtr client)
         return result;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.width_actual = pContext->width;
-    rep.height_actual = pContext->height;
-    rep.flags_return = pContext->flags;
-    rep.length = dwords;
+    rep = (xvmcCreateContextReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = dwords,
+        .width_actual = pContext->width,
+        .height_actual = pContext->height,
+        .flags_return = pContext->flags
+    };
 
-    WriteToClient(client, sizeof(xvmcCreateContextReply), (char *) &rep);
+    WriteToClient(client, sizeof(xvmcCreateContextReply), &rep);
     if (dwords)
-        WriteToClient(client, dwords << 2, (char *) data);
+        WriteToClient(client, dwords << 2, data);
     AddResource(pContext->context_id, XvMCRTContext, pContext);
 
     free(data);
@@ -320,14 +329,15 @@ ProcXvMCCreateSurface(ClientPtr client)
         free(pSurface);
         return result;
     }
+    rep = (xvmcCreateSurfaceReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = dwords
+    };
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = dwords;
-
-    WriteToClient(client, sizeof(xvmcCreateSurfaceReply), (char *) &rep);
+    WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep);
     if (dwords)
-        WriteToClient(client, dwords << 2, (char *) data);
+        WriteToClient(client, dwords << 2, data);
     AddResource(pSurface->surface_id, XvMCRTSurface, pSurface);
 
     free(data);
@@ -435,22 +445,23 @@ ProcXvMCCreateSubpicture(ClientPtr client)
         free(pSubpicture);
         return result;
     }
-
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.width_actual = pSubpicture->width;
-    rep.height_actual = pSubpicture->height;
-    rep.num_palette_entries = pSubpicture->num_palette_entries;
-    rep.entry_bytes = pSubpicture->entry_bytes;
-    rep.component_order[0] = pSubpicture->component_order[0];
-    rep.component_order[1] = pSubpicture->component_order[1];
-    rep.component_order[2] = pSubpicture->component_order[2];
-    rep.component_order[3] = pSubpicture->component_order[3];
-    rep.length = dwords;
-
-    WriteToClient(client, sizeof(xvmcCreateSubpictureReply), (char *) &rep);
+    rep = (xvmcCreateSubpictureReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = dwords,
+        .width_actual = pSubpicture->width,
+        .height_actual = pSubpicture->height,
+        .num_palette_entries = pSubpicture->num_palette_entries,
+        .entry_bytes = pSubpicture->entry_bytes,
+        .component_order[0] = pSubpicture->component_order[0],
+        .component_order[1] = pSubpicture->component_order[1],
+        .component_order[2] = pSubpicture->component_order[2],
+        .component_order[3] = pSubpicture->component_order[3]
+    };
+
+    WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep);
     if (dwords)
-        WriteToClient(client, dwords << 2, (char *) data);
+        WriteToClient(client, dwords << 2, data);
     AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture);
 
     free(data);
@@ -525,15 +536,17 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
     if (!surface)
         return BadMatch;
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.num = 0;
+    rep = (xvmcListSubpictureTypesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .num = 0
+    };
     if (surface->compatible_subpictures)
         rep.num = surface->compatible_subpictures->num_xvimages;
 
     rep.length = bytes_to_int32(rep.num * sizeof(xvImageFormatInfo));
 
-    WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), (char *) &rep);
+    WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), &rep);
 
     for (i = 0; i < rep.num; i++) {
         pImage = NULL;
@@ -569,7 +582,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
         info.vert_v_period = pImage->vert_v_period;
         memcpy(&info.comp_order, pImage->component_order, 32);
         info.scanline_order = pImage->scanline_order;
-        WriteToClient(client, sizeof(xvImageFormatInfo), (char *) &info);
+        WriteToClient(client, sizeof(xvImageFormatInfo), &info);
     }
 
     return Success;
@@ -595,13 +608,16 @@ ProcXvMCGetDRInfo(ClientPtr client)
     pScreen = pPort->pAdaptor->pScreen;
     pScreenPriv = XVMC_GET_PRIVATE(pScreen);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.major = pScreenPriv->major;
-    rep.minor = pScreenPriv->minor;
-    rep.patchLevel = pScreenPriv->patchLevel;
-    rep.nameLen = bytes_to_int32(strlen(pScreenPriv->clientDriverName) + 1);
-    rep.busIDLen = bytes_to_int32(strlen(pScreenPriv->busID) + 1);
+    rep = (xvmcGetDRInfoReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .major = pScreenPriv->major,
+        .minor = pScreenPriv->minor,
+        .patchLevel = pScreenPriv->patchLevel,
+        .nameLen = bytes_to_int32(strlen(pScreenPriv->clientDriverName) + 1),
+        .busIDLen = bytes_to_int32(strlen(pScreenPriv->busID) + 1),
+        .isLocal = 1
+    };
 
     rep.length = rep.nameLen + rep.busIDLen;
     rep.nameLen <<= 2;
@@ -612,7 +628,6 @@ ProcXvMCGetDRInfo(ClientPtr client)
      * segment she prepared for us.
      */
 
-    rep.isLocal = 1;
 #ifdef HAS_XVMCSHM
     patternP = (CARD32 *) shmat(stuff->shmKey, NULL, SHM_RDONLY);
     if (-1 != (long) patternP) {
@@ -634,7 +649,7 @@ ProcXvMCGetDRInfo(ClientPtr client)
     }
 #endif                          /* HAS_XVMCSHM */
 
-    WriteToClient(client, sizeof(xvmcGetDRInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xvmcGetDRInfoReply), &rep);
     if (rep.length) {
         WriteToClient(client, rep.nameLen, pScreenPriv->clientDriverName);
         WriteToClient(client, rep.busIDLen, pScreenPriv->busID);
@@ -709,7 +724,7 @@ XvMCExtensionInit(void)
 }
 
 static Bool
-XvMCCloseScreen(int i, ScreenPtr pScreen)
+XvMCCloseScreen(ScreenPtr pScreen)
 {
     XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
 
@@ -717,7 +732,7 @@ XvMCCloseScreen(int i, ScreenPtr pScreen)
 
     free(pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 int
index 5a4261b..2201d7b 100644 (file)
@@ -84,8 +84,7 @@ typedef struct {
     XvMCDestroySubpictureProcPtr DestroySubpicture;
 } XvMCAdaptorRec, *XvMCAdaptorPtr;
 
-#ifndef XorgLoader
-extern _X_EXPORT void XvMCExtensionInit(void);
+extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr);
 
 extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen,
                                     int num, XvMCAdaptorPtr adapt);
@@ -95,6 +94,5 @@ extern _X_EXPORT XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
 extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, char *name,
                                             char *busID, int major, int minor,
                                             int patchLevel);
-#endif
 
 #endif                          /* _XVMC_H */
index ff5d69a..9fe69a5 100644 (file)
@@ -113,7 +113,6 @@ ProcXChangeDeviceControl(ClientPtr client)
     AxisInfoPtr a;
     CARD32 *resolution;
     xDeviceEnableCtl *e;
-    devicePresenceNotify dpn;
 
     REQUEST(xChangeDeviceControlReq);
     REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
@@ -123,10 +122,12 @@ ProcXChangeDeviceControl(ClientPtr client)
     if (ret != Success)
         goto out;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_ChangeDeviceControl;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xChangeDeviceControlReply) {
+        .repType = X_Reply,
+        .RepType = X_ChangeDeviceControl,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     switch (stuff->control) {
     case DEVICE_RESOLUTION:
@@ -209,11 +210,13 @@ ProcXChangeDeviceControl(ClientPtr client)
 
  out:
     if (ret == Success) {
-        dpn.type = DevicePresenceNotify;
-        dpn.time = currentTime.milliseconds;
-        dpn.devchange = DeviceControlChanged;
-        dpn.deviceid = dev->id;
-        dpn.control = stuff->control;
+        devicePresenceNotify dpn = {
+            .type = DevicePresenceNotify,
+            .time = currentTime.milliseconds,
+            .devchange = DeviceControlChanged,
+            .deviceid = dev->id,
+            .control = stuff->control
+        };
         SendEventToAllWindows(dev, DevicePresenceNotifyMask,
                               (xEvent *) &dpn, 1);
 
@@ -236,5 +239,5 @@ SRepXChangeDeviceControl(ClientPtr client, int size,
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 47265b3..275511f 100644 (file)
@@ -39,10 +39,4 @@ int ProcXChangePointerDevice(ClientPtr  /* client */
 void DeleteFocusClassDeviceStruct(DeviceIntPtr  /* dev */
     );
 
-void SendEventToAllWindows(DeviceIntPtr /* dev */ ,
-                           Mask /* mask */ ,
-                           xEvent * /* ev */ ,
-                           int  /* count */
-    );
-
 #endif                          /* CHGPTR_H */
index 37ed5c7..494d07e 100644 (file)
@@ -269,8 +269,6 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
         }
     }
     else if (to->intfeed && !from->intfeed) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->intfeed = to->intfeed;
         to->intfeed = NULL;
@@ -301,8 +299,6 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
         }
     }
     else if (to->stringfeed && !from->stringfeed) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->stringfeed = to->stringfeed;
         to->stringfeed = NULL;
@@ -334,8 +330,6 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
         }
     }
     else if (to->bell && !from->bell) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->bell = to->bell;
         to->bell = NULL;
@@ -369,8 +363,6 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
         }
     }
     else if (to->leds && !from->leds) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->leds = to->leds;
         to->leds = NULL;
@@ -417,8 +409,6 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
         }
     }
     else if (to->kbdfeed && !from->kbdfeed) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->kbdfeed = to->kbdfeed;
         to->kbdfeed = NULL;
@@ -437,8 +427,6 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
         CopyKeyClass(from, to);
     }
     else if (to->key && !from->key) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->key = to->key;
         to->key = NULL;
@@ -494,8 +482,6 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
         }
     }
     else if (to->focus) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->focus = to->focus;
         to->focus = NULL;
@@ -536,8 +522,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
         }
     }
     else if (to->ptrfeed && !from->ptrfeed) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->ptrfeed = to->ptrfeed;
         to->ptrfeed = NULL;
@@ -564,8 +548,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
         v->sourceid = from->id;
     }
     else if (to->valuator && !from->valuator) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->valuator = to->valuator;
         to->valuator = NULL;
@@ -601,8 +583,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
         to->button->sourceid = from->id;
     }
     else if (to->button && !from->button) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->button = to->button;
         to->button = NULL;
@@ -624,8 +604,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
         to->proximity->sourceid = from->id;
     }
     else if (to->proximity) {
-        ClassesPtr classes;
-
         classes = to->unused_classes;
         classes->proximity = to->proximity;
         to->proximity = NULL;
@@ -948,10 +926,10 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
     else if (event->type == ET_ProximityOut)
         device->proximity->in_proximity = FALSE;
     else if (event->type == ET_TouchBegin) {
-        BUG_WARN(!b || !v);
-        BUG_WARN(!t);
+        BUG_RETURN_VAL(!b || !v, DONT_PROCESS);
+        BUG_RETURN_VAL(!t, DONT_PROCESS);
 
-        if (!b || !t || !b->map[key])
+        if (!b->map[key])
             return DONT_PROCESS;
 
         if (!(event->flags & TOUCH_POINTER_EMULATED) ||
@@ -963,10 +941,10 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
         UpdateDeviceMotionMask(device, t->state, DeviceButtonMotionMask);
     }
     else if (event->type == ET_TouchEnd) {
-        BUG_WARN(!b || !v);
-        BUG_WARN(!t);
+        BUG_RETURN_VAL(!b || !v, DONT_PROCESS);
+        BUG_RETURN_VAL(!t, DONT_PROCESS);
 
-        if (!b || !t || t->buttonsDown <= 0 || !b->map[key])
+        if (t->buttonsDown <= 0 || !b->map[key])
             return DONT_PROCESS;
 
         if (!(event->flags & TOUCH_POINTER_EMULATED))
@@ -1288,7 +1266,7 @@ ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
         else
             ti->listeners[0].state = LISTENER_HAS_ACCEPTED;
     }
-    else {                      /* this is the very first ownership event for a grab */
+    else {  /* this is the very first ownership event for a grab */
         DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource);
     }
 }
@@ -1378,9 +1356,8 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
                                    wOtherInputMasks(*win)->inputClients, next)
                 if (xi2mask_isset(iclients->xi2mask, dev, evtype))
                 break;
-            BUG_WARN(!iclients);
-            if (!iclients)
-                return FALSE;
+
+            BUG_RETURN_VAL(!iclients, FALSE);
 
             *mask = iclients->xi2mask;
             *client = rClient(iclients);
@@ -1393,9 +1370,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
                                    wOtherInputMasks(*win)->inputClients, next)
                 if (iclients->mask[dev->id] & xi_filter)
                 break;
-            BUG_WARN(!iclients);
-            if (!iclients)
-                return FALSE;
+            BUG_RETURN_VAL(!iclients, FALSE);
 
             *client = rClient(iclients);
         }
@@ -1436,9 +1411,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
         return Success;
 
     nevents = TouchConvertToPointerEvent(ev, &motion, &button);
-    BUG_WARN(nevents == 0);
-    if (nevents == 0)
-        return BadValue;
+    BUG_RETURN_VAL(nevents == 0, BadValue);
 
     if (nevents > 1)
         ptrev = &button;
@@ -1461,9 +1434,9 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
 
             if (grab->ownerEvents) {
                 WindowPtr focus = NullWindow;
-                WindowPtr win = dev->spriteInfo->sprite->win;
+                WindowPtr sprite_win = dev->spriteInfo->sprite->win;
 
-                deliveries = DeliverDeviceEvents(win, ptrev, grab, focus, dev);
+                deliveries = DeliverDeviceEvents(sprite_win, ptrev, grab, focus, dev);
             }
 
             if (!deliveries)
@@ -1494,7 +1467,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
          * the event.
          */
         if (!devgrab && dev->deviceGrab.grab && dev->deviceGrab.implicitGrab) {
-            TouchListener *listener;
+            TouchListener *l;
 
             devgrab = dev->deviceGrab.grab;
 
@@ -1504,13 +1477,13 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
              * selection. Implicit grab activation occurs through delivering an
              * event selection. Thus, we update the last listener in the array.
              */
-            listener = &ti->listeners[ti->num_listeners - 1];
-            listener->listener = devgrab->resource;
+            l = &ti->listeners[ti->num_listeners - 1];
+            l->listener = devgrab->resource;
 
             if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
-                listener->type = LISTENER_POINTER_GRAB;
+                l->type = LISTENER_POINTER_GRAB;
             else
-                listener->type = LISTENER_GRAB;
+                l->type = LISTENER_GRAB;
         }
 
     }
@@ -1723,7 +1696,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
         GetSpritePosition(device, &rootX, &rootY);
         event->root_x = rootX;
         event->root_y = rootY;
-        NoticeEventTime((InternalEvent *) event);
+        NoticeEventTime((InternalEvent *) event, device);
         event->corestate = corestate;
         key = event->detail.key;
         break;
@@ -1915,6 +1888,12 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
         if (normal_end)
             listener->state = LISTENER_HAS_END;
     }
+    else if (ev->device_event.flags & TOUCH_ACCEPT) {
+        /* Touch has been accepted by its owner, which is not this listener */
+        if (listener->state != LISTENER_HAS_END)
+            rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
+        listener->state = LISTENER_HAS_END;
+    }
 
  out:
     return rc;
@@ -2114,240 +2093,6 @@ SetScrollValuator(DeviceIntPtr dev, int axnum, enum ScrollType type,
     return TRUE;
 }
 
-static void
-FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k,
-                     ButtonClassPtr b, ValuatorClassPtr v, int first)
-{
-    ev->type = DeviceStateNotify;
-    ev->deviceid = dev->id;
-    ev->time = currentTime.milliseconds;
-    ev->classes_reported = 0;
-    ev->num_keys = 0;
-    ev->num_buttons = 0;
-    ev->num_valuators = 0;
-
-    if (b) {
-        ev->classes_reported |= (1 << ButtonClass);
-        ev->num_buttons = b->numButtons;
-        memcpy((char *) ev->buttons, (char *) b->down, 4);
-    }
-    else if (k) {
-        ev->classes_reported |= (1 << KeyClass);
-        ev->num_keys = k->xkbInfo->desc->max_key_code -
-            k->xkbInfo->desc->min_key_code;
-        memmove((char *) &ev->keys[0], (char *) k->down, 4);
-    }
-    if (v) {
-        int nval = v->numAxes - first;
-
-        ev->classes_reported |= (1 << ValuatorClass);
-        ev->classes_reported |= valuator_get_mode(dev, 0) << ModeBitsShift;
-        ev->num_valuators = nval < 3 ? nval : 3;
-        switch (ev->num_valuators) {
-        case 3:
-            ev->valuator2 = v->axisVal[first + 2];
-        case 2:
-            ev->valuator1 = v->axisVal[first + 1];
-        case 1:
-            ev->valuator0 = v->axisVal[first];
-            break;
-        }
-    }
-}
-
-static void
-FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v,
-                  int first)
-{
-    int nval = v->numAxes - first;
-
-    ev->type = DeviceValuator;
-    ev->deviceid = dev->id;
-    ev->num_valuators = nval < 3 ? nval : 3;
-    ev->first_valuator = first;
-    switch (ev->num_valuators) {
-    case 3:
-        ev->valuator2 = v->axisVal[first + 2];
-    case 2:
-        ev->valuator1 = v->axisVal[first + 1];
-    case 1:
-        ev->valuator0 = v->axisVal[first];
-        break;
-    }
-    first += ev->num_valuators;
-}
-
-static void
-DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win)
-{
-    int evcount = 1;
-    deviceStateNotify *ev, *sev;
-    deviceKeyStateNotify *kev;
-    deviceButtonStateNotify *bev;
-
-    KeyClassPtr k;
-    ButtonClassPtr b;
-    ValuatorClassPtr v;
-    int nval = 0, nkeys = 0, nbuttons = 0, first = 0;
-
-    if (!(wOtherInputMasks(win)) ||
-        !(wOtherInputMasks(win)->inputEvents[dev->id] & DeviceStateNotifyMask))
-        return;
-
-    if ((b = dev->button) != NULL) {
-        nbuttons = b->numButtons;
-        if (nbuttons > 32)
-            evcount++;
-    }
-    if ((k = dev->key) != NULL) {
-        nkeys = k->xkbInfo->desc->max_key_code - k->xkbInfo->desc->min_key_code;
-        if (nkeys > 32)
-            evcount++;
-        if (nbuttons > 0) {
-            evcount++;
-        }
-    }
-    if ((v = dev->valuator) != NULL) {
-        nval = v->numAxes;
-
-        if (nval > 3)
-            evcount++;
-        if (nval > 6) {
-            if (!(k && b))
-                evcount++;
-            if (nval > 9)
-                evcount += ((nval - 7) / 3);
-        }
-    }
-
-    sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent));
-    FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first);
-
-    if (b != NULL) {
-        FixDeviceStateNotify(dev, ev++, NULL, b, v, first);
-        first += 3;
-        nval -= 3;
-        if (nbuttons > 32) {
-            (ev - 1)->deviceid |= MORE_EVENTS;
-            bev = (deviceButtonStateNotify *) ev++;
-            bev->type = DeviceButtonStateNotify;
-            bev->deviceid = dev->id;
-            memcpy((char *) &bev->buttons[4], (char *) &b->down[4],
-                   DOWN_LENGTH - 4);
-        }
-        if (nval > 0) {
-            (ev - 1)->deviceid |= MORE_EVENTS;
-            FixDeviceValuator(dev, (deviceValuator *) ev++, v, first);
-            first += 3;
-            nval -= 3;
-        }
-    }
-
-    if (k != NULL) {
-        FixDeviceStateNotify(dev, ev++, k, NULL, v, first);
-        first += 3;
-        nval -= 3;
-        if (nkeys > 32) {
-            (ev - 1)->deviceid |= MORE_EVENTS;
-            kev = (deviceKeyStateNotify *) ev++;
-            kev->type = DeviceKeyStateNotify;
-            kev->deviceid = dev->id;
-            memmove((char *) &kev->keys[0], (char *) &k->down[4], 28);
-        }
-        if (nval > 0) {
-            (ev - 1)->deviceid |= MORE_EVENTS;
-            FixDeviceValuator(dev, (deviceValuator *) ev++, v, first);
-            first += 3;
-            nval -= 3;
-        }
-    }
-
-    while (nval > 0) {
-        FixDeviceStateNotify(dev, ev++, NULL, NULL, v, first);
-        first += 3;
-        nval -= 3;
-        if (nval > 0) {
-            (ev - 1)->deviceid |= MORE_EVENTS;
-            FixDeviceValuator(dev, (deviceValuator *) ev++, v, first);
-            first += 3;
-            nval -= 3;
-        }
-    }
-
-    DeliverEventsToWindow(dev, win, (xEvent *) sev, evcount,
-                          DeviceStateNotifyMask, NullGrab);
-    free(sev);
-}
-
-void
-DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
-                 WindowPtr pWin)
-{
-    deviceFocus event;
-    xXIFocusInEvent *xi2event;
-    DeviceIntPtr mouse;
-    int btlen, len, i;
-
-    mouse = IsFloating(dev) ? dev : GetMaster(dev, MASTER_POINTER);
-
-    /* XI 2 event */
-    btlen = (mouse->button) ? bits_to_bytes(mouse->button->numButtons) : 0;
-    btlen = bytes_to_int32(btlen);
-    len = sizeof(xXIFocusInEvent) + btlen * 4;
-
-    xi2event = calloc(1, len);
-    xi2event->type = GenericEvent;
-    xi2event->extension = IReqCode;
-    xi2event->evtype = type;
-    xi2event->length = bytes_to_int32(len - sizeof(xEvent));
-    xi2event->buttons_len = btlen;
-    xi2event->detail = detail;
-    xi2event->time = currentTime.milliseconds;
-    xi2event->deviceid = dev->id;
-    xi2event->sourceid = dev->id;       /* a device doesn't change focus by itself */
-    xi2event->mode = mode;
-    xi2event->root_x = FP1616(mouse->spriteInfo->sprite->hot.x, 0);
-    xi2event->root_y = FP1616(mouse->spriteInfo->sprite->hot.y, 0);
-
-    for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++)
-        if (BitIsOn(mouse->button->down, i))
-            SetBit(&xi2event[1], mouse->button->map[i]);
-
-    if (dev->key) {
-        xi2event->mods.base_mods = dev->key->xkbInfo->state.base_mods;
-        xi2event->mods.latched_mods = dev->key->xkbInfo->state.latched_mods;
-        xi2event->mods.locked_mods = dev->key->xkbInfo->state.locked_mods;
-        xi2event->mods.effective_mods = dev->key->xkbInfo->state.mods;
-
-        xi2event->group.base_group = dev->key->xkbInfo->state.base_group;
-        xi2event->group.latched_group = dev->key->xkbInfo->state.latched_group;
-        xi2event->group.locked_group = dev->key->xkbInfo->state.locked_group;
-        xi2event->group.effective_group = dev->key->xkbInfo->state.group;
-    }
-
-    FixUpEventFromWindow(dev->spriteInfo->sprite, (xEvent *) xi2event, pWin,
-                         None, FALSE);
-
-    DeliverEventsToWindow(dev, pWin, (xEvent *) xi2event, 1,
-                          GetEventFilter(dev, (xEvent *) xi2event), NullGrab);
-
-    free(xi2event);
-
-    /* XI 1.x event */
-    event.deviceid = dev->id;
-    event.mode = mode;
-    event.type = (type == XI_FocusIn) ? DeviceFocusIn : DeviceFocusOut;
-    event.detail = detail;
-    event.window = pWin->drawable.id;
-    event.time = currentTime.milliseconds;
-
-    DeliverEventsToWindow(dev, pWin, (xEvent *) &event, 1,
-                          DeviceFocusChangeMask, NullGrab);
-
-    if (event.type == DeviceFocusIn)
-        DeliverStateNotifyEvent(dev, pWin);
-}
-
 int
 CheckGrabValues(ClientPtr client, GrabParameters *param)
 {
@@ -2573,12 +2318,11 @@ SelectForWindow(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client,
 
     check = (mask & exclusivemasks);
     if (wOtherInputMasks(pWin)) {
-        if (check & wOtherInputMasks(pWin)->inputEvents[mskidx]) {      /* It is illegal for two different
-                                                                         * clients to select on any of the
-                                                                         * events for maskcheck. However,
-                                                                         * it is OK, for some client to
-                                                                         * continue selecting on one of those
-                                                                         * events.  */
+        if (check & wOtherInputMasks(pWin)->inputEvents[mskidx]) {
+            /* It is illegal for two different clients to select on any of
+             * the events for maskcheck. However, it is OK, for some client
+             * to continue selecting on one of those events.
+             */
             for (others = wOtherInputMasks(pWin)->inputClients; others;
                  others = others->next) {
                 if (!SameClient(others, client) && (check &
index 4483076..7e30755 100644 (file)
@@ -49,8 +49,6 @@ SOFTWARE.
  *  Dispatch routines and initialization routines for the X input extension.
  *
  */
-#define ARRAY_SIZE(_a)        (sizeof((_a)) / sizeof((_a)[0]))
-
 #define         NUMTYPES 15
 
 #ifdef HAVE_DIX_CONFIG_H
@@ -150,10 +148,8 @@ const Mask ChangeDeviceNotifyMask = (1L << 16);
 const Mask DeviceButtonGrabMask = (1L << 17);
 const Mask DeviceOwnerGrabButtonMask = (1L << 17);
 const Mask DevicePresenceNotifyMask = (1L << 18);
-const Mask DeviceEnterWindowMask = (1L << 18);
-const Mask DeviceLeaveWindowMask = (1L << 19);
-const Mask DevicePropertyNotifyMask = (1L << 20);
-const Mask XIAllMasks = (1L << 21) - 1;
+const Mask DevicePropertyNotifyMask = (1L << 19);
+const Mask XIAllMasks = (1L << 20) - 1;
 
 int ExtEventIndex;
 Mask ExtExclusiveMasks[EMASKSIZE];
@@ -162,25 +158,25 @@ static struct dev_type {
     Atom type;
     const char *name;
 } dev_type[] = {
-    {
-    0, XI_KEYBOARD}, {
-    0, XI_MOUSE}, {
-    0, XI_TABLET}, {
-    0, XI_TOUCHSCREEN}, {
-    0, XI_TOUCHPAD}, {
-    0, XI_BARCODE}, {
-    0, XI_BUTTONBOX}, {
-    0, XI_KNOB_BOX}, {
-    0, XI_ONE_KNOB}, {
-    0, XI_NINE_KNOB}, {
-    0, XI_TRACKBALL}, {
-    0, XI_QUADRATURE}, {
-    0, XI_ID_MODULE}, {
-    0, XI_SPACEBALL}, {
-    0, XI_DATAGLOVE}, {
-    0, XI_EYETRACKER}, {
-    0, XI_CURSORKEYS}, {
-0, XI_FOOTMOUSE}};
+    {0, XI_KEYBOARD},
+    {0, XI_MOUSE},
+    {0, XI_TABLET},
+    {0, XI_TOUCHSCREEN},
+    {0, XI_TOUCHPAD},
+    {0, XI_BARCODE},
+    {0, XI_BUTTONBOX},
+    {0, XI_KNOB_BOX},
+    {0, XI_ONE_KNOB},
+    {0, XI_NINE_KNOB},
+    {0, XI_TRACKBALL},
+    {0, XI_QUADRATURE},
+    {0, XI_ID_MODULE},
+    {0, XI_SPACEBALL},
+    {0, XI_DATAGLOVE},
+    {0, XI_EYETRACKER},
+    {0, XI_CURSORKEYS},
+    {0, XI_FOOTMOUSE}
+};
 
 CARD8 event_base[numInputClasses];
 XExtEventInfo EventInfo[32];
@@ -365,7 +361,7 @@ RESTYPE RT_INPUTCLIENT;
 
 extern XExtensionVersion XIVersion;
 
-Mask PropagateMask[MAXDEVICES];
+Mask PropagateMask[EMASKSIZE];
 
 /*****************************************************************
  *
@@ -438,8 +434,9 @@ SProcIDispatch(ClientPtr client)
 
 static void
 SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
-                                        /* All we look at is the type field */
-{                               /* This is common to all replies    */
+{
+    /* All we look at is the type field */
+    /* This is common to all replies    */
     if (rep->RepType == X_GetExtensionVersion)
         SRepXGetExtensionVersion(client, len,
                                  (xGetExtensionVersionReply *) rep);
@@ -1137,6 +1134,9 @@ IResetProc(ExtensionEntry * unused)
     EventSwapVector[DevicePresenceNotify] = NotImplemented;
     EventSwapVector[DevicePropertyNotify] = NotImplemented;
     RestoreExtensionEvents();
+
+    free(xi_all_devices.name);
+    free(xi_all_master_devices.name);
 }
 
 /***********************************************************************
@@ -1298,9 +1298,9 @@ XInputExtensionInit(void)
         memset(&xi_all_devices, 0, sizeof(xi_all_devices));
         memset(&xi_all_master_devices, 0, sizeof(xi_all_master_devices));
         xi_all_devices.id = XIAllDevices;
-        xi_all_devices.name = "XIAllDevices";
+        xi_all_devices.name = strdup("XIAllDevices");
         xi_all_master_devices.id = XIAllMasterDevices;
-        xi_all_master_devices.name = "XIAllMasterDevices";
+        xi_all_master_devices.name = strdup("XIAllMasterDevices");
 
         inputInfo.all_devices = &xi_all_devices;
         inputInfo.all_master_devices = &xi_all_master_devices;
index a0ec1a6..49b8688 100644 (file)
@@ -92,11 +92,13 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
     REQUEST(xGetDeviceButtonMappingReq);
     REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
 
-    rep.repType = X_Reply;
-    rep.RepType = X_GetDeviceButtonMapping;
-    rep.nElts = 0;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xGetDeviceButtonMappingReply) {
+        .repType = X_Reply,
+        .RepType = X_GetDeviceButtonMapping,
+        .sequenceNumber = client->sequence,
+        .nElts = 0,
+        .length = 0
+    };
 
     rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
     if (rc != Success)
@@ -109,7 +111,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
     rep.nElts = b->numButtons;
     rep.length = bytes_to_int32(rep.nElts);
     WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
-    (void) WriteToClient(client, rep.nElts, (char *) &b->map[1]);
+    WriteToClient(client, rep.nElts, &b->map[1]);
     return Success;
 }
 
@@ -126,5 +128,5 @@ SRepXGetDeviceButtonMapping(ClientPtr client, int size,
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 4d66a4d..6f73e09 100644 (file)
@@ -158,7 +158,7 @@ SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
 
 /***********************************************************************
@@ -182,10 +182,12 @@ ProcXGetDeviceControl(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_GetDeviceControl;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xGetDeviceControlReply) {
+        .repType = X_Reply,
+        .RepType = X_GetDeviceControl,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     switch (stuff->control) {
     case DEVICE_RESOLUTION:
index 2772c0c..599b2ef 100644 (file)
@@ -265,7 +265,7 @@ SRepXGetFeedbackControl(ClientPtr client, int size,
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
     swaps(&rep->num_feedbacks);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
 
 /***********************************************************************
@@ -295,11 +295,13 @@ ProcXGetFeedbackControl(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_GetFeedbackControl;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.num_feedbacks = 0;
+    rep = (xGetFeedbackControlReply) {
+        .repType = X_Reply,
+        .RepType = X_GetFeedbackControl,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .num_feedbacks = 0
+    };
 
     for (k = dev->kbdfeed; k; k = k->next) {
         rep.num_feedbacks++;
index ba36e37..40546cb 100644 (file)
@@ -99,10 +99,12 @@ ProcXGetDeviceFocus(ClientPtr client)
     if (!dev->focus)
         return BadDevice;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_GetDeviceFocus;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xGetDeviceFocusReply) {
+        .repType = X_Reply,
+        .RepType = X_GetDeviceFocus,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     focus = dev->focus;
 
@@ -135,5 +137,5 @@ SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
     swapl(&rep->length);
     swapl(&rep->focus);
     swapl(&rep->time);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 006be62..87c1977 100644 (file)
@@ -119,11 +119,13 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
     if (!syms)
         return BadAlloc;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_GetDeviceKeyMapping;
-    rep.sequenceNumber = client->sequence;
-    rep.keySymsPerKeyCode = syms->mapWidth;
-    rep.length = (syms->mapWidth * stuff->count);       /* KeySyms are 4 bytes */
+    rep = (xGetDeviceKeyMappingReply) {
+        .repType = X_Reply,
+        .RepType = X_GetDeviceKeyMapping,
+        .sequenceNumber = client->sequence,
+        .keySymsPerKeyCode = syms->mapWidth,
+        .length = (syms->mapWidth * stuff->count) /* KeySyms are 4 bytes */
+    };
     WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep);
 
     client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
@@ -150,5 +152,5 @@ SRepXGetDeviceKeyMapping(ClientPtr client, int size,
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 3f84243..f07f2bb 100644 (file)
@@ -101,15 +101,17 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
     if (ret != Success)
         return ret;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_GetDeviceModifierMapping;
-    rep.numKeyPerModifier = max_keys_per_mod;
-    rep.sequenceNumber = client->sequence;
+    rep = (xGetDeviceModifierMappingReply) {
+        .repType = X_Reply,
+        .RepType = X_GetDeviceModifierMapping,
+        .sequenceNumber = client->sequence,
+        .numKeyPerModifier = max_keys_per_mod,
     /* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
-    rep.length = max_keys_per_mod << 1;
+        .length = max_keys_per_mod << 1
+    };
 
     WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
-    WriteToClient(client, max_keys_per_mod * 8, (char *) modkeymap);
+    WriteToClient(client, max_keys_per_mod * 8, modkeymap);
 
     free(modkeymap);
 
@@ -129,5 +131,5 @@ SRepXGetDeviceModifierMapping(ClientPtr client, int size,
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index b7b9e6b..4d6ce63 100644 (file)
@@ -101,11 +101,13 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
     REQUEST(xGetDeviceDontPropagateListReq);
     REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
 
-    rep.repType = X_Reply;
-    rep.RepType = X_GetDeviceDontPropagateList;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.count = 0;
+    rep = (xGetDeviceDontPropagateListReply) {
+        .repType = X_Reply,
+        .RepType = X_GetDeviceDontPropagateList,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .count = 0
+    };
 
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
@@ -178,5 +180,5 @@ SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
     swaps(&rep->count);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 253c87f..60a46c2 100644 (file)
@@ -102,12 +102,14 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
     REQUEST(xGetSelectedExtensionEventsReq);
     REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
 
-    rep.repType = X_Reply;
-    rep.RepType = X_GetSelectedExtensionEvents;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.this_client_count = 0;
-    rep.all_clients_count = 0;
+    rep = (xGetSelectedExtensionEventsReply) {
+        .repType = X_Reply,
+        .RepType = X_GetSelectedExtensionEvents,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .this_client_count = 0,
+        .all_clients_count = 0
+    };
 
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
@@ -170,5 +172,5 @@ SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
     swapl(&rep->length);
     swaps(&rep->this_client_count);
     swaps(&rep->all_clients_count);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index eb52c5b..829e695 100644 (file)
@@ -98,14 +98,15 @@ ProcXGetExtensionVersion(ClientPtr client)
                                         stuff->nbytes))
         return BadLength;
 
-    memset(&rep, 0, sizeof(xGetExtensionVersionReply));
-    rep.repType = X_Reply;
-    rep.RepType = X_GetExtensionVersion;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.present = TRUE;
-    rep.major_version = XIVersion.major_version;
-    rep.minor_version = XIVersion.minor_version;
+    rep = (xGetExtensionVersionReply) {
+        .repType = X_Reply,
+        .RepType = X_GetExtensionVersion,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .major_version = XIVersion.major_version,
+        .minor_version = XIVersion.minor_version,
+        .present = TRUE
+    };
 
     WriteReplyToClient(client, sizeof(xGetExtensionVersionReply), &rep);
 
@@ -127,5 +128,5 @@ SRepXGetExtensionVersion(ClientPtr client, int size,
     swapl(&rep->length);
     swaps(&rep->major_version);
     swaps(&rep->minor_version);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index c904a97..443ef56 100644 (file)
@@ -113,10 +113,12 @@ ProcXGrabDevice(ClientPtr client)
         bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
         return BadLength;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_GrabDevice;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
+    rep = (xGrabDeviceReply) {
+        .repType = X_Reply,
+        .RepType = X_GrabDevice,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+    };
 
     rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
     if (rc != Success)
@@ -211,5 +213,5 @@ SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 0f0e975..8b4ae69 100644 (file)
@@ -137,13 +137,14 @@ ProcXGrabDeviceButton(ClientPtr client)
                                   X_GrabDeviceButton)) != Success)
         return ret;
 
-    memset(&param, 0, sizeof(param));
-    param.grabtype = XI;
-    param.ownerEvents = stuff->ownerEvents;
-    param.this_device_mode = stuff->this_device_mode;
-    param.other_devices_mode = stuff->other_devices_mode;
-    param.grabWindow = stuff->grabWindow;
-    param.modifiers = stuff->modifiers;
+    param = (GrabParameters) {
+        .grabtype = XI,
+        .ownerEvents = stuff->ownerEvents,
+        .this_device_mode = stuff->this_device_mode,
+        .other_devices_mode = stuff->other_devices_mode,
+        .grabWindow = stuff->grabWindow,
+        .modifiers = stuff->modifiers
+    };
     mask.xi = tmp[stuff->grabbed_device].mask;
 
     ret = GrabButton(client, dev, mdev, stuff->button, &param, XI, &mask);
index b755182..8694f9e 100644 (file)
@@ -135,13 +135,14 @@ ProcXGrabDeviceKey(ClientPtr client)
                                   X_GrabDeviceKey)) != Success)
         return ret;
 
-    memset(&param, 0, sizeof(param));
-    param.grabtype = XI;
-    param.ownerEvents = stuff->ownerEvents;
-    param.this_device_mode = stuff->this_device_mode;
-    param.other_devices_mode = stuff->other_devices_mode;
-    param.grabWindow = stuff->grabWindow;
-    param.modifiers = stuff->modifiers;
+    param = (GrabParameters) {
+        .grabtype = XI,
+        .ownerEvents = stuff->ownerEvents,
+        .this_device_mode = stuff->this_device_mode,
+        .other_devices_mode = stuff->other_devices_mode,
+        .grabWindow = stuff->grabWindow,
+        .modifiers = stuff->modifiers
+    };
     mask.xi = tmp[stuff->grabbed_device].mask;
 
     ret = GrabKey(client, dev, mdev, stuff->key, &param, XI, &mask);
index 48bc79a..4642b19 100644 (file)
@@ -110,13 +110,15 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
     if (dev->valuator->motionHintWindow)
         MaybeStopDeviceHint(dev, client);
     axes = v->numAxes;
-    rep.repType = X_Reply;
-    rep.RepType = X_GetDeviceMotionEvents;
-    rep.sequenceNumber = client->sequence;
-    rep.nEvents = 0;
-    rep.axes = axes;
-    rep.mode = Absolute;        /* XXX we don't do relative at the moment */
-    rep.length = 0;
+    rep = (xGetDeviceMotionEventsReply) {
+        .repType = X_Reply,
+        .RepType = X_GetDeviceMotionEvents,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .nEvents = 0,
+        .axes = axes,
+        .mode = Absolute        /* XXX we don't do relative at the moment */
+    };
     start = ClientTimeToServerTime(stuff->start);
     stop = ClientTimeToServerTime(stuff->stop);
     if (CompareTimeStamps(start, stop) == LATER ||
@@ -147,7 +149,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
                 bufptr++;
             }
         }
-        WriteToClient(client, length * 4, (char *) coords);
+        WriteToClient(client, length * 4, coords);
     }
     free(coords);
     return Success;
@@ -167,5 +169,5 @@ SRepXGetDeviceMotionEvents(ClientPtr client, int size,
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
     swapl(&rep->nEvents);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index a02112f..014c61d 100644 (file)
@@ -342,11 +342,12 @@ ProcXListInputDevices(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xListInputDevicesReq);
 
-    memset(&rep, 0, sizeof(xListInputDevicesReply));
-    rep.repType = X_Reply;
-    rep.RepType = X_ListInputDevices;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xListInputDevicesReply) {
+        .repType = X_Reply,
+        .RepType = X_ListInputDevices,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     /* allocate space for saving skip value */
     skip = calloc(sizeof(Bool), inputInfo.numDevices);
@@ -417,5 +418,5 @@ SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index e7c00a2..6708bad 100644 (file)
@@ -117,10 +117,6 @@ ProcXOpenDevice(ClientPtr client)
     if (status != Success)
         return status;
 
-    memset(&rep, 0, sizeof(xOpenDeviceReply));
-    rep.repType = X_Reply;
-    rep.RepType = X_OpenDevice;
-    rep.sequenceNumber = client->sequence;
     if (dev->key != NULL) {
         evbase[j].class = KeyClass;
         evbase[j++].event_type_base = event_base[KeyClass];
@@ -148,10 +144,15 @@ ProcXOpenDevice(ClientPtr client)
     }
     evbase[j].class = OtherClass;
     evbase[j++].event_type_base = event_base[OtherClass];
-    rep.length = bytes_to_int32(j * sizeof(xInputClassInfo));
-    rep.num_classes = j;
+    rep = (xOpenDeviceReply) {
+        .repType = X_Reply,
+        .RepType = X_OpenDevice,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(j * sizeof(xInputClassInfo)),
+        .num_classes = j
+    };
     WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
-    WriteToClient(client, j * sizeof(xInputClassInfo), (char *) evbase);
+    WriteToClient(client, j * sizeof(xInputClassInfo), evbase);
     return Success;
 }
 
@@ -167,5 +168,5 @@ SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index ffb6de0..04a652b 100644 (file)
@@ -87,11 +87,6 @@ ProcXQueryDeviceState(ClientPtr client)
     REQUEST(xQueryDeviceStateReq);
     REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
 
-    rep.repType = X_Reply;
-    rep.RepType = X_QueryDeviceState;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
     if (rc != Success && rc != BadAccess)
         return rc;
@@ -163,8 +158,13 @@ ProcXQueryDeviceState(ClientPtr client)
         }
     }
 
-    rep.num_classes = num_classes;
-    rep.length = bytes_to_int32(total_length);
+    rep = (xQueryDeviceStateReply) {
+        .repType = X_Reply,
+        .RepType = X_QueryDeviceState,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(total_length),
+        .num_classes = num_classes
+    };
     WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep);
     if (total_length > 0)
         WriteToClient(client, total_length, savbuf);
@@ -184,5 +184,5 @@ SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 110f5e9..9479655 100644 (file)
@@ -100,11 +100,13 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
     if (ret != Success)
         return ret;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_SetDeviceButtonMapping;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.status = MappingSuccess;
+    rep = (xSetDeviceButtonMappingReply) {
+        .repType = X_Reply,
+        .RepType = X_SetDeviceButtonMapping,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = MappingSuccess
+    };
 
     ret =
         ApplyPointerMapping(dev, (CARD8 *) &stuff[1], stuff->map_length,
@@ -134,5 +136,5 @@ SRepXSetDeviceButtonMapping(ClientPtr client, int size,
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 542f20d..4c9c99f 100644 (file)
@@ -92,11 +92,13 @@ ProcXSetDeviceValuators(ClientPtr client)
     REQUEST(xSetDeviceValuatorsReq);
     REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
 
-    rep.repType = X_Reply;
-    rep.RepType = X_SetDeviceValuators;
-    rep.length = 0;
-    rep.status = Success;
-    rep.sequenceNumber = client->sequence;
+    rep = (xSetDeviceValuatorsReply) {
+        .repType = X_Reply,
+        .RepType = X_SetDeviceValuators,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = Success
+    };
 
     if (stuff->length != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) +
         stuff->num_valuators)
@@ -138,5 +140,5 @@ SRepXSetDeviceValuators(ClientPtr client, int size,
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 36845d7..1320cfe 100644 (file)
@@ -98,10 +98,12 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
         (stuff->numKeyPerModifier << 1))
         return BadLength;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_SetDeviceModifierMapping;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xSetDeviceModifierMappingReply) {
+        .repType = X_Reply,
+        .RepType = X_SetDeviceModifierMapping,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
     if (ret != Success)
@@ -140,5 +142,5 @@ SRepXSetDeviceModifierMapping(ClientPtr client, int size,
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index a7bf1ea..5356552 100644 (file)
@@ -92,10 +92,12 @@ ProcXSetDeviceMode(ClientPtr client)
     REQUEST(xSetDeviceModeReq);
     REQUEST_SIZE_MATCH(xSetDeviceModeReq);
 
-    rep.repType = X_Reply;
-    rep.RepType = X_SetDeviceMode;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xSetDeviceModeReply) {
+        .repType = X_Reply,
+        .RepType = X_SetDeviceMode,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
     if (rc != Success)
@@ -137,5 +139,5 @@ SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 8baa5a0..39bee7c 100644 (file)
@@ -141,4 +141,5 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
 void
 DeleteInputDeviceRequest(DeviceIntPtr dev)
 {
+    RemoveDevice(dev, TRUE);
 }
index 756aaac..89f16d8 100644 (file)
@@ -293,12 +293,6 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
         }
     }
 
-    /* can't disable until we removed pairing */
-    keybd->spriteInfo->paired = NULL;
-    ptr->spriteInfo->paired = NULL;
-    XTestptr->spriteInfo->paired = NULL;
-    XTestkeybd->spriteInfo->paired = NULL;
-
     /* disable the remove the devices, XTest devices must be done first
        else the sprites they rely on will be destroyed  */
     DisableDevice(XTestptr, FALSE);
index 07dbf18..3c90d58 100644 (file)
@@ -75,12 +75,14 @@ ProcXIGetClientPointer(ClientPtr client)
     else
         winclient = client;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_XIGetClientPointer;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.set = (winclient->clientPtr != NULL);
-    rep.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0;
+    rep = (xXIGetClientPointerReply) {
+        .repType = X_Reply,
+        .RepType = X_XIGetClientPointer,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .set = (winclient->clientPtr != NULL),
+        .deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0
+    };
 
     WriteReplyToClient(client, sizeof(xXIGetClientPointerReply), &rep);
     return Success;
@@ -100,5 +102,5 @@ SRepXIGetClientPointer(ClientPtr client, int size,
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
     swaps(&rep->deviceid);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 8d2cf0b..09186e8 100644 (file)
@@ -104,11 +104,13 @@ ProcXIGrabDevice(ClientPtr client)
     if (ret != Success)
         return ret;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_XIGrabDevice;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.status = status;
+    rep = (xXIGrabDeviceReply) {
+        .repType = X_Reply,
+        .RepType = X_XIGrabDevice,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = status
+    };
 
     WriteReplyToClient(client, sizeof(rep), &rep);
     return ret;
@@ -156,5 +158,5 @@ SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep)
 {
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 7130328..ddab53d 100644 (file)
@@ -78,7 +78,13 @@ int
 ProcXIPassiveGrabDevice(ClientPtr client)
 {
     DeviceIntPtr dev, mod_dev;
-    xXIPassiveGrabDeviceReply rep;
+    xXIPassiveGrabDeviceReply rep = {
+        .repType = X_Reply,
+        .RepType = X_XIPassiveGrabDevice,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .num_modifiers = 0
+    };
     int i, ret = Success;
     uint32_t *modifiers;
     xXIGrabModifierInfo *modifiers_failed;
@@ -137,12 +143,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
     xi2mask_set_one_mask(mask.xi2mask, stuff->deviceid,
                          (unsigned char *) &stuff[1], mask_len * 4);
 
-    rep.repType = X_Reply;
-    rep.RepType = X_XIPassiveGrabDevice;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.num_modifiers = 0;
-
     memset(&param, 0, sizeof(param));
     param.grabtype = XI2;
     param.ownerEvents = stuff->owner_events;
@@ -224,7 +224,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
 
     WriteReplyToClient(client, sizeof(rep), &rep);
     if (rep.num_modifiers)
-        WriteToClient(client, rep.length * 4, (char *) modifiers_failed);
+        WriteToClient(client, rep.length * 4, modifiers_failed);
 
     free(modifiers_failed);
  out:
@@ -240,7 +240,7 @@ SRepXIPassiveGrabDevice(ClientPtr client, int size,
     swapl(&rep->length);
     swaps(&rep->num_modifiers);
 
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
 
 int
index e17efe4..43351bc 100644 (file)
@@ -49,132 +49,131 @@ static struct dev_properties {
     Atom type;
     const char *name;
 } dev_properties[] = {
-    {
-    0, XI_PROP_ENABLED}, {
-    0, XI_PROP_XTEST_DEVICE}, {
-    0, XATOM_FLOAT}, {
-    0, ACCEL_PROP_PROFILE_NUMBER}, {
-    0, ACCEL_PROP_CONSTANT_DECELERATION}, {
-    0, ACCEL_PROP_ADAPTIVE_DECELERATION}, {
-    0, ACCEL_PROP_VELOCITY_SCALING}, {
-    0, AXIS_LABEL_PROP}, {
-    0, AXIS_LABEL_PROP_REL_X}, {
-    0, AXIS_LABEL_PROP_REL_Y}, {
-    0, AXIS_LABEL_PROP_REL_Z}, {
-    0, AXIS_LABEL_PROP_REL_RX}, {
-    0, AXIS_LABEL_PROP_REL_RY}, {
-    0, AXIS_LABEL_PROP_REL_RZ}, {
-    0, AXIS_LABEL_PROP_REL_HWHEEL}, {
-    0, AXIS_LABEL_PROP_REL_DIAL}, {
-    0, AXIS_LABEL_PROP_REL_WHEEL}, {
-    0, AXIS_LABEL_PROP_REL_MISC}, {
-    0, AXIS_LABEL_PROP_REL_VSCROLL}, {
-    0, AXIS_LABEL_PROP_REL_HSCROLL}, {
-    0, AXIS_LABEL_PROP_ABS_X}, {
-    0, AXIS_LABEL_PROP_ABS_Y}, {
-    0, AXIS_LABEL_PROP_ABS_Z}, {
-    0, AXIS_LABEL_PROP_ABS_RX}, {
-    0, AXIS_LABEL_PROP_ABS_RY}, {
-    0, AXIS_LABEL_PROP_ABS_RZ}, {
-    0, AXIS_LABEL_PROP_ABS_THROTTLE}, {
-    0, AXIS_LABEL_PROP_ABS_RUDDER}, {
-    0, AXIS_LABEL_PROP_ABS_WHEEL}, {
-    0, AXIS_LABEL_PROP_ABS_GAS}, {
-    0, AXIS_LABEL_PROP_ABS_BRAKE}, {
-    0, AXIS_LABEL_PROP_ABS_HAT0X}, {
-    0, AXIS_LABEL_PROP_ABS_HAT0Y}, {
-    0, AXIS_LABEL_PROP_ABS_HAT1X}, {
-    0, AXIS_LABEL_PROP_ABS_HAT1Y}, {
-    0, AXIS_LABEL_PROP_ABS_HAT2X}, {
-    0, AXIS_LABEL_PROP_ABS_HAT2Y}, {
-    0, AXIS_LABEL_PROP_ABS_HAT3X}, {
-    0, AXIS_LABEL_PROP_ABS_HAT3Y}, {
-    0, AXIS_LABEL_PROP_ABS_PRESSURE}, {
-    0, AXIS_LABEL_PROP_ABS_DISTANCE}, {
-    0, AXIS_LABEL_PROP_ABS_TILT_X}, {
-    0, AXIS_LABEL_PROP_ABS_TILT_Y}, {
-    0, AXIS_LABEL_PROP_ABS_TOOL_WIDTH}, {
-    0, AXIS_LABEL_PROP_ABS_VOLUME}, {
-    0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR}, {
-    0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR}, {
-    0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR}, {
-    0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR}, {
-    0, AXIS_LABEL_PROP_ABS_MT_ORIENTATION}, {
-    0, AXIS_LABEL_PROP_ABS_MT_POSITION_X}, {
-    0, AXIS_LABEL_PROP_ABS_MT_POSITION_Y}, {
-    0, AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE}, {
-    0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID}, {
-    0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID}, {
-    0, AXIS_LABEL_PROP_ABS_MT_PRESSURE}, {
-    0, AXIS_LABEL_PROP_ABS_MISC}, {
-    0, BTN_LABEL_PROP}, {
-    0, BTN_LABEL_PROP_BTN_UNKNOWN}, {
-    0, BTN_LABEL_PROP_BTN_WHEEL_UP}, {
-    0, BTN_LABEL_PROP_BTN_WHEEL_DOWN}, {
-    0, BTN_LABEL_PROP_BTN_HWHEEL_LEFT}, {
-    0, BTN_LABEL_PROP_BTN_HWHEEL_RIGHT}, {
-    0, BTN_LABEL_PROP_BTN_0}, {
-    0, BTN_LABEL_PROP_BTN_1}, {
-    0, BTN_LABEL_PROP_BTN_2}, {
-    0, BTN_LABEL_PROP_BTN_3}, {
-    0, BTN_LABEL_PROP_BTN_4}, {
-    0, BTN_LABEL_PROP_BTN_5}, {
-    0, BTN_LABEL_PROP_BTN_6}, {
-    0, BTN_LABEL_PROP_BTN_7}, {
-    0, BTN_LABEL_PROP_BTN_8}, {
-    0, BTN_LABEL_PROP_BTN_9}, {
-    0, BTN_LABEL_PROP_BTN_LEFT}, {
-    0, BTN_LABEL_PROP_BTN_RIGHT}, {
-    0, BTN_LABEL_PROP_BTN_MIDDLE}, {
-    0, BTN_LABEL_PROP_BTN_SIDE}, {
-    0, BTN_LABEL_PROP_BTN_EXTRA}, {
-    0, BTN_LABEL_PROP_BTN_FORWARD}, {
-    0, BTN_LABEL_PROP_BTN_BACK}, {
-    0, BTN_LABEL_PROP_BTN_TASK}, {
-    0, BTN_LABEL_PROP_BTN_TRIGGER}, {
-    0, BTN_LABEL_PROP_BTN_THUMB}, {
-    0, BTN_LABEL_PROP_BTN_THUMB2}, {
-    0, BTN_LABEL_PROP_BTN_TOP}, {
-    0, BTN_LABEL_PROP_BTN_TOP2}, {
-    0, BTN_LABEL_PROP_BTN_PINKIE}, {
-    0, BTN_LABEL_PROP_BTN_BASE}, {
-    0, BTN_LABEL_PROP_BTN_BASE2}, {
-    0, BTN_LABEL_PROP_BTN_BASE3}, {
-    0, BTN_LABEL_PROP_BTN_BASE4}, {
-    0, BTN_LABEL_PROP_BTN_BASE5}, {
-    0, BTN_LABEL_PROP_BTN_BASE6}, {
-    0, BTN_LABEL_PROP_BTN_DEAD}, {
-    0, BTN_LABEL_PROP_BTN_A}, {
-    0, BTN_LABEL_PROP_BTN_B}, {
-    0, BTN_LABEL_PROP_BTN_C}, {
-    0, BTN_LABEL_PROP_BTN_X}, {
-    0, BTN_LABEL_PROP_BTN_Y}, {
-    0, BTN_LABEL_PROP_BTN_Z}, {
-    0, BTN_LABEL_PROP_BTN_TL}, {
-    0, BTN_LABEL_PROP_BTN_TR}, {
-    0, BTN_LABEL_PROP_BTN_TL2}, {
-    0, BTN_LABEL_PROP_BTN_TR2}, {
-    0, BTN_LABEL_PROP_BTN_SELECT}, {
-    0, BTN_LABEL_PROP_BTN_START}, {
-    0, BTN_LABEL_PROP_BTN_MODE}, {
-    0, BTN_LABEL_PROP_BTN_THUMBL}, {
-    0, BTN_LABEL_PROP_BTN_THUMBR}, {
-    0, BTN_LABEL_PROP_BTN_TOOL_PEN}, {
-    0, BTN_LABEL_PROP_BTN_TOOL_RUBBER}, {
-    0, BTN_LABEL_PROP_BTN_TOOL_BRUSH}, {
-    0, BTN_LABEL_PROP_BTN_TOOL_PENCIL}, {
-    0, BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH}, {
-    0, BTN_LABEL_PROP_BTN_TOOL_FINGER}, {
-    0, BTN_LABEL_PROP_BTN_TOOL_MOUSE}, {
-    0, BTN_LABEL_PROP_BTN_TOOL_LENS}, {
-    0, BTN_LABEL_PROP_BTN_TOUCH}, {
-    0, BTN_LABEL_PROP_BTN_STYLUS}, {
-    0, BTN_LABEL_PROP_BTN_STYLUS2}, {
-    0, BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP}, {
-    0, BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP}, {
-    0, BTN_LABEL_PROP_BTN_GEAR_DOWN}, {
-    0, BTN_LABEL_PROP_BTN_GEAR_UP}, {
-    0, XI_PROP_TRANSFORM}
+    {0, XI_PROP_ENABLED},
+    {0, XI_PROP_XTEST_DEVICE},
+    {0, XATOM_FLOAT},
+    {0, ACCEL_PROP_PROFILE_NUMBER},
+    {0, ACCEL_PROP_CONSTANT_DECELERATION},
+    {0, ACCEL_PROP_ADAPTIVE_DECELERATION},
+    {0, ACCEL_PROP_VELOCITY_SCALING},
+    {0, AXIS_LABEL_PROP},
+    {0, AXIS_LABEL_PROP_REL_X},
+    {0, AXIS_LABEL_PROP_REL_Y},
+    {0, AXIS_LABEL_PROP_REL_Z},
+    {0, AXIS_LABEL_PROP_REL_RX},
+    {0, AXIS_LABEL_PROP_REL_RY},
+    {0, AXIS_LABEL_PROP_REL_RZ},
+    {0, AXIS_LABEL_PROP_REL_HWHEEL},
+    {0, AXIS_LABEL_PROP_REL_DIAL},
+    {0, AXIS_LABEL_PROP_REL_WHEEL},
+    {0, AXIS_LABEL_PROP_REL_MISC},
+    {0, AXIS_LABEL_PROP_REL_VSCROLL},
+    {0, AXIS_LABEL_PROP_REL_HSCROLL},
+    {0, AXIS_LABEL_PROP_ABS_X},
+    {0, AXIS_LABEL_PROP_ABS_Y},
+    {0, AXIS_LABEL_PROP_ABS_Z},
+    {0, AXIS_LABEL_PROP_ABS_RX},
+    {0, AXIS_LABEL_PROP_ABS_RY},
+    {0, AXIS_LABEL_PROP_ABS_RZ},
+    {0, AXIS_LABEL_PROP_ABS_THROTTLE},
+    {0, AXIS_LABEL_PROP_ABS_RUDDER},
+    {0, AXIS_LABEL_PROP_ABS_WHEEL},
+    {0, AXIS_LABEL_PROP_ABS_GAS},
+    {0, AXIS_LABEL_PROP_ABS_BRAKE},
+    {0, AXIS_LABEL_PROP_ABS_HAT0X},
+    {0, AXIS_LABEL_PROP_ABS_HAT0Y},
+    {0, AXIS_LABEL_PROP_ABS_HAT1X},
+    {0, AXIS_LABEL_PROP_ABS_HAT1Y},
+    {0, AXIS_LABEL_PROP_ABS_HAT2X},
+    {0, AXIS_LABEL_PROP_ABS_HAT2Y},
+    {0, AXIS_LABEL_PROP_ABS_HAT3X},
+    {0, AXIS_LABEL_PROP_ABS_HAT3Y},
+    {0, AXIS_LABEL_PROP_ABS_PRESSURE},
+    {0, AXIS_LABEL_PROP_ABS_DISTANCE},
+    {0, AXIS_LABEL_PROP_ABS_TILT_X},
+    {0, AXIS_LABEL_PROP_ABS_TILT_Y},
+    {0, AXIS_LABEL_PROP_ABS_TOOL_WIDTH},
+    {0, AXIS_LABEL_PROP_ABS_VOLUME},
+    {0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR},
+    {0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR},
+    {0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR},
+    {0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR},
+    {0, AXIS_LABEL_PROP_ABS_MT_ORIENTATION},
+    {0, AXIS_LABEL_PROP_ABS_MT_POSITION_X},
+    {0, AXIS_LABEL_PROP_ABS_MT_POSITION_Y},
+    {0, AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE},
+    {0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID},
+    {0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID},
+    {0, AXIS_LABEL_PROP_ABS_MT_PRESSURE},
+    {0, AXIS_LABEL_PROP_ABS_MISC},
+    {0, BTN_LABEL_PROP},
+    {0, BTN_LABEL_PROP_BTN_UNKNOWN},
+    {0, BTN_LABEL_PROP_BTN_WHEEL_UP},
+    {0, BTN_LABEL_PROP_BTN_WHEEL_DOWN},
+    {0, BTN_LABEL_PROP_BTN_HWHEEL_LEFT},
+    {0, BTN_LABEL_PROP_BTN_HWHEEL_RIGHT},
+    {0, BTN_LABEL_PROP_BTN_0},
+    {0, BTN_LABEL_PROP_BTN_1},
+    {0, BTN_LABEL_PROP_BTN_2},
+    {0, BTN_LABEL_PROP_BTN_3},
+    {0, BTN_LABEL_PROP_BTN_4},
+    {0, BTN_LABEL_PROP_BTN_5},
+    {0, BTN_LABEL_PROP_BTN_6},
+    {0, BTN_LABEL_PROP_BTN_7},
+    {0, BTN_LABEL_PROP_BTN_8},
+    {0, BTN_LABEL_PROP_BTN_9},
+    {0, BTN_LABEL_PROP_BTN_LEFT},
+    {0, BTN_LABEL_PROP_BTN_RIGHT},
+    {0, BTN_LABEL_PROP_BTN_MIDDLE},
+    {0, BTN_LABEL_PROP_BTN_SIDE},
+    {0, BTN_LABEL_PROP_BTN_EXTRA},
+    {0, BTN_LABEL_PROP_BTN_FORWARD},
+    {0, BTN_LABEL_PROP_BTN_BACK},
+    {0, BTN_LABEL_PROP_BTN_TASK},
+    {0, BTN_LABEL_PROP_BTN_TRIGGER},
+    {0, BTN_LABEL_PROP_BTN_THUMB},
+    {0, BTN_LABEL_PROP_BTN_THUMB2},
+    {0, BTN_LABEL_PROP_BTN_TOP},
+    {0, BTN_LABEL_PROP_BTN_TOP2},
+    {0, BTN_LABEL_PROP_BTN_PINKIE},
+    {0, BTN_LABEL_PROP_BTN_BASE},
+    {0, BTN_LABEL_PROP_BTN_BASE2},
+    {0, BTN_LABEL_PROP_BTN_BASE3},
+    {0, BTN_LABEL_PROP_BTN_BASE4},
+    {0, BTN_LABEL_PROP_BTN_BASE5},
+    {0, BTN_LABEL_PROP_BTN_BASE6},
+    {0, BTN_LABEL_PROP_BTN_DEAD},
+    {0, BTN_LABEL_PROP_BTN_A},
+    {0, BTN_LABEL_PROP_BTN_B},
+    {0, BTN_LABEL_PROP_BTN_C},
+    {0, BTN_LABEL_PROP_BTN_X},
+    {0, BTN_LABEL_PROP_BTN_Y},
+    {0, BTN_LABEL_PROP_BTN_Z},
+    {0, BTN_LABEL_PROP_BTN_TL},
+    {0, BTN_LABEL_PROP_BTN_TR},
+    {0, BTN_LABEL_PROP_BTN_TL2},
+    {0, BTN_LABEL_PROP_BTN_TR2},
+    {0, BTN_LABEL_PROP_BTN_SELECT},
+    {0, BTN_LABEL_PROP_BTN_START},
+    {0, BTN_LABEL_PROP_BTN_MODE},
+    {0, BTN_LABEL_PROP_BTN_THUMBL},
+    {0, BTN_LABEL_PROP_BTN_THUMBR},
+    {0, BTN_LABEL_PROP_BTN_TOOL_PEN},
+    {0, BTN_LABEL_PROP_BTN_TOOL_RUBBER},
+    {0, BTN_LABEL_PROP_BTN_TOOL_BRUSH},
+    {0, BTN_LABEL_PROP_BTN_TOOL_PENCIL},
+    {0, BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH},
+    {0, BTN_LABEL_PROP_BTN_TOOL_FINGER},
+    {0, BTN_LABEL_PROP_BTN_TOOL_MOUSE},
+    {0, BTN_LABEL_PROP_BTN_TOOL_LENS},
+    {0, BTN_LABEL_PROP_BTN_TOUCH},
+    {0, BTN_LABEL_PROP_BTN_STYLUS},
+    {0, BTN_LABEL_PROP_BTN_STYLUS2},
+    {0, BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP},
+    {0, BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP},
+    {0, BTN_LABEL_PROP_BTN_GEAR_DOWN},
+    {0, BTN_LABEL_PROP_BTN_GEAR_UP},
+    {0, XI_PROP_TRANSFORM}
 };
 
 static long XIPropHandlerID = 1;
@@ -182,30 +181,27 @@ static long XIPropHandlerID = 1;
 static void
 send_property_event(DeviceIntPtr dev, Atom property, int what)
 {
-    devicePropertyNotify event;
-    xXIPropertyEvent xi2;
-    int state;
+    int state = (what == XIPropertyDeleted) ? PropertyDelete : PropertyNewValue;
+    devicePropertyNotify event = {
+        .type = DevicePropertyNotify,
+        .deviceid = dev->id,
+        .state = state,
+        .atom = property,
+        .time = currentTime.milliseconds
+    };
+    xXIPropertyEvent xi2 = {
+        .type = GenericEvent,
+        .extension = IReqCode,
+        .length = 0,
+        .evtype = XI_PropertyEvent,
+        .deviceid = dev->id,
+        .time = currentTime.milliseconds,
+        .property = property,
+        .what = what
+    };
 
-    if (what == XIPropertyDeleted)
-        state = PropertyDelete;
-    else
-        state = PropertyNewValue;
-
-    event.type = DevicePropertyNotify;
-    event.deviceid = dev->id;
-    event.state = state;
-    event.atom = property;
-    event.time = currentTime.milliseconds;
     SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1);
 
-    xi2.type = GenericEvent;
-    xi2.extension = IReqCode;
-    xi2.length = 0;
-    xi2.evtype = XI_PropertyEvent;
-    xi2.deviceid = dev->id;
-    xi2.time = currentTime.milliseconds;
-    xi2.property = property;
-    xi2.what = what;
     SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent *) &xi2),
                           (xEvent *) &xi2, 1);
 }
@@ -754,7 +750,7 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type,
             break;
         }
         if (new_data)
-            memcpy((char *) new_data, (char *) value, len * size_in_bytes);
+            memcpy((char *) new_data, value, len * size_in_bytes);
         if (old_data)
             memcpy((char *) old_data, (char *) prop_value->data,
                    prop_value->size * size_in_bytes);
@@ -774,6 +770,8 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type,
                                                   &new_value, checkonly);
                         if (checkonly && rc != Success) {
                             free(new_value.data);
+                            if (add)
+                                XIDestroyDeviceProperty(prop);
                             return rc;
                         }
                     }
@@ -864,11 +862,13 @@ ProcXListDeviceProperties(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_ListDeviceProperties;
-    rep.length = natoms;
-    rep.sequenceNumber = client->sequence;
-    rep.nAtoms = natoms;
+    rep = (xListDevicePropertiesReply) {
+        .repType = X_Reply,
+        .RepType = X_ListDeviceProperties,
+        .sequenceNumber = client->sequence,
+        .length = natoms,
+        .nAtoms = natoms
+    };
 
     WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep);
     if (natoms) {
@@ -958,15 +958,17 @@ ProcXGetDeviceProperty(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    reply.repType = X_Reply;
-    reply.RepType = X_GetDeviceProperty;
-    reply.sequenceNumber = client->sequence;
-    reply.deviceid = dev->id;
-    reply.nItems = nitems;
-    reply.format = format;
-    reply.bytesAfter = bytes_after;
-    reply.propertyType = type;
-    reply.length = bytes_to_int32(length);
+    reply = (xGetDevicePropertyReply) {
+        .repType = X_Reply,
+        .RepType = X_GetDeviceProperty,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(length),
+        .propertyType = type,
+        .bytesAfter = bytes_after,
+        .nItems = nitems,
+        .format = format,
+        .deviceid = dev->id
+    };
 
     if (stuff->delete && (reply.bytesAfter == 0))
         send_property_event(dev, stuff->property, XIPropertyDeleted);
@@ -1063,7 +1065,7 @@ SRepXListDeviceProperties(ClientPtr client, int size,
     swapl(&rep->length);
     swaps(&rep->nAtoms);
     /* properties will be swapped later, see ProcXListDeviceProperties */
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
 
 void
@@ -1076,7 +1078,7 @@ SRepXGetDeviceProperty(ClientPtr client, int size,
     swapl(&rep->bytesAfter);
     swapl(&rep->nItems);
     /* data will be swapped, see ProcXGetDeviceProperty */
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
 
 /* XI2 Request/reply handling */
@@ -1100,11 +1102,13 @@ ProcXIListProperties(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_XIListProperties;
-    rep.length = natoms;
-    rep.sequenceNumber = client->sequence;
-    rep.num_properties = natoms;
+    rep = (xXIListPropertiesReply) {
+        .repType = X_Reply,
+        .RepType = X_XIListProperties,
+        .sequenceNumber = client->sequence,
+        .length = natoms,
+        .num_properties = natoms
+    };
 
     WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep);
     if (natoms) {
@@ -1194,14 +1198,16 @@ ProcXIGetProperty(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    reply.repType = X_Reply;
-    reply.RepType = X_XIGetProperty;
-    reply.sequenceNumber = client->sequence;
-    reply.num_items = nitems;
-    reply.format = format;
-    reply.bytes_after = bytes_after;
-    reply.type = type;
-    reply.length = bytes_to_int32(length);
+    reply = (xXIGetPropertyReply) {
+        .repType = X_Reply,
+        .RepType = X_XIGetProperty,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(length),
+        .type = type,
+        .bytes_after = bytes_after,
+        .num_items = nitems,
+        .format = format
+    };
 
     if (length && stuff->delete && (reply.bytes_after == 0))
         send_property_event(dev, stuff->property, XIPropertyDeleted);
@@ -1300,7 +1306,7 @@ SRepXIListProperties(ClientPtr client, int size, xXIListPropertiesReply * rep)
     swapl(&rep->length);
     swaps(&rep->num_properties);
     /* properties will be swapped later, see ProcXIListProperties */
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
 
 void
@@ -1312,5 +1318,5 @@ SRepXIGetProperty(ClientPtr client, int size, xXIGetPropertyReply * rep)
     swapl(&rep->bytes_after);
     swapl(&rep->num_items);
     /* data will be swapped, see ProcXIGetProperty */
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 749bc24..85c1dd8 100644 (file)
@@ -107,12 +107,13 @@ ProcXIQueryDevice(ClientPtr client)
         return BadAlloc;
     }
 
-    memset(&rep, 0, sizeof(xXIQueryDeviceReply));
-    rep.repType = X_Reply;
-    rep.RepType = X_XIQueryDevice;
-    rep.sequenceNumber = client->sequence;
-    rep.length = len / 4;
-    rep.num_devices = 0;
+    rep = (xXIQueryDeviceReply) {
+        .repType = X_Reply,
+        .RepType = X_XIQueryDevice,
+        .sequenceNumber = client->sequence,
+        .length = len / 4,
+        .num_devices = 0
+    };
 
     ptr = info;
     if (dev) {
@@ -162,7 +163,7 @@ SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply * rep)
 
     /* Device info is already swapped, see ProcXIQueryDevice */
 
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
 
 /**
@@ -430,7 +431,7 @@ ListTouchInfo(DeviceIntPtr dev, xXITouchInfo * touch)
 {
     touch->type = XITouchClass;
     touch->length = sizeof(xXITouchInfo) >> 2;
-    touch->sourceid = touch->sourceid;
+    touch->sourceid = dev->touch->sourceid;
     touch->mode = dev->touch->mode;
     touch->num_touches = dev->touch->num_touches;
 
index 169436e..7e6852d 100644 (file)
@@ -121,15 +121,16 @@ ProcXIQueryPointer(ClientPtr client)
 
     pSprite = pDev->spriteInfo->sprite;
 
-    memset(&rep, 0, sizeof(rep));
-    rep.repType = X_Reply;
-    rep.RepType = X_XIQueryPointer;
-    rep.length = 6;
-    rep.sequenceNumber = client->sequence;
-    rep.root = (GetCurrentRootWindow(pDev))->drawable.id;
-    rep.root_x = FP1616(pSprite->hot.x, 0);
-    rep.root_y = FP1616(pSprite->hot.y, 0);
-    rep.child = None;
+    rep = (xXIQueryPointerReply) {
+        .repType = X_Reply,
+        .RepType = X_XIQueryPointer,
+        .sequenceNumber = client->sequence,
+        .length = 6,
+        .root = (GetCurrentRootWindow(pDev))->drawable.id,
+        .root_x = FP1616(pSprite->hot.x, 0),
+        .root_y = FP1616(pSprite->hot.y, 0),
+        .child = None
+    };
 
     if (kbd) {
         state = &kbd->key->xkbInfo->state;
@@ -219,5 +220,5 @@ SRepXIQueryPointer(ClientPtr client, int size, xXIQueryPointerReply * rep)
     swapl(&rep->win_y);
     swaps(&rep->buttons_len);
 
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 95a8efa..b807a53 100644 (file)
@@ -70,26 +70,37 @@ ProcXIQueryVersion(ClientPtr client)
 
     pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
 
-    if (version_compare(XIVersion.major_version, XIVersion.minor_version,
-                        stuff->major_version, stuff->minor_version) > 0) {
-        major = stuff->major_version;
-        minor = stuff->minor_version;
+    if (pXIClient->major_version) {
+        if (version_compare(stuff->major_version, stuff->minor_version,
+                            pXIClient->major_version, pXIClient->minor_version) < 0) {
+            client->errorValue = stuff->major_version;
+            return BadValue;
+        }
+        major = pXIClient->major_version;
+        minor = pXIClient->minor_version;
+    } else {
+        if (version_compare(XIVersion.major_version, XIVersion.minor_version,
+                    stuff->major_version, stuff->minor_version) > 0) {
+            major = stuff->major_version;
+            minor = stuff->minor_version;
+        }
+        else {
+            major = XIVersion.major_version;
+            minor = XIVersion.minor_version;
+        }
+
+        pXIClient->major_version = major;
+        pXIClient->minor_version = minor;
     }
-    else {
-        major = XIVersion.major_version;
-        minor = XIVersion.minor_version;
-    }
-
-    pXIClient->major_version = major;
-    pXIClient->minor_version = minor;
 
-    memset(&rep, 0, sizeof(xXIQueryVersionReply));
-    rep.repType = X_Reply;
-    rep.RepType = X_XIQueryVersion;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.major_version = major;
-    rep.minor_version = minor;
+    rep = (xXIQueryVersionReply) {
+        .repType = X_Reply,
+        .RepType = X_XIQueryVersion,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .major_version = major,
+        .minor_version = minor
+    };
 
     WriteReplyToClient(client, sizeof(xXIQueryVersionReply), &rep);
 
@@ -116,5 +127,5 @@ SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply * rep)
     swapl(&rep->length);
     swaps(&rep->major_version);
     swaps(&rep->minor_version);
-    WriteToClient(client, size, (char *) rep);
+    WriteToClient(client, size, rep);
 }
index 43a67c8..0e45cb8 100644 (file)
@@ -175,17 +175,17 @@ ProcXISelectEvents(ClientPtr client)
                 if (inputMasks)
                     iclient = inputMasks->inputClients;
                 for (; iclient; iclient = iclient->next) {
-                    DeviceIntPtr dummy;
+                    DeviceIntPtr tmp;
 
                     if (CLIENT_ID(iclient->resource) == client->index)
                         continue;
 
-                    dixLookupDevice(&dummy, evmask->deviceid, serverClient,
+                    dixLookupDevice(&tmp, evmask->deviceid, serverClient,
                                     DixReadAccess);
-                    if (!dummy)
+                    if (!tmp)
                         return BadImplementation;       /* this shouldn't happen */
 
-                    if (xi2mask_isset(iclient->xi2mask, dummy, XI_TouchBegin))
+                    if (xi2mask_isset(iclient->xi2mask, tmp, XI_TouchBegin))
                         return BadAccess;
                 }
             }
@@ -260,11 +260,13 @@ ProcXIGetSelectedEvents(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    reply.repType = X_Reply;
-    reply.RepType = X_XIGetSelectedEvents;
-    reply.length = 0;
-    reply.sequenceNumber = client->sequence;
-    reply.num_masks = 0;
+    reply = (xXIGetSelectedEventsReply) {
+        .repType = X_Reply,
+        .RepType = X_XIGetSelectedEvents,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .num_masks = 0
+    };
 
     masks = wOtherInputMasks(win);
     if (masks) {
@@ -335,5 +337,5 @@ SRepXIGetSelectedEvents(ClientPtr client,
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
     swaps(&rep->num_masks);
-    WriteToClient(client, len, (char *) rep);
+    WriteToClient(client, len, rep);
 }
index b52c9cc..372ec24 100644 (file)
@@ -97,10 +97,12 @@ ProcXIGetFocus(ClientPtr client)
     if (!dev->focus)
         return BadDevice;
 
-    rep.repType = X_Reply;
-    rep.RepType = X_XIGetFocus;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xXIGetFocusReply) {
+        .repType = X_Reply,
+        .RepType = X_XIGetFocus,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     if (dev->focus->win == NoneWin)
         rep.focus = None;
@@ -121,5 +123,5 @@ SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply * rep)
     swaps(&rep->sequenceNumber);
     swapl(&rep->length);
     swapl(&rep->focus);
-    WriteToClient(client, len, (char *) rep);
+    WriteToClient(client, len, rep);
 }
diff --git a/compile b/compile
deleted file mode 100755 (executable)
index 669edc3..0000000
--- a/compile
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/bin/bash
-
-#CONFOPT="--disable-xquartz --disable-glx --disable-dri --disable-launchd --enable-kdrive --disable-xsdl --enable-xnest --enable-xvfb"
-#CONFOPT="--enable-xorg --disable-xquartz --disable-kdrive --disable-xnest --disable-xvfb"
-
-CONFOPT="--enable-standalone-xpbproxy"
-#CONFOPT="--disable-shave --without-dtrace"
-
-CONFOPT="${CONFOPT} --with-dtrace"
-
-# Parallel Make.  Change $MAKE if you don't have gmake installed
-MAKE="gnumake"
-MAKE_OPTS="-j10"
-
-. ~/src/strip.sh
-
-PATH=$PATH:/opt/local/bin
-
-#PREFIX=/usr/X11
-#ARCHFLAGS="-arch i386 -arch x86_64"
-
-PREFIX=/opt/X11
-CONFOPT="$CONFOPT --with-apple-application-name=XQuartz --with-launchd-id-prefix=org.macosforge.xquartz"
-ARCHFLAGS="-arch i386 -arch x86_64"
-
-ACLOCAL="aclocal -I ${PREFIX}/share/aclocal -I /usr/local/share/aclocal"
-
-CPPFLAGS="-DNO_ALLOCA -DNO_COMPILER_H -DFAKEIT -DFAIL_HARD"
-
-CFLAGS="$CFLAGS -O0 -g3 -pipe"
-CFLAGS="$CFLAGS $ARCHFLAGS"
-CFLAGS="$CFLAGS -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers"
-
-CFLAGS="${CFLAGS} -fdiagnostics-show-category=name"
-
-# Stage 1:
-#    CFLAGS="${CFLAGS} -Werror=clobbered"
-#    CFLAGS="${CFLAGS} -Wlogical-op"
-#    CFLAGS="${CFLAGS} -Wparentheses"
-#    CFLAGS="${CFLAGS} -Wcast-align"
-#    CFLAGS="${CFLAGS} -Wunsafe-loop-optimizations"
-
-OBJCFLAGS="$CFLAGS"
-LDFLAGS="$CFLAGS"
-
-#CC="llvm-gcc"
-#CXX="llvm-g++"
-CC="/opt/local/bin/clang-mp-3.0"
-CXX="/opt/local/bin/clang++-mp-3.0"
-
-OBJC="$CC"
-
-#SCAN_BUILD="scan-build -v -V -o clang.d --use-cc=${CC} --use-c++=${CXX}"
-#CPPFLAGS="$CPPFLAGS -F/Applications/Utilities/XQuartz.app/Contents/Frameworks"
-#LDFLAGS="$LDFLAGS -F/Applications/Utilities/XQuartz.app/Contents/Frameworks"
-#CPPFLAGS="$CPPFLAGS -F/Applications/Utilities/X11.app/Contents/Frameworks"
-#LDFLAGS="$LDFLAGS -F/Applications/Utilities/X11.app/Contents/Frameworks"
-#CONFOPT="${CONFOPT} --enable-sparkle"
-
-# This section is for building release tarballs
-if false ; then
-       CONFOPT="${CONFOPT} --enable-docs --enable-devel-docs --enable-builddocs --with-doxygen --with-xmlto --with-fop"
-       export XMLTO=/opt/local/bin/xmlto
-       export ASCIIDOC=/opt/local/bin/asciidoc
-       export DOXYGEN=/opt/local/bin/doxygen
-       export FOP=/opt/local/bin/fop
-       export FOP_OPTS="-Xmx2048m -Djava.awt.headless=true"
-       export GROFF=/opt/local/bin/groff
-       export PS2PDF=/opt/local/bin/ps2pdf
-else
-       CONFOPT="${CONFOPT} --disable-docs --disable-devel-docs --disable-builddocs"
-fi
-
-export ACLOCAL CPPFLAGS CFLAGS OBJCFLAGS LDFLAGS CC OBJC
-
-PKG_CONFIG_PATH=${PREFIX}/share/pkgconfig:${PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH
-PATH=${PREFIX}/bin:$PATH
-
-die() {
-       echo "${@}" >&2
-       exit 1
-}
-
-docomp() {
-       #autoreconf -fvi || die
-       #${SCAN_BUILD} ./configure --prefix=${PREFIX} ${CONFOPT} --disable-dependency-tracking --enable-maintainer-mode --enable-xcsecurity --enable-record --disable-xevie "${@}" || die "Could not configure xserver"
-       #${MAKE} clean || die "Unable to make clean"
-       #${SCAN_BUILD} ${MAKE} ${MAKE_OPTS} || die "Could not make xserver"
-       #${MAKE} distcheck ${MAKE_OPTS} DESTDIR=/tmp/distcheck || die "distcheck failed"
-       ../modular/release.sh .
-}
-
-doinst() {
-       ${MAKE} install DESTDIR="$(pwd)/../dist" || die "Could not install xserver"
-}
-
-dosign() {
-       /opt/local/bin/gmd5sum $1 > $1.md5sum
-       /opt/local/bin/gsha1sum $1 > $1.sha1sum
-       DISPLAY="" /opt/local/bin/gpg2 -b $1
-}
-
-dodist() {
-       ${MAKE} dist
-       dosign xorg-server-$1.tar.bz2
-
-       cp hw/xquartz/mach-startup/X11.bin X11.bin-$1
-       bzip2 X11.bin-$1
-       dosign X11.bin-$1.bz2 
-}
-
-docomp `[ -f conf_flags ] && cat conf_flags`
-#doinst
-[[ -n $1 ]] && dodist $1
-
-exit 0
index 1482def..5366f88 100644 (file)
@@ -55,14 +55,13 @@ compScreenUpdate(ScreenPtr pScreen)
 }
 
 static void
-compBlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask)
+compBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask)
 {
-    ScreenPtr pScreen = screenInfo.screens[i];
     CompScreenPtr cs = GetCompScreen(pScreen);
 
     pScreen->BlockHandler = cs->BlockHandler;
     compScreenUpdate(pScreen);
-    (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+    (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
 
     /* Next damage will restore the block handler */
     cs->BlockHandler = NULL;
@@ -573,8 +572,8 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h)
         }
     }
     else {
-        PictFormatPtr pSrcFormat = compWindowFormat(pParent);
-        PictFormatPtr pDstFormat = compWindowFormat(pWin);
+        PictFormatPtr pSrcFormat = PictureWindowFormat(pParent);
+        PictFormatPtr pDstFormat = PictureWindowFormat(pWin);
         XID inferiors = IncludeInferiors;
         int error;
 
index 940eed1..8641eff 100644 (file)
@@ -48,6 +48,7 @@
 #include "compint.h"
 #include "xace.h"
 #include "protocol-versions.h"
+#include "extinit.h"
 
 static CARD8 CompositeReqCode;
 static DevPrivateKeyRec CompositeClientPrivateKeyRec;
@@ -107,14 +108,15 @@ static int
 ProcCompositeQueryVersion(ClientPtr client)
 {
     CompositeClientPtr pCompositeClient = GetCompositeClient(client);
-    xCompositeQueryVersionReply rep;
+    xCompositeQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     REQUEST(xCompositeQueryVersionReq);
 
     REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
     if (stuff->majorVersion < SERVER_COMPOSITE_MAJOR_VERSION) {
         rep.majorVersion = stuff->majorVersion;
         rep.minorVersion = stuff->minorVersion;
@@ -131,7 +133,7 @@ ProcCompositeQueryVersion(ClientPtr client)
         swapl(&rep.majorVersion);
         swapl(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xCompositeQueryVersionReply), &rep);
     return Success;
 }
 
@@ -311,18 +313,19 @@ ProcCompositeGetOverlayWindow(ClientPtr client)
         return rc;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.overlayWin = cs->pOverlayWin->drawable.id;
+    rep = (xCompositeGetOverlayWindowReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .overlayWin = cs->pOverlayWin->drawable.id
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.overlayWin);
     }
-    (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply,
-                         (char *) &rep);
+    WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep);
 
     return Success;
 }
@@ -497,6 +500,28 @@ SProcCompositeDispatch(ClientPtr client)
         return BadRequest;
 }
 
+/** @see GetDefaultBytes */
+static void
+GetCompositeClientWindowBytes(pointer value, XID id, ResourceSizePtr size)
+{
+    WindowPtr window = value;
+
+    /* Currently only pixmap bytes are reported to clients. */
+    size->resourceSize = 0;
+
+    /* Calculate pixmap reference sizes. */
+    size->pixmapRefSize = 0;
+    if (window->redirectDraw != RedirectDrawNone)
+    {
+        SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP);
+        ResourceSizeRec pixmapSize = { 0, 0 };
+        ScreenPtr screen = window->drawable.pScreen;
+        PixmapPtr pixmap = screen->GetWindowPixmap(window);
+        pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize);
+        size->pixmapRefSize += pixmapSize.pixmapRefSize;
+    }
+}
+
 void
 CompositeExtensionInit(void)
 {
@@ -529,6 +554,9 @@ CompositeExtensionInit(void)
     if (!CompositeClientWindowType)
         return;
 
+    SetResourceTypeSizeFunc(CompositeClientWindowType,
+                            GetCompositeClientWindowBytes);
+
     CompositeClientSubwindowsType = CreateNewResourceType
         (FreeCompositeClientSubwindows, "CompositeClientSubwindows");
     if (!CompositeClientSubwindowsType)
@@ -818,18 +846,19 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
 
     cs = GetCompScreen(screenInfo.screens[0]);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.overlayWin = cs->pOverlayWin->drawable.id;
+    rep = (xCompositeGetOverlayWindowReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .overlayWin = cs->pOverlayWin->drawable.id
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.overlayWin);
     }
-    (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply,
-                         (char *) &rep);
+    WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep);
 
     return Success;
 }
index eaa1256..bc1130e 100644 (file)
@@ -53,7 +53,7 @@ DevPrivateKeyRec CompWindowPrivateKeyRec;
 DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
 
 static Bool
-compCloseScreen(int index, ScreenPtr pScreen)
+compCloseScreen(ScreenPtr pScreen)
 {
     CompScreenPtr cs = GetCompScreen(pScreen);
     Bool ret;
@@ -82,7 +82,7 @@ compCloseScreen(int index, ScreenPtr pScreen)
 
     free(cs);
     dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
-    ret = (*pScreen->CloseScreen) (index, pScreen);
+    ret = (*pScreen->CloseScreen) (pScreen);
 
     return ret;
 }
index 6c4272e..45b5824 100644 (file)
@@ -71,6 +71,7 @@
 #include "damageextint.h"
 #include "xfixes.h"
 #include <X11/extensions/compositeproto.h>
+#include "compositeext.h"
 #include <assert.h>
 
 /*
@@ -182,7 +183,6 @@ extern DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
 #define GetCompSubwindows(w) ((CompSubwindowsPtr) \
     dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey))
 
-extern RESTYPE CompositeClientWindowType;
 extern RESTYPE CompositeClientSubwindowsType;
 extern RESTYPE CompositeClientOverlayType;
 
@@ -229,13 +229,6 @@ compReallocPixmap(WindowPtr pWin, int x, int y,
                   unsigned int w, unsigned int h, int bw);
 
 /*
- * compext.c
- */
-
-void
- CompositeExtensionInit(void);
-
-/*
  * compinit.c
  */
 
@@ -272,8 +265,6 @@ void
 #define compCheckTree(s)
 #endif
 
-PictFormatPtr compWindowFormat(WindowPtr pWin);
-
 void
  compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap);
 
index 600604d..0b148f0 100644 (file)
@@ -35,4 +35,6 @@ extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen,
                                                         VisualID * vids,
                                                         int nVisuals);
 
+extern _X_EXPORT RESTYPE CompositeClientWindowType;
+
 #endif                          /* _COMPOSITEEXT_H_ */
index 6eb624b..0be7a1b 100644 (file)
@@ -208,7 +208,8 @@ updateOverlayWindow(ScreenPtr pScreen)
         return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin));
     }
 
-    /* Let's be on the safe side and not assume an overlay window is always allocated. */
+    /* Let's be on the safe side and not assume an overlay window is
+       always allocated. */
     return Success;
 }
 
@@ -631,28 +632,6 @@ compGetRedirectBorderClip(WindowPtr pWin)
     return &cw->borderClip;
 }
 
-static VisualPtr
-compGetWindowVisual(WindowPtr pWin)
-{
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-    VisualID vid = wVisual(pWin);
-    int i;
-
-    for (i = 0; i < pScreen->numVisuals; i++)
-        if (pScreen->visuals[i].vid == vid)
-            return &pScreen->visuals[i];
-    return 0;
-}
-
-PictFormatPtr
-compWindowFormat(WindowPtr pWin)
-{
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-
-    return PictureMatchVisual(pScreen, pWin->drawable.depth,
-                              compGetWindowVisual(pWin));
-}
-
 static void
 compWindowUpdateAutomatic(WindowPtr pWin)
 {
@@ -660,8 +639,8 @@ compWindowUpdateAutomatic(WindowPtr pWin)
     ScreenPtr pScreen = pWin->drawable.pScreen;
     WindowPtr pParent = pWin->parent;
     PixmapPtr pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin);
-    PictFormatPtr pSrcFormat = compWindowFormat(pWin);
-    PictFormatPtr pDstFormat = compWindowFormat(pWin->parent);
+    PictFormatPtr pSrcFormat = PictureWindowFormat(pWin);
+    PictFormatPtr pDstFormat = PictureWindowFormat(pWin->parent);
     int error;
     RegionPtr pRegion = DamageRegion(cw->damage);
     PicturePtr pSrcPicture = CreatePicture(0, &pSrcPixmap->drawable,
@@ -700,7 +679,8 @@ compWindowUpdateAutomatic(WindowPtr pWin)
     /*
      * And paint
      */
-    CompositePicture(PictOpSrc, pSrcPicture, 0, pDstPicture, 0, 0,      /* src_x, src_y */
+    CompositePicture(PictOpSrc, pSrcPicture, 0, pDstPicture,
+                     0, 0,      /* src_x, src_y */
                      0, 0,      /* msk_x, msk_y */
                      pSrcPixmap->screen_x - pParent->drawable.x,
                      pSrcPixmap->screen_y - pParent->drawable.y,
index e5622d5..6423701 100644 (file)
@@ -33,8 +33,10 @@ void remove_devices(const char *backend, const char *config_info);
 BOOL device_is_duplicate(const char *config_info);
 
 #ifdef CONFIG_UDEV
+int config_udev_pre_init(void);
 int config_udev_init(void);
 void config_udev_fini(void);
+void config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback);
 #else
 
 #ifdef CONFIG_NEED_DBUS
index 2b96dbb..d0889a3 100644 (file)
 #include "config-backends.h"
 
 void
+config_pre_init(void)
+{
+#ifdef CONFIG_UDEV
+    if (!config_udev_pre_init())
+        ErrorF("[config] failed to pre-init udev\n");
+#endif
+}
+
+void
 config_init(void)
 {
 #ifdef CONFIG_UDEV
@@ -76,6 +85,14 @@ config_fini(void)
 #endif
 }
 
+void
+config_odev_probe(config_odev_probe_proc_ptr probe_callback)
+{
+#if defined(CONFIG_UDEV_KMS)
+    config_udev_odev_probe(probe_callback);
+#endif
+}
+
 static void
 remove_device(const char *backend, DeviceIntPtr dev)
 {
@@ -124,3 +141,51 @@ device_is_duplicate(const char *config_info)
 
     return FALSE;
 }
+
+struct OdevAttributes *
+config_odev_allocate_attribute_list(void)
+{
+    struct OdevAttributes *attriblist;
+
+    attriblist = malloc(sizeof(struct OdevAttributes));
+    if (!attriblist)
+        return NULL;
+
+    xorg_list_init(&attriblist->list);
+    return attriblist;
+}
+
+void
+config_odev_free_attribute_list(struct OdevAttributes *attribs)
+{
+    config_odev_free_attributes(attribs);
+    free(attribs);
+}
+
+Bool
+config_odev_add_attribute(struct OdevAttributes *attribs, int attrib,
+                          const char *attrib_name)
+{
+    struct OdevAttribute *oa;
+
+    oa = malloc(sizeof(struct OdevAttribute));
+    if (!oa)
+        return FALSE;
+
+    oa->attrib_id = attrib;
+    oa->attrib_name = strdup(attrib_name);
+    xorg_list_append(&oa->member, &attribs->list);
+    return TRUE;
+}
+
+void
+config_odev_free_attributes(struct OdevAttributes *attribs)
+{
+    struct OdevAttribute *iter, *safe;
+
+    xorg_list_for_each_entry_safe(iter, safe, &attribs->list, member) {
+        xorg_list_del(&iter->member);
+        free(iter->attrib_name);
+        free(iter);
+    }
+}
diff --git a/config/dbus-api b/config/dbus-api
new file mode 100644 (file)
index 0000000..018e986
--- /dev/null
@@ -0,0 +1,40 @@
+D-BUS Configuration API v2
+----------------------------
+
+The X server will register the bus name org.x.config.displayN, and the 
+object /org/x/config/N, where N is the display number.
+
+Currently only hotplugging of input devices is supported.
+
+org.x.config.input:
+    org.x.config.input.version:
+        Returns one unsigned int32, which is the API version.
+
+    org.x.config.input.add:
+        Takes an argument of key/value option pairs in arrays, e.g.:
+         [ss][ss][ss][ss]
+        is the signature for four options.  These options will be passed
+        to the input driver as with any others.
+        Option names beginning with _ are not allowed; they are reserved
+        for internal use.
+
+        Returns a number of signed int32s.  Positive integers are the
+        device IDs of new devices; negative numbers are X error codes,
+        as defined in X.h.  BadMatch will be returned if the options
+        given do not match any device.  BadValue is returned for a malformed
+        message.  (Example: 8 is new device ID 8; -8 is BadMatch.)
+
+        Notably, BadAlloc is never returned: the server internally signals
+        to D-BUS that the attempt failed for lack of memory.
+
+    org.x.config.input.remove:
+        Takes one uint32 argument, which is the device ID to remove, i.e.:
+         u
+        is the signature.
+
+        Returns one signed int32 which represents an X status as defined in
+        X.h. See org.x.config.input.add. Error codes are negative numbers.
+
+    org.x.config.input.listDevices:
+        Lists the currently active devices. No argument. 
+        Return value is sequence of [<id> <name>] [<id> <name>] ..., i.e. [us].
index d766a09..bd49e91 100644 (file)
 
 static struct udev_monitor *udev_monitor;
 
+#ifdef CONFIG_UDEV_KMS
+static Bool
+config_udev_odev_setup_attribs(const char *path, const char *syspath,
+                               config_odev_probe_proc_ptr probe_callback);
+#endif
+
 static void
 device_added(struct udev_device *udev_device)
 {
@@ -85,6 +91,20 @@ device_added(struct udev_device *udev_device)
     if (!SeatId && strcmp(dev_seat, "seat0"))
         return;
 
+#ifdef CONFIG_UDEV_KMS
+    if (!strcmp(udev_device_get_subsystem(udev_device), "drm")) {
+        const char *sysname = udev_device_get_sysname(udev_device);
+
+        if (strncmp(sysname, "card", 4) != 0)
+            return;
+
+        LogMessage(X_INFO, "config/udev: Adding drm device (%s)\n", path);
+
+        config_udev_odev_setup_attribs(path, syspath, NewGPUDeviceRequest);
+        return;
+    }
+#endif
+
     if (!udev_device_get_property_value(udev_device, "ID_INPUT")) {
         LogMessageVerb(X_INFO, 10,
                        "config/udev: ignoring device %s without "
@@ -260,6 +280,22 @@ device_removed(struct udev_device *device)
     char *value;
     const char *syspath = udev_device_get_syspath(device);
 
+#ifdef CONFIG_UDEV_KMS
+    if (!strcmp(udev_device_get_subsystem(device), "drm")) {
+        const char *sysname = udev_device_get_sysname(device);
+        const char *path = udev_device_get_devnode(device);
+
+        if (strncmp(sysname,"card", 4) != 0)
+            return;
+        ErrorF("removing GPU device %s %d\n", syspath, path);
+        if (!path)
+            return;
+
+        config_udev_odev_setup_attribs(path, syspath, DeleteGPUDeviceRequest);
+        return;
+    }
+#endif
+
     if (asprintf(&value, "udev:%s", syspath) == -1)
         return;
 
@@ -301,39 +337,55 @@ block_handler(pointer data, struct timeval **tv, pointer read_mask)
 }
 
 int
-config_udev_init(void)
+config_udev_pre_init(void)
 {
     struct udev *udev;
-    struct udev_enumerate *enumerate;
-    struct udev_list_entry *devices, *device;
 
     udev = udev_new();
     if (!udev)
         return 0;
+
     udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
     if (!udev_monitor)
         return 0;
 
     udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "input",
                                                     NULL);
-    udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "tty", NULL); /* For Wacom serial devices */
+    /* For Wacom serial devices */
+    udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "tty", NULL);
+#ifdef CONFIG_UDEV_KMS
+    /* For output GPU devices */
+    udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "drm", NULL);
+#endif
 
 #ifdef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG
     if (SeatId && strcmp(SeatId, "seat0"))
         udev_monitor_filter_add_match_tag(udev_monitor, SeatId);
 #endif
-
     if (udev_monitor_enable_receiving(udev_monitor)) {
         ErrorF("config/udev: failed to bind the udev monitor\n");
         return 0;
     }
+    return 1;
+}
+
+int
+config_udev_init(void)
+{
+    struct udev *udev;
+    struct udev_enumerate *enumerate;
+    struct udev_list_entry *devices, *device;
 
+    udev = udev_monitor_get_udev(udev_monitor);
     enumerate = udev_enumerate_new(udev);
     if (!enumerate)
         return 0;
 
     udev_enumerate_add_match_subsystem(enumerate, "input");
     udev_enumerate_add_match_subsystem(enumerate, "tty");
+#ifdef CONFIG_UDEV_KMS
+    udev_enumerate_add_match_subsystem(enumerate, "drm");
+#endif
 
 #ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG
     if (SeatId && strcmp(SeatId, "seat0"))
@@ -378,3 +430,72 @@ config_udev_fini(void)
     udev_monitor = NULL;
     udev_unref(udev);
 }
+
+#ifdef CONFIG_UDEV_KMS
+
+static Bool
+config_udev_odev_setup_attribs(const char *path, const char *syspath,
+                               config_odev_probe_proc_ptr probe_callback)
+{
+    struct OdevAttributes *attribs = config_odev_allocate_attribute_list();
+    int ret;
+
+    if (!attribs)
+        return FALSE;
+
+    ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_PATH, path);
+    if (ret == FALSE)
+        goto fail;
+
+    ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_SYSPATH, syspath);
+    if (ret == FALSE)
+        goto fail;
+
+    /* ownership of attribs is passed to probe layer */
+    probe_callback(attribs);
+    return TRUE;
+fail:
+    config_odev_free_attributes(attribs);
+    free(attribs);
+    return FALSE;
+}
+
+void
+config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback)
+{
+    struct udev *udev;
+    struct udev_enumerate *enumerate;
+    struct udev_list_entry *devices, *device;
+
+    udev = udev_monitor_get_udev(udev_monitor);
+    enumerate = udev_enumerate_new(udev);
+    if (!enumerate)
+        return;
+
+    udev_enumerate_add_match_subsystem(enumerate, "drm");
+    udev_enumerate_add_match_sysname(enumerate, "card[0-9]*");
+    udev_enumerate_scan_devices(enumerate);
+    devices = udev_enumerate_get_list_entry(enumerate);
+    udev_list_entry_foreach(device, devices) {
+        const char *syspath = udev_list_entry_get_name(device);
+        struct udev_device *udev_device = udev_device_new_from_syspath(udev, syspath);
+        const char *path = udev_device_get_devnode(udev_device);
+        const char *sysname = udev_device_get_sysname(udev_device);
+
+        if (!path || !syspath)
+            goto no_probe;
+        else if (strcmp(udev_device_get_subsystem(udev_device), "drm") != 0)
+            goto no_probe;
+        else if (strncmp(sysname, "card", 4) != 0)
+            goto no_probe;
+
+        config_udev_odev_setup_attribs(path, syspath, probe_callback);
+
+    no_probe:
+        udev_device_unref(udev_device);
+    }
+    udev_enumerate_unref(enumerate);
+    return;
+}
+#endif
+
index 7a5e8cc..fb114bd 100644 (file)
@@ -53,8 +53,10 @@ struct nameint {
     int val;
     char *name;
 } kbdenc[] = {
-    KB_OVRENC, KB_ENCTAB, {
-0}};
+    KB_OVRENC,
+    KB_ENCTAB,
+    {0}
+};
 
 struct nameint kbdvar[] = {
     {KB_NODEAD | KB_SG, "de_nodeadkeys"},
index 4a29dce..969d86b 100644 (file)
@@ -26,8 +26,9 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.12.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2012-05-29"
+AC_INIT([xorg-server], 1.12.99.905, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2012-08-21"
+RELEASE_NAME="Splashing Orca"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
@@ -271,10 +272,11 @@ AC_CACHE_CHECK([for SYSV IPC],
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/shm.h>
+#include <sys/stat.h>
 ],[
 { 
     int id;
-    id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R);
+    id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR);
     if (id < 0) return -1;
     return shmctl(id, IPC_RMID, 0);
 }],
@@ -593,7 +595,7 @@ dnl Extensions.
 AC_ARG_ENABLE(registry,       AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes])
 AC_ARG_ENABLE(composite,      AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
 AC_ARG_ENABLE(gesture,       AS_HELP_STRING([--disable-gesture], [Build Gesture extension (default: enabled)]), [GESTURE=$enableval], [GESTURE=yes])
-AC_ARG_ENABLE(mitshm,         AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
+AC_ARG_ENABLE(mitshm,         AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: auto)]), [MITSHM=$enableval], [MITSHM=auto])
 AC_ARG_ENABLE(xres,           AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
 AC_ARG_ENABLE(record,         AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes])
 AC_ARG_ENABLE(xv,             AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
@@ -615,11 +617,11 @@ AC_ARG_ENABLE(dbe,            AS_HELP_STRING([--disable-dbe], [Build DBE extensi
 AC_ARG_ENABLE(xf86bigfont,    AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no])
 AC_ARG_ENABLE(dpms,           AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
 AC_ARG_ENABLE(config-udev,    AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto])
+AC_ARG_ENABLE(config-udev-kms,    AS_HELP_STRING([--enable-config-udev-kms], [Build udev kms support (default: auto)]), [CONFIG_UDEV_KMS=$enableval], [CONFIG_UDEV_KMS=auto])
 AC_ARG_ENABLE(config-dbus,    AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no])
 AC_ARG_ENABLE(config-hal,     AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
 AC_ARG_ENABLE(config-wscons,  AS_HELP_STRING([--enable-config-wscons], [Build wscons config support (default: auto)]), [CONFIG_WSCONS=$enableval], [CONFIG_WSCONS=auto])
 AC_ARG_ENABLE(xfree86-utils,     AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
-AC_ARG_ENABLE(xaa,               AS_HELP_STRING([--enable-xaa], [Build XAA (default: enabled)]), [XAA=$enableval], [XAA=yes])
 AC_ARG_ENABLE(vgahw,          AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes])
 AC_ARG_ENABLE(vbe,            AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes])
 AC_ARG_ENABLE(int10-module,     AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes])
@@ -657,6 +659,7 @@ AC_MSG_CHECKING([to see if we can install the Xorg server as root])
 if test "x$SETUID" = "xauto" ; then
        case $host_os in
            cygwin*)            SETUID="no"  ;;
+           mingw*)             SETUID="no"  ;;
            darwin*)            SETUID="no"  ;;
            *)
                case $host_cpu in
@@ -699,12 +702,22 @@ AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])
 dnl DDX Detection... Yes, it's ugly to have it here... but we need to
 dnl handle this early on so that we don't require unsupported extensions
 case $host_os in
-       cygwin*)
+       cygwin* | mingw*)
+               CONFIG_DBUS_API=no
+               CONFIG_HAL=no
+               CONFIG_UDEV=no
+               CONFIG_UDEV_KMS=no
                DGA=no
                DRI2=no
+               INT10MODULE=no
+               PCI=no
+               VGAHW=no
+               VBE=no
+               XF86UTILS=no
                XF86VIDMODE=no
                XSELINUX=no
                XV=no
+               SYMBOL_VISIBILITY=no
                ;;
        darwin*)
                PCI=no
@@ -753,7 +766,6 @@ dnl Extension section
 dnl ---------------------------------------------------------------------------
 XEXT_INC='-I$(top_srcdir)/Xext'
 XEXT_LIB='$(top_builddir)/Xext/libXext.la'
-XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
 
 dnl Optional modules
 VIDEOPROTO="videoproto"
@@ -761,13 +773,13 @@ COMPOSITEPROTO="compositeproto >= 0.4"
 GESTUREPROTO="gestureproto >= 0.1.0"
 RECORDPROTO="recordproto >= 1.13.99.1"
 SCRNSAVERPROTO="scrnsaverproto >= 1.1"
-RESOURCEPROTO="resourceproto"
+RESOURCEPROTO="resourceproto >= 1.2.0"
 DRIPROTO="xf86driproto >= 2.1.0"
-DRI2PROTO="dri2proto >= 2.6"
+DRI2PROTO="dri2proto >= 2.8"
 XINERAMAPROTO="xineramaproto"
 BIGFONTPROTO="xf86bigfontproto >= 1.2.0"
 DGAPROTO="xf86dgaproto >= 2.0.99.1"
-GLPROTO="glproto >= 1.4.14"
+GLPROTO="glproto >= 1.4.16"
 DMXPROTO="dmxproto >= 2.2.99.1"
 VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
 WINDOWSWMPROTO="windowswmproto"
@@ -775,7 +787,7 @@ APPLEWMPROTO="applewmproto >= 1.4"
 
 dnl Required modules
 XPROTO="xproto >= 7.0.22"
-RANDRPROTO="randrproto >= 1.2.99.3"
+RANDRPROTO="randrproto >= 1.4.0"
 RENDERPROTO="renderproto >= 0.11"
 XEXTPROTO="xextproto >= 7.1.99"
 INPUTPROTO="inputproto >= 2.1.99.6"
@@ -828,11 +840,16 @@ AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes])
 if test "x$CONFIG_UDEV" = xyes; then
        CONFIG_DBUS_API=no
        CONFIG_HAL=no
+       if test "x$CONFIG_UDEV_KMS" = xauto; then
+               CONFIG_UDEV_KMS="$HAVE_LIBUDEV"
+       fi
        if ! test "x$HAVE_LIBUDEV" = xyes; then
                AC_MSG_ERROR([udev configuration API requested, but libudev is not installed])
        fi
        AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug])
-
+       if test "x$CONFIG_UDEV_KMS" = xyes; then
+               AC_DEFINE(CONFIG_UDEV_KMS, 1, [Use libudev for kms enumeration])
+       fi
        SAVE_LIBS=$LIBS
        SAVE_CFLAGS=$CFLAGS
        CFLAGS=$UDEV_CFLAGS
@@ -842,6 +859,7 @@ if test "x$CONFIG_UDEV" = xyes; then
        LIBS=$SAVE_LIBS
        CFLAGS=$SAVE_CFLAGS
 fi
+AM_CONDITIONAL(CONFIG_UDEV_KMS, [test "x$CONFIG_UDEV_KMS" = xyes])
 
 dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
 dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config
@@ -1000,6 +1018,9 @@ if test "x$COMPOSITE" = xyes; then
        COMPOSITE_INC='-I$(top_srcdir)/composite'
 fi
 
+if test "x$MITSHM" = xauto; then
+       MITSHM="$ac_cv_sysv_ipc"
+fi
 AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes])
 if test "x$MITSHM" = xyes; then
        AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension])
@@ -1070,13 +1091,13 @@ if test "x$GLX_USE_TLS" = xyes ; then
        GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread"
 fi
 AC_SUBST([GLX_DEFINES])
+AC_SUBST([GLX_SYS_LIBS])
 
 AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
 if test "x$DRI" = xyes; then
        AC_DEFINE(XF86DRI, 1, [Build DRI extension])
-       PKG_CHECK_MODULES([DRIPROTO], [$DRIPROTO])
-       PKG_CHECK_MODULES([DRI], $GLPROTO $LIBDRI)
-       AC_SUBST(DRIPROTO_CFLAGS)
+       REQUIRED_MODULES="$REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI"
+       SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI"
 fi
 
 PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO,
@@ -1093,7 +1114,7 @@ case "$DRI2,$HAVE_DRI2PROTO" in
 esac
 AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
 
-if test "x$DRI" = xyes || test "x$DRI2" = xyes; then
+if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then
        if test "x$DRM" = xyes; then
                AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
                PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
@@ -1159,6 +1180,7 @@ AM_CONDITIONAL(DBE, [test "x$DBE" = xyes])
 if test "x$DBE" = xyes; then
        AC_DEFINE(DBE, 1, [Support DBE extension])
        DBE_LIB='$(top_builddir)/dbe/libdbe.la'
+       DBE_INC='-I$(top_srcdir)/dbe'
 fi
 
 AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes])
@@ -1196,7 +1218,6 @@ XI_LIB='$(top_builddir)/Xi/libXi.la'
 XI_INC='-I$(top_srcdir)/Xi'
 
 AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes)
-AM_CONDITIONAL(XAA, test "x$XAA" = xyes)
 AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes)
 AM_CONDITIONAL(VBE, test "x$VBE" = xyes)
 AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes)
@@ -1349,7 +1370,7 @@ CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
 
 # SHA1 hashing
 AC_ARG_WITH([sha1],
-            [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto],
+            [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
                             [choose SHA1 implementation])])
 AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
 if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then
@@ -1375,6 +1396,19 @@ if test "x$with_sha1" = xCommonCrypto; then
                [Use CommonCrypto SHA1 functions])
        SHA1_LIBS=""
 fi
+dnl stdcall functions cannot be tested with AC_CHECK_LIB
+AC_CHECK_HEADER([wincrypt.h], [HAVE_SHA1_IN_CRYPTOAPI=yes], [], [#include <windows.h>])
+if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_CRYPTOAPI" = xyes; then
+       with_sha1=CryptoAPI
+fi
+if test "x$with_sha1" = xCryptoAPI && test "x$HAVE_SHA1_IN_CRYPTOAPI" != xyes; then
+       AC_MSG_ERROR([CryptoAPI requested but not found])
+fi
+if test "x$with_sha1" = xCryptoAPI; then
+       AC_DEFINE([HAVE_SHA1_IN_CRYPTOAPI], [1],
+               [Use CryptoAPI SHA1 functions])
+       SHA1_LIBS=""
+fi
 AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
 if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then
        with_sha1=libmd
@@ -1471,7 +1505,41 @@ AC_SUBST([UTILS_SYS_LIBS])
 # Some platforms require extra flags to do this.   libtool should set the
 # necessary flags for each platform when -export-dynamic is passed to it.
 LD_EXPORT_SYMBOLS_FLAG="-export-dynamic"
+LD_NO_UNDEFINED_FLAG=
+XORG_DRIVER_LIBS=
+case "$host_os" in
+    cygwin*)
+       LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-all,--out-implib,lib\$@.a"
+       LD_NO_UNDEFINED_FLAG="-no-undefined -Wl,\$(top_builddir)/hw/xfree86/libXorg.exe.a"
+       XORG_DRIVER_LIBS="-lXorg.exe -L\${moduledir} -lshadow -lfb -no-undefined"
+       CYGWIN=yes
+       ;;
+    solaris*)
+       # We use AC_LINK_IFELSE to generate a temporary program conftest$EXEEXT
+       # that we can link against for testing if the system linker is new
+       # enough to support -z parent=<program> for verifying loadable modules
+       # are only calling functions defined in either the loading program or
+       # the libraries they're linked with.
+       AC_LINK_IFELSE(
+           [AC_LANG_SOURCE([int main(int argc, char **argv) { return 0; }])],
+           [mv conftest$EXEEXT conftest.parent
+            XORG_CHECK_LINKER_FLAGS([-Wl,-z,parent=conftest.parent -G],
+               [LD_NO_UNDEFINED_FLAG="-Wl,-z,defs -Wl,-z,parent=\$(top_builddir)/hw/xfree86/Xorg"
+# Not set yet, since this gets exported in xorg-server.pc to all the drivers,
+# and they're not all fixed to build correctly with it yet.
+#               XORG_DRIVER_LIBS="-Wl,-z,defs -Wl,-z,parent=${bindir}/Xorg"
+         ],[],
+               [AC_LANG_SOURCE([extern int main(int argc, char **argv);
+                       int call_main(void) { return main(0, NULL); }])])
+            rm -f conftest.parent
+           ])
+       ;;
+esac
 AC_SUBST([LD_EXPORT_SYMBOLS_FLAG])
+AC_SUBST([LD_NO_UNDEFINED_FLAG])
+AC_SUBST([XORG_DRIVER_LIBS])
+AM_CONDITIONAL([CYGWIN], [test x"$CYGWIN" = xyes])
+AM_CONDITIONAL([NO_UNDEFINED], [test x"$LD_NO_UNDEFINED_FLAG" != x])
 
 dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so
 dnl we need to replicate that here until those can all be fixed
@@ -1484,7 +1552,7 @@ AC_EGREP_CPP([I_AM_SVR4],[
 AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4])
 AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
 
-XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $GESTURE_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC"
+XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $GESTURE_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC $DBE_INC"
 
 dnl ---------------------------------------------------------------------------
 dnl DDX section.
@@ -1532,6 +1600,7 @@ if test "x$XORG" = xauto; then
        XORG="yes"
        case $host_os in
                cygwin*) XORG="no" ;;
+               mingw*)  XORG="no" ;;
                darwin*) XORG="no" ;;
        esac
 fi
@@ -1542,7 +1611,7 @@ if test "x$XORG" = xyes; then
        XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
        XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
        XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
-       XORG_LIBS="$GESTURE_LIB $COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB"
+       XORG_LIBS="$GESTURE_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB"
 
        dnl ==================================================================
        dnl symbol visibility
@@ -1596,8 +1665,8 @@ if test "x$XORG" = xyes; then
 
        PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
        SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS"
-       XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS"
-       XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
+       XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $LIBDRM_LIBS"
+       XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS $LIBDRM_CFLAGS"
 
        AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation])
        AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
@@ -1614,6 +1683,10 @@ if test "x$XORG" = xyes; then
        fi
        AC_MSG_RESULT([$PCI])
 
+       if test "x$CONFIG_UDEV_KMS" = xyes; then
+               AC_DEFINE(XSERVER_PLATFORM_BUS, 1, [X server supports platform device enumeration])
+       fi
+       AC_MSG_RESULT([$XSERVER_PLATFORM_BUS])
        dnl ===================================================================
        dnl ==================== end of PCI configuration =====================
        dnl ===================================================================
@@ -1752,7 +1825,6 @@ if test "x$XORG" = xyes; then
        AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
        AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
        AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
-       AC_DEFINE(XFree86LOADER, 1, [Building loadable XFree86 server])
        AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
        AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
        AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
@@ -1802,7 +1874,7 @@ AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes])
 AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes])
 AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
 AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
-
+AM_CONDITIONAL([XORG_BUS_PLATFORM], [test "x$CONFIG_UDEV_KMS" = xyes])
 dnl XWin DDX
 
 AC_MSG_CHECKING([whether to build XWin DDX])
@@ -1842,11 +1914,12 @@ if test "x$XWIN" = xyes; then
                        XWIN_SERVER_NAME=Xming
                        AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location])
                        AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets])
-                       XWIN_SYS_LIBS=-lwinsock2
+                       XWIN_SYS_LIBS=-lws2_32
                        ;;
        esac
+
        XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB"
-       XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS"
+       XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS $GLX_SYS_LIBS"
        AC_SUBST(XWIN_LIBS)
        AC_SUBST(XWIN_SERVER_NAME)
        AC_SUBST(XWIN_SYS_LIBS)
@@ -1933,6 +2006,7 @@ if test "x$DMX" = xauto; then
        DMX="$have_dmx"
        case $host_os in
                cygwin*) DMX="no" ;;
+               mingw*)  DMX="no" ;;
                darwin*) DMX="no" ;;
        esac
 fi
@@ -2160,7 +2234,6 @@ miext/Makefile
 miext/sync/Makefile
 miext/damage/Makefile
 miext/shadow/Makefile
-miext/cw/Makefile
 miext/rootless/Makefile
 os/Makefile
 randr/Makefile
@@ -2176,7 +2249,6 @@ hw/xfree86/common/Makefile
 hw/xfree86/common/xf86Build.h
 hw/xfree86/ddc/Makefile
 hw/xfree86/dixmods/Makefile
-hw/xfree86/dixmods/extmod/Makefile
 hw/xfree86/doc/Makefile
 hw/xfree86/dri/Makefile
 hw/xfree86/dri2/Makefile
@@ -2203,7 +2275,6 @@ hw/xfree86/shadowfb/Makefile
 hw/xfree86/vbe/Makefile
 hw/xfree86/vgahw/Makefile
 hw/xfree86/x86emu/Makefile
-hw/xfree86/xaa/Makefile
 hw/xfree86/utils/Makefile
 hw/xfree86/utils/man/Makefile
 hw/xfree86/utils/cvt/Makefile
index 35f7620..4d4cf44 100644 (file)
@@ -4,5 +4,4 @@ AM_CFLAGS = $(DIX_CFLAGS)
 
 libdamageext_la_SOURCES =      \
        damageext.c             \
-       damageext.h             \
        damageextint.h
index f21f71c..a942ffa 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "damageextint.h"
 #include "protocol-versions.h"
+#include "extinit.h"
 
 static unsigned char DamageReqCode;
 static int DamageEventBase;
@@ -46,15 +47,17 @@ DamageExtNotify(DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
     int i;
 
     UpdateCurrentTimeIf();
-    ev.type = DamageEventBase + XDamageNotify;
-    ev.level = pDamageExt->level;
-    ev.drawable = pDamageExt->drawable;
-    ev.damage = pDamageExt->id;
-    ev.timestamp = currentTime.milliseconds;
-    ev.geometry.x = pDrawable->x;
-    ev.geometry.y = pDrawable->y;
-    ev.geometry.width = pDrawable->width;
-    ev.geometry.height = pDrawable->height;
+    ev = (xDamageNotifyEvent) {
+        .type = DamageEventBase + XDamageNotify,
+        .level = pDamageExt->level,
+        .drawable = pDamageExt->drawable,
+        .damage = pDamageExt->id,
+        .timestamp = currentTime.milliseconds,
+        .geometry.x = pDrawable->x,
+        .geometry.y = pDrawable->y,
+        .geometry.width = pDrawable->width,
+        .geometry.height = pDrawable->height
+    };
     if (pBoxes) {
         for (i = 0; i < nBoxes; i++) {
             ev.level = pDamageExt->level;
@@ -126,14 +129,16 @@ static int
 ProcDamageQueryVersion(ClientPtr client)
 {
     DamageClientPtr pDamageClient = GetDamageClient(client);
-    xDamageQueryVersionReply rep;
+    xDamageQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     REQUEST(xDamageQueryVersionReq);
 
     REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+
     if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) {
         rep.majorVersion = stuff->majorVersion;
         rep.minorVersion = stuff->minorVersion;
@@ -154,7 +159,7 @@ ProcDamageQueryVersion(ClientPtr client)
         swapl(&rep.majorVersion);
         swapl(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDamageQueryVersionReply), &rep);
     return Success;
 }
 
index b7e63e0..2723379 100644 (file)
@@ -37,7 +37,6 @@
 #include "windowstr.h"
 #include "selection.h"
 #include "scrnintstr.h"
-#include "damageext.h"
 #include "damage.h"
 #include "xfixes.h"
 
index ca7f3e2..9039d80 100644 (file)
--- a/dbe/dbe.c
+++ b/dbe/dbe.c
@@ -42,6 +42,7 @@
 #include <X11/Xproto.h>
 #include "scrnintstr.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include "gcstruct.h"
 #include "dixstruct.h"
 #define NEED_DBE_PROTOCOL
@@ -118,21 +119,21 @@ static int
 ProcDbeGetVersion(ClientPtr client)
 {
     /* REQUEST(xDbeGetVersionReq); */
-    xDbeGetVersionReply rep;
+    xDbeGetVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = DBE_MAJOR_VERSION,
+        .minorVersion = DBE_MINOR_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xDbeGetVersionReq);
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = DBE_MAJOR_VERSION;
-    rep.minorVersion = DBE_MINOR_VERSION;
-
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
     }
 
-    WriteToClient(client, sizeof(xDbeGetVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDbeGetVersionReply), &rep);
 
     return Success;
 
@@ -667,10 +668,12 @@ ProcDbeGetVisualInfo(ClientPtr client)
         length += pScrVisInfo[i].count * sizeof(xDbeVisInfo);
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = bytes_to_int32(length);
-    rep.m = count;
+    rep = (xDbeGetVisualInfoReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(length),
+        .m = count
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
@@ -679,7 +682,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
     }
 
     /* Send off reply. */
-    WriteToClient(client, sizeof(xDbeGetVisualInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDbeGetVisualInfoReply), &rep);
 
     for (i = 0; i < count; i++) {
         CARD32 data32;
@@ -693,7 +696,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
             swapl(&data32);
         }
 
-        WriteToClient(client, sizeof(CARD32), (char *) &data32);
+        WriteToClient(client, sizeof(CARD32), &data32);
 
         /* Now send off visual info items. */
         for (j = 0; j < pScrVisInfo[i].count; j++) {
@@ -717,8 +720,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
             }
 
             /* Write visualID(32), depth(8), perfLevel(8), and pad(16). */
-            WriteToClient(client, 2 * sizeof(CARD32),
-                          (char *) &visInfo.visualID);
+            WriteToClient(client, 2 * sizeof(CARD32), &visInfo.visualID);
         }
     }
 
@@ -756,7 +758,11 @@ static int
 ProcDbeGetBackBufferAttributes(ClientPtr client)
 {
     REQUEST(xDbeGetBackBufferAttributesReq);
-    xDbeGetBackBufferAttributesReply rep;
+    xDbeGetBackBufferAttributesReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     DbeWindowPrivPtr pDbeWindowPriv;
     int rc;
 
@@ -772,18 +778,13 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
         rep.attributes = None;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.attributes);
     }
 
-    WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply),
-                  (char *) &rep);
+    WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply), &rep);
     return Success;
 
 }                               /* ProcDbeGetbackBufferAttributes() */
index 9ea9eb6..f9d938a 100644 (file)
@@ -83,8 +83,6 @@ typedef struct {
 /* Marker for free elements in the buffer ID array. */
 #define DBE_FREE_ID_ELEMENT    0
 
-extern _X_EXPORT void DbeExtensionInit(void);
-
 /* TYPEDEFS */
 
 /* Record used to pass swap information between DIX and DDX swapping
diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644 (file)
index b09a1ab..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-------------------------------------------------------
-Quick Guide To Patching This Package For The Impatient
-------------------------------------------------------
-
-1. Make sure you have quilt installed
-2. Unpack the package as usual with "dpkg-source -x"
-3. Run the "patch" target in debian/rules
-4. Create a new patch with "quilt new" (see quilt(1))
-5. Edit all the files you want to include in the patch with "quilt edit" 
-   (see quilt(1)).
-6. Write the patch with "quilt refresh" (see quilt(1))
-7. Run the "clean" target in debian/rules
-
-Alternatively, instead of using quilt directly, you can drop the patch in to 
-debian/patches and add the name of the patch to debian/patches/series.
-
-------------------------------------
-Guide To The X Strike Force Packages
-------------------------------------
-
-The X Strike Force team maintains X packages in git repositories on
-git.debian.org in the pkg-xorg subdirectory. Most upstream packages
-are actually maintained in git repositories as well, so they often
-just need to be pulled into git.debian.org in a "upstream-*" branch.
-Otherwise, the upstream sources are manually installed in the Debian
-git repository.
-
-The .orig.tar.gz upstream source file could be generated using this
-"upstream-*" branch in the Debian git repository but it is actually
-copied from upstream tarballs directly.
-
-Due to X.org being highly modular, packaging all X.org applications
-as their own independent packages would have created too many Debian
-packages. For this reason, some X.org applications have been grouped
-into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
-x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
-Most packages, including the X.org server itself and all libraries
-and drivers are, however maintained independently.
-
-The Debian packaging is added by creating the "debian-*" git branch
-which contains the aforementioned "upstream-*" branch plus the debian/
-repository files.
-When a patch has to be applied to the Debian package, two solutions
-are involved:
-* If the patch is available in one of the upstream branches, it
-  may be git'cherry-picked into the Debian repository. In this
-  case, it appears directly in the .diff.gz.
-* Otherwise, the patch is added to debian/patches/ which is managed
-  with quilt as documented in /usr/share/doc/quilt/README.source.
-
-quilt is actually invoked by the Debian X packaging through a larger
-set of scripts called XSFBS. XSFBS brings some other X specific
-features such as managing dependencies and conflicts due to the video
-and input driver ABIs.
-XSFBS itself is maintained in a separate repository at
-  git://git.debian.org/pkg-xorg/xsfbs.git
-and it is pulled inside the other Debian X repositories when needed.
-
-The XSFBS patching system requires a build dependency on quilt. Also
-a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
-so that the XSFBS patching occurs before the actual build. So the
-very first target of the build (likely the one running autoreconf)
-should depend on $(STAMP_DIR)/patch. It should also not depend on
-anything so that parallel builds are correctly supported (nothing
-should probably run while patching is being done). And finally, the
-clean target should depend on the xsfclean target so that patches
-are unapplied on clean.
-
-When the upstream sources contain some DFSG-nonfree files, they are
-listed in text files in debian/prune/ in the "debian-*" branch of
-the Debian repository. XSFBS' scripts then take care of removing
-these listed files during the build so as to generate a modified
-DFSG-free .orig.tar.gz tarball.
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100755 (executable)
index cd94c43..0000000
+++ /dev/null
@@ -1,5805 +0,0 @@
-xorg-server (2:1.9.3-25slp2) unstable; urgency=low
-
-  * Fix xkb patch in packaging/xorg-server.spec file
-    - Change --with-xkb-path from /opt/etc/X11/xkb to /usr/etc/X11/xkb
-    - Change --with-xkb-output from /opt/etc/X11/xkb to /usr/etc/X11/xkb
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-25slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Mon, 18 Jun 2012 10:42:28 +0900
-
-xorg-server (2:1.9.3-24slp2) unstable; urgency=low
-
-  * get still on pixmap
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-24slp2
-
- -- Boram Park <boram1288.park@samsung.com>  Wed, 07 Mar 2012 21:25:28 +0900
-
-xorg-server (2:1.9.3-23slp2) unstable; urgency=low
-
-  * Change the value of --with-xkb-path and --with-xkb-output from /opt/etc/X11/xkb to /usr/etc/X11/xkb
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-23slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 07 Mar 2012 16:40:08 +0900
-
-xorg-server (2:1.9.3-22slp2) unstable; urgency=low
-
-  * fix error of applying patch
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-22slp2
-
- -- Boram Park <boram1288.park@samsung.com>  Tue, 14 Feb 2012 19:35:42 +0900
-
-xorg-server (2:1.9.3-21slp2) unstable; urgency=low
-
-  * put video on pixmap
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-21slp2
-
- -- Boram Park <boram1288.park@samsung.com>  Tue, 14 Feb 2012 09:51:15 +0900
-
-xorg-server (2:1.9.3-20slp2) unstable; urgency=low
-
-  * Add libkms1 into "Depends" section for xserver-xorg-core pkg
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-20slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 06 Dec 2011 22:14:20 +0900
-
-xorg-server (2:1.9.3-19slp2) unstable; urgency=low
-
-  * mi,gesture: Add X Gesture Extension code
-  * dix: add DRI2,SYNC protocol
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-19slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 02 Nov 2011 16:31:56 +0900
-
-xorg-server (2:1.9.3-18slp2) unstable; urgency=low
-
-  * remove slp patches related to dri2
-  * update the patches related to dri2
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-18slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Mon, 10 Oct 2011 15:56:43 +0900
-
-xorg-server (2:1.9.3-17slp2) unstable; urgency=low
-
-  * add feature to support hw overlay
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-17slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Wed, 21 Sep 2011 16:00:04 +0900
-
-xorg-server (2:1.9.3-16slp2) unstable; urgency=low
-
-  * Enable udev support for non-arm architecture(s)
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-16slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Mon, 22 Aug 2011 13:28:23 +0900
-
-xorg-server (2:1.9.3-15slp2) unstable; urgency=low
-
-  * Upload again due to version redundency
-  * Remove /hw/dmx/config/parser.c, /hw/dmx/config/parser.h, hw/xwin/winprefsyacc.c, hw/xwin/winprefsyacc.h
-    which will be made during build time
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-15slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Fri, 19 Aug 2011 21:32:53 +0900
-
-xorg-server (2:1.9.3-14slp2) unstable; urgency=low
-
-  * Remove /hw/dmx/config/parser.c, /hw/dmx/config/parser.h, hw/xwin/winprefsyacc.c, hw/xwin/winprefsyacc.h
-    which will be made during build time
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-14slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Fri, 19 Aug 2011 11:20:22 +0900
-
-xorg-server (2:1.9.3-13slp2) unstable; urgency=low
-
-  * Remove a macro (_F_UDEV_INPUT_HOTPLUGGING_)
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-13slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 12 Jul 2011 14:16:55 +0900
-
-xorg-server (2:1.9.3-12slp2) unstable; urgency=low
-
-  * remove features not to use any more
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-12slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Fri, 08 Jul 2011 16:09:23 +0900
-
-xorg-server (2:1.9.3-11slp2) unstable; urgency=low
-
-  * support for swapinterval 0
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-11slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Tue, 28 Jun 2011 13:36:19 +0900
-
-xorg-server (2:1.9.3-10slp2) unstable; urgency=low
-
-  * change the dri2 for the new dri2_drm architecture
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-10slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Fri, 03 Jun 2011 14:03:49 +0900
-
-xorg-server (2:1.9.3-9slp2) unstable; urgency=low
-
-  * disable updating grabTime for the first pointer(1st mt) device with the
-    other mt device's grabTime
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-9slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Mon, 18 Apr 2011 11:44:24 +0900
-
-xorg-server (2:1.9.3-8slp2) unstable; urgency=low
-
-  * oal rollback
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-8slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Fri, 08 Apr 2011 14:17:50 +0900
-
-xorg-server (2:1.9.3-7slp2) unstable; urgency=low
-
-  * work for oal
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-7slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Tue, 05 Apr 2011 10:28:50 +0900
-
-xorg-server (2:1.9.3-6slp2) unstable; urgency=low
-
-  * Implement dynamic miEventQueue handling in mieq.c
-    (The codes are with _F_DYNAMIC_MIEQ_ macros.)
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-6slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 22 Mar 2011 19:41:36 +0900
-
-xorg-server (2:1.9.3-5slp2) unstable; urgency=low
-
-  * add _F_CHECK_NULL_CLIENT_
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-5slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Thu, 10 Mar 2011 17:18:40 +0900
-
-xorg-server (2:1.9.3-4slp2) unstable; urgency=low
-
-  * xserver-xorg-core depends on udev at only arm
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-4slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Wed, 09 Mar 2011 16:32:22 +0900
-
-xorg-server (2:1.9.3-3slp2) unstable; urgency=low
-
-  * Modify config/udev.c to add a device for both 'add' and 'change' event
-    from udev daemon (newer than 152 version) by request from Karol Lewandowski
-    who is currently working for Poland R&D Center-Linux (MSD)
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-3slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Mon, 07 Mar 2011 17:27:57 +0900
-
-xorg-server (2:1.9.3-2slp2) unstable; urgency=low
-
-  * [X11R7.6] upgrade package
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-2slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Sat, 05 Mar 2011 01:50:49 +0900
-
-xorg-server (2:1.9.3-1slp2) unstable; urgency=low
-
-  * [X11R7.6] upgrade package
-  * Git: 165.213.180.234:slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.9.3-1slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Tue, 11 Jan 2011 20:32:10 +0900
-
-xorg-server (2:1.9.0-0ubuntu7) unstable; urgency=low
-
-  * debian/control:
-    - Tweak the breaks/conflicts for the virtual xserver-xorg-input
-      breaks to help apt in lucid deal with the upgrade.
-      With the apt in unstable this will be no longer needed ((LP: #614993)
-
- -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 16 Sep 2010 15:17:27 +0200
-
-xorg-server (2:1.9.0-0ubuntu6) unstable; urgency=low
-
-  [ Chase Douglas ]
-  * Fix udev USB product ID parsing (LP: #628214)
-    - debian/patches:
-      + 205_udev-product-ids.patch
-
-  [ Christopher James Halse Rogers ]
-  * debian/patches/206_intel_8xx_default_to_fbdev.patch:
-    - Don't autoload the intel driver on i830, i845g and i855.  These are
-      still too unstable with KMS/GEM.  X will autoload the fbdev driver
-      (if using KMS) or the vesa driver instead.  (LP: #633593)
-
- -- Christopher James Halse Rogers <raof@ubuntu.com>  Mon, 13 Sep 2010 18:48:54 +1000
-
-xorg-server (2:1.9.0-0ubuntu5) unstable; urgency=low
-
-  * debian/control:
-    - fix duplicated breaks for xserver-xorg-video-v4l
-
- -- Michael Vogt <michael.vogt@ubuntu.com>  Wed, 08 Sep 2010 10:57:49 +0200
-
-xorg-server (2:1.9.0-0ubuntu4) unstable; urgency=low
-
-  * debian/control:
-    - add more "breaks" for leftover drivers that have no
-      xserver 1.9 abi version, thanks to Jean-Baptiste Lallement
-      (LP: #614993)
-
- -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 31 Aug 2010 10:52:29 +0200
-
-xorg-server (2:1.9.0-0ubuntu3) unstable; urgency=low
-
-  * debian/control:
-    - add additional breaks for video drivers that have no ABI for
-      xserver 1.9 (LP: #614993)
-    - merge the "breaks" list from the debian git tree
-
- -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 31 Aug 2010 10:04:01 +0200
-
-xorg-server (2:1.9.0-0ubuntu2) unstable; urgency=low
-
-  * debian/control:
-    - add explict breaks from xserver-xorg-core against
-      xserver-xorg-video-v4l (<< 1:0.2.0-4ubuntu1) to ensure that
-      upgrades with universe disabled work (LP: #614993)
-
- -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 30 Aug 2010 15:40:07 +0200
-
-xorg-server (2:1.9.0-0ubuntu1) unstable; urgency=low
-
-  * Merge from (unreleased) Debian experimental.  Remaining Ubuntu changes:
-    - rules, control:
-      + Disable SELinux, libaudit-dev is not in main yet (LP 406226).
-        Drop libaudit-dev from build-deps.
-    - rules: Enable xcsecurity (LP 247537).
-    - local/xvfb-run*: Add correct docs about error codes (LP 328205)
-    - rules: Add --with-extra-module-dir to support GL alternatives.
-    - control: Xvfb depends on xauth, x11-xkb-utils. (LP 500102)
-    - rules, local/64-xorg-xkb.rules: Don't use keyboard-configuration
-      until it's available.
-    - control: Update some versioned Breaks for Ubuntu versions.
-    - debian/patches:
-      + 100_rethrow_signals.patch:
-        When aborting, re-raise signals for apport
-      + 109_fix-swcursor-crash.patch:
-        Avoid dereferencing null pointer while reloading cursors during
-        resume. (LP 371405)
-      + 111_armel-drv-fallbacks.patch:
-        Add support for armel driver fallbacks.
-      + 121_only_switch_vt_when_active.diff:
-        Add a check to prevent the X server from changing the VT when killing
-        GDM from the console.
-      + 122_xext_fix_card32_overflow_in_xauth.patch:
-        Fix server crash when ?\9cxauth generate??is called with large timeout.
-      + 157_check_null_modes.patch, 162_null_crtc_in_rotation.patch,
-        166_nullptr_xinerama_keyrepeat.patch, 167_nullptr_xisbread.patch
-        169_mipointer_nullptr_checks.patch,
-        172_cwgetbackingpicture_nullptr_check.patch:
-        Fix various segfaults in xserver by checking pointers for NULL
-        values before dereferencing them.
-      + 165_man_xorg_conf_no_device_ident.patch
-        Correct man page
-      + 168_glibc_trace_to_stderr.patch:
-        Report abort traces to stderr instead of terminal
-      + 184_virtual_devices_autodetect.patch:
-        Use vesa for qemu device, which is not supported by cirrus
-      + 187_edid_quirk_hp_nc8430.patch:
-        Quirk for another LPL monitor (LP 380009)
-      + 188_default_primary_to_first_busid.patch:
-        Pick the first device and carry on (LP 459512)
-      + 189_xserver_1.5.0_bg_none_root.patch:
-        Create a root window with no background.
-      + 190_cache-xkbcomp_output_for_fast_start_up.patch:
-        Cache keyboard settings.
-      + 191-Xorg-add-an-extra-module-path.patch:
-        Add support for the alternatives module path.
-      + 197_xvfb-randr.patch:
-        Adds xrandr support to xvfb. (LP 516123)
-      + 198_nohwaccess.patch:
-        Adds a -nohwaccess argument to make X not access the hardware
-        ports directly.
-      + 200_randr-null.patch:
-        Clarify a pointer initialization.
-      + 203_gestures-extension.patch:
-      + 202_xf86CoordinationsToWindows.patch:
-        Add gesture extension support (LP: 616678)
-      + debian/serverminver:
-        Bump for gesture support
-  * New upstream release:
-    - Fixes crash in DamageUnregister on session close (LP: #343694)
-    - Fixes crash with extremely large windows exposed by xpdf (Closes: #320627)
-  * Drop 17-fix-DRI2-segfault-when-clientGone.diff: fixed upstream in more
-    generality.
-  * debian/patches/204_fix-neg-sync-transition.patch:
-    - Fix edge case in SYNC extension resulting in GNOME screensaver's
-      fade-to-screensaver being uninteruptible.  (LP: #595555)
-
- -- Christopher James Halse Rogers <raof@ubuntu.com>  Tue, 24 Aug 2010 15:44:10 +1000
-
-xorg-server (2:1.8.99.905-1ubuntu3) unstable; urgency=low
-
-  * Bump debian/serverminver for gesture support
-
- -- Chase Douglas <chase.douglas@ubuntu.com>  Fri, 20 Aug 2010 16:35:22 -0400
-
-xorg-server (2:1.8.99.905-1ubuntu2) unstable; urgency=low
-
-    * Add in gesture support (LP: #616678)
-      - add debian/patches/203_gestures-extension.patch
-        and debian/patches/202_xf86CoordinationsToWindows.patch
-      - debian/rules:
-        - add configure option to enable gesture
-
- -- Chase Douglas <chase.douglas@ubuntu.com>  Mon, 09 Aug 2010 14:33:40 +0000
-
-xorg-server (2:1.8.99.905-1ubuntu1) unstable; urgency=low
-
-  * Merge from (unreleased) Debian experimental.  Remaining Ubuntu changes:
-    - rules, control:
-      + Disable SELinux, libaudit-dev is not in main yet (LP 406226).
-        Drop libaudit-dev from build-deps.
-    - rules: Enable xcsecurity (LP 247537).
-    - local/xvfb-run*: Add correct docs about error codes (LP 328205)
-    - rules: Add --with-extra-module-dir to support GL alternatives.
-    - control: Xvfb depends on xauth, x11-xkb-utils. (LP 500102)
-    - rules, local/64-xorg-xkb.rules: Don't use keyboard-configuration
-      until it's available.
-    - control: Update some versioned Breaks for Ubuntu versions.
-    - debian/patches:
-      + 100_rethrow_signals.patch:
-        When aborting, re-raise signals for apport
-      + 109_fix-swcursor-crash.patch:
-        Avoid dereferencing null pointer while reloading cursors during
-        resume. (LP 371405)
-      + 111_armel-drv-fallbacks.patch:
-        Add support for armel driver fallbacks.
-      + 121_only_switch_vt_when_active.diff:
-        Add a check to prevent the X server from changing the VT when killing
-        GDM from the console.
-      + 122_xext_fix_card32_overflow_in_xauth.patch:
-        Fix server crash when ?\9cxauth generate??is called with large timeout.
-      + 157_check_null_modes.patch, 162_null_crtc_in_rotation.patch,
-        166_nullptr_xinerama_keyrepeat.patch, 167_nullptr_xisbread.patch
-        169_mipointer_nullptr_checks.patch,
-        172_cwgetbackingpicture_nullptr_check.patch:
-        Fix various segfaults in xserver by checking pointers for NULL
-        values before dereferencing them.
-      + 165_man_xorg_conf_no_device_ident.patch
-        Correct man page
-      + 168_glibc_trace_to_stderr.patch:
-        Report abort traces to stderr instead of terminal
-      + 184_virtual_devices_autodetect.patch:
-        Use vesa for qemu device, which is not supported by cirrus
-      + 187_edid_quirk_hp_nc8430.patch:
-        Quirk for another LPL monitor (LP 380009)
-      + 188_default_primary_to_first_busid.patch:
-        Pick the first device and carry on (LP 459512)
-      + 189_xserver_1.5.0_bg_none_root.patch:
-        Create a root window with no background.
-      + 190_cache-xkbcomp_output_for_fast_start_up.patch:
-        Cache keyboard settings.
-      + 191-Xorg-add-an-extra-module-path.patch:
-        Add support for the alternatives module path.
-      + 197_xvfb-randr.patch:
-        Adds xrandr support to xvfb. (LP 516123)
-      + 198_nohwaccess.patch:
-        Adds a -nohwaccess argument to make X not access the hardware
-        ports directly.
-      + 200_randr-null.patch:
-        Clarify a pointer initialization.
-  * Update changelog entries for 1.8.1.902-1 which became 1.8.99.904-1
-  * Drop 196_xvfbscreeninit-handling.patch: it's semantically empty, and now
-    doesn't apply.  Merge remaining #include change into 197_xvfb-randr.patch
-  * New upstream version will start correctly when no outputs are connected,
-    as long as the video driver can dynamically resize the framebuffer
-    (true for all KMS drivers) (LP: #337889)
-  * New upstream version fixes crash on non-admin logout with KDE (LP: #569879)
-  * Refresh 111_armel-drv-fallbacks.patch to fix the build on armel
-
- -- Christopher James Halse Rogers <raof@ubuntu.com>  Thu, 05 Aug 2010 11:25:14 +1000
-
-xorg-server (2:1.8.99.905-1) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * Drop recommends on xbase-clients.
-  * Add xauth to xserver-common recommends.
-  * Bump Standards-Version to 3.9.0.
-  * Don't install serverminver, drivers shouldn't use this anymore.
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 17 Jul 2010 11:13:32 +0100
-
-xorg-server (2:1.8.99.904-1) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * Install the upstream changelog in xserver-common, instead of duplicating
-    its 1MB in all other packages.
-  * Stop repacking the tarball: the non-modifiable README.DRI was removed
-    upstream.
-  * Bump build-deps on x11proto-core-dev, x11proto-dri2-dev, libxfont-dev.
-  * Bump xserver-xorg-dev dependency on x11proto-core-dev and
-    x11proto-dri2-dev, add dependency on x11proto-xinerama-dev.
-  * Bump serverminver, videoabiver, inputabiver.
-
-  [ Christopher James Halse Rogers ]
-  * New upstream RC
-    - A number of DRI2 fixes.
-    - Fix for hanging OpenGL clients with multiple heads.
-  * 17-fix-DRI2-segfault-when-clientGone.diff:
-    - Pick up fix from https://bugs.freedesktop.org/show_bug.cgi?id=27497 to
-      fix server crash in DRI2SwapEvent handling (LP: #595182).
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 09 Jul 2010 12:45:09 +0100
-
-xorg-server (2:1.8.1.902-0ubuntu2) unstable; urgency=low
-
-  * debian/rules:
-    - Drop the upstream changelog harder.  We're scrabbling for CD space
-      and this is an easy 1MB saving.
-
- -- Christopher James Halse Rogers <raof@ubuntu.com>  Wed, 30 Jun 2010 09:50:33 +1000
-
-xorg-server (2:1.8.1.902-0ubuntu1) unstable; urgency=low
-
-  * Merge from (unreleased) Debian experimental.  Remaining changes:
-    - rules, control:
-      + Disable SELinux, libaudit-dev is not in main yet (LP 406226).
-        Drop libaudit-dev from build-deps.
-    - rules: Enable xcsecurity (LP 247537).
-    - local/xvfb-run*: Add correct docs about error codes (LP 328205)
-    - rules: Add --with-extra-module-dir to support GL alternatives.
-    - control: Xvfb depends on xauth, x11-xkb-utils. (LP 500102)
-    - rules, local/64-xorg-xkb.rules: Don't use keyboard-configuration
-      until it's available.
-    - control: Update some versioned Breaks for Ubuntu versions.
-    - debian/patches:
-      + 100_rethrow_signals.patch:
-        When aborting, re-raise signals for apport
-      + 109_fix-swcursor-crash.patch:
-        Avoid dereferencing null pointer while reloading cursors during
-        resume. (LP 371405)
-      + 111_armel-drv-fallbacks.patch:
-        Add support for armel driver fallbacks.
-      + 121_only_switch_vt_when_active.diff:
-        Add a check to prevent the X server from changing the VT when killing
-        GDM from the console.
-      + 122_xext_fix_card32_overflow_in_xauth.patch:
-        Fix server crash when ?\9cxauth generate??is called with large timeout.
-      + 157_check_null_modes.patch, 162_null_crtc_in_rotation.patch,
-        166_nullptr_xinerama_keyrepeat.patch, 167_nullptr_xisbread.patch
-        169_mipointer_nullptr_checks.patch,
-        172_cwgetbackingpicture_nullptr_check.patch:
-        Fix various segfaults in xserver by checking pointers for NULL
-        values before dereferencing them.
-      + 165_man_xorg_conf_no_device_ident.patch
-        Correct man page
-      + 168_glibc_trace_to_stderr.patch:
-        Report abort traces to stderr instead of terminal
-      + 184_virtual_devices_autodetect.patch:
-        Use vesa for qemu device, which is not supported by cirrus
-      + 187_edid_quirk_hp_nc8430.patch:
-        Quirk for another LPL monitor (LP 380009)
-      + 188_default_primary_to_first_busid.patch:
-        Pick the first device and carry on (LP 459512)
-      + 189_xserver_1.5.0_bg_none_root.patch:
-        Create a root window with no background.
-      + 190_cache-xkbcomp_output_for_fast_start_up.patch:
-        Cache keyboard settings.
-      + 191-Xorg-add-an-extra-module-path.patch:
-        Add support for the alternatives module path.
-      + 196_xvfb-fbscreeninit-handling.patch, 197_xvfb-randr.patch:
-        Adds xrandr support to xvfb. (LP 516123)
-      + 198_nohwaccess.patch:
-        Adds a -nohwaccess argument to make X not access the hardware
-        ports directly.
-      + 200_randr-null.patch:
-        Clarify a pointer initialization.
-  * Update changelog entries for previously unreleased Debian 1.8.1.901-1
-
- -- Christopher James Halse Rogers <raof@ubuntu.com>  Wed, 23 Jun 2010 11:19:49 +1000
-
-xorg-server (2:1.8.1.901-1ubuntu1) unstable; urgency=low
-
-  [ Timo Aaltonen ]
-  * Merged from Debian experimental, remaining changes:
-    - rules, control:
-      + Disable SELinux, libaudit-dev is not in main yet (LP 406226).
-        Drop libaudit-dev from build-deps.
-    - rules: Enable xcsecurity (LP 247537).
-    - local/xvfb-run*: Add correct docs about error codes (LP 328205)
-    - rules: Add --with-extra-module-dir to support GL alternatives.
-    - control: Xvfb depends on xauth, x11-xkb-utils, recommends
-      libgl1-mesa-dri. (LP 500102)
-    - rules, local/64-xorg-xkb.rules: Don't use keyboard-configuration
-      until it's available.
-    - debian/patches:
-      + 100_rethrow_signals.patch:
-        When aborting, re-raise signals for apport
-      + 109_fix-swcursor-crash.patch:
-        Avoid dereferencing null pointer while reloading cursors during
-        resume. (LP 371405)
-      + 111_armel-drv-fallbacks.patch:
-        Add support for armel driver fallbacks.
-      + 121_only_switch_vt_when_active.diff:
-        Add a check to prevent the X server from changing the VT when killing
-        GDM from the console.
-      + 122_xext_fix_card32_overflow_in_xauth.patch:
-      + 157_check_null_modes.patch, 162_null_crtc_in_rotation.patch,
-        166_nullptr_xinerama_keyrepeat.patch, 167_nullptr_xisbread.patch
-        169_mipointer_nullptr_checks.patch,
-        172_cwgetbackingpicture_nullptr_check.patch:
-        Fix various segfaults in xserver by checking pointers for NULL
-        values before dereferencing them.
-      + 165_man_xorg_conf_no_device_ident.patch
-        Correct man page
-      + 168_glibc_trace_to_stderr.patch:
-        Report abort traces to stderr instead of terminal
-      + 184_virtual_devices_autodetect.patch:
-        Use vesa for qemu device, which is not supported by cirrus
-      + 187_edid_quirk_hp_nc8430.patch:
-        Quirk for another LPL monitor (LP 380009)
-      + 188_default_primary_to_first_busid.patch:
-        Pick the first device and carry on (LP 459512)
-      + 189_xserver_1.5.0_bg_none_root.patch:
-        Create a root window with no background.
-      + 190_cache-xkbcomp_output_for_fast_start_up.patch:
-        Cache keyboard settings.
-      + 191-Xorg-add-an-extra-module-path.patch:
-        Add support for the alternatives module path.
-      + 196_xvfb-fbscreeninit-handling.patch, 197_xvfb-randr.patch:
-        Adds xrandr support to xvfb. (LP 516123)
-      + 198_nohwaccess.patch:
-        Adds a -nohwaccess argument to make X not access the hardware
-        ports directly.
-      + 200_randr-null.patch:
-        Clarify a pointer initialization.
-  * Dropped patches:
-    - 106_nouveau_autodetect.patch: obsoleted by 15-nouveau.diff
-    - 112_xaa-fbcomposite-fix-negative-size.patch: adopted by Debian
-    - 113_quell_nouveau_aiglx.patch: obsoleted by 15-nouveau.diff
-    - 115_xext_fix_cursor_ref_counting.patch: merged upstream
-    - 116_fix_typos_in_swap_functions.patch: merged upstream
-    - 118_xkb_fix_garbage_init.patch: merged upstream
-    - 123_exa_sys_ptr_nullpointer_check.patch: merged upstream
-    - 199_xfvb-help-typo.patch: merged upstream
-  * debian/xserver-xorg-core.preinst.in: Drop the removal of the wrong
-    alternative, obsolete by now.
-  * debian/control: Build the udeb and bump the relaxed build-deps.
-  * debian/local/xvfb-run: Don't disable composite, seems to run fine
-    with it nowadays.
-
-  [ Robert Hooker ]
-  * Fix 190_cache-xkbcomp_output_for_fast_start_up.patch so it works.
-  * Drop 164_trap-aspect-ratios.patch: obsolete.
-  * debian/rules: Adjust confflag targets so xcsecurity isn't enabled for udeb
-    with disabled xace.
-  * Drop 184_virtual_devices_autodetect.patch: It's a noop with todays autoconfig.
-
-  [ Bryce Harrington ]
-  * debian/rules: Don't reference the package uploader for support; instead point
-    users to the standard Ubuntu support page.
-    (LP: #589811)
-
-  [ Christopher James Halse Rogers ]
-  * Add debian/gbp.conf pointing at ubuntu branch.
-  * Drop 109_fix-swcursor-crash.patch; merged upstream in 3a3edb2c.
-  * 122_xext_fix_card32_overflow_in_xauth.patch: Update to most recent patch
-    on patchwork.  This patch actually works! (tested with
-    ?\9cxauth generate :0 . trusted timeout 99999999) (LP: #519049)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 07 Jun 2010 14:50:49 -0700
-
-xorg-server (2:1.8.1.901-1) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * New upstream release
-  * Merge changes from 2:1.7.7-2.
-
-  [ Christopher James Halse Rogers ]
-  * 16-xaa-fbcomposite-fix-negative-size.diff:
-    - mi hunk merged upstream.  Update to keep just the fbpict.c hunk.
-
- -- Julien Cristau <jcristau@debian.org>  Mon, 07 Jun 2010 23:22:48 +0200
-
-xorg-server (2:1.8.1-1) experimental; urgency=low
-
-  * New upstream release
-    - 02_Add-libgcrypt-and-libnettle-as-options-for-sha1.diff: partly merged
-      upstream, rest renamed to 02_Add-libnettle-as-option-for-sha1.diff and
-      ported to new version
-    - 05_only_call_gamma_set_if_nonnull.diff: merged upstream
-    - 07-xfree86-fix-build-with-xv-disabled.diff: rediffed
-    - 08-config-xorg-conf-d.diff: merged upstream
-    - 09-inputclass-sans-abi9.diff: likewise
-    - 10-config-libudev-backend.diff: likewise
-    - 11-xfree86-fix-video-fallback.diff: likewise
-    - 12-xfree86-dont-complain-about-missing-coredevices.diff: likewise
-    - 13-unbreak-input-abi.diff: obsolete
-    - 14-tone-down-nidr-errors.diff: merged upstream
-    - 15-nouveau.diff: rediffed
-    - 17-xfree86-saner-conf-search-paths.diff: merged upstream
-    - 18-Add-10-evdev.conf.diff: likewise
-  * Bump xutils-dev build-dep for new macros.
-  * Add build-dep on xfonts-utils for fontutil.pc.
-  * Bump build-deps on mesa, glproto and dri2proto.
-  * Drop obsolete configure options --disable-xsdl and
-    --disable-null-root-cursor.
-  * --enable-werror has been replaced by --enable-strict-compilation, adjust
-    rules.
-  * xdmx-tools.install: xdmx was renamed to dmxinfo.
-  * Bump debian/serverminver and ABI versions.
-
- -- Julien Cristau <jcristau@debian.org>  Wed, 12 May 2010 18:01:39 +0200
-
-xorg-server (1.8.0-1slp2+12) unstable; urgency=low
-
-  * Apply XI2 sendevent patch and enable _F_ENABLE_XI2_SENDEVENT_ macro
-  * Git: 165.213.180.234:/git/slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.8.0-1slp2+12
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Sat, 27 Nov 2010 17:35:10 +0900
-
-xorg-server (1.8.0-1slp2+11) unstable; urgency=low
-
-  * do not remove shadow modules
-  * Modify debian/rules to strip binary
-  * Git: 165.213.180.234:/git/slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.8.0-1slp2+11
-
- -- SooChan Lim <sc1.lim@samsung.com>  Tue, 23 Nov 2010 14:23:27 +0900
-
-xorg-server (1.8.0-1slp2+10) unstable; urgency=low
-
-  * do not include so files not to use in binary package
-  * Modify debian/rules to strip binary
-  * Git: 165.213.180.234:/git/slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.8.0-1slp2+10
-
- -- SooChan Lim <sc1.lim@samsung.com>  Wed, 17 Nov 2010 20:56:24 +0900
-
-xorg-server (1.8.0-1slp2+9) unstable; urgency=low
-
-  * Fix config/udev.c to print device type properly
-  * Modify debian/rules to strip binary
-  * Git: 165.213.180.234:/git/slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.8.0-1slp2+9
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Fri, 12 Nov 2010 11:32:20 +0900
-
-xorg-server (1.8.0-1slp2+8) unstable; urgency=low
-
-  * Modify config/udev.c
-    - Fix the bug that BT mouse is detected for a keyboard device
-    - Fix the message to print device type properly when a udev device is added
-  * Git: 165.213.180.234:/git/slp/pkgs/xorg/server/xorg-server
-  * Tag: xorg-server_1.8.0-1slp2+8
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 09 Nov 2010 13:24:59 +0900
-
-xorg-server (1.8.0-1slp2+7) unstable; urgency=low
-
-  * block to deal with the specific signals. platform will take care of them.
-  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
-  * Tag: xorg-server_1.8.0-1slp2+7
-
- -- SooChan Lim <sc1.lim@samsung.com>  Sat, 30 Oct 2010 19:49:39 +0900
-
-xorg-server (1.8.0-1slp2+6) unstable; urgency=low
-
-  * use a32 glyphcashe picture for the device not supporting for A8 ( fimg2d )
-  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
-  * Tag: xorg-server_1.8.0-1slp2+6
-
- -- SooChan Lim <sc1.lim@samsung.com>  Thu, 02 Sep 2010 15:53:09 +0900
-
-xorg-server (1.8.0-1slp2+5) unstable; urgency=low
-
-  * unwrap the damage functions at damageCloseScreen
-  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
-  * Tag: xorg-server_1.8.0-1slp2+5
-
- -- SooChan Lim <sc1.lim@samsung.com>  Mon, 30 Aug 2010 14:14:16 +0900
-
-xorg-server (1.8.0-1slp2+4) unstable; urgency=low
-
-  * enable the double buffer extension
-  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
-  * Tag: xorg-server_1.8.0-1slp2+4
-
- -- SooChan Lim <sc1.lim@samsung.com>  Thu, 24 Jun 2010 15:20:13 +0900
-
-xorg-server (1.8.0-1slp2+3) unstable; urgency=low
-
-  * [Crash Logger] to prevent Xserver from abortion when it closes.
-  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
-  * Tag: xorg-server_1.8.0-1slp2+3
-
- -- YoungHoon Jung <yhoon.jung@samsung.com>  Thu, 10 Jun 2010 16:20:52 +0900
-
-xorg-server (1.8.0-1slp2+2) unstable; urgency=low
-
-  * Enable udev for input device probing
-  * Modify config/udev.c not to probe input device @ launching time
-  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
-  * Tag: xorg-server_1.8.0-1slp2+2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 19 May 2010 15:19:49 +0900
-
-xorg-server (1.8.0-1slp2+1) unstable; urgency=low
-
-  * Upgrade from 1.7.1 to 1.8.0
-  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
-  * Tag: xorg-server_1.8.0-1slp2+1
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Mon, 19 Apr 2010 17:11:38 +0900
-
-xorg-server (1.7.1-10slp2+2) unstable; urgency=low
-
-  * do not change the pixclock
-  * Git : 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
-  * Tag : xorg-server_1.7.1-10slp2+2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Mon, 05 Apr 2010 11:55:14 +0900
-
-xorg-server (1.7.1-10slp2+1) unstable; urgency=low
-
-  * make xsever reveal the backtrace, avoiding the call of abort()
-
- -- SooChan Lim <sc1.lim@samsung.com>  Fri, 26 Mar 2010 16:30:46 +0900
-
-xorg-server (1.7.1-9) unstable; urgency=low
-
-  * Repackaging for changed version policy and ToolChain upgrade
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Fri, 26 Mar 2010 15:11:48 +0900
-
-xorg-server (1.7.1-8) unstable; urgency=low
-
-  * remove __attribute((noreturn)) to see the backtrace at a crash
-
- -- SooChan Lim <sc1.lim@samsung.com>  Wed, 24 Mar 2010 08:53:43 +0900
-
-xorg-server (1.7.1-7) unstable; urgency=low
-
-  * add a optimization option for compiling
-
- -- SooChan Lim <sc1.lim@samsung.com>  Tue, 16 Mar 2010 15:43:35 +0900
-
-xorg-server (1.7.1-6) unstable; urgency=low
-
-  * Modify debian/rules to change with-xkb-output directory to /opt/etc/X11/xkb
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 26 Jan 2010 16:28:57 +0900
-
-xorg-server (1.7.1-5) unstable; urgency=low
-
-  * Modify debian/rules to change xkb-base-directory from /opt/share/X11/xkb to /opt/etc/X11/xkb
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Mon, 25 Jan 2010 17:42:32 +0900
-
-xorg-server (1.7.1-4) unstable; urgency=low
-
-  * Restore debian/control file
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 02 Dec 2009 18:27:05 +0900
-
-xorg-server (1.7.1-3) unstable; urgency=low
-
-  * Modify debian/control file
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 02 Dec 2009 15:31:10 +0900
-
-xorg-server (1.7.1-2) unstable; urgency=low
-
-  * Upgrade version for importing xorg-server package for i386
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 02 Dec 2009 15:07:15 +0900
-
-xorg-server (1.7.1-1) unstable; urgency=low
-
-  * Initial release
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 1 Jul 2009 22:34:55 +0900
-
-xorg-server (2:1.7.7-2) unstable; urgency=low
-
-  * autoconfig: load the nouveau driver for nvidia hw.  Stolen from F13.
-  * Try to catch non-event devices when running udevadm info in the bug
-    script.
-  * Pull from upstream server-1.7-nominations branch
-    - dix: make DeviceEvent coordinates signed for Xinerama (closes: #581763)
-    - xfree86: dga needs to use the master keyboard state (closes: #576393)
-    - Fix null pointer dereference in xf86_reload_cursors (closes: #507916)
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 03 Jun 2010 17:00:18 +0200
-
-xorg-server (2:1.7.7-1) unstable; urgency=low
-
-  [ Timo Aaltonen ]
-  * Update patch 17; Add missing __datadir__ to cpprules.in.
-
-  [ Cyril Brulebois ]
-  * Add listing files under /etc/X11/xorg.conf.d in bug script.
-  * Fix typo in 10-mouse.conf: s/Mouse/Pointer/ (Closes: #579130).
-
-  [ Julien Cristau ]
-  * Drop the GLX 1.4 patches to fix server crashes with DRI2 (closes:
-    #567677).
-  * Change driver ABI Conflicts to Breaks.  Drop old Conflicts/Replaces on
-    pre-modular xserver packages.
-  * Unset PRERELEASE to avoid the prerelease warning in the log.
-  * New upstream release:
-    - fixes Xvfb crash with XI2 (closes: #575905)
-    - EXA: Check sys_ptr isn't NULL before passing it to the UploadToScreen
-      hook (closes: #576656)
-  * 19-exa-handle-pixmap-create-destroy-in-lower-layers.diff is now upstream,
-    remove it.
-  * Drop mention of input_id from debian/copyright since we stopped shipping
-    it a while back.
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 04 May 2010 15:17:59 +0200
-
-xorg-server (2:1.7.6.901-3) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * On !linux, install mouse and kbd catchall snippets in the xorg.conf.d
-    directory.  Fixes FTBFS on those archs.
-
-  [ Cyril Brulebois ]
-  * Cherry-pick ?\9cexa: handle pixmap create/destroy in lower layers??which
-    fixes server crashes when pixmaps are created in the course of
-    software fallbacks (Closes: #576816). Many thanks to Arthur Marsh for
-    the tests!
-
- -- Cyril Brulebois <kibi@debian.org>  Mon, 19 Apr 2010 15:26:15 +0200
-
-xorg-server (2:1.7.6.901-2) unstable; urgency=low
-
-  * Fix dependency generation: Replace PKG_CONFIG_DIR with PKG_CONFIG_PATH
-    (/usr/share/xserver-xorg/{videodrv,xinput}dep may lack a version
-    otherwise).
-
- -- Cyril Brulebois <kibi@debian.org>  Sat, 17 Apr 2010 18:38:17 +0200
-
-xorg-server (2:1.7.6.901-1) unstable; urgency=low
-
-  * New upstream release candidate.
-    - Fix crash when all glyphs of a given depth are freed, but not all
-      glyphsets (closes: #568533)
-
-  [ Cyril Brulebois ]
-  * Steal patch 112_xaa-fbcomposite-fix-negative-size.patch from ubuntu,
-    and rename it 16-xaa-fbcomposite-fix-negative-size.diff as it's now
-    applied in Debian as well. It fixes arithmetic bugs in mod(); thanks to
-    Bryce Harrington.
-  * Merge 'xsfbs/debian-unstable' to fix target dependencies, which fixes
-    useless rebuilds.
-  * Add support for ?\9cnoudeb??in DEB_BUILD_OPTIONS to disable building the
-    udeb flavour (even on architectures where udebs are supposed to be
-    built) to speed up debug builds. When this is used, the udeb is still
-    built, but rather empty??  * Modify bug script to include kernel version (from /proc/version) since
-    the uname in Xorg.*.log might not give enough details (like the Debian
-    revision).
-
-  [ Julien Cristau ]
-  * Remove from debian/rules an obsolete reference to
-    /usr/share/debhelper/dh_make/debianm/rules.
-  * Make xserver-xorg-core provide ABI-versioned virtual packages for drivers
-    to depend on.  This is a first step in making our ABI handling saner (see
-    #573371).
-  * xvfb-run: don't rely on /tmp/X$i-lock to bump $SERVERNUM in auto-servernum
-    mode (closes: #577195).  Thanks, Jozef Kutej!
-  * Bump serverminver for new handling of input config.
-  * Add Breaks on input drivers installing files in /usr/lib/X11/xorg.conf.d
-    since we're changing the path.
-  * Stop looking for x11_driver property in udev, since we're migrating the
-    drivers over to xorg.conf.d anyway.
-  * Install 10-evdev.conf in /usr/share/X11/xorg.conf.d (from upstream, patch
-    18-Add-10-evdev.conf.diff).
-
-  [ Timo Aaltonen ]
-  * Add 17-xfree86-saner-conf-search-paths.diff. Allows using another
-    xorg.conf.d directory for local changes.
-
- -- Cyril Brulebois <kibi@debian.org>  Sat, 17 Apr 2010 16:55:39 +0200
-
-xorg-server (2:1.7.6-2ubuntu8) lucid-updates; urgency=low
-
-  [Bryce Harrington]
-  * Add 123_exa_sys_ptr_nullpointer_check.patch: Patch from upstream to
-    verify a pointer is not NULL before dereferencing it.  Fixes X
-    segfault in miCopyRegion which occurs while using firefox (e.g. typing
-    into fields in AOL).  Issue found by Jerry Lamos.
-    (LP: #539772)
-  * Add 19-exa-handle-pixmap-create-destroy-in-lower-layers.diff: Patch
-    from Debian to fix X segfault on mouse click in xfig, when pixmaps
-    are created in the course of software fallbacks.
-    (LP: #553647)
-
-  [Martin Pitt]
-  * debian/local/64-xorg-xkb.rules: Ignore XKBMODEL=="SKIP" and
-    XKBVARIANT=="U.S. English", which happen to get into
-    /etc/default/console-setup in some cases like the VMWare automatic
-    installer.
-    (LP: #548891)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 28 Apr 2010 13:10:44 -0700
-
-xorg-server (2:1.7.6-2ubuntu7) lucid; urgency=low
-
-  * Drop 117_fix_crash_with_createglyphset.patch
-    - Dupe of patch 110
-  * Drop 03_fedora_glx_versioning.diff, 04_fedora_glx14-swrast.diff
-    - These patches were brought in by Debian to provide glx 1.4 support
-      which Fedora backported from xserver 1.8, however testing in
-      Ubuntu showed they caused a crash when closing Clutter apps (#550218),
-      and graphics corruption when opening windows.  Dropping these patches
-      returns us to GLX 1.2, which has been found to be stable; Debian has
-      also dropped these two patches.
-      (Fixes #565903).
-  * Drop 114_dri2_make_sure_x_drawable_exists.patch
-    - This was an early attempt by upstream which fixed the aforementioned
-      Clutter crash, but which introduced a memory leak.
-      (Fixes #565981)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 22 Apr 2010 17:24:38 -0700
-
-xorg-server (2:1.7.6-2ubuntu6) lucid; urgency=low
-
-  * Add 122_xext_fix_card32_overflow_in_xauth.patch:  Prevent overflow
-    of a CARD32 variable millis by doing bounds checking.  This is a
-    patch currently in discussion at fdo #27134, so this patch can be
-    dropped in favor of whatever upstream decides to include.
-    (LP: #519049)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 15 Apr 2010 14:10:53 -0700
-
-xorg-server (2:1.7.6-2ubuntu5) lucid; urgency=low
-
-  * Update patches in previous upload to fix FTBS issue.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 15 Apr 2010 11:03:01 -0700
-
-xorg-server (2:1.7.6-2ubuntu4) lucid; urgency=low
-
-  * Add several cherrypicks of fixes from upstream git tree which fix various
-    issues and that look safe with low or no risk of regression.
-    + 115_xext_fix_cursor_ref_counting.patch: Xext: Fix cursor reference
-      counting hazard.
-    + 116_fix_typos_in_swap_functions.patch: Fixes typos in several of the
-      glxcmdsswap routines.
-    + 117_fix_crash_with_createglyphset.patch:  Fixes crash introduced in
-      FindGlyphsByHash() if one client disconnects while a second is in
-      the middle of doing certain Glyph operations.
-    + 118_xkb_fix_garbage_init.patch: Fixes typo that can cause garbage
-      bits to get appended on the xkbControlsNotify changedControls mask
-      because it was uninitialized on the stack.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 14 Apr 2010 18:49:56 -0700
-
-xorg-server (2:1.7.6-2ubuntu3) lucid; urgency=low
-
-  * add support for omapfb to 111_armel-drv-fallbacks.patch
-
- -- Alexander Sack <asac@ubuntu.com>  Mon, 12 Apr 2010 14:43:42 +0200
-
-xorg-server (2:1.7.6-2ubuntu2) lucid; urgency=low
-
-  [Bryce Harrington]
-  * Add 113_quell_nouveau_aiglx.patch: Don't emit error message about
-    AIGLX on nouveau.  3D is not supported yet on -nouveau so this error
-    message serves only to confuse bug reporters.
-    (LP: #529590)
-
-  [Robert Sarvatt]
-  * Add 114_dri2_make_sure_x_drawable_exists.patch: Makes sure
-    a corresponding X drawable exists before trying to use it, fixing
-    xserver segfaults under DRI2 when closing down GLX apps.
-    (LP: #550218)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 31 Mar 2010 16:37:45 -0700
-
-xorg-server (2:1.7.6-2ubuntu1) lucid; urgency=low
-
-  [ Timo Aaltonen ]
-  * Merge from Debian unstable. (LP: #546933)
-
-  [ Michael Casadevall ]
-  * Updated 111_armel-drv-fallbacks.patch to also add support for finding
-    dovefb devices in addition to imx51 ones. (LP: #550701)
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Tue, 30 Mar 2010 22:01:12 +0300
-
-xorg-server (2:1.7.6-2) unstable; urgency=low
-
-  [ Timo Aaltonen ]
-  * Add 08-config-xorg-conf-d.diff, 09-inputclass-sans-abi9.diff,
-    10-config-libudev-backend.diff. Backport xorg.conf.d, inputclass
-    and libudev support from xserver 1.8. Replaces the patches we had
-    before. This allows us to migrate from a temporary udev based
-    input device configuration straight to the long term solution
-    introduced in 1.8.
-  * Add 11-xfree86-fix-video-fallback.diff from SUSE. Allows the video
-    fallback method to work when there's an xorg.conf around.
-  * Add 12-xfree86-dont-complain-about-missing-coredevices.diff.
-    No reason to complain about these, unless AEI is off.
-  * Add 13-unbreak-input-abi.diff. Keep the old NewInputDeviceRequest(),
-    rename the new as NIDR18() and call it from NIDR(). This way we
-    don't break the input ABI.
-  * Add 14-tone-down-nidr-errors.diff. Use X_INFO instead of X_ERROR.
-
-  [ Julien Cristau ]
-  * 15-keep-udev-x11-driver.diff: keep looking for the x11_driver udev
-    property as a transitional measure.  This should allow the new server to
-    work while drivers aren't transitioned to xorg.conf.d yet.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Tue, 30 Mar 2010 21:32:52 +0300
-
-xorg-server (2:1.7.6-1ubuntu3) lucid; urgency=low
-
-  * Extend 112_xaa-fbcomposite-fix-negative-size.patch to also correct a
-    mod() definition in the mi code which suffers the same flaw.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 29 Mar 2010 14:15:07 -0700
-
-xorg-server (2:1.7.6-1ubuntu2) lucid; urgency=low
-
-  * Add 112_xaa-fbcomposite-fix-negative-size.patch:  Prevent 3rd-party
-    controllable Xorg crash/exploit when XAA and compositing is in use.
-    Be more careful in sign-changes with mod().
-    (LP: #551193)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 29 Mar 2010 13:37:06 -0700
-
-xorg-server (2:1.7.6-1ubuntu1) lucid; urgency=low
-
-  [Timo Aaltonen]
-  * Merge from Debian unstable.
-  * Drop patch 107, included in Debian.
-  * Drop patch 108, included upstream.
-  * control: Drop the udeb, we don't need it for lucid.
-  * control: Relax/drop some build-deps caused by the udeb.
-
-  [Bryce Harrington]
-  * Add 110_findglyphbyhash-fix.patch from upstream to fix a sporadic
-    crash in FindGlyphByHash.
-    (LP: #401045)
-  * Renumber patch 201_armel-drv-fallbacks.patch to 111
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 24 Mar 2010 12:04:20 -0700
-
-xorg-server (2:1.7.6-1) unstable; urgency=low
-
-  [ Brice Goglin ]
-  * Add 06_dont_trap_access_to_timer_and_keyboard.diff,
-    thanks Samuel Thibault.
-
-  [ Timo Aaltonen ]
-  * New upstream release, closes: #574354.
-
-  [ Julien Cristau ]
-  * Don't build xserver-xorg-core-udeb on sparc.  The linker fails because
-    relocations have to be truncated when building statically against
-    libnettle.
-
- -- Cyril Brulebois <kibi@debian.org>  Tue, 23 Mar 2010 16:59:08 +0100
-
-xorg-server (2:1.7.5.902-1) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * config/udev: fix adding unnamed devices.
-  * Build two flavours, one for the main package and one for the udeb.
-  * Add patch to fix Xorg build with XV disabled.
-
-  [ Timo Aaltonen ]
-  * Add 16-config-dont-filter-input-subsys.diff so for instance serial
-    wacom devices are initialized by the udev backend (LP: #522318,
-    closes: #568236).
-
-  [ Brice Goglin ]
-  * New upstream release.
-    + Allow for missing or disabled compat_output, closes: #572268, #554450.
-    + Reenable RECORD extension, closes: #570680.
-    + dix: try to ring the bell even if the current device doesn't have one,
-      closes: #564200.
-  * Refresh patches.
-  * Fix typo in xvfb-run.1, thanks Joey Hess, closes: #527490.
-  * Add 06_dont_trap_access_to_timer_and_keyboard.diff,
-    thanks Samuel Thibault.
-
-  [ Cyril Brulebois ]
-  * Add udeb needed for the graphical installer: xserver-xorg-core-udeb.
-  * Version/Bump some B-D to make sure xserver-xorg-core-udeb gets its
-    dependencies on the (recently-added) udebs rather than on the
-    libraries:
-     - libpciaccess-dev
-     - libudev-dev
-     - libxau-dev
-     - libxfont-dev
-  * Replace 02_Add-libgcrypt-as-an-option-for-sha1.diff with
-    02_Add-libgcrypt-and-libnettle-as-options-for-sha1.diff so that it's
-    also possible to link against libnettle. Link (unconditionally)
-    statically against libnettle.a to avoid an extra udeb for a few bytes.
-  * Add nettle-dev to Build-Depends; and pass --with-sha1=libnettle for
-    the udeb build (and --with-sha1=libgcrypt for the main build).
-  * Add myself to Uploaders.
-  * Tweak builderstring to use the name of the person responsible for the
-    upload instead of an host-specific one (Closes: #574017).
-
- -- Cyril Brulebois <kibi@debian.org>  Mon, 15 Mar 2010 22:19:01 +0100
-
-xorg-server (2:1.7.5-1ubuntu4) lucid; urgency=low
-
-  * 201_armel-drv-fallbacks.patch: use imx driver if available on
-    armel imx51 systems; the current test checks for mxc_gpu
-    devices listed in /sys/devices/platform and ensures that the
-    imx_drv module can be loaded; if both succeed, imx driver is
-    used instead of fbdev; note: the mxc_gpu device test should be
-    replaced with parsing output of /proc/fb once the mxc driver
-    provides reasonable content there.
-
- -- Alexander Sack <asac@ubuntu.com>  Wed, 24 Mar 2010 13:03:41 +0100
-
-xorg-server (2:1.7.5-1ubuntu3) lucid; urgency=low
-
-  * Add 109_fix-swcursor-crash.patch: Avoid dereferencing null pointer
-    while reloading cursors during resume.
-    (LP: #371405)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 11 Mar 2010 17:16:12 -0800
-
-xorg-server (2:1.7.5-1ubuntu2) lucid; urgency=low
-
-  [ Bryce Harrington ]
-  [Timo Aaltonen]
-  * Add 107_dont_filter_input_subsys.diff so for instance serial wacom
-    devices are initialized by the udev backend (LP: #522318)
-
-  [Bryce Harrington]
-  * Add 108_reenable_record_ext.patch: Upstream patch to make the
-    record callback work with the new internal core/Xi events mechanism
-    instead of xEvents. With this fix, the record extension can be
-    re-enabled.
-    (LP: #315456)
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Tue, 02 Mar 2010 17:09:33 +0200
-
-xorg-server (2:1.7.5-1ubuntu1) lucid; urgency=low
-
-  [ Bryce Harrington ]
-  [Robert Hooker]
-  * Add 106_nouveau_autodetect.patch: makes nouveau the default driver
-    for supported cards when not explicitly named in xorg.conf.
-
-  [Timo Aaltonen]
-  * Merge from Debian unstable.
-  * Drop patch 101, included in Debian.
-
-  [Robert Collins]
-  * Add 199_xfvb-help-typo.patch to fix typo in help for xvfb (fdo #32990)
-  * Add 200_randr-null.patch to clarify a pointer initialization (fdo #26389)
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Fri, 19 Feb 2010 13:24:15 +0200
-
-xorg-server (2:1.7.5-1) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * Remove myself from Uploaders
-
-  [ Brice Goglin ]
-  * New upstream release.
-    + Restore lastDeviceEventTime update in dixSaveScreens,
-      closes: #563816.
-    + Don't double-swap the RandR PropertyNotify event,
-      closes: #569036.
-    + Xi: reset the sli pointers after copying device classes,
-      closes: #566147.
-  * Bump Standards-Version to 3.8.4.
-
- -- Brice Goglin <bgoglin@debian.org>  Tue, 16 Feb 2010 08:00:27 +0100
-
-xorg-server (2:1.7.4-2) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * Rename the build directory to not include DEB_BUILD_GNU_TYPE for no
-    good reason.  Thanks, Colin Watson!
-
-  [ Brice Goglin ]
-  * Add 05_only_call_gamma_set_if_nonnull.diff to unbreak the nv driver,
-    closes: #564203.
-
- -- Brice Goglin <bgoglin@debian.org>  Wed, 20 Jan 2010 23:51:26 +0100
-
-xorg-server (2:1.7.4-1) unstable; urgency=low
-
-  [ Timo Aaltonen ]
-  * New upstream release.
-
-  [ Julien Cristau ]
-  * Don't call config_init() until after InitInput() has initialized the event
-    queue, so that devices don't get enabled too early (closes: #564256,
-    #564324).
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 12 Jan 2010 10:49:22 +0000
-
-xorg-server (2:1.7.3.902-1ubuntu12) lucid; urgency=low
-
-  * Add 198_nohwaccess.patch: Needed for rootless X.  Adds a -nohwaccess
-    argument to make X not access the hardware ports directly.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri, 05 Feb 2010 22:17:20 -0800
-
-xorg-server (2:1.7.3.902-1ubuntu11) lucid; urgency=low
-
-  * Add 196_xvfb-fbscreeninit-handling.patch and 197_xvfb-randr.patch:
-    Adds xrandr support to xvfb.  Thanks lifeless!
-    (LP: #516123)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 04 Feb 2010 10:56:12 -0800
-
-xorg-server (2:1.7.3.902-1ubuntu10) lucid; urgency=low
-
-  * 100_rethrow_signals.patch: Fix SigAbortServer to cleanly exit(1) on a
-    non-signal crash, as the original upstream code does. Not exiting leads to
-    continuing back into the code which threw the error, which eventually
-    leads to writing into the already closed log file and other operations
-    which cause segfaults.
-  * Re-enable 100_rethrow_signals.patch.  Hello apport.
-
- -- Martin Pitt <martin.pitt@ubuntu.com>  Wed, 03 Feb 2010 17:29:53 -0800
-
-xorg-server (2:1.7.3.902-1ubuntu9) lucid; urgency=low
-
-  * Fully disable 100_rethrow_signals.patch as it seems to still cause
-    crashes.  Goodbye apport.
-    (LP: #506510)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 18 Jan 2010 23:31:08 -0800
-
-xorg-server (2:1.7.3.902-1ubuntu8) lucid; urgency=low
-
-  * Drop 160_log_timestamping.patch.  The bootup time objectives have been
-    met so this patch is no longer required.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Sat, 16 Jan 2010 02:28:30 -0800
-
-xorg-server (2:1.7.3.902-1ubuntu7) lucid; urgency=low
-
-  * Update 100_rethrow_signals.patch: Don't log more error messages after
-    the log has been closed, else it causes a SIGSEGV (signal 11) crash
-    under several different conditions, including on even ordinary error
-    exits.
-    (LP: #506510, #507345, #506977, #504497, #507083)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri, 15 Jan 2010 15:22:34 -0800
-
-xorg-server (2:1.7.3.902-1ubuntu6) lucid; urgency=low
-
-  * debian/xserver-xorg-core.preinst.in:
-    - Correct the name of the alternative that we need to remove.
-      Thanks to Steve Langasek for spotting the error.
-
- -- Alberto Milone <alberto.milone@canonical.com>  Thu, 14 Jan 2010 12:50:19 +0100
-
-xorg-server (2:1.7.3.902-1ubuntu5) lucid; urgency=low
-
-  * debian/xserver-xorg-core.preinst.in:
-    - Make sure that the alternative which was previously provided by
-      xserver-xorg-core is removed.
-
- -- Alberto Milone <alberto.milone@canonical.com>  Tue, 12 Jan 2010 11:37:49 +0100
-
-xorg-server (2:1.7.3.902-1ubuntu4) lucid; urgency=low
-
-  * debian/patches/191-Xorg-add-an-extra-module-path.patch:
-    - Patch from Mandriva to allow the use of an extra-modules-dir so that
-      the modules installed in this dir will override the ones in the
-      default directory.
-  * debian/rules:
-    - Remove alternatives stuff introduced in a previous upload.
-    - Configure with --with-extra-module-dir="/usr/lib/xorg/extra-modules".
-    - Do not install libglx.so and libdri.so in a different place any more.
-    - Do not install ld.so.conf file any more. Mesa will deal with this.
-  * debian/xserver-xorg-core.links:
-    - Do not create link to /usr/lib/xvmcconfig-standard/XvMCConfig.
-    - Remove links file.
-  * debian/xserver-xorg-core.postinst.in:
-    - Do not install an alternative any more. Mesa will deal with this.
-  * debian/xserver-xorg-core.prerm.in:
-    - Remove file.
-
- -- Alberto Milone <alberto.milone@canonical.com>  Mon, 11 Jan 2010 14:48:35 +0100
-
-xorg-server (2:1.7.3.902-1ubuntu3) lucid; urgency=low
-
-  [ Julien Cristau ]
-  * Don't call config_init() until after InitInput() has initialized the event
-    queue, so that devices don't get enabled too early (closes: #564256,
-    #564324). (LP: #504254)
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Sat, 09 Jan 2010 19:34:30 +0200
-
-xorg-server (2:1.7.3.902-1ubuntu2) lucid; urgency=low
-
-  * debian/rules:
-    - Make sure that /usr/lib/standard-x11/ld.so.conf points to
-      the libraries provided by mesa.
-
- -- Alberto Milone <alberto.milone@canonical.com>  Fri, 08 Jan 2010 18:55:52 +0100
-
-xorg-server (2:1.7.3.902-1ubuntu1) lucid; urgency=low
-
-  [ Timo Aaltonen ]
-  * Merge from Debian unstable.
-
-  [ Michael Vogt ]
-  * Add 101_nv-crash-fix.diff: Do not crash if gamma_set is NULL.
-    (LP: #494627)
-
-  [ Alberto Milone ]
-  * Install libglx.so and libdri.so in /usr/lib/standard-x11 as X
-    seems to prefer the file in /usr/lib/xorg/modules/extensions/standard/
-    over links in /usr/lib/xorg/modules/extensions/.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Fri, 08 Jan 2010 14:21:15 +0200
-
-xorg-server (2:1.7.3.902-1) unstable; urgency=low
-
-  [ Timo Aaltonen ]
-  * Run udevadm trigger on postinst, and depend on udev [linux-any].
-
-  [ Julien Cristau ]
-  * Add xserver-common dependency on x11-xkb-utils for xkbcomp.
-  * Remove our copy of input_id, add Depends on new enough udev instead.
-  * New upstream release.
-  * Make xserver-common recommend xfonts-base, some clients don't work without
-    those.
-  * Upload to unstable.
-
- -- Julien Cristau <jcristau@debian.org>  Wed, 06 Jan 2010 17:44:59 +0000
-
-xorg-server (2:1.7.3.901-1ubuntu5) lucid; urgency=low
-
-  * Use alternatives to make it easier to switch between X11 and 3rd
-    party modules.
-  * Add link to /usr/lib/xvmcconfig-standard/XvMCConfig and use it
-    for alternatives.
-
- -- Alberto Milone <alberto.milone@canonical.com>  Mon, 04 Jan 2010 12:08:17 +0100
-
-xorg-server (2:1.7.3.901-1ubuntu4) lucid; urgency=low
-
-  * xvfb: Depend again on xauth. Depend on x11-xkb-utils. LP: #500102.
-
- -- Matthias Klose <doko@ubuntu.com>  Thu, 24 Dec 2009 12:20:02 +0100
-
-xorg-server (2:1.7.3.901-1ubuntu3) lucid; urgency=low
-
-  * Update 100_rethrow_signals.patch to work with xserver 1.7
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri, 18 Dec 2009 18:55:56 -0800
-
-xorg-server (2:1.7.3.901-1ubuntu2) lucid; urgency=low
-
-  [ Alberto Milone ]
-  * debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch:
-    Make the patch build again with xserver 1.7.
-
-  [ Timo Aaltonen ]
-  * Enable patch 190 now that it works.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Tue, 15 Dec 2009 14:49:39 +0200
-
-xorg-server (2:1.7.3.901-1ubuntu1) lucid; urgency=low
-
-  * Merge from Debian experimental.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Mon, 14 Dec 2009 11:34:33 +0200
-
-xorg-server (2:1.7.3.901-1) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * Enable GLX 1.4 on DRI2 and swrast (from upstream, via F12).
-  * xserver-xorg-dev: add Depends on x11proto-kb-dev and libxkbfile-dev for
-    xkbsrv.h (closes: #559676).  Thanks, Ron!
-  * Update input_id to the version in udev 149.
-  * Update xserver-xorg-core bug script to run udevadm info instead of lshal.
-
-  [ Brice Goglin ]
-  * New upstream release.
-    + Refresh patches.
-
- -- Brice Goglin <bgoglin@debian.org>  Sat, 12 Dec 2009 17:46:45 +0100
-
-xorg-server (2:1.7.2-2ubuntu2) lucid; urgency=low
-
-  * local/64-xorg-xkb.rules: Use "program" instead of "file" when
-    grepping the XKB settings from console-setup.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Tue, 08 Dec 2009 13:17:04 +0200
-
-xorg-server (2:1.7.2-2ubuntu1) lucid; urgency=low
-
-  * Merge from Debian experimental. Remaining Ubuntu changes:
-    - debian/rules, debian/control:
-      + Disable SELinux, libaudit-dev is not in main yet (LP 406226).
-        Drop libaudit-dev from build-deps.
-    - debian/rules: Enable xcsecurity (LP 247537).
-    - local/xvfb-run*: Add correct docs about error codes (LP 328205)
-    - local/xvfb-run: Use "-extension Composite" to fix xvfb-run crashing.
-    - debian/patches:
-      + 121_only_switch_vt_when_active.diff:
-        Add a check to prevent the X server from changing the VT when killing
-        GDM from the console.
-      + 135_rethrow_signals.patch:
-        When aborting, re-raise signals for apport
-      + 157_check_null_modes.patch, 162_null_crtc_in_rotation.patch,
-        166_nullptr_xinerama_keyrepeat.patch, 167_nullptr_xisbread.patch
-        169_mipointer_nullptr_checks.patch,
-        172_cwgetbackingpicture_nullptr_check.patch:
-        Fix various segfaults in xserver by checking pointers for NULL
-        values before dereferencing them.
-      + 164_trap-aspect-ratios.patch:
-        Correct monitor EDIDs that have misreported aspect ratios.
-      + 165_man_xorg_conf_no_device_ident.patch
-        Correct man page
-      + 168_glibc_trace_to_stderr.patch:
-        Report abort traces to stderr instead of terminal
-      + 184_virtual_devices_autodetect.patch:
-        Use vesa for qemu device, which is not supported by cirrus
-      + 187_edid_quirk_hp_nc8430.patch:
-        Quirk for another LPL monitor (LP: #380009)
-      + 188_default_primary_to_first_busid.patch:
-        Pick the first device and carry on (LP 459512)
-      + 189_xserver_1.5.0_bg_none_root.patch:
-        Create a root window with no background.
-      + 190_cache-xkbcomp_output_for_fast_start_up.patch:
-        Cache keyboard settings.
-  * debian/control: Drop obsolete Conflicts/Breaks against -psb,
-    -synaptics and -evdev.
-  * debian/local/xserver-xephyr.1: Delete, upstream has Xephyr.1 now.
-  * Dropped patches:
-    - 101_fedora_xserver-1.3.0-document-fontpath-correctly.patch:
-      Upstream dropped it.
-    - 102_ubuntu_sharevts_load_cpu.patch: Upstream.
-    - 103_psb_auto.patch: Fallback to vesa done differently upstream.
-    - 110_fedora_no_move_damage.patch: Upstream dropped it.
-    - 140_quell_acpi_errmsgs.patch: Superseded.
-    - 153_make_dmx_compile.patch: Xdmx is fixed upstream.
-    - 156_exevents_copykeyclass_nullptrcheck.patch: No longer needed.
-      Appropriate checks are done on the pointers prior to CopyKeyClass
-      being called now.
-    - 158_raise_maxclients.patch: Breaks binary drivers.  We've had this
-      reverted for some time now, may as well just get rid of it entirely.
-    - 174_set_bg_pixmap_of_cow_to_none.patch: Upstream
-    - 177_animated_cursor_change_master.patch: Different fix upstream.
-    - 180_fedora_no_synaptics_mouse_synthesis.patch: Superseded.
-    - 181_fedora_log_proc_cmdline.patch: Upstream.
-    - 185_dix_badwindow.patch: Upstream.
-    - 186_autoconfig_geode.patch: Upstream.
-  * 189_xserver_1.5.0_bg_none_root.patch: Fetched a new version.
-  * 135_rethrow_signals.patch, 168_glibc_trace_to_stderr.patch:
-    Disabled until fixed to work with the current version.
-  * 160_log_timestamping.patch: Updated and re-enabled for boot speed
-    testing in Lucid.  This patch should be disabled by beta2.
-  * 169_mipointer_nullptr_checks.patch: Updated.  MIPOINTER() still
-    can return NULL under some circumstances, and its return values
-    are still being dereferenced without checking for NULL.
-  * 188_default_primary_to_first_busid.patch: Updated.  Still looks to be
-    relevant for certain multi-card systems.
-  * 190_cache-xkbcomp_output_for_fast_start_up.patch: Updated.
-  * control, local/64-xorg-xkb.rules: Don't depend on keyboard-configuration
-    until we have it.
-  * rules, local/64-xorg-xkb.rules: Use input_id from udev.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Mon, 07 Dec 2009 15:30:18 +0200
-
-xorg-server (2:1.7.2-2) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * debian/rules: upstream build system got fixed, no need to remove
-    configure-generated files.
-  * Steal input_id helper from udev, install it in /lib/xorg.  Thanks, Martin
-    Pitt!
-
-  [ Brice Goglin ]
-  * Cherry pick upstream commit to fix the ABI.
-
- -- Brice Goglin <bgoglin@debian.org>  Mon, 30 Nov 2009 20:10:27 +0100
-
-xorg-server (2:1.7.2-1) experimental; urgency=low
-
-  * New upstream release
-    + Xorg sets umask to 022 (closes: #555308)
-  * Delete 09_debian_xserver_rtff.diff.  Was disabled since 1.3.99, and is not
-    necessary since the fall back to builtin fonts was added.
-  * Change the server's dependency on xserver-common to >= ${source:Version},
-    to allow installation of different versions of the various servers.
-  * Add build-dep on libglib2.0-dev, xkb-data and x11-xkb-utils for unit
-    tests, and run the tests unless nocheck is in DEB_BUILD_OPTIONS.
-  * Cherry-pick upstream commit to turn ModeDebug on during server startup,
-    replacing our Turn-on-ModeDebug-by-default.patch.
-  * Number our patches to make it easier to keep track of things.  Requested
-    by the Ubuntu folks.
-  * xvfb-run: retry a few times if Xvfb can't be started when using
-    --auto-servernum, to make concurrent invocations work (closes: #521075).
-    Thanks, Kees Cook!
-  * Use libudev instead of libhal for input hotplug on linux.
-  * Add udev rule to get keymap from /etc/default/keyboard.
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 28 Nov 2009 16:48:43 +0100
-
-xorg-server (2:1.7.0-1) experimental; urgency=low
-
-  * Add missing Conflicts on xserver-xorg-video-5 and xserver-xorg-input-4.
-  * Add xkb-data to xserver-common's Depends.  XKB is mandatory in 1.7.
-  * Make all servers depend on xserver-common (= ${source:Version}).
-  * New upstream release
-    + fixes Xvfb crashes (closes: #529927)
-    + fixes DGA init crash (closes: #548716)
-
- -- Julien Cristau <jcristau@debian.org>  Sun, 04 Oct 2009 15:57:01 +0200
-
-xorg-server (2:1.6.99.903-1) experimental; urgency=low
-
-  * New upstream snapshot.
-    + doesn't fill log file with errors when acpid isn't running
-      (closes: #487904, #500583)
-    + adds autoconfig for geode variants (closes: #544988)
-    + fixes idle time computation (closes: #542064)
-    + Xnest uses the host's mouse acceleration and speed (closes: #325181)
-    + Xephyr now has a manpage (closes: #427121)
-    + Xdmx works again (closes: #541254)
-  * Update build deps
-  * Update patch stack:
-    - 20_hurd-i386.diff applied upstream
-    - fedora-bad-fbdev-thats-mine.patch applied upstream
-    - fedora-pci-primary.diff superseded upstream
-    - fedora-vboxvideo.diff applied upstream
-    - kfreebsd-ftbfs.diff applied upstream
-    - Add-libgcrypt-as-an-option-for-sha1.diff refreshed
-    - Turn-on-ModeDebug-by-default.patch refreshed
-  * Cleanup some libtool cruft in debian/rules clean.
-  * Bump serverminver, videoabiver and inputabiver.
-  * Bump debhelper compat level to 5:
-    - handle dh_strip behaviour change
-    - fix xserver-xorg-core.install
-  * Bump Standards-Version to 3.8.3.
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 29 Sep 2009 17:51:05 +0200
-
-xorg-server (2:1.6.4-2ubuntu6) lucid; urgency=low
-
-  * 189_xserver_1.5.0_bg_none_root.patch: Moblin patch to allow X to
-    create a root window with no background by passing the -nr
-    argument.  This will make X no longer clear the framebuffer when it
-    starts, thus eliminating a flicker between bootsplash and gdm.  -nr
-    is ignored if this feature is not supported by the driver.  This patch
-    is not upstream yet.
-    TESTERS:  Watch for screen corruption issues during X or app start.
-  * 190_cache-xkbcomp_output_for_fast_start_up.patch: Causes the X
-    Keyboard Compiler (xkbcomp) to create a cache file of the keyboard
-    settings.  This will make the 2nd and later boots slightly faster.
-    TESTERS:  Watch for issues relating to keyboard customizations not
-    taking effect properly following boot.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 23 Nov 2009 13:59:44 -0800
-
-xorg-server (2:1.6.4-2ubuntu5) lucid; urgency=low
-
-  * Rework xvfb-run patch to wait for server to come up before checking
-    status (LP: #481591, Debian bug 521075).
-
- -- Kees Cook <kees@ubuntu.com>  Fri, 13 Nov 2009 16:15:36 -0800
-
-xorg-server (2:1.6.4-2ubuntu4) karmic; urgency=low
-
-  * Add 188_default_primary_to_first_busid.patch: X can abort if multiple
-    video devices are present, and none are marked as primary.  This makes
-    X just pick the first one it sees and carry on.
-    (LP: #459512)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 26 Oct 2009 10:05:44 -0700
-
-xorg-server (2:1.6.4-2ubuntu3) karmic; urgency=low
-
-  * local/xvfb-run: Fix race condition in xvfb-run that can cause
-    concurrent invocations to fail.
-    (LP: #348052)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 14 Oct 2009 15:21:51 -0700
-
-xorg-server (2:1.6.4-2ubuntu2) karmic; urgency=low
-
-  * Add 187_edid_quirk_hp_nc8430.patch: Quirk for another LPL monitor, to
-    fix huge font sizes due to invalid EDID from the hardware.
-    (LP: #380009)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 13 Oct 2009 02:25:46 -0700
-
-xorg-server (2:1.6.4-2ubuntu1) karmic; urgency=low
-
-  * Merge from Debian unstable.  (LP: #447010)
-    Remaining Ubuntu changes:
-    - debian/control:
-      + set Conflicts: xkb-data (<< 0.9), since xkb-path is
-        different from previous releases
-      + do not Conflict with xserver-xorg-video
-      + xvfb Depends on xauth, xfonts-base
-      + Set Maintainer to Ubuntu Core Developers
-    - debian/rules:
-      + build using -fno-stack-protector
-      + --with-os-vendor=Ubuntu
-    - debian/xserver-xorg-core.install:
-      + Add ioport, pcitweak, scanpci scripts & man pages
-    - debian/patches:
-      + 101_fedora_xserver-1.3.0-document-fontpath-correctly.patch:
-        Specify correct paths to fonts
-      + 102_ubuntu_sharevts_load_cpu.patch:
-        close console fd only when ShareVTs
-      + 103_psb_auto.patch:
-        Autodetect poulsbo devices (but use -vesa since -psb is broken)
-      + 110_fedora_no_move_damage.patch:
-        further aiglx support
-      + 121_only_switch_vt_when_active.diff:
-        Add a check to prevent the X server from changing the VT when killing
-        GDM from the console.
-      + 135_rethrow_signals.patch:
-        When aborting, re-raise signals for apport
-      + 140_quell_acpi_errmsgs.patch:
-        Avoid generating extraneous warnings when acpi is missing
-      + 153_make_dmx_compile.patch:
-        Change xcalloc -> calloc, so that dmx compiles.
-      + 156_exevents_copykeyclass_nullptrcheck.patch,
-        157_check_null_modes.patch, 162_null_crtc_in_rotation.patch,
-        166_nullptr_xinerama_keyrepeat.patch, 167_nullptr_xisbread.patch
-        169_mipointer_nullptr_checks.patch,
-        172_cwgetbackingpicture_nullptr_check.patch:
-        Fix various segfaults in xserver by checking pointers for NULL
-        values before dereferencing them.
-      + 164_trap-aspect-ratios.patch:
-        Correct monitor EDIDs that have misreported aspect ratios.
-      + 165_man_xorg_conf_no_device_ident.patch
-        Correct man page
-      + 168_glibc_trace_to_stderr.patch:
-        Report abort traces to stderr instead of terminal
-      + 174_set_bg_pixmap_of_cow_to_none.patch:
-        Set background pixmap of composite overlay window to no background
-      + 177_animated_cursor_change_master.patch:
-        Don't create animated cursors for slave devices
-      + 180_fedora_no_synaptics_mouse_synthesis.patch:
-        Don't synthesize a mouse section if a synaptics device is found
-      + 181_fedora_log_proc_cmdline.patch:
-        Dump /proc/cmdline in the log file too
-      + 184_virtual_devices_autodetect.patch:
-        Use vesa for qemu device, which is not supported by cirrus
-      + 185_dix_badwindow.patch:
-        Don't return BadMatch from GetProperty if window isn't actually a window
-      + 186_autoconfig_geode.patch
-        Perform autodetection correctly for various geode devices
-  * Update 184_virtual_devices_autodetect.patch to only include inserting
-    cirrus, since vbox is covered by the new fedora patch.
-  * Drop patches already included upstream:
-    - 187_lastdeviceeventtime-no-reset.patch
-    - 178_glx_flush_cache.patch
-    - 179_glx_cleanup_drawables.patch
-    - 183_dont_reset_event_time.patch
-    - 182_negative_sync_transitions.patch
-  * Ubuntu bugs fixed as of this release:
-    - Generate key up event only when key is released.  (Fixed previously)
-      (LP: #403339)
-    - Fix XDPMS change event idle handling
-      (LP: #114336, #152999)
-    - Don't shutdown the libhal ctx if it failed to initialize.  Fixes
-      crash if HAL or dbus is not running or is interrupted.
-      (LP: #114336)
-    - Fix crash if SendCoreEvents is off.  Don't send events through
-      master in this case.
-      (LP: #368135)
-    - Fix SWCursor check in xf86CursorSetCursor to prevent cursor image
-      showing up on every screen with Xinerama.
-      (LP: #357901)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri, 09 Oct 2009 12:01:52 -0700
-
-xorg-server (2:1.6.4-2) unstable; urgency=low
-
-  * Add fix-dga-removal.patch, closes: #548724.
-
- -- Brice Goglin <bgoglin@debian.org>  Wed, 30 Sep 2009 22:40:29 +0200
-
-xorg-server (2:1.6.4-1) unstable; urgency=low
-
-  * New upstream release.
-  * Update 20_hurd-i386.diff, thanks Samuel Thibault, closes: #548606.
-  * Drop render-return-the-supported-version.patch, applied upstream.
-
- -- Brice Goglin <bgoglin@debian.org>  Mon, 28 Sep 2009 07:23:07 +0200
-
-xorg-server (2:1.6.3.901-1) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * Add patch stolen from Fedora to add the vboxvideo driver to the
-    autodetection routine (closes: #540884).
-  * Add built-ins to the default font path so that non-Xorg servers can use
-    them (closes: #542707).  Thanks, Josselin Mouette!
-  * Add avr32 to the libselinux-dev/libaudit-dev build-deps (closes: #543540).
-    Thanks, Bradley Smith!
-  * Add patch to return the actually supported version in RenderQueryVersion
-    rather than whatever renderproto version the server built against.
-  * New upstream release.
-    + idle counter computation fixes (closes: #542064)
-  * Cherry-pick three more patches nominated on
-    http://www.x.org/wiki/Server16Branch:
-    - Don't reset the lastDeviceEventTime when doing DPMS actions
-    - dri2: Don't crash if pPriv is NULL
-    - EXA: Only take special code path for 1x1 fill for pixmaps
-
-  [ David Nusinow ]
-  * Update xsfbs to 5693792171d885769e58dcccc053c08b11acd12a
-
- -- Julien Cristau <jcristau@debian.org>  Mon, 14 Sep 2009 15:33:46 +0200
-
-xorg-server (2:1.6.3-1ubuntu7) karmic; urgency=low
-
-  * Add 187_lastdeviceeventtime-no-reset.patch: Avoids resetting IDLETIME on
-    DPMS events.  Cherrypick from upstream.
-    (LP: #397839)
-
- -- Loïc Minier <loic.minier@ubuntu.com>  Mon, 28 Sep 2009 10:54:08 +0200
-
-xorg-server (2:1.6.3-1ubuntu6) karmic; urgency=low
-
-  * Add 186_autoconfig_geode.patch:  Add autoconfiguration support for
-    older geode cards.  Cherrypick from upstream.
-    (LP: #423866)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 08 Sep 2009 15:43:28 -0700
-
-xorg-server (2:1.6.3-1ubuntu5) karmic; urgency=low
-
-  * Add 185_dix_badwindow.patch: dixLookupWindow may return BadMatch if
-    the window in question isn't actually a window. In this case,
-    GetProperty needs to return BadWindow - not BadMatch.  Fixes unexpected
-    crash in some GNOME applications not expecting to get BadMatch returned
-    from this function call.
-    (LP: #321041)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 03 Sep 2009 18:27:04 -0700
-
-xorg-server (2:1.6.3-1ubuntu4) karmic; urgency=low
-
-  * Add 184_virtual_devices_autodetect.patch: Automatic driver detection
-    for vbox and kvm for non-cirrus devices.
-    (LP: #338219, #348497)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 24 Aug 2009 14:58:22 -0700
-
-xorg-server (2:1.6.3-1ubuntu3) karmic; urgency=low
-
-  * Add 183_dont_reset_event_time.patch:  Upstream cherrypick.
-    Fix another random display blanking issue.  When we turn off DPMS with
-    DPMSModeOff and do dixSaveScreens, don't reset the event time else
-    session clients using IDLETIME will be reset.
-    See http://blogs.gnome.org/hughsie/2009/08/17/
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 19 Aug 2009 10:21:45 -0700
-
-xorg-server (2:1.6.3-1ubuntu2) karmic; urgency=low
-
-  * Add 182_negative_sync_transitions.patch:  Upstream cherrypick.
-    Fix random blanking display when system is not idle, caused by
-    mishandling of negative transition triggers in XSync.
-    (LP: #397839)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri, 14 Aug 2009 11:21:09 -0700
-
-xorg-server (2:1.6.3-1ubuntu1) karmic; urgency=low
-
-  * Merge from Debian unstable.
-  * control: Drop libaudit-dev from build-deps, since SELinux-support
-    is still disabled anyway.
-  * Drop 182_fedora_quirk_pea.patch, included in 1.6.3.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Wed, 05 Aug 2009 14:11:01 +0300
-
-xorg-server (2:1.6.3-1) unstable; urgency=low
-
-  * New upstream release.
-
- -- Brice Goglin <bgoglin@debian.org>  Sat, 01 Aug 2009 08:55:40 +0200
-
-xorg-server (2:1.6.2.901-1ubuntu3) karmic; urgency=low
-
-  * Add 182_fedora_quirk_pea.patch:  Quirk for Peacock Ergovision 19
-    to use first detailed mode.
-  * Add 181_fedora_log_proc_cmdline.patch: Log the /proc/cmdline into
-    Xorg.0.log
-  * Add 180_fedora_no_synaptics_mouse_synthesis.patch: Don't synthesise a
-    mouse section if synaptics devices are found.
-    (LP: #406291, #405281, #396908)
-  * Actually enable patches 178 and 179
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 04 Aug 2009 02:37:12 -0700
-
-xorg-server (2:1.6.2.901-1ubuntu2) karmic; urgency=low
-
-  * Add 178_glx_flush_cache.patch and 179_glx_cleanup_drawables.patch:
-    - Cleanup destroyed windows and drawables, to prevent crash during
-      compiz startup.
-      (LP: #408293)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 03 Aug 2009 07:55:12 -0700
-
-xorg-server (2:1.6.2.901-1ubuntu1) karmic; urgency=low
-
-  [ Timo Aaltonen ]
-  * Merge from Debian unstable. (LP: #403316)
-  * Drop 170_primary_pci_video_device.patch, included in Debian
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Tue, 28 Jul 2009 15:34:16 +0300
-
-xorg-server (2:1.6.2.901-1) unstable; urgency=low
-
-  * New upstream release candidate.
-  * Bump mesa Build-Depends to >= 7.5 to fix DRI2 madness again,
-    closes: #538637.
-
- -- Brice Goglin <bgoglin@debian.org>  Mon, 27 Jul 2009 00:17:42 +0200
-
-xorg-server (2:1.6.2-1) unstable; urgency=low
-
-  [ Brice Goglin ]
-  * New upstream release.
-    + Fixes dri2 madness introduced in previous upload
-      (closes: #534522, #536019, #534766, #534771, #534890).
-    + Fixes xkb bogus length in write keyboard desc, closes: #529625.
-    + Fixes SWCursor being multiply rendered, closes: #526260.
-    + Drop Change-default-for-ExaOptimizeMigration-to-false.diff,
-      applied upstream.
-    + Pull upstream server-1.6-branch up to commit 606f6dba.
-  * Bump serverminver to 2:1.6.2 for the dri2 upstream changes in the
-    previous upload.
-
-  [ Julien Cristau ]
-  * Bump xserver-xorg-dev's dependency on dri2proto to >= 2.1 for the same
-    reason.
-  * Don't set PCI_TXT_IDS_DIR, we don't use that anymore.
-  * xserver-xorg-core.bug.script: add a newline between X log and lshal
-    output.
-
- -- Brice Goglin <bgoglin@debian.org>  Mon, 13 Jul 2009 23:35:13 +0200
-
-xorg-server (2:1.6.1.901-3) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * xvfb-run: don't pass the magic cookie to xauth on the command line
-    (CVE-2009-1573; closes: #526678).  Thanks, Loïc Minier!
-  * xvfb-run: use mktemp to create the temporary directory.
-  * Change default for ExaOptimizeMigration to false.  This option still
-    causes visual corruption in some cases.  Thanks, Michel Dänzer!
-  * Only include hal info for keyboards, mice, touchpads and tablets in the
-    bug script.
-  * In the bug script, grep dmesg for agp in addition to drm.
-  * Add patch stolen from Fedora to disable the fbdev driver when it's loaded
-    together with a PCI or SBUS driver, instead of calling FatalError (closes:
-    #508476).
-  * Add patch stolen from Fedora to try and detect the primary PCI device by
-    mapping the legacy VGA bios and comparing the vendor and device ids.
-    Previously if there was more than one VGA device and the config didn't
-    specify BusIDs, the server would just fail to start, so this hack should
-    improve things.
-  * Update configure options:
-    + use --enable-xvfb instead of --enable-vfb
-    + drop --disable-builtin-fonts, --enable-xtrap, --disable-kdrive-vesa,
-      --disable-lbx, --disable-xprint, --disable-xorgconfig, --disable-xorgcfg
-      which don't exist anymore
-    + use --disable-config-hal and --disable-dri on hurd-i386
-    + reorder options to match configure.ac, and use explicit
-      --enable/--disable instead of using the defaults / autodetection
-  * Don't recommend xfonts-base.  libXfont provides builtin versions of the
-    fixed and cursor fonts, which are the only required ones.  Keep xfonts-*
-    packages in Suggests for xserver-xorg-core.
-  * Bump Standards-Version to 3.8.2 now that we have README.source.
-  * Drop Build-Conflicts on xlibs-static-dev; it's only in oldstable at this
-    point.
-  * Pull from upstream server-1.6-branch as of June 23rd (commit dbac41b).
-  * Bump build-dep on dri2proto to 2.1 for new protocol.
-  * Bump build-dep on libselinux1-dev to 2.0.80 for avc_netlink_acquire_fd.
-
-  [ David Nusinow ]
-  * Add README.source
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 23 Jun 2009 19:52:10 +0200
-
-xorg-server (2:1.6.1.901-2ubuntu2) karmic; urgency=low
-
-  * Add xserver-1.5.0-bad-fbdev-thats-mine.patch - If no xorg.conf is
-    specified, framebuffer device can erroneously grab the PCI.  Make
-    it fail instead in this case.
-    (LP: #383407)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 24 Jun 2009 15:24:44 -0700
-
-xorg-server (2:1.6.1.901-2ubuntu1) karmic; urgency=low
-
-  * Merge from Debian unstable.
-  * Dropped patches:
-    - obsolete:
-      100_xserver_exa_force_greedy.patch
-      107_fedora_dont_backfill_bg_none.patch
-    - upstream:
-      163_thinko_in_xf86targetpreferred.patch
-      171_xkb_geometry_copying.patch
-      173_edid_quirk_philips_lcd.patch
-      175_set_pointer_screen_in_xtestfakeinput.patch
-      176_quell_warning_exacopydirty.patch
-    - included by Debian: 999_default_modedebug_on.patch
-  * Disable 143_default_to_vesa.patch for now, breaks autoconfiguration
-    when the pci-ids directory exists but has no match. (LP: #379504)
-  * Disable SELinux support for now, because libaudit-dev needs to be
-    moved to main first.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Sun, 24 May 2009 00:32:37 +0300
-
-xorg-server (2:1.6.1.901-2) unstable; urgency=low
-
-  * Merge from upstream server-1.6-branch (commit a9f85dce).
-  * Fix FTBFS on kfreebsd (closes: #525475).  Thanks, Petr Salinger!
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 14 May 2009 17:37:40 +0200
-
-xorg-server (2:1.6.1.901-1) experimental; urgency=low
-
-  * New upstream development release
-    + fixes crash in CheckMotion with xinerama (closes: #524853)
-    + Refresh 20_hurd-i386.diff
-
-  [ Brice Goglin ]
-  * Add 20_hurd-i386.diff to fix FTBFS on hurd-i386,
-    thanks Samuel Thibault! (closes: #523970)
-
-  [ David Nusinow ]
-  * Have the reportbug script append lshal and drm info.
-    The drm info comes from grepping dmesg output.
-
-  [ Julien Cristau ]
-  * Properly initialize libgcrypt in the libgcrypt patch (closes: #524822).
-    Thanks, Sven Joachim!
-
- -- David Nusinow <dnusinow@debian.org>  Mon, 11 May 2009 21:50:37 -0400
-
-xorg-server (2:1.6.1-1) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * Disable dri2 on hurd-i386.  Thanks, Samuel Thibault!
-
-  [ Brice Goglin ]
-  * New upstream release.
-
- -- Brice Goglin <bgoglin@debian.org>  Wed, 15 Apr 2009 13:30:51 +0200
-
-xorg-server (2:1.6.0-1) unstable; urgency=low
-
-  [ David Nusinow ]
-  * Add 0001-xorg.conf-5-refer-to-mousedrv-4-.-Debian-394058.patch to
-    refer to correct (semi-obsolete) mouse driver manpage.
-    closes: #394058
-
-  [ Julien Cristau ]
-  * New upstream release.
-  * 0001-mi-force-the-paired-kbd-device-before-CopyKeyClass.patch: remove,
-    included upstream.
-  * Turn on ModeDebug by default.
-  * Use libgcrypt for SHA1 instead of OpenSSL's libcrypto.
-  * Build the xselinux extension on Linux architectures.
-  * Remove build-dependencies on x11proto-evie-dev, x11proto-trap-dev,
-    x11proto-xf86misc-dev; the corresponding extensions are removed.
-  * Remove build-dependencies on x11proto-print-dev, libfreetype6-dev and
-    xfonts-utils since we don't build Xprt anymore.
-  * Fix lintian warnings about xserver-xorg-core.NEWS formatting.
-  * Move -dbg package to new section debug, add ${misc:Depends} where missing.
-  * Remove unused 06_use_proc_instead_of_sysfs_for_pci_domains.diff, obsoleted
-    by pci-rework.
-  * Merge changelog entries 2:1.4.2-9 to 2:1.4.2-11.
-  * Upload to unstable.
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 09 Apr 2009 00:36:40 +0100
-
-xorg-server (2:1.6.0-0ubuntu15) karmic; urgency=low
-
-  * Re-enable 999_default_modedebug_on.patch to provide debug info in
-    Xorg.0.log for development series.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Sun, 10 May 2009 22:35:02 -0700
-
-xorg-server (2:1.6.0-0ubuntu14) jaunty; urgency=low
-
-  * Add 177_animated_cursor_change_master.patch: Fixes crash when using
-    animated cursors.
-    (LP: #358009)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 08 Apr 2009 18:52:56 -0700
-
-xorg-server (2:1.6.0-0ubuntu13) jaunty; urgency=low
-
-  * Add 176_quell_warning_exacopydirty.patch: Quells innocuous but scary
-    sounding "exaCopyDirty: Pending damage region empty!" warning, as it
-    can lead to false-positives with bug reporters.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 08 Apr 2009 14:49:36 -0700
-
-xorg-server (2:1.6.0-0ubuntu12) jaunty; urgency=low
-
-  * local/xvfb-run: Revert change from 2:1.6.0-0ubuntu9; prevents running
-    multiple times.
-    (LP: #357338.  Reopen 348052 rejecting patch)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 07 Apr 2009 15:21:32 -0700
-
-xorg-server (2:1.6.0-0ubuntu11) jaunty; urgency=low
-
-  * Add 175_set_pointer_screen_in_xtestfakeinput.patch: Fixes issue when
-    using Vino, mouse cursor can get stuck in the upper left corner of the
-    screen.  The POINTER_SCREEN flag must be set explicitly for XTest core events to avoid
-    out-of-range events when the lastSlave was an SD with an explicit axis range.
-    Device events sent through XTest don't need this flag, they are expected to be
-    in the valuator range of the device anyway.
-    (LP: #337926)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 06 Apr 2009 17:22:35 -0700
-
-xorg-server (2:1.6.0-0ubuntu10) jaunty; urgency=low
-
-  * debian/patches/174_set_bg_pixmap_of_cow_to_none.patch:
-    - Set bg pixmap of composite overlay window to None.
-      Thanks to Havoc Pennington for the patch.
-      (LP: #356254).
-
- -- Alberto Milone <alberto.milone@canonical.com>  Mon, 06 Apr 2009 15:06:14 +0200
-
-xorg-server (2:1.6.0-0ubuntu9) jaunty; urgency=low
-
-  * local/xvfb-run: Fixes race condition with concurrent invocations
-    (LP: #348052)
-  * local/xvfb-run, xvfb-run.1: Add correct docs about error codes
-    (LP: #328205)
-  * local/xserver-xephyr.1, rules, xserver-xephyr.install: Add man page
-    for xephyr
-    (LP: #134906)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 01 Apr 2009 20:37:22 -0700
-
-xorg-server (2:1.6.0-0ubuntu8) jaunty; urgency=low
-
-  * Add 173_edid_quirk_philips_lcd.patch :
-    Quirk for wrongly reported screen dimensions.
-    Fixes "huge fonts" issues.
-    (LP: #353074)
-
- -- Tormod Volden <debian.tormod@gmail.com>  Wed, 01 Apr 2009 19:47:13 +0200
-
-xorg-server (2:1.6.0-0ubuntu7) jaunty; urgency=low
-
-  * Add 172_cwgetbackingpicture_nullptr_check.patch:
-    - cwGetBackingPicture can segfault when minimizing/maximizing firefox with
-      a flash video playing.  This appears to be a race condition in which the
-      backing picture's data is not always fully defined.
-      (LP: #319402)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 30 Mar 2009 22:20:17 -0700
-
-xorg-server (2:1.6.0-0ubuntu6) jaunty; urgency=low
-
-  * Add 171_xkb_geometry_copying.patch:
-    - Fixes crash when plugging/unplugging USB devices due to incorrect
-      copying of XKB geometry base_color and label_color.  Patch
-      cherrypicked from upstream.
-      (LP: #333222, #321946)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri, 27 Mar 2009 19:58:33 -0700
-
-xorg-server (2:1.6.0-0ubuntu5) jaunty; urgency=low
-
-  [Tormod Volden]
-  * Disable 160_log_timestamping.patch before the beta, this was only used
-    for testing, and the patch also has a serious stack corruption bug.
-    (LP: #328035)
-
-  [Bryce Harrington]
-  * Disable 999_default_modedebug_on.patch before the beta, this was used
-    only for testing.
-  * Add 169_mipointer_nullptr_checks.patch:
-    - MIPOINTER() can return NULL in some circumstances, so always check
-      its return value before dereferencing.
-    - Fixes crash with keyrepeat on non-primary screen on -nvidia when
-      using Xinerama (and probably other serious mipointer-related crashes)
-      (LP: #324465)
-  * Add 170_primary_pci_video_device.patch:
-    - Patch from redhat
-    - Fixes failure when multiple video cards are present.  Xserver currently
-      exits with an error "(EE) No device detected" in such cases.
-      (LP: #267241)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 24 Mar 2009 09:57:17 -0700
-
-xorg-server (2:1.6.0-0ubuntu4) jaunty; urgency=low
-
-  * Add 168_glibc_trace_to_stderr.patch:
-    - Catch glibc internal abort traces on stderr instead of to the
-      controlling terminal (LP: #345748).
-
- -- Kees Cook <kees@ubuntu.com>  Thu, 19 Mar 2009 22:39:33 -0700
-
-xorg-server (2:1.6.0-0ubuntu3) jaunty; urgency=low
-
-  * Add 165_man_xorg_conf_no_device_ident.patch:
-    - Device identifier no longer necessary in Screen section of
-      xorg.conf.  Update man page accordingly.
-      (LP: #261577)
-  * Add 166_nullptr_xinerama_keyrepeat.patch:
-    - Avoids null pointer dereference when holding down keys on
-      non-primary screen when using TwinView / Xinerama on -nvidia.
-      (LP: #324465)
-  * Add 167_nullptr_xisbread.patch:
-    - Avoids null pointer dereference in XisbRead to prevent a (difficult
-      to reproduce) crash during or after a resume from RAM.
-      (LP: #324368)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 19 Mar 2009 00:17:40 -0700
-
-xorg-server (2:1.6.0-0ubuntu2) jaunty; urgency=low
-
-  * Add 163_thinko_in_xf86targetpreferred.patch:
-    - For monitors that do not define a "preferred" mode, if the monitor
-      is not connected to the first output, X wouldn't pick up the mode
-      correctly, resulting in a "No modes" error in Xorg.0.log and dropping
-      user to failsafe-X mode.
-      (LP: #335214)
-  * Add 164_trap-aspect-ratios.patch:
-    - Some monitors fib in the EDID they provide, giving their physical
-      dimensions in the global block, and their aspect ratio(!) in
-      the detailed timings.  This totally messes up DPI calculations
-      resulting in huge fonts.
-      (LP: #320930)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 18 Mar 2009 20:47:12 -0700
-
-xorg-server (2:1.6.0-0ubuntu1) jaunty; urgency=low
-
-  [ Bryce Harrington ]
-  * New upstream release
-    - Fixes segfault during X startup for drivers with RANDR < 1.2
-      (LP: #319210)
-    - Fixes EDID for monitors that incorrectly report aspect ratio instead
-      of resolution (LP: #311485)
-    - Fixes issue where X stops responding to mouse clicks after some time
-      if using Xinerama. (LP: #296167)
-  * Add 162_null_crtc_in_rotation.patch: Fixes crash when two displays on
-    separate cards are attached.  X doesn't work with multiple cards yet,
-    but crashing is not an appropriate way to handle such a situation.
-    (LP: #139990)
-
-  [ Timo Aaltonen ]
-  * 159_xinerama_focus.patch,
-    161_force_paired_kbd_device.patch:
-    - Dropped, applied upstream
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri, 06 Mar 2009 14:44:31 -0800
-
-xorg-server (2:1.5.99.902-1) experimental; urgency=low
-
-  * New upstream release candidate.
-  * xserver-xorg-core.install: there are no more font modules.
-  * 0001-mi-force-the-paired-kbd-device-before-CopyKeyClass.patch: new patch,
-    fixes a crash with some multimedia keyboards (closes: #513384).
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 31 Jan 2009 19:32:31 +0100
-
-xorg-server (2:1.5.99.902-0ubuntu7) jaunty; urgency=low
-
-  * Add 161_force_paired_kbd_device.patch: Fixes issue where a multimedia
-    keyboard (or keyboard-like device) sends its multimedia key events
-    through the mouse device file.  In this case, pair the device with the
-    master before processing the events.  Patch cherrypicked from upstream.
-    (LP: #318261)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 17 Feb 2009 17:20:51 -0800
-
-xorg-server (2:1.5.99.902-0ubuntu6) jaunty; urgency=low
-
-  * Add 999_default_modedebug_on.patch.  Defaults ModeDebug to on.
-    Upstream requests that users include this option when forwarding bugs
-    upstream, thus it should be carried at least during development and
-    reverted by -beta.  Performance won't be impacted, and boot time will
-    be slowed only a negligible amount, as it merely adds a few additional
-    prints.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 10 Feb 2009 14:06:38 -0800
-
-xorg-server (2:1.5.99.902-0ubuntu5) jaunty; urgency=low
-
-  * Revert 158_raise_maxclients.patch.  Breaks -nvidia.  Binary drivers FTL.
-    (LP: #326344)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 09 Feb 2009 13:51:04 -0800
-
-xorg-server (2:1.5.99.902-0ubuntu4) jaunty; urgency=low
-
-  * 160_log_timestamping.patch: Only add timestamp on tagged messages
-    (LP: #285787)
-
- -- Tormod Volden <debian.tormod@gmail.com>  Fri, 06 Feb 2009 23:33:11 +0100
-
-xorg-server (2:1.5.99.902-0ubuntu3) jaunty; urgency=low
-
-  * Add 160_log_timestamping.patch: Show timestamps in Xorg.*.log
-    files.
-    (LP: #285787)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri, 06 Feb 2009 06:28:48 -0800
-
-xorg-server (2:1.5.99.902-0ubuntu2) jaunty; urgency=low
-
-  [Bryce Harrington]
-  * Add 157_check_null_modes.patch: Catch null pointer dereference in
-    video mode selection, which can cause xserver crash when using SDL
-    applications with qemu/kvm.
-    (LP: #300310)
-  * Add 158_raise_maxclients.patch to raise max number of clients from 256
-    to 512.  Trade-off is that this reduces client resources available to
-    1,048,576 total resources (which should still be ample).
-    (LP: #260138)
-
-  [Steven Harms]
-  * 159_xinerama_focus.patch: Resolves xinerama focus issues
-    with multiple screens
-    (LP: #41301)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 04 Feb 2009 22:33:28 -0800
-
-xorg-server (2:1.5.99.902-0ubuntu1) jaunty; urgency=low
-
-  * New upstream release candidate.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Sat, 31 Jan 2009 11:03:52 +0200
-
-xorg-server (2:1.5.99.901-2) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * Bump libdrm-dev build-dep to help out sbuild.
-
-  [ Timo Aaltonen ]
-  * debian/rules: Disable builtin fonts (LP: #308649, closes: #512706)
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 23 Jan 2009 21:16:14 +0100
-
-xorg-server (2:1.5.99.901-1ubuntu1) jaunty; urgency=low
-
-  * Merge with Debian experimental.
-  * debian/rules: Include xorg-server.conf for dbus support.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Fri, 23 Jan 2009 13:53:33 +0200
-
-xorg-server (2:1.5.99.901-1) experimental; urgency=low
-
-  * New upstream release candidate.
-    + adds autodetection of sbus devices (closes: #483942).
-      Thanks, Bernhard R. Link!
-    + RandR version 1.3 adds panning (closes: #509699).
-    + fixes a crash with XAA and fb24_32ReformatTile (closes: #443480).
-    + correctly sets RAW mode on the console when xorg.conf is absent
-      (closes: #505746).
-
-  [ Timo Aaltonen ]
-  * debian/control:
-    - Add x11proto-dri2-dev to build-depends.
-    - Bump the x11proto-randr-dev build-dep version to 1.2.99.3.
-    - Bump the libpixman-1-dev build-dep version to 0.13.2.
-    - Bump the xtrans-dev build-dep version to 1.2.2.
-    - Bump the x11proto-xext-dev build-dep version to 7.0.3.
-    - Bump the x11proto-input-dev build-dep version to 1.5.
-    - Bump the libgl1-mesa-dev and mesa-common-dev build-dep to
-      7.2+git20081209.a0d5c3cf.
-    - Bump the x11proto-core build-dep to 7.0.13.
-    - Add a build-dep on libxinerama-dev.
-    - Conflict xserver-xorg-video-4, xserver-xorg-input-2.1.
-  * debian/rules:
-    - Enable dri2 again.
-  * debian/patches:
-    02_Disable-DRI-in-Xephyr.patch
-    03_glx-init-infinite-loop.diff
-    - Dropped, implemented upstream.
-    13_debian_add_xkbpath_env_variable.diff
-    - Disabled for now, needs to be reimplemented or dropped.
-  * debian/{input,video}abiver: Bump the input (4) and videoabiver (5).
-  * debian/serverminver: Bump to 2:1.5.99.901.
-
-  [ Julien Cristau ]
-  * Ditch the GLX Public License and the CID Font Code Public License from
-    debian/copyright.  The CID code has been removed a while ago, and all code
-    under the GLXPL has been relicensed to the SGI Free Software License B 2.0.
-    This finally closes: #211765.
-
-  [ Yves-Alexis Perez ]
-  * debian/control: update deps for xserver-xorg-dev:
-    - libpixman-1-dev (>= 0.13.2-1)
-    - x11proto-core-dev (>= 7.0.14)
-    - x11proto-input-dev (>= 1.5.0)
-    - x11proto-xext-dev (>= 7.0.4)
-    - x11proto-randr-dev (>= 1.2.99.3)
-    - add x11proto-dri2-dev
-
- -- Julien Cristau <jcristau@debian.org>  Wed, 21 Jan 2009 20:59:34 +0100
-
-xorg-server (2:1.5.99.901-0ubuntu1) jaunty; urgency=low
-
-  [ Timo Aaltonen ]
-  * debian/rules: Enable dbus-support.
-  * Merge current server-1.6-branch.
-  * Disable patch 107 for now, to see what kind of a performance hit
-    it'll be. The problem it causes is random garbage on windows
-    while apps are being loaded.
-    (LP: #254468)
-  * Remove patches 150, 151, 152, 154, applied upstream.
-
-  [ Bryce Harrington ]
-  * 156_exevents_copykeyclass_nullptrcheck.patch: Add several NULL pointer
-    checks in CopyKeyClass to prevent SEGFAULT seen when pressing button
-    on an ATI USB remote control.
-    (LP: #311254)
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Sat, 17 Jan 2009 16:17:58 +0200
-
-xorg-server (2:1.5.99.3-0ubuntu3) jaunty; urgency=low
-
-  [Timo Aaltonen]
-  * debian/rules: Disable builtin fonts (LP: #308649)
-
-  [Bryce Harrington]
-  * 135_rethrow_signals.patch:  Update for 1.6 and re-enable.
-    (LP: #226668)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 16 Dec 2008 19:04:14 -0800
-
-xorg-server (2:1.5.99.3-0ubuntu2) jaunty; urgency=low
-
-  * Merge server-1.6-branch (LP: #308225).
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Tue, 16 Dec 2008 10:00:58 +0200
-
-xorg-server (2:1.5.99.3-0ubuntu1) jaunty; urgency=low
-
-  * Merge from debian experimental git branch.
-  * Dropped patches:
-    - 103_inputproto_1.4.3_is_fine.patch: obsolete
-    - 137_add_device_property_support.patch: upstream
-    - 138_look_at_all_bytes_of_dev_enabled.diff: upstream
-    - 141_improved_driver_selection.patch: upstream
-    - 150_no_visibility_notify_on_unredirect.patch: upstream
-  * 110_fedora_no_move_damage.patch modified to use new function names.
-  * Renumbered 142_psb_auto.patch to 103.
-  * Add a couple of patches from the proposed queue:
-    - 150_dont-update-vcp-valuators.patch
-      The VCP doesn't need to update the valuators anyway since it cannot
-      send XI events. Just skip that bit.
-    - 151_allow-null-as-rulesfile.patch
-      If no rules file is given, simply re-use the previous one. If no
-      RF is given the first time this function is called, use the
-      built-in default.
-    - 152_let-the-ddx-decide-on-the-xkbrulesdefaults.patch
-      Rather than assuming rules in the CoreKeyboardProc, init the default
-      rules in InitCoreDevices, then re-use them later.
-  * Add 153_make_dmx_compile.patch
-    - Change xcalloc -> calloc, so that dmx compiles. Not tested if it
-      also works.
-  * Drop patch 136, since SwitchCoreKeyboard is gone, and patches 151/152
-    basically reimplement the functionality.
-  * Add 154_force-copykeyclass-for-key-events.patch, to fix fdo
-    bug 19048. Without this the server default layout would always be
-    used.
-
-  [ Bryce Harrington ]
-  * Patch 135 updated so that apport actually works now, but leave it
-    disabled until the code is updated for 1.6.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Mon, 15 Dec 2008 11:34:53 +0200
-
-
-xorg-server (2:1.5.3-1ubuntu1) jaunty; urgency=low
-
-  * Merge from debian-experimental, remaining changes:
-   + debian/control:
-    - x11proto-input-dev, libxi-dev build-deps bumped because of
-      input properties.
-    - Conflict with xserver-xorg-video-psb << 0.15.0-0ubuntu1~804um5
-      as these versions didn't have an ABI provide.
-    - Breaks old synaptics, evdev which didn't have properties.
-   + debian/patches:
-    - 100_xserver_exa_force_greedy.patch
-      Provide a mechanism for drivers to force greedy mode on.
-    - 101_fedora_xserver-1.3.0-document-fontpath-correctly.patch
-      Fixes document fontpaths shown in the man page.
-    - 102_ubuntu_sharevts_load_cpu.patch
-      Close console fd only when using --sharevts.
-    - 103_inputproto_1.4.3_is_fine.patch:
-      Don't require inputproto 1.4.4 in configure.ac.
-    - 107_fedora_dont_backfill_bg_none.patch
-      Disable backfilling of windows created with bg=none, which
-      would otherwise force a framebuffer readback.
-    - 110_fedora_no_move_damage.patch
-      Disable damage notifications on move for manually redirected windows.
-    - 121_only_switch_vt_when_active.diff
-      Add a check to prevent the X server from changing the VT when
-      killing GDM from the console.
-    - 135_rethrow_signals.patch
-      Currently Xorg "eats" its crash signals, issuing an error message
-      that it caught the signal and then aborts.  This patch raises the
-      signal it caught, so that subsequent crash handlers (i.e. apport)
-      can also catch and act on it.
-    - 136_fedora_force_switchcorekeyboard_for_evdev.patch
-      Allow clients to set the layout.
-    - 137_add_device_property_support.patch
-      Add support for input-device properties (XI 1.5).
-    - 138_look_at_all_bytes_of_dev_enabled.diff:  dev->enabled has type
-      Bool, which is typedef'd to int, but is used in comparisons with
-      CARD8 data, which gives incorrect logic on big endian systems,
-      causing failure to initialize keyboard and mouse.
-    - 140_quell_acpid_errmsgs.patch: Don't fill the server log with errors
-      from not being able to connect to acpid.
-    - 141_improved_driver_selection.patch
-      Allow returning multiple drivers to try for a given PCI id.
-      Also includes support for fallback drivers, but only when
-      not using an xorg.conf.
-    - 142_psb_auto.patch
-      Autoload vesa for the psb hardware, psb being broken currently.
-    - 143_default_to_vesa.patch:  If no matching driver is found in the
-      .ids files, set "vesa" as a fallback default, otherwise a driver
-      may be selected regardless of whether it actually provides support
-      for the chipset by videoPtrToDriverList() based on its vendor id.
-    - 150_no_visibility_notify_on_unredirect.patch
-      Do not sent VisibilityNotify events when MapUnmapEvents
-      are disabled
-   + debian/local/xvfb-run: disable the Composite-extension for xvfb.
-   + debian/serverminver: Bump the serverminver because of the newer
-     properties API.
-   + debian/rules:
-     Add --enable-xcsecurity --enable-appgroup. The SECURITY module was
-     disabled by default as part of the SELinux merge. However, we need
-     the security module for xauth on Kubuntu, else ubiquity fails.
-     (LP 247537)
-  * Changes done:
-    - debian/control: xfvb doesn't need to Depend on xauth, xfonts-base
-      anymore, Recommends are pulled in by default now.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Wed, 26 Nov 2008 13:42:11 +0200
-
-xorg-server (2:1.5.3-1) experimental; urgency=low
-
-  [ Loic Minier ]
-  * Shut up rmdir error when trying to remove dirs; this might confuse
-    debconf.
-
-  [ Julien Cristau ]
-  * New upstream release.
-  * Fix infinite loop on server reset when swrast_dri.so is missing.  Only
-    push swrast on the glx provider stack on first generation, so we don't
-    turn the stack into a circular list (closes: #500287).
-  * Enable the record extension (closes: #504303).
-  * Merge changes from 2:1.4.2-8.
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 11 Nov 2008 23:17:14 +0100
-
-xorg-server (2:1.5.2-2ubuntu3) intrepid; urgency=low
-
-  * 138_look_at_all_bytes_of_dev_enabled.diff:  dev->enabled has type
-    Bool, which is typedef'd to int, but is used in comparisons with
-    CARD8 data, which gives incorrect logic on big endian systems,
-    causing failure to initialize keyboard and mouse.
-    (LP: #281610)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 23 Oct 2008 07:31:47 -0700
-
-xorg-server (2:1.5.2-2ubuntu2) intrepid; urgency=low
-
-   * 143_default_to_vesa.patch:  If no matching driver is found in the
-     .ids files, set "vesa" as a fallback default, otherwise a driver
-     may be selected regardless of whether it actually provides support
-     for the chipset by videoPtrToDriverList() based on its vendor id.
-     (LP: #261977)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 23 Oct 2008 06:21:18 -0700
-
-xorg-server (2:1.5.2-2ubuntu1) intrepid; urgency=low
-
-  * debian/patches/150_no_visibility_notify_on_unredirect.patch
-    - do not sent VisibilityNotify events when MapUnmapEvents
-      are disabled (LP: #278112)
-
- -- Michael Vogt <michael.vogt@ubuntu.com>  Sat, 18 Oct 2008 00:05:30 +0200
-
-xorg-server (2:1.5.2-1ubuntu4) intrepid; urgency=low
-
-  * Update patch 142_psb_auto to only try vesa, not even psb, as this requires
-    the psb driver to be loadable, and it's not available anymore (and broken
-    anyway).
-
- -- Loic Minier <lool@dooz.org>  Wed, 15 Oct 2008 18:14:28 +0200
-
-xorg-server (2:1.5.2-1ubuntu3) intrepid; urgency=low
-
-  * Shut up rmdir error when trying to remove dirs; this might confuse
-    debconf.
-
- -- Loic Minier <lool@dooz.org>  Wed, 15 Oct 2008 17:57:13 +0200
-
-xorg-server (2:1.5.2-1ubuntu2) intrepid; urgency=low
-
-  * Update patch 142_psb_auto to also try psb and vesa for 0x8109.
-  * Apply and drop patch 123_no_composite_for_xvfb_run which was changing
-    files below debian/ (xvfb-run, to disable the Composite extension by
-    default).
-
- -- Loic Minier <lool@dooz.org>  Wed, 15 Oct 2008 15:27:23 +0200
-
-xorg-server (2:1.5.2-1ubuntu1) intrepid; urgency=low
-
-  * Merge from debian-experimental.
-  * Update patch 142_psb_auto to try vesa if psb fails; thanks Oliver Grawert.
-  * Refresh patch 100_xserver_exa_force_greedy to apply cleanly.
-  * Let xserver-xorg-core conflict with xserver-xorg-video-psb
-    << 0.15.0-0ubuntu1~804um5 as these versions didn't have an ABI provide.
-
- -- Loic Minier <lool@dooz.org>  Tue, 14 Oct 2008 23:03:06 +0200
-
-xorg-server (2:1.5.2-1) experimental; urgency=low
-
-  * New upstream bugfix release.
-  * debian/rules: define PCI_TXT_IDS_DIR to unbreak the pci id matching using
-    plain text files provided by drivers.
-  * Don't pass --with-serverconfig-path to configure, we only used to override
-    it for Xprint.
-  * Re-introduce the xserver-common package, containing
-    /usr/lib/xorg/protocol.txt and the Xserver(1) manpage for now.
-  * debian/rules: Use filter instead of findstring for noopt in
-    DEB_BUILD_OPTIONS.
-  * Remove obsolete conffile /etc/X11/xserver/SecurityPolicy on upgrades.
-  * Merge changes from 2:1.4.2-7.
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 11 Oct 2008 20:20:28 +0200
-
-xorg-server (2:1.5.1-1ubuntu3) intrepid; urgency=low
-
-  * Pull upstream changes from server-1.5-branch including b595b65e:
-    - Fix GKVE with key_code > 255 (LP: #274203)
-    - DGA: Fix ProcXF86DGASetViewPort for missing support in driver.
-      Fixes a segfault when trying to activate a DGA mode without
-      checking whether DGA modesetting is at all possible.
-    - Check nextEnabledOutput()'s return in bestModeForAspect()
-      In case no enabled outputs, we will reference wrong index of
-      output array.
-    - int10: Fix a nasty memory leak.
-    - int10: Don't warn when scanning for devices we don't have.
-      Some BIOSes (hi XGI!) will attempt to enumerate the PCI bus by
-      asking for the config space of every possible device number.
-      This despite perfectly functional BIOS methods to enumerate the
-      bus exactly.
-    - int10: Remove useless check.
-      If you have more than one PCI device with the same d/b/d/f, you're
-      already in trouble.
-    - http://bugs.freedesktop.org/show_bug.cgi?id=14373
-      xkb: squash canonical types into explicit ones on core reconstruction.
-      xkb: fix core keyboard map generation.
-    - xkb: fix use of uninitialized variable.
-    - Remove usage of mfbChangeWindowAttributes missed in e4d11e58c...
-    - Only build dri2 when DRI2 is enabled.
-  * Merge patches 138 and 139 into 137, and update the properties API to
-    match the current version in master (final API for XI 1.5).
-    (LP: #274728)
-  * Bump the build-dep on x11proto-input-dev and libxi-dev.
-  * Bump the serverminver because of newer properties API.
-  * Add Breaks against current synaptics and evdev, since they use the old
-    API and need to be updated with the server.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Fri, 10 Oct 2008 11:16:56 +0300
-
-xorg-server (2:1.5.1-1ubuntu2) intrepid; urgency=low
-
-  * Merge with Debian experimental:
-    - debian/rules: define PCI_TXT_IDS_DIR to unbreak the pci id matching
-      using plain text files provided by drivers. (LP: #261977)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Fri, 26 Sep 2008 12:05:12 +0300
-
-xorg-server (2:1.5.1-1ubuntu1) intrepid; urgency=low
-
-  * Merge with Debian experimental. (LP: #269388)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Wed, 24 Sep 2008 19:33:34 +0300
-
-xorg-server (2:1.5.1-1) experimental; urgency=low
-
-  * New upstream bugfix release.
-  * 02_Disable-DRI-in-Xephyr.patch: don't use DRI in Xephyr, as it doesn't
-    work correctly.
-  * Merge changelog from 2:1.4.2-6 (all changes are upstream now).
-
- -- Julien Cristau <jcristau@debian.org>  Wed, 24 Sep 2008 17:49:18 +0200
-
-xorg-server (2:1.5.0-1ubuntu1) intrepid; urgency=low
-
-  * Merge with Debian experimental.
-  * 141_improved_driver_selection.patch
-    - Allow returning multiple drivers to try for a given PCI id.
-      Also includes support for fallback drivers, but only when
-      not using an xorg.conf.
-  * 142_psb_auto.patch
-    - Renamed, refreshed.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Tue, 09 Sep 2008 11:44:13 +0300
-
-xorg-server (2:1.5.0-1) experimental; urgency=low
-
-  * New upstream release.
-  * Kill patch 50_Make-RandRQueryVersion-return-1.1-for-swapped-client.patch,
-    1.2 requests are properly swapped now.
-  * Bump videoabiver to 4 to match ABI_VIDEODRV_VERSION.  Yes, that means
-    rebuilding video drivers; sorry about that.
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 04 Sep 2008 02:05:47 +0200
-
-xorg-server (2:1.4.99.906-2ubuntu5) intrepid; urgency=low
-
-  * Bump the serverminver because of input properties.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Wed, 03 Sep 2008 16:03:28 +0300
-
-xorg-server (2:1.4.99.906-2ubuntu4) intrepid; urgency=low
-
-  [ Bryce Harrington ]
-  * 140_quell_acpid_errmsgs.patch: Don't fill the server log with errors
-    from not being able to connect to acpid. (LP: #247195)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Wed, 03 Sep 2008 10:48:24 +0300
-
-xorg-server (2:1.4.99.906-2ubuntu3) intrepid; urgency=low
-
-  [ Bryce Harrington ]
-  * 135_rethrow_signals.patch:  Update to make it catch and throw a
-    wider variety of signals, and do a clean shutdown of the X server
-    (code borrowed from FatalError()).
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 01 Sep 2008 13:19:46 -0700
-
-xorg-server (2:1.4.99.906-2ubuntu2) intrepid; urgency=low
-
-  * 103_inputproto_1.4.3_is_fine.patch:
-    - Don't require inputproto 1.4.4 in configure.ac..
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Thu, 28 Aug 2008 13:24:05 +0300
-
-xorg-server (2:1.4.99.906-2ubuntu1) intrepid; urgency=low
-
-  * Merge with Debian experimental.
-  * Dropped patches, upstream:
-    130_fedora_fix_procxkbsetxyz_to_work_on_all.patch
-    131_remove_open-coded_strcasestr.patch
-    132_add_parsing_for_xkb.options.patch
-    133_support_strlist_for_xkboptions.patch
-    134_protect_against_out_of_bounds.patch
-  * control: Fix build-dep on inputproto to >= 1.4.3-2ubuntu2 for
-    DeviceControlChanged.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Thu, 28 Aug 2008 12:39:33 +0300
-
-xorg-server (2:1.4.99.906-2) experimental; urgency=low
-
-  * Pull from server-1.5-branch as of Aug 27th
-    + input devices from xorg.conf aren't ignored if there is no ServerLayout
-      option (closes: #492140)
-  * Bump build-dep on inputproto to >= 1.4.4 for DeviceControlChanged.
-  * Merge in changes from 2:1.4.2-3 to 2:1.4.2-5.
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 28 Aug 2008 00:33:02 +0200
-
-xorg-server (2:1.4.99.906-1ubuntu4) intrepid; urgency=low
-
-  * 137_add_device_property_support.patch,
-    138_xi_expose_enable_disabledevice.patch,
-    139_xi_protect_against_null_handlers.patch:
-    - Add support for input-device properties.
-  * debian/control: Bump the build-depends on x11proto-input-dev
-    and libxi-dev.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Fri, 22 Aug 2008 09:00:14 +0300
-
-xorg-server (2:1.4.99.906-1ubuntu3) intrepid; urgency=low
-
-  * 130_fedora_fix_procxkbsetxyz_to_work_on_all.patch
-    136_fedora_force_switchcorekeyboard_for_evdev.patch
-    - Allow clients to set the layout.
-  * Drop 130_fedora_call_switchcorekeyboard.patch, obsoleted.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Wed, 06 Aug 2008 13:30:28 +0300
-
-xorg-server (2:1.4.99.906-1ubuntu2) intrepid; urgency=low
-
-  * Add 135_rethrow_signals.patch
-    - Currently Xorg "eats" its crash signals, issuing an error message
-      that it caught the signal and then aborts.  This patch raises the
-      signal it caught, so that subsequent crash handlers (i.e. apport)
-      can also catch and act on it.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 05 Aug 2008 16:20:46 -0700
-
-xorg-server (2:1.4.99.906-1ubuntu1) intrepid; urgency=low
-
-  * Merge with debian experimental, 1.5RC6 (LP: #247120, #253021)
-  * Drop 120_fedora_xserver-xaa-evict-pixmaps.patch, because offscreen
-    pixmaps are already disabled by default.
-  * Drop 124_fix_randr_no_crtc.patch, fixed upstream.
-  * Add 130_fedora_call_switchcorekeyboard.patch, a hack to fix fd.o bug
-    #16364. Breaks if the first hotplugged keyboard is not the wanted
-    keyboard.
-  * Patches from upstream master:
-    131_remove_open-coded_strcasestr.patch
-    - pre-requisite for the rest
-    132_add_parsing_for_xkb.options.patch
-    - parsing xkb.options didn't work (fd.o #16874)
-    133_support_strlist_for_xkboptions.patch
-    - allow using a list for xkb.options like before.
-    134_protect_against_out_of_bounds.patch
-    - protect against potential out-of-bounds indexing.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Tue, 05 Aug 2008 01:49:42 +0300
-
-xorg-server (2:1.4.99.906-1) experimental; urgency=low
-
-  * debian/rules: drop useless handling of nostrip in DEB_BUILD_OPTIONS (this
-    is taken care of by dh_strip); make the rules files and xsfbs.mk
-    parallel-safe, and enable parallel=n using example code from Debian
-    Policy.
-  * debian/rules: put the source package name and version in builderstring
-    instead of osvendor, add builder email as well; don't explicitly set
-    osname, configure sets it to $(uname -srm) by default.
-  * New upstream release candidate.
-    - fixes 64-bit Xephyr (closes: #491569)
-    - work around the DIX losing physical monitor dimensions for randr 1.1
-      drivers, in particular nvidia (closes: #488987)
-    - make sure RANDR reports refresh as 0 if pixel clock is 0 (closes:
-      #490258)
-    - doesn't try to load dri2 when it's not built (closes: #491651)
-  * Switch to running autoreconf at build time, and build-depend on automake,
-    libtool and xutils-dev.
-  * Reformat the SGI Free Software License B, to shut up over 1000 lintian
-    warnings.
-
- -- Julien Cristau <jcristau@debian.org>  Sun, 27 Jul 2008 18:30:45 +0200
-
-xorg-server (2:1.4.99.905-0ubuntu5) intrepid; urgency=low
-
-  * debian/rules:
-    Added --enable-record.  By default, xorg-server does not build the
-    RECORD extension.  Added the record module (for Xnee and other purposes).
-
- -- Chris Nasho <chris.nasho@sympatico.ca>  Thu, 31 Jul 2008 17:26:00 -0400
-
-xorg-server (2:1.4.99.905-0ubuntu4) intrepid; urgency=low
-
-  * debian/rules:
-    Add --enable-xcsecurity --enable-appgroup.  The SECURITY module was
-    disabled by default in commit 86b2e59bfb79bd042a13c35fbb4ccecec576f629,
-    as part of the SELinux merge.  However, we need the security module
-    for xauth on Kubuntu, else ubiquity fails.  (Ref. LP 247537)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 16 Jul 2008 06:01:45 -0700
-
-xorg-server (2:1.4.99.905-0ubuntu3) intrepid; urgency=low
-
-   * patches/124_fix_randr_no_crtc.patch:
-     + In certain circumstances, xrandr multiscreen initialization fails
-       to associate crtcs with monitors, resulting in startup failures
-       in some GDK-based applications when using -vesa.  This occurs
-       because mode-Clock, mode->HTotal, and mode->VTotal are all 0.
-       (LP: #246585)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 15 Jul 2008 07:01:13 -0700
-
-xorg-server (2:1.4.99.905-0ubuntu2) intrepid; urgency=low
-
-  * Merge with debian git, new changes:
-    - Build with --enable-glx-tls, we build mesa with TLS support
-      (otherwise swrast_dri.so might fail to load due to unresolved
-      symbols).
-    - Make the servers recommend libgl1-mesa-dri (>= 7.1~rc1).  Without
-      this package, the GLX extension fails to initialise (and takes the
-      server down) due to missing swrast_dri.so.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Mon, 07 Jul 2008 11:44:39 +0300
-
-xorg-server (2:1.4.99.905-0ubuntu1) intrepid; urgency=low
-
-  * Merge with Debian experimental, remaining changes:
-  * debian/control:
-    - Change maintainer address.
-    - xvfb Depends on xauth, xfonts-base.
-  * debian/patches:
-    - 100_xserver_exa_force_greedy.patch
-      Provide a mechanism for drivers to force greedy mode on.
-    - 101_fedora_xserver-1.3.0-document-fontpath-correctly.patch
-      Fixes document fontpaths shown in the man page.
-    - 102_ubuntu_sharevts_load_cpu.patch
-      Close console fd only when using --sharevts.
-    - 104_psb_auto.patch
-      Add automatic detection of Poulsbo hardware when running without a
-      Device definition.
-    - 107_fedora_dont_backfill_bg_none.patch
-      Disable backfilling of windows created with bg=none, which
-      would otherwise force a framebuffer readback.
-    - 110_fedora_no_move_damage.patch
-      Disable damage notifications on move for manually redirected windows.
-    - 120_fedora_xserver-xaa-evict-pixmaps.patch
-      A hack to evict XAA pixmaps and disable the pixmap cache when the first
-      texture is bound.
-    - 121_only_switch_vt_when_active.diff
-      Add a check to prevent the X server from changing the VT when
-      killing GDM from the console.
-    - 123_no_composite_for_xvfb_run.patch
-      Use "-extension Composite" to fix xvfb-run crashing.
-  * Cleaned up patches:
-    - upstream, either directly or otherwise implemented:
-      103_fedora_openchrome.patch, 105_reduce_wakeups_from_smart_scheduler.diff
-      108_fedora_honor_displaysize.patch, 109_glx_fail_if_no_texture_bound.diff
-      144_fedora_xserver-1.3.0-xnest-exposures.patch,
-      146_X86EMU-added-blacklist-for-I-O-port-in-0-0xFF-range.patch,
-      147_X86EMU-pass-the-correct-bus-dev-fn-tag-to-pci-emula.patch,
-      148_dix_touchscreen_fixes.diff,
-      149_add_quirks_for_physical_screen_size_issues.patch,
-      150_edid_quirk_lp154w01.patch, 151_x86emu_handle_cpuid.patch,
-      153_exa_skip_empty_glyphs.diff, 154_fix_rotation_for_multimon.diff,
-      155_exa_fix_off-by-one.diff, 156_resize_composite_overlay.diff,
-      157_fix_exa_pixmap_width.diff, 158_xkb_wrapping.diff,
-      159_xkb_default_to_null.diff, 160_default_to_intel.diff,
-      161_fix_big_endian_cursor.diff, 162_cve-2007-6429.diff,
-      163_fix_untrusted_access.diff, 164_fix_context_sharing.diff,
-      165_fedora_xserver-1.5.0-xaa-option-inversion.patch,
-      166_fix_lpl_monitors.diff, 167_xf86AutoConfig_geode_addition.diff,
-      168_closedir.patch,
-      170_xorg-xserver-1.4-cve-2008-1377.diff,
-      171_xorg-xserver-1.4-cve-2008-1379.diff,
-      172_xorg-xserver-1.4-cve-2008-2360.diff,
-      173_xorg-xserver-1.4-cve-2008-2361.diff,
-      174_xorg-xserver-1.4-cve-2008-2362.diff
-    - obsolete:
-      101_fedora-apm-typedefs.patch
-      104_fedora_init_origins_fix.patch
-      142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch
-      169_xf86AutoConfig_choose_default_driver_if_no_pci.patch
-    - unnecessary:
-      106_ubuntu_fpic_libxf86config.patch (the lib is not shipped)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Fri, 04 Jul 2008 13:39:34 +0300
-
-xorg-server (2:1.4.99.905-1) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * New upstream release candidate
-    - fixes FTBFS on alpha (closes: #472205); won't work, though, because
-      of #485528
-    - fixes FTBFS on GNU/kFreeBSD (closes: #482550)
-  * 001_ubuntu_add_extra_modelines_from_xorg.patch: remove, replace with
-    001_fedora_extramodes.patch stolen from fedora 9 cvs, rev 1.8.
-  * xvfb: recommend xauth instead of xbase-clients.
-  * xserver-xfbdev: recommend xfonts-base.
-  * debian/rules: drop our special handling for stripping modules, which I
-    think dates back to the days of the custom module loader.
-  * debian/rules: drop some remaining xprintisms.
-  * bump serverminver to 2:1.4.99.905.
-  * Stop build-depending on mesa-swx11-source (mesa 7.1 will build the
-    software driver itself), and don't pass --with-mesa-source to configure.
-  * Build with --enable-glx-tls, we build mesa with TLS support (otherwise
-    swrast_dri.so might fail to load due to unresolved symbols).
-  * Make the servers recommend libgl1-mesa-dri (>= 7.1~rc1).  Without this
-    package, the GLX extension fails to initialise (and takes the server down)
-    due to missing swrast_dri.so.
-
-  [ Timo Aaltonen ]
-  * Re-enable dri & glx.
-  * Add a build-dep on mesa-common-dev (>= 7.1~rc1) and bump the desired
-    version of libgl1-mesa-dev respectively.
-  * Bump the libdrm-dev build-dep version to 2.3.1.
-
- -- Julien Cristau <jcristau@debian.org>  Sun, 13 Jul 2008 23:33:05 +0200
-
-xorg-server (2:1.4.99.902-1) experimental; urgency=low
-
-  * Add postrm script for xserver-xorg-core, to remove
-    /var/log/Xorg.*.log{,.old} on purge (closes: #343384).
-  * Use dh_* -s instead of -a in binary-arch, to fix FTBFS on s390 (which
-    doesn't build xserver-xfbdev).
-  * New upstream release candidate.
-    + refresh 13_debian_add_xkbpath_env_variable.diff
-    + doesn't crash when there is no pci device (closes: #472823)
-    + includes a quirk for LPL monitors with broken EDID (closes: #473260)
-    + XKB is now enabled in Xnest (closes: #164379)
-  * Stop building Xprt, and drop related patches; it will be provided as a
-    separate package.
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 23 May 2008 00:58:45 +0200
-
-xorg-server (2:1.4.99.901-2) experimental; urgency=low
-
-  * xserver-xorg-dev needs to depend on libpciaccess-dev.
-  * Pull from upstream server-1.5-branch as of March 21st (commit 98249dfa).
-    + fixes build on ia64 (closes: #471663)
-  * Add missing conflicts on xserver-xorg-input-2.
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 21 Mar 2008 22:40:36 +0100
-
-xorg-server (2:1.4.99.901-1) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * New upstream release candidate
-  * Update patches:
-    + 001_ubuntu_add_extra_modelines_from_xorg.patch: remove useless
-      whitespace changes
-    + 02_libvgahw_gcc4_volatile_fix.diff: delete, the gcc bug this was working
-      around is fixed for a long time
-    + 03_auto_load_driver.diff, 04_auto_load_driver_no_conf.diff,
-      05_kill_type1.diff, 07_autoconfig_screen_with_device_section.diff,
-      08_better_dpms_logging.diff, 10_dont_look_in_home_for_config.diff,
-      11_dont_crash_on_bad_dri_mode.diff, 14_default_screen_section.diff,
-      21_glx_align_fixes.patch, 40_default_dpi_96.patch,
-      41_vbe_filter_less.diff,
-      42_dont_break_grab_and_focus_for_window_when_redirecting.diff,
-      43_allow_override_BIOS_EDID_preferred_mode.diff,
-      44_preferredmode_infinite_loop.diff,
-      45_only_XF86_APM_CAPABILITY_CHANGED_for_video_change_acpi_events.diff,
-      46_reduce_wakeups_from_smart_scheduler.patch,
-      47_fbdevhw_magic_numbers.diff, 51_xkb-and-loathing.diff,
-      93_xprint_fonts_fix: remove, applied upstream
-    + 06_use_proc_instead_of_sysfs_for_pci_domains.diff: disable for now,
-      shouldn't be needed with pciaccess
-    + 13_debian_add_xkbpath_env_variable.diff: refresh
-    + 94_xprint_XSERVER_LIBS: disable, should be fixed upstream
-  * Disable glx, dri and dri2 for now.
-  * Re-enable dmx, build the xdmx and xdmx-tools packages.
-  * Add build-deps on libpciaccess-dev and libssl-dev for Xorg, bump build-dep
-    on libpixman-1-dev to >= 0.9.5.
-  * Add build-dep on libxv-dev for Xephyr.
-  * Drop XS- prefix from Vcs-* debian/control fields.
-  * Bump videoabiver to 2.9, inputabiver to 2.1, serverminver to 2:1.4.99.901.
-  * Drop obsolete --with-rgb-path configure option.
-  * /etc/X11/xserver/SecurityPolicy is gone, don't install it.
-  * Don't build-dep on "foo (>= bar-1)", to fix lintian warnings.
-
-  [ Drew Parsons ]
-  * Remove 94_xprint_XSERVER_LIBS (not needed in xserver 1.5).
-
-  [ Brice Goglin ]
-  * Build the Xfbdev server for real now, in new package xserver-xfbdev,
-    closes: #439764.
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 14 Mar 2008 13:46:48 +0100
-
-xorg-server (2:1.4.2-11) unstable; urgency=low
-
-  * Bump x11proto-input-dev build-dep to >= 1.5.0 to fix keyboard layout
-    breakage with new libxi built against the same. Closes: #515976
-
- -- David Nusinow <dnusinow@debian.org>  Thu, 19 Feb 2009 21:52:24 -0500
-
-xorg-server (2:1.4.2-10) unstable; urgency=medium
-
-  * Cherry-pick from upstream: GLcore: make googleearth not crash the server
-    on sw-rendering (closes: #495483).
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 09 Jan 2009 02:26:06 +0100
-
-xorg-server (2:1.4.2-9) unstable; urgency=low
-
-  * Cherry-pick patches from upstream to make xf86ScaleAxis() work correctly.
-  * Steal patch from Fedora: more sanity checks to stop vmmouse from
-    segfaulting the server (closes: #503459).
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 13 Nov 2008 23:32:47 +0100
-
-xorg-server (2:1.4.2-8) unstable; urgency=low
-
-  * Add patch from Petr Salinger to fix PCI domain support on kfreebsd
-    (closes: #499501).
-  * xfree86: xf86SetDepthBpp needs to respect the driver's depth24flags.
-    Instead of forcing a 32bpp framebuffer, we pick a value that the driver
-    actually supports (closes: #504819, #486925); cherry-picked from upstream
-    git.
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 11 Nov 2008 20:46:52 +0100
-
-xorg-server (2:1.4.2-7) unstable; urgency=low
-
-  * Update debian/copyright to the SGI Free Software License B, version 2.0.
-    It now mirrors the free X11 license used by X.Org.
-    http://www.sgi.com/company_info/newsroom/press_releases/2008/september/opengl.html
-  * Not closing bug#211765 for now, because GL/glx/glxext.c and
-    hw/dmx/glxProxy/glxext.c are covered by the GLX Public License, which is
-    still not free.  SGI has since released their code under FreeB, but that
-    doesn't necessarily apply to contributions from other people.  Hopefully
-    this can be cleared up soon, though.
-  * xvfb-run: append to $ERRORFILE instead of truncating it, so the error
-    output from Xvfb is not deleted when we run 'xauth remove'.
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 30 Sep 2008 00:39:58 +0200
-
-xorg-server (2:1.4.2-6) unstable; urgency=low
-
-  * Xevie: always set rep.length to 0 (closes: #497337).  Thanks, Thorvald
-    Natvig!
-  * Xevie: swap replies if necessary, to not confuse clients with a different
-    endianness.
-  * Cherry-picked from upstream git:
-    XF86VidMode: Correct a NULL pointer dereference (closes: #498289)
-
- -- Julien Cristau <jcristau@debian.org>  Mon, 15 Sep 2008 01:21:13 +0200
-
-xorg-server (2:1.4.2-5) unstable; urgency=low
-
-  * Don't pretend we support randr 1.2 when queried by swapped clients.  The
-    dispatch code for RandR 1.2 requests would return BadImplementation anyway
-    (closes: #495833).
-  * Cherry-picked from upstream:
-    + exa: fix assert logic thinko.
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 26 Aug 2008 19:27:34 +0200
-
-xorg-server (2:1.4.2-4) unstable; urgency=low
-
-  * Re-enable patch 47_fbdevhw_magic_numbers.diff, fixes xen framebuffer
-    (closes: #493901).  Thanks, Olivier Tétard!  If someone knows why I
-    disabled it a year ago, I'd love to know.
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 15 Aug 2008 19:15:54 +0200
-
-xorg-server (2:1.4.2-3) unstable; urgency=low
-
-  * Add Romanian debconf translation (closes: #489069).  Thanks, Eddy
-    Petri?or!
-  * Update Dutch debconf translation (closes: #491663).  Thanks, Thijs
-    Kinkhorst!
-  * Pull from server-1.4-branch:
-    - Xi: ChangeDeviceControl presence events should set the appropriate
-      devchange
-    - Fix potential crasher in xf86CrtcRotate()
-  * Cherry-picked from 1.5:
-    - Work around the DIX losing mmWidth/mmHeight for RandR 1.1 DDXen
-      (closes: #491526).
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 02 Aug 2008 23:22:32 +0200
-
-xorg-server (2:1.4.2-2) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * GLX: zero the buffer used in __glXDisp_GetVisualConfigs (backport from
-    upstream).
-
-  [ Brice Goglin ]
-  * Cherry-pick various patches from upstream:
-    - Fix incorrect test regarding keyboard map.
-    - xfree86: append, not prepend, new input devices to xf86InputDevs.
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 18 Jul 2008 10:53:26 +0200
-
-xorg-server (2:1.4.2-1) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * New upstream release.
-  * Security fixes from the previous upload are included upstream.
-  * Cherry-pick patches from upstream git to make the LeftOf and Above options
-    in xorg.conf actually work (closes: #466526).
-  * 48_xaa_nooffscreenpixmaps.diff: disable XAA offscreen pixmaps by default;
-    they can be enabled with Option "XaaOffscreenPixmaps" (closes: #478277,
-    #433331).
-  * Cherry-pick various patches from upstream for Xorg's modes code:
-    - add quirks for monitors with broken EDID (closes: #473260)
-    - fix max clock computation
-    - inherit the preferred mode from the global configuration (so if you have
-      Modes "800x600" in the Display subsection the server will honor it
-      instead of ignoring it)
-  * Backport patch from upstream git to fix emulation of int1A PCI BIOS
-    services (closes: #404885).  Thanks, Robert de Bath!
-
-  [ Brice Goglin ]
-  * Update patches to not require -p0, closes: #485185.
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 26 Jun 2008 01:57:18 +0200
-
-xorg-server (2:1.4.1~git20080517-2) unstable; urgency=high
-
-  * High urgency upload for security fixes.
-  * New patch from upstream to fix multiple security issues reported by
-    iDefense:
-    CVE-2008-2360 - RENDER Extension heap buffer overflow
-    CVE-2008-2361 - RENDER Extension crash
-    CVE-2008-2362 - RENDER Extension memory corruption
-    CVE-2008-1379 - MIT-SHM arbitrary memory read
-    CVE-2008-1377 - RECORD and Security extensions memory corruption
-
- -- Julien Cristau <jcristau@debian.org>  Mon, 09 Jun 2008 14:59:04 +0200
-
-xorg-server (2:1.4.1~git20080517-1) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * Pass -DPRE_RELEASE=0 in CPPFLAGS, so we don't print the pre-release
-    warning in the Xorg log.
-  * Pull from upstream server-1.4-branch
-    + drop patch 40_default_dpi_96.patch applied upstream
-    + refresh patches 03_auto_load_driver.diff and
-      04_auto_load_driver_no_conf.diff
-  * Don't build-depend on packages with a -1 debian revision.
-  * Drop the XS- prefix from Vcs-* control fields.
-  * Add x11-common to the Depends field of xnest, xvfb and xserver-xephyr (its
-    init script sets up the /tmp/.X11-unix directory).
-  * Re-enable the dmx DDX, and build the xdmx and xdmx-tools packages (the
-    build is now fixed upstream); closes: #449254.
-
-  [ Drew Parsons ]
-  * Patch 95_xprint_disable_dbus disables dbus in Xprint by providing
-    dummy config functions. Taken from upstream commit
-    2a3d1421e0cc18822ae8f478fcc272e16a9e9340, with removal of
-    CONFIG_LIB from configure.ac shifted to 94_xprint_XSERVER_LIBS.
-    Closes: #472180.
-  * Enable the xprint DDX, and build the xprint and xprint-common packages.
-
- -- Julien Cristau <jcristau@debian.org>  Sun, 18 May 2008 13:36:11 +0200
-
-xorg-server (2:1.4.1~git20080507-1) unstable; urgency=low
-
-  * Pull from upstream server-1.4-branch, highlights:
-    - the server should now scale input events correctly
-    - xkb keymap failures now give an explanation instead of just a 'failed to
-      load' message
-  * Drop patch 51_xkb-and-loathing.diff, applied upstream
-  * Refresh patches 13_debian_add_xkbpath_env_variable.diff,
-    21_glx_align_fixes.patch, 46_reduce_wakeups_from_smart_scheduler.patch and
-    94_xprint_XSERVER_LIBS.
-  * chmod +x configure in debian/rules clean so we can build a git snapshot
-    where configure is not in the tarball.
-  * Cherry-pick fix from upstream's master branch to re-arm the DPMS timer
-    when re-enabling DPMS (closes: #397197).
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 08 May 2008 15:34:38 +0200
-
-xorg-server (2:1.4.1~git20080131-4) unstable; urgency=low
-
-  * fix AlwaysCore handling: enabling AlwaysCore in xorg.conf 1) is the
-    default, and 2) shouldn't prevent the device from sending core events
-    (closes: #461760).
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 29 Apr 2008 20:14:22 +0200
-
-xorg-server (2:1.4.1~git20080131-3) unstable; urgency=low
-
-  * XKB: Fix processInputProc wrapping (cherry-picked from upstream).
-    Thanks to Thomas Jaeger.  This should fix the bug with some keys getting
-    stuck (closes: #473165).
-  * xkb: when copying the keymap, make sure the structs default to 0/NULL
-    (cherry-picked from upstream).  Fixes a crash and closes: #461783.
-  * __glXDRIbindTexImage: Fail if no texture bound to pixmap's texture target
-    (cherry-picked from upstream).
-  * EXA: Fix off-by-one in polyline drawing (cherry-picked from upstream).
-  * EXA: Skip empty glyphs (cherry-picked from upstream).
-  * Fix overly-restrictive integer overflow check in EXA pixmap creation
-    (cherry-picked from upstream).  Fixes BadAlloc errors returned by
-    XCreatePixmap for pixmaps of width 8192 or greater (closes: #471782).
-
-  Following patches by Bart Trojanowski, stolen from the ubuntu package:
-  * 15_X86EMU-added-blacklist-for-I-O-port-in-0-0xFF-range.patch
-    - Restrict access to I/O ports in range 0-0xFF from x86emu.
-  * 16_X86EMU-pass-the-correct-bus-dev-fn-tag-to-pci-emula.patch
-    - Fix improper emulation of PCI access General Software BIOS.
-  * Add 17_x86emu_handle_cpuid.patch to fix X86EMU CPUID handling.
-    (closes: #451089).
-
- -- Julien Cristau <jcristau@debian.org>  Wed, 02 Apr 2008 00:20:15 +0200
-
-xorg-server (2:1.4.1~git20080131-2) unstable; urgency=low
-
-  [ Brice Goglin ]
-  * Add 46_reduce_wakeups_from_smart_scheduler.patch to reduce
-    power consumption, closes: #462700.
-
-  [ Drew Parsons ]
-  * Restore Xprint, cherry-picking commits
-    f7f79724fdea0cc6fda0e90e56431df937d49335 and
-    d67e210f3458b62d7d4a6032aabfda0004d661c1 from master (xserver 1.5).
-    Include patch 94_xprint_XSERVER_LIBS to give new meaning of
-    XSERVER_LIBS as expected in configure.ac from master (see commit
-    a02db0d500cac20d0f0f107d27c064a175018421). Delete
-    94_xprint_XSERVER_LIBS when we upgrade to xserver 1.5.
-
-  [ Julien Cristau ]
-  * Re-enable patch 51_xkb-and-loathing.diff: ignore SIGALRM around calls to
-    Popen()/Pclose() to fix a hang when opening menus in OpenOffice.org
-    (once again closes: #433131)
-  * Refresh all patches to make patch-audit happy.
-  * Pull from upstream server-1.4-branch as of March 14th.
-  * 42_dont_break_grab_and_focus_for_window_when_redirecting.diff removed,
-    applied upstream.
-  * Don't build xprint just yet, because it needs NEW processing.
-
-  [ David Nusinow ]
-  * Add 11_dont_crash_on_bad_dri_mode. See bugzilla #13860
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 14 Mar 2008 15:18:16 +0100
-
-xorg-server (2:1.4.1~git20080131-1ubuntu12) intrepid; urgency=low
-
-   * Fix multiple security issues:
-     + CVE-2008-2360 - RENDER Extension heap buffer overflow
-     + CVE-2008-2361 - RENDER Extension crash
-     + CVE-2008-2362 - RENDER Extension memory corruption
-     + CVE-2008-1379 - MIT-SHM arbitrary memory read
-     + CVE-2008-1377 - RECORD and Security extensions memory corruption
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 11 Jun 2008 10:54:15 -0700
-
-xorg-server (2:1.4.1~git20080131-1ubuntu11) intrepid; urgency=low
-
-  * 169_xf86AutoConfig_choose_default_driver_if_no_pci.patch
-    - Choose the default driver for the platform instead of the generic
-      default (vesa) if there is no PCI info.  Without this, on platforms
-      like PS3 where fbdev should be used rather than vesa, the system
-      will fail to start up.  (LP: #219424)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 13 May 2008 13:09:17 -0700
-
-xorg-server (2:1.4.1~git20080131-1ubuntu10) intrepid; urgency=low
-
-  [Timo Aaltonen]
-  * 166_fix_lpl_monitors.diff:
-    - fix LPL monitors properly (LP: #204065)
-
-  [Martin-Eric Racine]
-  * 167_xf86AutoConfig_geode_addition.diff:
-    - Autodetect geode video devices (LP: #219630)
-
-  [Bryce Harrington]
-  * 166_fix_lpl_monitors.diff:
-    - Modified to apply to Ubuntu
-  * 168_closedir.patch:
-    - Fix crash on PS3 due to closing a dir that wasn't successfully opened
-      (LP: #217647)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 13 May 2008 00:03:40 -0700
-
-xorg-server (2:1.4.1~git20080131-1ubuntu9) hardy; urgency=low
-
-  * debian/patches/series,
-    debian/patches/165_fedora_xserver-1.5.0-xaa-option-inversion.patch:
-    - Turn on patch included in previous commit - obviously accidentially
-      forgotten.
-    - Now that its really enabled, make it apply to 1.4.1 code base
-      accordingly. (LP: #182038)
-
- -- Alexander Sack <asac@ubuntu.com>  Tue, 15 Apr 2008 18:23:51 +0200
-
-xorg-server (2:1.4.1~git20080131-1ubuntu8) hardy; urgency=low
-
-  * debian/patches/165_fedora_xserver-1.5.0-xaa-option-inversion.patch:
-    - Turn XAA Offscreen Pixmaps off by default, and use
-      XaaOffscreenPixmaps "true" to turn them on.  This setting was an
-      early pre-EXA HW optimization attempt that didn't pan out; upstream is
-      deprecating XAA in favor of EXA generally, and for situations where
-      XAA is still in use recommends NOT using this optimization hack, since
-      they found it often just made performance worse, and sometimes created
-      visualization bugs.  People wishing to gain added performance should be
-      experimenting with EXA anyway, not this setting.  (closes LP: #182038)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 21 Apr 2008 12:30:53 -0700
-
-xorg-server (2:1.4.1~git20080131-1ubuntu7) hardy; urgency=low
-
-  * 159_xkb_default_to_null.diff:
-    When copying the keymap, make sure the structs default to 0/NULL.
-    (LP: #184651)
-  * 160_default_to_intel.diff:
-    Default to using intel instead of i810. (LP: #158709)
-  * 161_fix_big_endian_cursor.diff:
-    Fix RandR 1.2 driver interface conversion of two colour cursors to
-    ARGB. (LP: #141118)
-  * Fixes from the upstream 1.4-branch:
-    - 162_cve-2007-6429.diff:
-      CVE-2007-6429: Always test for size+offset wrapping.
-    - 163_fix_untrusted_access.diff:
-      Security: Fix for fdo bug #14480: untrusted access broken in 7.3.
-    - 164_fix_context_sharing.diff:
-      Fix context sharing between direct/indirect contexts
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Wed, 09 Apr 2008 11:06:04 +0300
-
-xorg-server (2:1.4.1~git20080131-1ubuntu6) hardy; urgency=low
-
-  * 157_fix_exa_pixmap_width.diff:
-    A patch from upstream to allow wider pixmaps with EXA (LP: #205599)
-  * 158_xkb_wrapping.diff:
-    A patch reviewed by upstream that prevents keys from getting stuck under
-    certain situations. (LP: #194214)
-  * 51_xkb-and-loathing.diff:
-    Re-enable. Ignore SIGALRM around calls to Popen()/Pclose() to fix a hang
-    when opening menus in OpenOffice.org. (LP: #204137)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Sun, 30 Mar 2008 19:18:32 +0300
-
-xorg-server (2:1.4.1~git20080131-1ubuntu5) hardy; urgency=low
-
-  * Add some patches from upstream 1.4-branch or proposed set:
-    - 109_glx_fail_if_no_texture_bound.diff
-      + __glXDRIbindTexImage: Fail if no texture bound to pixmap's texture
-        target.
-    - 153_exa_skip_empty_glyphs.diff
-      + Fix a crasher when EXA and RenderAccel is in use.
-    - 154_fix_rotation_for_multimon.diff
-      + Fix rotation for multi-monitor situation.
-    - 155_exa_fix_off-by-one.diff
-      + Fix off-by-one in polyline drawing.
-    - 156_resize_composite_overlay.diff
-      + Resize composite overlay window when the root window changes.
-        (LP: #199700)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Thu, 13 Mar 2008 18:21:41 +0200
-
-xorg-server (2:1.4.1~git20080131-1ubuntu4) hardy; urgency=low
-
-  * Add 152_xserver_exa_force_greedy.patch to provide a mechanism for
-    drivers to force greedy mode on.  (LP: #177492, others)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 19 Feb 2008 13:38:16 -0800
-
-xorg-server (2:1.4.1~git20080131-1ubuntu3) hardy; urgency=low
-
-  [ Bryce Harrington ]
-  * Add 150_edid_quirk_lp154w01.patch to fix font size on LGPhilipsLCD
-    LP154W01-TLAE (LP: #127827)
-  * Add 149_add_quirks_for_physical_screen_size_issues.patch to help
-    address various common EDID issues (like monitors that report in
-    centimeters instead of millimeters, etc.)  (LP: #151311)
-
-  [ Timo Aaltonen ]
-  * Add 151_x86emu_handle_cpuid.patch to fix X86EMU CPUID handling.
-    (LP: #180742)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Tue, 19 Feb 2008 17:48:05 +0200
-
-xorg-server (2:1.4.1~git20080131-1ubuntu2) hardy; urgency=low
-
-    * Add patch 148_dix_touchscreen_fixes.diff from Matthew Garrett to fix
-      touchscreen issues with DIX.
-      http://lists.freedesktop.org/archives/xorg-commit/2008-February/014648.html
-
- -- Steve Kowalik <stevenk@ubuntu.com>  Fri, 08 Feb 2008 10:30:04 +1100
-
-xorg-server (2:1.4.1~git20080131-1ubuntu1) hardy; urgency=low
-
-  [ Timo Aaltonen ]
-  * Merge with Debian unstable, remaining changes:
-  * debian/control:
-    - Change maintainer address.
-    - set Conflicts: xkb-data (<< 0.9), since xkb-path is
-      different compared to Dapper.
-    - xvfb Depends on xauth, xfonts-base.
-  * debian/patches:
-    - 101_fedora-apm-typedefs.patch:
-      Temporary hack from Fedora for broken kernels that don't publish the
-      /dev/apm_bios types.
-    - 102_ubuntu_sharevts_load_cpu.patch:
-      Close console fd only when using --sharevts.
-    - 103_fedora_openchrome.patch:
-      Patch from Fedora to use openchrome instead of via.
-    - 104_fedora_init_origins_fix.patch
-      Multihead initialization.
-    - 105_reduce_wakeups_from_smart_scheduler.diff:
-      Patch from upstream to reduce wakeups and improve battery life.
-    - 106_ubuntu_fpic_libxf86config.patch
-      Add -fPIC to makefiles for xfree86/parser.
-    - 107_fedora_dont_backfill_bg_none.patch
-      Disable backfilling of windows created with bg=none, which
-      otherwise would force a framebuffer readback.
-    - 110_fedora_no_move_damage.patch
-      Disable damage notifications on move for manually redirected windows.
-    - 120_fedora_xserver-xaa-evict-pixmaps.patch:
-      New version of the hack to copy textures from video memory. Shouldn't
-      break EXA anymore.
-    - 121_only_switch_vt_when_active.diff
-      Add a check to prevent the X server from changing the VT when
-      killing GDM from the console.
-    - 123_no_composite_for_xvfb_run.patch
-      Use "-extension Composite" to fix xvfb-run crashing.
-    - 133_psb_auto.patch
-      Add automatic detection of Poulsbo hardware when running
-      without a Device definition.
-    - 139_fedora_xserver-1.3.0-document-fontpath-correctly.patch
-      Fixes document fontpaths shown in the man page.
-    - 142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch
-      Composite on 8bpp pseudocolor root windows appears to fail, so just
-      disable it on anything pseudocolor for safety.
-    - 144_fedora_xserver-1.3.0-xnest-exposures.patch:
-      Only collect xnest exposures for xexposes with non-zero height and width.
-  * 108_fedora_honor_displaysize.patch:
-    - Patch from upstream/Fedora to honor the DisplaySize-setting.
-      (LP: #135738, b.fd.o #9758)
-  * Drop patch 100_avoid_acpi_insanity.diff, superseded by patch 45.
-
-  [ Bart Trojanowski, Martin-Eric Racine ]
-  * 146_X86EMU-added-blacklist-for-I-O-port-in-0-0xFF-range.patch
-    - Restrict access to I/O ports in range 0-0xFF from x86emu.
-    (LP: #140051)
-  * 147_X86EMU-pass-the-correct-bus-dev-fn-tag-to-pci-emula.patch
-    - Fix improper emulation of PCI access General Software BIOS.
-    (LP: #140051)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Tue, 05 Feb 2008 18:57:14 +0200
-
-xorg-server (2:1.4.1~git20080131-1) unstable; urgency=low
-
-  [ Brice Goglin ]
-  * Add 45_only_XF86_APM_CAPABILITY_CHANGED_for_video_change_acpi_events.diff
-    to prevent XF86_APM_CAPABILITY_CHANGED from being issued for all ACPI
-    events, thanks Sjoerd Simons, closes: #461463.
-
-  [ David Nusinow ]
-  * Update Japanese translation from Hideki Yamane. closes: #462761
-  * New upstream pull
-    + Fixes crashes due to absent LED's being referenced
-
- -- David Nusinow <dnusinow@debian.org>  Thu, 31 Jan 2008 21:43:12 -0500
-
-xorg-server (2:1.4.1~git20080118-1ubuntu2) hardy; urgency=low
-
-  * Remove the DPI patch for real this time, conflicts with the upstream
-    commit that was pulled.
-  * 105_reduce_wakeups_from_smart_scheduler.diff:
-    Patch from upstream to reduce wakeups and improve battery life.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Sat, 19 Jan 2008 20:26:41 +0200
-
-xorg-server (2:1.4.1~git20080118-1ubuntu1) hardy; urgency=low
-
-  * Merge with Debian unstable, remaining changes:
-  * debian/control:
-    - Change maintainer address.
-    - set Conflicts: xkb-data (<< 0.9), since xkb-path is
-      different compared to Dapper.
-    - xvfb Depends on xauth, xfonts-base.
-  * debian/patches:
-    - 100_avoid_acpi_insanity.diff
-      Don't send a configuration change event just because somebody's pressed
-      a brightness key.
-    - 101_fedora-apm-typedefs.patch:
-      Temporary hack from Fedora for broken kernels that don't publish the
-      /dev/apm_bios types.
-    - 102_ubuntu_sharevts_load_cpu.patch:
-      Close console fd only when using --sharevts.
-    - 103_fedora_openchrome.patch:
-      Patch from Fedora to use openchrome instead of via.
-    - 104_fedora_init_origins_fix.patch
-      Multihead initialization.
-    - 106_ubuntu_fpic_libxf86config.patch
-      Add -fPIC to makefiles for xfree86/parser.
-    - 107_fedora_dont_backfill_bg_none.patch
-      Disable backfilling of windows created with bg=none, which
-      otherwise would force a framebuffer readback.
-    - 110_fedora_no_move_damage.patch
-      Disable damage notifications on move for manually redirected windows.
-    - 120_fedora_xserver-xaa-evict-pixmaps.patch:
-      New version of the hack to copy textures from video memory. Shouldn't
-      break EXA anymore.
-    - 121_only_switch_vt_when_active.diff
-      Add a check to prevent the X server from changing the VT when
-      killing GDM from the console.
-    - 123_no_composite_for_xvfb_run.patch
-      Use "-extension Composite" to fix xvfb-run crashing.
-    - 133_psb_auto.patch
-      Add automatic detection of Poulsbo hardware when running
-      without a Device definition.
-    - 139_fedora_xserver-1.3.0-document-fontpath-correctly.patch
-      Fixes document fontpaths shown in the man page.
-    - 142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch
-      Composite on 8bpp pseudocolor root windows appears to fail, so just
-      disable it on anything pseudocolor for safety.
-    - 144_fedora_xserver-1.3.0-xnest-exposures.patch:
-      Only collect xnest exposures for xexposes with non-zero height and width.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Sat, 19 Jan 2008 02:40:00 +0200
-
-xorg-server (2:1.4.1~git20080118-1) unstable; urgency=low
-
-  [ Brice Goglin ]
-  * Add 42_dont_break_grab_and_focus_for_window_when_redirecting.diff
-    to prevent password authentication bypass, closes: #449108.
-
-  [ Julien Cristau ]
-  * New upstream snapshot
-    + includes the security fixes from the previous version
-    + fixes regression introduced by the fix for CVE-2007-6429 in the MIT-SHM
-      extension (closes: #461410)
-
- -- Brice Goglin <bgoglin@debian.org>  Fri, 18 Jan 2008 22:20:32 +0100
-
-xorg-server (2:1.4.1~git20080105-2) unstable; urgency=low
-
-  [ David Nusinow ]
-  * Improve dpms logging patch to correctly label message type
-
-  [ Brice Goglin ]
-  * Grab upstream commit db9ae863536fff80b5463d99e71dc47ae587980d
-    to set DEFAULT_DPI to 96 instead of 75.
-
-  [ Julien Cristau ]
-  * Fix multiple security issues
-    + CVE-2007-6427: XInput Extension Memory Corruption
-    + CVE-2007-6428: TOG-CUP Extension Memory Corruption
-    + CVE-2007-6429: EVI Extension Integer Overflow,
-                     MIT-SHM Extension Integer Overflow
-    + CVE-2007-5760: XFree86-Misc Extension Invalid Array Index
-    + CVE-2007-5958: file existence disclosure
-    + CVE-2008-0006: PCF font parser buffer overflow
-  * Bump Standards-Version to 3.7.3 (no changes).
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 17 Jan 2008 15:10:03 +0100
-
-xorg-server (2:1.4.1~git20080105-1ubuntu1) hardy; urgency=low
-
-  * Merge with Debian unstable, remaining changes:
-  * debian/control:
-    - Change maintainer address.
-    - set Conflicts: xkb-data (<< 0.9), since xkb-path is
-      different compared to Dapper.
-    - xvfb Depends on xauth, xfonts-base.
-  * debian/patches:
-    - 100_avoid_acpi_insanity.diff
-      Don't send a configuration change event just because somebody's pressed
-      a brightness key.
-    - 101_fedora-apm-typedefs.patch:
-      Temporary hack from Fedora for broken kernels that don't publish the
-      /dev/apm_bios types.
-    - 102_ubuntu_sharevts_load_cpu.patch:
-      Close console fd only when using --sharevts.
-    - 104_fedora_init_origins_fix.patch
-      Multihead initialization.
-    - 106_ubuntu_fpic_libxf86config.patch
-      Add -fPIC to makefiles for xfree86/parser.
-    - 107_fedora_dont_backfill_bg_none.patch
-      Disable backfilling of windows created with bg=none, which
-      otherwise would force a framebuffer readback.
-    - 110_fedora_no_move_damage.patch
-      Disable damage notifications on move for manually redirected windows.
-    - 120_fedora_xserver-xaa-evict-pixmaps.patch:
-      New version of the hack to copy textures from video memory. Shouldn't
-      break EXA anymore.
-    - 121_only_switch_vt_when_active.diff
-      Add a check to prevent the X server from changing the VT when
-      killing GDM from the console.
-    - 123_no_composite_for_xvfb_run.patch
-      Use "-extension Composite" to fix xvfb-run crashing.
-    - 133_psb_auto.patch
-      Add automatic detection of Poulsbo hardware when running
-      without a Device definition.
-    - 138_fedora_xserver-1.3.0-default-dpi.patch
-      Changes default dpi to 96.
-    - 139_fedora_xserver-1.3.0-document-fontpath-correctly.patch
-      Fixes document fontpaths shown in the man page.
-    - 142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch
-      Composite on 8bpp pseudocolor root windows appears to fail, so just
-      disable it on anything pseudocolor for safety.
-    - 144_fedora_xserver-1.3.0-xnest-exposures.patch:
-      Only collect xnest exposures for xexposes with non-zero height and width.
-  * debian/patches/103_fedora_openchrome.patch:
-    - Patch from Fedora to use openchrome instead of via.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Tue, 08 Jan 2008 18:05:21 +0200
-
-xorg-server (2:1.4.1~git20080105-1) unstable; urgency=low
-
-  * Don't reference non-existent bug-reporting.txt file in xvfb-run.1
-  * New upstream git pull, again from the server-1.4-branch
-    + Drop 08_xkb_infinite_loop.diff, it's upstream now
-  * Improve logging when DPMS is enabled implicitly
-    + Adds 08_better_dpms_logging.diff
-
- -- David Nusinow <dnusinow@debian.org>  Sun, 06 Jan 2008 16:56:38 -0500
-
-xorg-server (2:1.4.1~git20071212-1ubuntu2) hardy; urgency=low
-
-  * debian/patches/101_fedora-apm-typedefs.patch:
-    - Temporary hack from Fedora for broken kernels that don't publish the
-      /dev/apm_bios types.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Mon, 17 Dec 2007 11:54:46 +0200
-
-xorg-server (2:1.4.1~git20071212-1ubuntu1) hardy; urgency=low
-
-  * Merge with Debian unstable, remaining changes:
-  * debian/control:
-    - Change maintainer address.
-    - set Conflicts: xkb-data (<< 0.9), since xkb-path is
-      different compared to Dapper.
-    - xvfb Depends on xauth, xfonts-base.
-  * debian/patches:
-    - 100_avoid_acpi_insanity.diff
-      Don't send a configuration change event just because somebody's pressed
-      a brightness key.
-    - 102_ubuntu_sharevts_load_cpu.patch:
-      Close console fd only when using --sharevts.
-    - 104_fedora_init_origins_fix.patch
-      Multihead initialization.
-    - 106_ubuntu_fpic_libxf86config.patch
-      Add -fPIC to makefiles for xfree86/parser.
-    - 107_fedora_dont_backfill_bg_none.patch
-      Disable backfilling of windows created with bg=none, which
-      otherwise would force a framebuffer readback.
-    - 110_fedora_no_move_damage.patch
-      Disable damage notifications on move for manually redirected windows.
-    - 120_fedora_xserver-xaa-evict-pixmaps.patch:
-      New version of the hack to copy textures from video memory. Shouldn't
-      break EXA anymore.
-    - 121_only_switch_vt_when_active.diff
-      Add a check to prevent the X server from changing the VT when
-      killing GDM from the console.
-    - 123_no_composite_for_xvfb_run.patch
-      Use "-extension Composite" to fix xvfb-run crashing.
-    - 133_psb_auto.patch
-      Add automatic detection of Poulsbo hardware when running
-      without a Device definition.
-    - 138_fedora_xserver-1.3.0-default-dpi.patch
-      Changes default dpi to 96.
-    - 139_fedora_xserver-1.3.0-document-fontpath-correctly.patch
-      Fixes document fontpaths shown in the man page.
-    - 142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch
-      Composite on 8bpp pseudocolor root windows appears to fail, so just
-      disable it on anything pseudocolor for safety.
-    - 144_fedora_xserver-1.3.0-xnest-exposures.patch:
-      Only collect xnest exposures for xexposes with non-zero height and width.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Thu, 13 Dec 2007 13:43:35 +0200
-
-xorg-server (2:1.4.1~git20071212-2) unstable; urgency=low
-
-  * Add patch 08_xkb_infinite_loop.diff from upstream bug#13511: papers over
-    an infinite loop in event processing (closes: #451989).
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 22 Dec 2007 00:02:01 +0100
-
-xorg-server (2:1.4.1~git20071212-1) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * debian/rules: Use lsb_release -i -s to get the vendor name, instead of
-    hardcoding "Debian".
-  * debian/control: build-dep on lsb-release.
-  * Cherry-pick commit f30abe30 from master: edid quirk for MAX 0x77e monitor.
-  * Add patch 44_preferredmode_infinite_loop.diff from upstream git: fixes an
-    infinite loop when PreferredMode is used in xorg.conf.
-
-  [ David Nusinow ]
-  * New upstream version. This is based on the server-1.4-branch, and includes
-    all the changes in the 1.4.0.90 (pre-)release as well as additional fixes.
-    This is primarily a bugfix release
-    + Remove 12_bgPixel_fix_64bit_issue.diff. Applied upstream
-
- -- David Nusinow <dnusinow@debian.org>  Wed, 12 Dec 2007 20:19:11 -0500
-
-xorg-server (2:1.4.1~git20071119-1ubuntu1) hardy; urgency=low
-
-  * Merge with Debian unstable, remaining changes:
-  * debian/control:
-    - Change maintainer address.
-    - set Conflicts: xkb-data (<< 0.9), since xkb-path is
-      different compared to Dapper.
-    - xvfb Depends on xauth, xfonts-base.
-  * debian/rules:
-    - --with-os-vendor=Ubuntu
-  * debian/patches:
-    - 100_avoid_acpi_insanity.diff
-      Don't send a configuration change event just because somebody's pressed
-      a brightness key.
-    - 102_ubuntu_sharevts_load_cpu.patch:
-      Close console fd only when using --sharevts.
-    - 104_fedora_init_origins_fix.patch
-      Multihead initialization.
-    - 106_ubuntu_fpic_libxf86config.patch
-      Add -fPIC to makefiles for xfree86/parser.
-    - 107_fedora_dont_backfill_bg_none.patch
-      Disable backfilling of windows created with bg=none, which
-      otherwise would force a framebuffer readback.
-    - 110_fedora_no_move_damage.patch
-      Disable damage notifications on move for manually redirected windows.
-    - 121_only_switch_vt_when_active.diff
-      Add a check to prevent the X server from changing the VT when
-      killing GDM from the console.
-    - 123_no_composite_for_xvfb_run.patch
-      Use "-extension Composite" to fix xvfb-run crashing.
-    - 133_psb_auto.patch
-      Add automatic detection of Poulsbo hardware when running
-      without a Device definition.
-    - 138_fedora_xserver-1.3.0-default-dpi.patch
-      Changes default dpi to 100.
-    - 139_fedora_xserver-1.3.0-document-fontpath-correctly.patch
-      Fixes document fontpaths shown in the man page.
-    - 142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch
-      Composite on 8bpp pseudocolor root windows appears to fail, so just
-      disable it on anything pseudocolor for safety.
-    - 144_fedora_xserver-1.3.0-xnest-exposures.patch:
-      Only collect xnest exposures for xexposes with non-zero height and width.
-  * Bring back old changelog entries.
-  * debian/patches/120_fedora_xserver-xaa-evict-pixmaps.patch:
-    - New version of the hack to copy textures from video memory. Shouldn't
-      break EXA anymore.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Tue, 20 Nov 2007 15:35:59 +0200
-
-xorg-server (2:1.4.1~git20071119-1) unstable; urgency=low
-
-  * Ship a .orig.tar.gz that's been autoreconf'ed. Closes: #451891
-  * Re-enable validation of the screen section of xorg.conf
-    Modify 14_default_screen_section.diff. This also fixes a problem where the
-    server can't find the device section when it is specified in the screen
-    section. Closes: #451950
-
- -- David Nusinow <dnusinow@debian.org>  Mon, 19 Nov 2007 20:38:04 -0500
-
-xorg-server (2:1.4.1~git20071117-1) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * Add conflict on xserver-xorg-input-wacom (<< 0.7.8) to xserver-xorg-core.
-    That driver is built against the old ABI, but doesn't provide
-    xserver-xorg-input.
-
-  [ David Nusinow ]
-  * Add 14_default_screen_section.diff. This allows you to not have a screen
-    section in your xorg.conf. A basic default one with a simple identifier
-    will be created for you in this case using all default values
-
-  [ Christian Perrier ]
-  * Debconf translations:
-  * Galician. Closes: #444764
-  * German. Closes: #444917
-  * Brazilian Portuguese. Closes: #445266
-  * Russian. Closes: #443859
-  * Portuguese. Closes: #445051
-  * Slovak. Closes: #446418, #448220
-
-  [ Brice Goglin ]
-  * Bump x11proto-core-dev build-dependency to >= 7.0.9,
-    thanks Max Kellermann, closes: #446869.
-
-  [ David Nusinow ]
-  * New upstream stable snapshot
-    + fixes a bunch of input-related bugs, notably keyboard leds
-      (closes: #440743 and its pile of duplicates)
-  * Remove patches merged in this snapshot
-    + 08_exa_fix_exaFillRegionTiled_fallback.diff
-    + 11_exa_no_negative_tile_offsets.diff
-    + 42_fix_RemoveGeneralSocket_crash_from_dbus.diff
-    + 44_XKB_mapping_changes_for_all_core-sending_devices.diff
-    + 45_GetKeyboardEvents_reject_out-of-range_keycodes.diff
-  * Make xephyr recommend xfonts-base. Closes: #451542
-
- -- David Nusinow <dnusinow@debian.org>  Sat, 17 Nov 2007 18:54:02 -0500
-
-xorg-server (2:1.4.1~git20071105-1ubuntu2) hardy; urgency=low
-
-  * Brown paper bag release: include all the patches.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Sat, 10 Nov 2007 15:24:28 +0200
-
-xorg-server (2:1.4.1~git20071105-1ubuntu1) hardy; urgency=low
-
-  * Merge with Debian unstable, remaining changes:
-  * debian/control:
-    - Change maintainer address.
-    - set Conflicts: xkb-data (<< 0.9), since xkb-path is
-      different compared to Dapper.
-    - xvfb Depends on xauth, xfonts-base.
-  * debian/rules:
-    - --with-os-vendor=Ubuntu
-  * debian/patches:
-    - 100_avoid_acpi_insanity.diff
-      Don't send a configuration change event just because somebody's pressed
-      a brightness key.
-    - 102_ubuntu_sharevts_load_cpu.patch:
-      Close console fd only when using --sharevts.
-    - 104_fedora_init_origins_fix.patch
-      Multihead initialization.
-    - 106_ubuntu_fpic_libxf86config.patch
-      Add -fPIC to makefiles for xfree86/parser.
-    - 107_fedora_dont_backfill_bg_none.patch
-      Disable backfilling of windows created with bg=none, which
-      otherwise would force a framebuffer readback.
-    - 110_fedora_no_move_damage.patch
-      Disable damage notifications on move for manually redirected windows.
-    - 121_only_switch_vt_when_active.diff
-      Add a check to prevent the X server from changing the VT when
-      killing GDM from the console.
-    - 123_no_composite_for_xvfb_run.patch
-      Use "-extension Composite" to fix xvfb-run crashing.
-    - 133_psb_auto.patch
-      Add automatic detection of Poulsbo hardware when running
-      without a Device definition.
-    - 138_fedora_xserver-1.3.0-default-dpi.patch
-      Changes default dpi to 100.
-    - 139_fedora_xserver-1.3.0-document-fontpath-correctly.patch
-      Fixes document fontpaths shown in the man page.
-    - 142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch
-      Composite on 8bpp pseudocolor root windows appears to fail, so just disable
-      it on anything pseudocolor for safety.
-    - 144_fedora_xserver-1.3.0-xnest-exposures.patch:
-      Only collect xnest exposures for xexposes with non-zero height and width.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Sat, 10 Nov 2007 13:07:55 +0200
-
-xorg-server (2:1.4-3) unstable; urgency=low
-
-  [ David Nusinow ]
-  * Minor cleanups of 03_autoload_drivers.diff. Thanks to Julien for
-    spotting all these ugly bits
-    + Newline after #else when picking the driver (this is the failsafe
-      choice)
-    + Change by hacked "ids" file name suffix check to use strncmp and check
-      for ".ids"
-    + Use strncpy instead of strncat unnecessarily
-  * Add support for a partially configured device section
-    Implemented in 03_autoload_driver.diff. Now if you have a device section
-    but lack a driver, it'll use the settings. This will allow you to just
-    have a device section and enable EXA but not have to specify the driver or
-    anything else.
-  * Add 07_autoconfig_screen_with_device_section.diff
-    This patch allows the Screen section to not specify a device section. If
-    this happens, the server will automatically use the first device section
-    listed in the xorg.conf instead
-
-  [ Brice Goglin ]
-  * Allow building the Xfbdev server in new package xserver-xfbdev, but leave
-    it disabled for now (see #439764).
-  * Add upstream commit 27ad5d74c20f01516a1bff73be283f8982fcf0fe as patch
-    44_XKB_mapping_changes_for_all_core-sending_devices.diff to fix broken
-    xmodmap invocation in .xsession, closes: #443044.
-  * Add upstream commit 0e800ca4651a947ccef239e6fe7bf64aab92257c as patch
-    45_GetKeyboardEvents_reject_out-of-range_keycodes.diff to fix crash
-    in GetKeyboardValuatorEvents, closes: #443697.
-
-  [ Christian Perrier ]
-  * Debconf templates and debian/control reviewed by the debian-l10n-
-    english team as part of the Smith review project. Closes: #442210
-  * Debconf translation updates:
-    - Swedish. Closes: #443047
-    - Czech. Closes: #443100
-    - French
-    - Vietnamese. Closes: #443174
-    - Italian. Closes: #422414
-  * New debconf translations
-    - Hungarian. Closes: #442956
-    - Thai. Closes: #442962
-    - Tamil. Closes: #443027
-    - Basque. Closes: #443156
-    - Hebrew. Closes: #443204
-    - Bulgarian. Closes: #443226
-    - Finnish. Closes: #443611
-
-  [ Julien Cristau ]
-  * Add patch backported from upstream commit
-    13949f997289068354e83bc83e50d97b8232efb1 to remove the type1 module: patch
-    05_kill_type1.diff replaces 48_disable_type1.diff, and is now enabled in
-    debian/patches/series.
-  * Don't build kdrive-based servers we're not shipping.
-  * Use ${binary:Version} instead of ${Source-Version}.
-  * Add 08_exa_fix_exaFillRegionTiled_fallback.diff by Michel Dänzer to punt
-    on fallback case not handled correctly in exaFillRegionTiled (backported
-    from master's c7d6d1f5); closes: #444203.
-  * Add 11_exa_no_negative_tile_offsets.diff by Michel Dänzer to make sure
-    tile offsets passed to drivers are never negative (backported from
-    master's 006f6525).
-  * Add 12_bgPixel_fix_64bit_issue.diff by Hong Liu: bgPixel (unsigned long)
-    is 64-bit on x86_64, so -1 != 0xffffffff (master's 9adea807).
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 29 Sep 2007 16:14:35 +0200
-
-xorg-server (2:1.4-2) unstable; urgency=low
-
-  [ Brice Goglin ]
-  * Add 42_fix_RemoveGeneralSocket_crash_from_dbus.diff to fix a crash
-    when leaving, closes: #440547.
-  * Add 43_allow_override_BIOS_EDID_preferred_mode.diff to allow overriding
-    BIOD/EDID preferred mode with Option PreferredMode in the config file.
-
-  [ David Nusinow ]
-  * Upload to unstable
-
- -- David Nusinow <dnusinow@debian.org>  Sun, 16 Sep 2007 14:24:18 -0400
-
-xorg-server (2:1.4-1) experimental; urgency=low
-
-  * New upstream release (X.Org 7.3)
-    + RandR doesn't mark Xinerama as active when no crtcs are enabled
-      (closes: #431746)
-  * Add proper depends to xserver-xorg-dev:
-    x11proto-core-dev, x11proto-input-dev (>= 1.4), x11proto-xext-dev,
-    x11proto-video-dev, x11proto-randr-dev (>= 1.2), x11proto-render-dev (>=
-    2:0.9.3), x11proto-fonts-dev
-  * Bump serverminver to 2:1.4, videoabiver to 2, inputabiver to 2.
-
- -- Julien Cristau <jcristau@debian.org>  Mon, 10 Sep 2007 14:35:38 +0200
-
-xorg-server (2:1.3.99.2-1) experimental; urgency=low
-
-  [ David Nusinow ]
-  * Refactor auto_load_driver patch to allow the same method to be used when
-    there is no xorg.conf present
-  * Add 04_auto_load_driver_no_config.diff to use my auto_load_driver method
-    when there's no xorg.conf present
-
-  [ Brice Goglin ]
-  * Simplify output redirections in the reportbug script,
-    thanks Justin Pryzby, closes: #358390.
-  * Add missing URL in long descriptions, update links to the upstream
-    module, fix some capitalization, thanks Christian Perrier.
-
-  [ Julien Cristau ]
-  * New upstream release candidate.
-    + bump build dep on renderproto to >= 0.9.3, and on pixman to >= 0.9.4-2.
-    + bump video abi version and serverminver.
-  * Drop the Conflict on fglrx-driver, which is taken care of by the abi
-    version.
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 04 Sep 2007 17:32:19 +0200
-
-xorg-server (2:1.3.99.0-2) experimental; urgency=low
-
-  * Improve 03_auto_load_driver.diff
-    + Move memory cleanup and directory closing to after the end label to
-      prevent leaks. Thanks Julien.
-    + Allow a driver to claim everything from a specific vendor. It does so by
-      only specifying a vendor ID and leaving the latter four digits empty.
-
- -- David Nusinow <dnusinow@debian.org>  Sun, 19 Aug 2007 16:06:54 -0400
-
-xorg-server (2:1.3.99.0-1) experimental; urgency=low
-
-  [ Julien Cristau, David Nusinow ]
-  * New upstream release candidate.
-    + X is now more tolerant of devices without a CtrlProc (closes: #269860).
-    + cvt(1) and gtf(1) typos fixed (closes: #432065).
-    + Make sure DRIScreenPrivIndex is -1 when no DRI screen private is
-      allocated. (closes: #413697).
-    + __glXDRIscreenProbe: Use drmOpen/CloseOnce (closes: #419614).
-    + segfault in swrast_Triangle fixed in mesa (closes: #407502).
-    + the Xvfb manpage doesn't refer to /usr/tmp anymore (closes: #270257).
-    + typos in Xserver(1) fixed (closes: #306688).
-
-  * Remove patches that were pushed upstream
-    + 03_xnest_manpage_overhaul.diff
-    + 04_read_rom_in_chunks.diff
-    + 05_module_defaults.diff
-    + 07_stolen_from_HEAD_xorgconf_manpage.diff
-    + 08_s390_servermd.diff
-    + 12_security_policy_in_etc.diff
-    + 16_s390_fix.diff
-    + 18_execinfo_configured.patch
-    + 23_kfreebsd_support.diff
-    + 24_hurd_ioperm_fix.diff
-    + 32_disable_sparc_pci_bridge.diff
-    + 39_alpha_build_flags.patch
-    + 40_consolidate_portPriv_pDraw_assignments.diff
-    + 42_only_run_special_key_behaviours_on_non-XKB.diff
-    + 44_fedora-xephyr-keysym-madness.diff (different fix applied upstream)
-    + 45_CVE-2007-2437.diff
-    + 46_export-ramdac-symbols.diff
-    + 49_map_keyboard_driver_to_kbd.diff
-    + 50_alpha_no_include_asm_pci.h.diff
-    + 94_use_default_font_path.diff
-    + 125_glx_remove-stray__GLinterface.diff,
-      126_glxproxy_remove-stray__GLinterface.diff and
-      127_mesa-6.5.3-compat.diff (obsolete)
-
-  * Update other patches:
-    + 09_debian_xserver_rtff.diff disabled (doesn't apply, and isn't even
-      used AFAICS;
-    + 11_define_XFree86Server.diff dropped, to be fixed in drivers instead;
-    + 13_debian_add_xkbpath_env_variable.diff refreshed;
-    + 21_glx_align_fixes.patch updated;
-    + 43_xephyr_crash_at_exit.diff dropped (doesn't apply);
-    + 47_fbdevhw_magic_numbers.diff disabled for now;
-    + 48_disable_type1.diff disabled for now;
-    + 51_xkb-and-loathing.diff disabled for now.
-
-  [ Julien Cristau ]
-  * Add build-dep on x11proto-input-dev (>= 1.4.2), libpixman-1-dev
-    (>= 0.9.0), libdbus-1-dev, libhal-dev (except on hurd-i386 for the last
-    two).
-  * Bump build-dep on mesa-swx11-source to >> 7.0.1~rc2-1.
-  * Bump serverminver to this version, videoabiver to 1.9, inputabiver to
-    0.9 (so this doesn't clash with a release and drivers have to be
-    rebuilt).
-  * Bump build-dep on compositeproto to >= 0.4.
-  * Install the upstream changelog.
-  * Disable the xprint and dmx DDX for now, they fail to build.
-  * xserver-xorg-dev needs a dependency on libpixman-1-dev.
-  * Add explanations about our tarball and upstream URL to debian/copyright.
-
-  [ Drew Parsons ]
-  * Update Xprint build to include pixman.
-
-  [ David Nusinow ]
-  * Add 03_auto_load_driver.diff. This patch allows the server to select a
-    driver and automatically create a Devices section when none is specified
-    in your xorg.conf. It chooses the driver based on a set of PCI ID's that
-    the driver itself provides in /usr/share/xserver-xorg/pci. If no driver
-    claims the PCI ID of your primary video card, then it will choose a
-    fallback based on your system.
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 18 Aug 2007 18:28:49 +0200
-
-xorg-server (2:1.3.0.0.dfsg-13) UNRELEASED; urgency=low
-
-  [ Debconf templates translations ]
-  * Italian added. Closes: #422414
-  * Slovak added. Closes: #438578
-
- -- Christian Perrier <bubulle@debian.org>  Sun, 26 Aug 2007 12:09:52 +0200
-
-xorg-server (2:1.3.0.0.dfsg-12ubuntu8) gutsy; urgency=low
-
-  * Add 145_glx_visuals_bound_check.patch to fix issue where mesa
-    incorrectly counts its visuals and can free too many of them during
-    video mode changes (VT switch, restart, hibernate, etc.) such as
-    when running Compiz.  (closes LP: #127101)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri, 28 Sep 2007 15:48:08 -0700
-
-xorg-server (2:1.3.0.0.dfsg-12ubuntu7) gutsy; urgency=low
-
-  * Drop 143_fedora_xserver-1.3.0-randr12-config-hack.patch
-    as it causes failure to detect proper resolution on some intel
-    hardware.  (closes LP: #144956)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 25 Sep 2007 14:42:59 -0700
-
-xorg-server (2:1.3.0.0.dfsg-12ubuntu6) gutsy; urgency=low
-
-  * Drop 214_Bug_9680-_Remove_bogus_blank_length_limiting_in_xf86SetModeCrtc.patch
-    as it is causing black bars to appear on screen for i810 users.
-    (closes LP: #137604 + several dupes)
-
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 20 Sep 2007 14:35:54 -0700
-
-xorg-server (2:1.3.0.0.dfsg-12ubuntu5) gutsy; urgency=low
-
-  [ Kees Cook ]
-  * debian/patches/132_composite-no-clipping.diff: Adjusted WindowRec
-    structure order and RedirectDraw logic to avoid nvidia crashes
-    (fixes LP: #130325).
-  * debian/patches/100_security_fdo-bug-7447.diff: Composite used for
-    pixmap population on redirect. [CVE-2007-4730]
-
- -- Bryce Harrington <bryce@ubuntu.com>  Tue, 18 Sep 2007 17:20:14 -0700
-
-xorg-server (2:1.3.0.0.dfsg-12ubuntu4) gutsy; urgency=low
-
-  * debian/patches/133_psb_auto.patch:  Add automatic detection of
-    Poulsbo hardware when running without a Device definition.
-  * Added some cherry-picked patches from fedora:
-    - 134_fedorda_xorg-x11-server-1.1.1-vt-activate-is-a-terrible-api.patch:
-      Fixes race condition where someone does a VT_ACTIVATE
-      between another ACTIVATE/WAITACTIVE by adding a fail.
-      (Potentially might address Ubuntu bugs 134478 and/or 134982)
-    - 135_fedora_xorg-x11-server-1.1.1-xkb-in-xnest.patch:  Fixes issue when
-      starting a session in an xnest nest environment as a different user,
-      where keyboard map does not get preserved.  Removes
-      NO_HW_ONLY_EXTS check to address this issue.  (RedHat bug 193431;
-      Potentially may address Ubuntu bug 44846)
-    - 136_fedora_xserver-1.2.0-honor-displaysize.patch:  Fixes issue if monitor
-      width and height have been specified, xserver would override them
-      with the hsize/vsize detected from DDC.
-    - 137_fedora_xserver-1.2.0-vfprintf.patch:  Fixes typo 'vfprinf'
-    - 138_fedora_xserver-1.3.0-default-dpi.patch:  Changes default dpi to 100.
-      (Addresses Ubuntu bugs 118745, 107320, many others...)
-    - 139_fedora_xserver-1.3.0-document-fontpath-correctly.patch: Fixes
-      document fontpaths shown in the man page.
-    - 140_fedora_xserver-1.3.0-domain-obiwan.patch:  Fixes longstanding bug in
-      domain support.
-    - 141_fedora_xserver-1.3.0-edid-quirk-backports.patch: Adds quirk for
-      Samsung SyncMaster 225BW.
-    - 142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch:  Composite on
-      8bpp pseudocolor root windows appears to fail, so just disable it
-      on anything pseudocolor for safety.
-    - 143_fedora_xserver-1.3.0-randr12-config-hack.patch:  Adds check to use
-      the screen's xrandr modes if a preferred mode was not specified.
-    - 144_fedora_xserver-1.3.0-xnest-exposures.patch:  Only collect xnest
-      exposures for xexposes with non-zero height and width.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri,  7 Sep 2007 14:23:23 -0700
-
-xorg-server (2:1.3.0.0.dfsg-12ubuntu3) gutsy; urgency=low
-
-  * Added some cherry-picked patches from xserver 1.3.99:
-    - 202_Add_quirk_for_Acer_AL1706_monitor_to_force_60hz_refresh.patch:
-      The Acer AL1706 monitor reports support for 75hz via EDID, but
-      does not sync when this range is given, so force it to 60hz.
-    - 205_Bug_10770-_Inputdevs_isnt_a_valid_config_file_keyword.patch:
-      Fixes typo in config file parser.
-    - 208_Bug_6620-_Fixed_a_missing_else_in_ATIPseudoDMAInit.patch:
-      Fixes issue where registers were written twice on R200, sometimes
-      also putting bad values in atis->cce_pri_size.
-    - 214_Bug_9680-_Remove_bogus_blank_length_limiting_in_xf86SetModeCrtc.patch:
-      Fixes situation where when a specific mode is requested by monitor
-      or user, xorg would tweak it to something incorrect.
-    - 216_Bug_9041-_Check_the_return_code_in_xf86MapDomainMemory.patch:
-      Fixes issue where mmap return value was being ignored and failing
-      to issue fatal error as it should.
-    - 221_ExaOffscreenMarkUsed-_Dont_crash_when_theres_no_offscreen_memory.patch:
-      Fixes crash when there is no offscreen memory for EXA.
-    - 222_Fix_a_crash_when_rotating_the_screen.patch:
-      Fixes crash when rotating screen with xrandr.
-    - 223_Fix_bug_8871-scrolling_corruption_with_a_compositing_manager.patch:
-      Fixes scrolling corruption with composite due to incorrectly
-      generated GraphicsExposes.
-    - 224_Fix_calculations_in_x86_emulator_for_the_long_long_case_Andreas_Schwab.patch:
-      Fixes long long multiplication when in x86 emulator.
-    - 227_Fix_sync_polarity_on_Samsung_SyncMaster_205BW_monitor.patch:
-      Adds quirk for Samsung SyncMaster 205BW
-    - 230_In___glXCreateARGBConfig_insert_the_new_GL_mode_at_the__end__of_the_linked_list.patch:
-      Fixes insertion order of linked list that can cause GLX clients to
-      fail when attempting to use the last GLX mode/visual.
-    - 231_In_dmxBackendMouGetInfo_initialize_the_info-minval_maxval_arrays_to_the_size_of_the_backend_display.patch:
-      Fixes potential issue in X input where axis clipping code in
-      GetPointerEvents() constrains the pointer's coordinate range to a
-      max of 0, causing the mouse to not move.
-    - 234_Reapply_patch_to_fix_AMD_CPU_detection.patch:
-      Fixes AMD Geode CPU detection.
-    - 236_Syncmaster_226_monitor_needs_60Hz_refresh_10545.patch:
-      Adds quirk for Samsung SyncMaster 226BW.
-    - 238_Update_pci.ids_to_2007-07-16_snapshot.patch:
-      Updates our pci ids to support more current hardware.
-      Remove nvidia ids in extrapci.ids that are now in pci.ids.
-      Add nvidia ids to extrapci.ids that are in xf86-video-nv but not pci.ids
-    - 241_XFree86-_Treat_evdev_and_vmmouse_as_mouse_drivers_bug_10512_10559.patch:
-      Fix issue where a default mouse device gets automatically added
-      when an evdev or vmmouse section has already been specified.
-    - 243_exaDriverInit-_Fail_if_pScreenInfo_or_a_member_of_it_is_invalid.patch:
-      Fix crash in EXA when pScreenInfo or a member of it is invalid.
-    - 244_fix_an_occasional_crash_in_GetWindowName_bug-_9798.patch:
-      Fixes crash by adding check of XmbTextPropertyToTextList()'s
-      return code.
-    - 245_regenerated_to_fix_bug_10371.patch:
-      Fixes issue where if DRI is disabled, GL_MAX_TEXTURE_COORDS_ARB
-      value is not returned correctly from glGetIntegerv().
-
- -- Bryce Harrington <bryce@ubuntu.com>  Fri, 31 Aug 2007 18:36:22 -0700
-
-xorg-server (2:1.3.0.0.dfsg-12ubuntu2) gutsy; urgency=low
-
-  * Don't send a configuration change event just because somebody's pressed
-    a brightness key
-
- -- Matthew Garrett <mjg59@srcf.ucam.org>  Sun, 26 Aug 2007 16:17:15 +0100
-
-xorg-server (2:1.3.0.0.dfsg-12ubuntu1) gutsy; urgency=low
-
-  * Merge from debian unstable, remaining changes:
-    - debian/control:
-      + set Conflicts: xkb-data (<< 0.9), since xkb-path is
-        different from previous releases
-      + do not Conflict with xserver-xorg-video
-      + xvfb Depends on xauth, xfonts-base
-      + Set Maintainer to Ubuntu Core Developers
-    - debian/rules:
-      + --with-os-vendor=Ubuntu
-    - debian/xserver-xorg-core.install:
-      + Add ioport, pcitweak, scanpci scripts & man pages
-    - debian/patches:
-      + 102_ubuntu_sharevts_load_cpu.patch:
-        close console fd only when ShareVTs
-      + 104_fedora_init_origins_fix.patch:
-        multihead initialization
-      + 106_ubuntu_fpic_libxf86config.patch:
-        Add -fPIC to makefiles for xfree86/parser
-      + 107_fedora_dont_backfill_bg_none.patch
-        110_fedora_no_move_damage.patch,
-        114_fedora_no_composite_in_xnest.patch,
-        120_fedora_disable_offscreen_pixmaps.patch:
-        further aiglx support
-      + 119_ubuntu_enable_composite.diff:
-        enable composite
-      + 121_only_switch_vt_when_active.diff:
-        Add a check to prevent the X server from changing the VT when killing
-        GDM from the console.
-      + 123_no_composite_for_xvfb_run.patch:
-        use "-extension Composite" to fix xvfb-run crashing
-      + 125_glx_remove-stray__GLinterface.diff,
-        126_glxproxy_remove-stray__GLinterface.diff,
-        127_mesa-6.5.3-compat.diff:
-        Patches needed to build against newer Mesa.
-      + 132_composite-no-clipping.diff:
-        Change the semantics of manual-redirect Composite windows so that
-        they do not clip sibling or parent drawing.  Needed by hildon-desktop
-        to prevent home applets from clipping.
-    - debian/apport.py: Add apport hook for automatically attaching
-      files useful for debugging X crashes:  Xorg.0.log, xorg.conf,
-      lsmod, lspci, and /proc/version
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Tue, 21 Aug 2007 22:01:38 +0300
-
-xorg-server (2:1.3.0.0.dfsg-12) unstable; urgency=low
-
-  [ Brice Goglin ]
-  * Add 51_xkb-and-loathing.diff to fix a hang in OpenOffice.org
-    when opening menus, closes: #433131.
-  * Install the exa(4) and fbdevhw(4) manpages.
-
-  [ Julien Cristau ]
-  * Update the xorg.conf(5) manpage to get documentation for RandR 1.2
-    options:
-    + 07_stolen_from_HEAD_xorgconf_manpage.diff: new patch;
-    + 07_xorgconf_manpage_overhaul.diff dropped;
-    + 34_xorg.conf_man_typos.patch dropped;
-    + 05_module_defaults.diff, 94_use_default_font_path.diff: dropped hunks
-      applying to hw/xfree86/doc/man/xorg.conf.man.pre.
-  * Add patch 11_define_XFree86Server.diff: XFree86Server needs to be defined
-    in xorg-server.h and exported to drivers.
-  * Add patches 125_glx_remove-stray__GLinterface.diff
-    126_glxproxy_remove-stray__GLinterface.diff and 127_mesa-6.5.3-compat.diff
-    to build with mesa >= 6.5.3, and bump build-dependency on
-    mesa-swx11-source.
-  * Include the Debian package version in OSVENDOR to make it appear in the
-    X log.
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 09 Aug 2007 16:32:14 +0200
-
-xorg-server (2:1.3.0.0.dfsg-11) unstable; urgency=low
-
-  * Yet another alpha build fix: also remove the asm/pci.h include from
-    os-support/linux/lnx_axp.c.  Include "lnx.h" and <unistd.h> instead.
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 14 Jul 2007 20:09:35 +0200
-
-xorg-server (2:1.3.0.0.dfsg-10) unstable; urgency=medium
-
-  * hw/xfree86/common/compiler.h and <sys/io.h> declare incompatible
-    prototypes for outb and friends, so change the patch from -9 to not
-    #include <sys/io.h> and rely on declarations in lnx.h itself for the
-    IOBASE_* macros.
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 14 Jul 2007 18:06:14 +0200
-
-xorg-server (2:1.3.0.0.dfsg-9) unstable; urgency=medium
-
-  * Include <sys/io.h> instead of <asm/pci.h> in
-    hw/xfree86/os-support/linux/lnx.h, as the latter isn't exported to
-    userspace anymore; fixes FTBFS on alpha.  Thanks, Steve Langasek!
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 14 Jul 2007 12:17:10 +0200
-
-xorg-server (2:1.3.0.0.dfsg-8) unstable; urgency=medium
-
-  * Medium-urgency upload to get the fix for #428794 in testing faster,
-    hopefully.
-
-  [ Brice Goglin ]
-  * Add 47_fbdevhw_magic_numbers.diff: patch by Adam Jackson to keep the
-    fbdev2xfree_timing() function from changing the pixel clock value if the
-    fbdev driver claims that it is 0.
-
-  [ Julien Cristau ]
-  * Don't build the type1 font module.
-  * Add patch by Alan Coopersmith to map (case-insensitively) the old
-    "keyboard" input driver to "kbd" (addresses: #428794).  I'm not
-    reassigning the bug to xserver-xorg-core for now so as not to break
-    testing by letting xserver-xorg-input-keyboard transition before the fixed
-    xorg-server.
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 14 Jul 2007 01:48:20 +0200
-
-xorg-server (2:1.3.0.0.dfsg-7) unstable; urgency=low
-
-  [ Brice Goglin ]
-  * Add 40_consolidate_portPriv_pDraw_assignments.diff to avoid a crash
-    in xf86XVReputVideo (closes: #424899, #431655).
-  * Add 41_vbe_filter_less.diff to not reject VESA modes early since
-    xf86ValidateModes should handle them just fine (closes: #424684).
-  * Add 42_only_run_special_key_behaviours_on_non-XKB.diff to fix special
-    keys in Xephyr (closes: #415025).
-  * Add 43_xephyr_crash_at_exit.diff to avoid crashing Xephyr when first
-    client disconnect (closes: #420421).
-
- -- Julien Cristau <jcristau@debian.org>  Wed, 04 Jul 2007 23:42:40 +0200
-
-xorg-server (2:1.3.0.0.dfsg-6ubuntu3) gutsy; urgency=low
-
-  * debian/patches/series:
-    - Re-enable 132_composite-no-clipping.diff with fix from upstream
-
- -- Bryce Harrington <bryce@ubuntu.com>  Wed, 25 Jul 2007 16:39:29 -0700
-
-xorg-server (2:1.3.0.0.dfsg-6ubuntu2) gutsy; urgency=low
-
-  * debian/patches/series:
-    - don't apply 132_composite-no-clipping.diff for now, it doesn't work
-      correctly when using compiz
-
- -- Sebastien Bacher <seb128@canonical.com>  Fri, 13 Jul 2007 17:03:42 +0100
-
-xorg-server (2:1.3.0.0.dfsg-6ubuntu1) gutsy; urgency=low
-
-  * Merge from Debian unstable. Remaining Ubuntu changes:
-    - debian/control:
-      + set Conflicts: xkb-data (<< 0.9), since xkb-path is
-        different from previous releases
-      + do not Conflict with xserver-xorg-video
-      + xvfb Depends on xauth, xfonts-base
-      + Set Maintainer to Ubuntu Core Developers
-    - debian/rules:
-      + build using -fno-stack-protector
-      + --with-os-vendor=Ubuntu
-    - debian/xserver-xorg-core.install:
-      + Add ioport, pcitweak, scanpci scripts & man pages
-    - debian/patches:
-      + 102_ubuntu_sharevts_load_cpu.patch:
-        close console fd only when ShareVTs
-      + 104_fedora_init_origins_fix.patch:
-        multihead initialization
-      + 106_ubuntu_fpic_libxf86config.patch:
-        Add -fPIC to makefiles for xfree86/parser
-      + 107_fedora_dont_backfill_bg_none.patch:
-        Re-enable to see if it helps with performance regressions.
-      + 108_fedora_gl_include_inferiors.patch,
-        110_fedora_no_move_damage.patch,
-        114_fedora_no_composite_in_xnest.patch:
-        further aiglx support
-      + 119_ubuntu_enable_composite.diff:
-        enable composite
-      + 120_fedora_disable_offscreen_pixmaps.patch:
-        update to the latest version from Fedora (rev. 1.6, was 1.1)
-        Despite being a hack, it works and is needed for compositing
-        managers to work properly.
-      + 121_only_switch_vt_when_active.diff:
-        Add a check to prevent the X server from changing the VT when killing
-        GDM from the console.
-      + 123_no_composite_for_xvfb_run.patch:
-        use "-extension Composite" to fix xvfb-run crashing
-      - 125_glx_remove-stray__GLinterface.diff,
-        126_glxproxy_remove-stray__GLinterface.diff,
-        127_mesa-6.5.3-compat.diff:
-        Mesa 6.5.3 build support
-  * debian/apport.py:  Add apport hook for automatically attaching
-    files useful for debugging X crashes:  Xorg.0.log, xorg.conf,
-    lsmod, lspci, and /proc/version
-  * debian/patches/132_composite-no-clipping.diff:  Change the
-    semantics of manual-redirect Composite windows so that they do not
-    clip sibling or parent drawing.  Needed by hildon-desktop to prevent
-    home applets from clipping.
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon,  2 Jul 2007 12:47:44 -0700
-
-xorg-server (2:1.3.0.0.dfsg-6) unstable; urgency=low
-
-  * Change fglrx conflict to << 8.37.6 (closes: #424975).
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 01 Jun 2007 14:58:39 +0200
-
-xorg-server (2:1.3.0.0.dfsg-5) unstable; urgency=low
-
-  [ Brice Goglin ]
-  * Add 24_hurd_ioperm_fix.diff to fix xf86Enable/DisableIO on Hurd with
-    recent GNU Mach. Thanks Samuel Thibault!
-  * Add 06_use_proc_instead_of_sysfs_for_pci_domains.diff since sysfs-based
-    PCI management code is broken at least on sparc and powerpc.
-    Closes: #422077, #422095. Thanks to Jim Watson for testing!
-  * Install the Xephyr README, closes: #395888.
-  * Update 07_xorgconf_manpage_overhaul.diff to drop the reference to the
-    xorg.conf example which we do not install since Xserver 1.3 does automatic
-    configuration, the manpage is very well documented, and we generate a
-    config file during installation. Closes: #222932.
-  * Fix warning in /etc/init.d/xprint when /usr/lib/X11/fonts does not exist.
-    Closes: #422352. Thanks Cristian Ionescu-Idbohrn!
-  * Pull upstream commit 9c80eda826448822328bb678a7d284cc43fffb17 to disable
-    RandR's fake xinerama geometry when there's more than one protocol screen
-    (closes: #420679).
-
-  [ Julien Cristau ]
-  * Add patch to make sure that the ramdac symbols are present in the server
-    and drivers can use them (closes: #423129).
-  * xserver-xorg-core Conflicts with fglrx-driver, which broke with 1.3.
-    We'll need to make this versioned (or drop it) when fglrx is fixed.
-
- -- Julien Cristau <jcristau@debian.org>  Wed, 16 May 2007 15:17:55 +0200
-
-xorg-server (2:1.3.0.0.dfsg-4ubuntu2) gutsy; urgency=low
-
-  * Build-Depend on mesa 6.5.3
-  * Apply Mandriva patches to build against mesa 6.5.3
-    - 125_glx_remove-stray__GLinterface.diff
-    - 126_glxproxy_remove-stray__GLinterface.diff
-    - 127_mesa-6.5.3-compat.diff
-
- -- Kyle McMartin <kyle@ubuntu.com>  Sat, 26 May 2007 18:12:35 +0000
-
-xorg-server (2:1.3.0.0.dfsg-4ubuntu1) gutsy; urgency=low
-
-  * Merge from Debian unstable. Remaining Ubuntu changes:
-    - debian/control:
-      + set Conflicts: xkb-data (<< 0.9), since xkb-path is
-        different from previous releases
-      + do not Conflict with xserver-xorg-video
-      + xvfb Depends on xauth, xfonts-base
-      + Set Maintainer to Ubuntu Core Developers
-    - debian/rules:
-      + build using -fno-stack-protector
-      + --with-os-vendor=Ubuntu
-    - debian/xserver-xorg-core.install:
-      + Add ioport, pcitweak, scanpci scripts & man pages
-    - debian/patches:
-      + 102_ubuntu_sharevts_load_cpu.patch:
-        close console fd only when ShareVTs
-      + 104_fedora_init_origins_fix.patch:
-        multihead initialization
-      + 106_ubuntu_fpic_libxf86config.patch:
-        Add -fPIC to makefiles for xfree86/parser
-      + 107_fedora_dont_backfill_bg_none.patch:
-        Re-enable to see if it helps with performance regressions.
-      + 108_fedora_gl_include_inferiors.patch,
-        110_fedora_no_move_damage.patch,
-        114_fedora_no_composite_in_xnest.patch:
-        further aiglx support
-      + 119_ubuntu_enable_composite.diff:
-        enable composite
-      + 120_fedora_disable_offscreen_pixmaps.patch:
-        update to the latest version from Fedora (rev. 1.6, was 1.1)
-        Despite being a hack, it works and is needed for compositing
-        managers to work properly.
-      + 121_only_switch_vt_when_active.diff:
-        Add a check to prevent the X server from changing the VT when killing
-        GDM from the console.
-      + 123_no_composite_for_xvfb_run.patch:
-        use "-extension Composite" to fix xvfb-run crashing
-  * Drop 124_fix-pdripriv_null_deref.patch.  Already fixed in GLX code.
-    See upstream FDO bug #8537
-
- -- Bryce Harrington <bryce@ubuntu.com>  Mon, 14 May 2007 16:40:03 -0700
-
-xorg-server (2:1.3.0.0.dfsg-4) unstable; urgency=low
-
-  * Cherry-pick patch from upstream git to fix security issue in the Xrender
-    extension: malicious clients can cause a division by zero in the server
-    (closes: #422936). Reference: CVE-2007-2437. Thanks, Micah Anderson!
-
- -- Julien Cristau <jcristau@debian.org>  Wed, 09 May 2007 02:11:08 +0200
-
-xorg-server (2:1.3.0.0.dfsg-3) unstable; urgency=low
-
-  * Include 94_use_default_font_path.diff. This patch is like Eugene's patch
-    to always look in the default font path from the past, but now we provide
-    an option to disable looking in the default font path at runtime. This
-    will allow people to specify additional font paths in their xorg.conf
-    without losing their current paths. This will also help avoid people
-    having ye olde "fixed font" problem.
-  * Fix compilation warnings for 05_module_defaults.diff. Previously the patch
-    used a generic pointer for the options record, but now we use the actual
-    XF86OptionsPtr type.
-
- -- David Nusinow <dnusinow@debian.org>  Thu, 26 Apr 2007 22:39:52 -0400
-
-xorg-server (2:1.3.0.0.dfsg-2) unstable; urgency=low
-
-  * Add Brice Goglin's fix for 05_module_defaults.diff, so that it also works
-    when there is no module section at all. Thanks to Michel Dänzer for
-    helping also.
-
- -- David Nusinow <dnusinow@debian.org>  Sat, 21 Apr 2007 09:34:12 -0400
-
-xorg-server (2:1.3.0.0.dfsg-1) unstable; urgency=low
-
-  * Upload to unstable.
-  * Add XS-Vcs-* to debian/control.
-  * Remove non-free file hw/xfree86/doc/README.DRI from the upstream tarball.
-  * Bump serverminver to 2:1.3.0.0.
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 20 Apr 2007 07:54:14 +0200
-
-xorg-server (2:1.3.0.0-1) experimental; urgency=low
-
-  * New upstream release
-
- -- David Nusinow <dnusinow@debian.org>  Thu, 19 Apr 2007 22:27:05 -0400
-
-xorg-server (2:1.2.99.905-3) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * xvfb now Recommends: xfonts-base (closes: #314598).
-
-  [ David Nusinow ]
-  * Add 05_module_defaults.diff. This provides default modules loading
-    capabilities for the server that may be overrided easily. Previously the
-    server would load a set of default modules, but only if none were
-    specified in the xorg.conf, or if you didn't have a xorg.conf at all. This
-    patch provides a default set and you can add only the "Load" instructions
-    to xorg.conf that you want without losing the defaults. Similarly, if you
-    don't want to load a module that's loaded by default, you can add
-    "Disable modulename" to your xorg.conf (see man xorg.conf in this release
-    for details). See upstream bug #10541 for more.
-
- -- David Nusinow <dnusinow@debian.org>  Sun, 15 Apr 2007 11:17:45 -0400
-
-xorg-server (2:1.2.99.905-2) experimental; urgency=low
-
-  * Install the cvt and gtf utilities and their manpages (closes: #414792).
-  * Build the xserver-xorg-core-dbg package, which contains debugging symbols
-    for Xorg and /usr/lib/xorg/modules/**/*.so
-
- -- Julien Cristau <jcristau@debian.org>  Mon, 09 Apr 2007 20:38:22 +0200
-
-xorg-server (2:1.2.99.905-1) experimental; urgency=low
-
-  * New upstream release candidate.
-    + includes fix for CVE-2007-1003: XC-MISC Extension ProcXCMiscGetXIDList()
-      Memory Corruption.
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 06 Apr 2007 12:05:40 +0200
-
-xorg-server (2:1.2.99.903-1) experimental; urgency=low
-
-  [ Drew Parsons ]
-  * Add exclude entries to dh_install in debian/rules.
-
-  [ Julien Cristau ]
-  * Prepare packaging to ship debugging symbols for xserver-xorg-core in
-    xserver-xorg-core-dbg, but leave it commented out so we can get rc3 in the
-    archive first.
-  * New upstream release candidate.
-    + bump serverminver to 2:1.2.99.903.
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 27 Mar 2007 07:33:29 +0200
-
-xorg-server (2:1.2.99.902-1) experimental; urgency=low
-
-  [ Drew Parsons ]
-  * Bring xprint back into the xorg fold.
-    - include existing patches:
-      - 91_ttf2pt1 allows Xprint to use ttf2pt1 for Type1 font handling
-       (but extract and apply manually the patch to
-               hw/xprint/ps/Makefile.am so it may be applied by autoconf)
-      - 91_ttf2pt1_updates brings ttf2pt1 into the modern X11R7.1 world
-      - 92_xprint-security-holes-fix.patch places PS/PDF file output
-       into the user's home directory (~/Xprintjobs), more secure than
-       a shared /tmp/Xprintjobs
-      - 93_spooltodir_check_file_exists ensures output filenames are
-       less than 256 characters in length
-      - 93_xprint_fonts_fix released references to font names after use.
-     - enable freetype support for Xprint.
-     - add descriptions to debian/control and Build-Dependency on
-       x11proto-print-dev
-  * Run autoreconf to update changes to hw/xprint/ps/Makefile.am.
-
-  [ Brice Goglin ]
-  * Apply patch from adrian@smop.co.uk to our xvfb-run wrapper
-    to check whether Xvfb started ok and fix its cleanup
-    (closes: #351042).
-
-  [ Julien Cristau ]
-  * New upstream release candidate.
-  * Bump serverminver to 2:1.2.99.902.
-  * Drop patch 42_build_int10_submodules.diff, and use x86emu on all
-    architectures instead (closes: #410879).
-  * Refresh patches:
-    + 12_security_policy_in_etc.diff
-    + 21_glx_align_fixes.patch
-    + 23_kfreebsd_support.diff
-  * Delete a few files generated by configure on clean, since they seem to
-    have been included in the tarball.
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 15 Mar 2007 04:28:00 +0100
-
-xorg-server (2:1.2.99.901-1) experimental; urgency=low
-
-  * New upstream release candidate.
-    + Remove patches 24 (hurd support), 35 (randr byteswap) and 43 (set damage
-      version), applied upstream.
-    + Bump build-dep on x11proto-randr-dev to >= 1.2, and on
-      x11proto-damage-dev to >= 1.1.
-
- -- Julien Cristau <jcristau@debian.org>  Wed,  7 Mar 2007 19:58:53 +0100
-
-xorg-server (2:1.2.0-6) experimental; urgency=low
-
-  * Set videoabiver to 1.0, same as in xorg-server 1.1.
-
- -- Julien Cristau <jcristau@debian.org>  Fri,  2 Mar 2007 16:38:12 +0100
-
-xorg-server (2:1.2.0-5) experimental; urgency=low
-
-  * Add input ABI versioning metadata. Rename serverabiver file to
-    videoabiver, and add inputabiver. Bump serverminver to 2:1.2.0-5 to deal
-    with this change.
-
- -- David Nusinow <dnusinow@debian.org>  Thu,  1 Mar 2007 22:09:45 -0500
-
-xorg-server (2:1.2.0-4) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * Don't strip modules when DEB_BUILD_OPTIONS contains nostrip.  Thanks,
-    Cyril Brulebois!
-
-  [ David Nusinow ]
-  * Move serverabiver file to serverminver. Use serverabiver to store the
-    actual video ABI version number (1.1 right now). This will allow drivers
-    to automatically generate their Provides: xserver-xorg-video-* line when
-    built against a particular server version. The rename of the files
-    is to better denote what they actually are.
-  * Bump the serverminver to 2:1.2.0-4 because of this change
-
- -- David Nusinow <dnusinow@debian.org>  Wed, 21 Feb 2007 21:53:51 -0500
-
-xorg-server (2:1.2.0-3ubuntu8) feisty; urgency=low
-
-  * SECURITY UPDATE: arbitrary code execution with root privs via integer
-    overflows in MISC-XC.
-  * Add debian/patches/131_misc_xc_overflows.patch: upstream fixes.
-  * References
-    CVE-2007-1003
-
- -- Kees Cook <kees@ubuntu.com>  Thu, 29 Mar 2007 17:46:44 -0700
-
-xorg-server (2:1.2.0-3ubuntu7) feisty; urgency=low
-
-  * debian/patches/120_fedora_disable_offscreen_pixmaps.patch
-    - update to the latest version from Fedora (rev. 1.6, was 1.1)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Fri, 30 Mar 2007 10:39:01 +0300
-
-xorg-server (2:1.2.0-3ubuntu6) feisty; urgency=low
-
-  * debian/{rules,xsfbs/xsfbs.mk,serverminver,inputabiver}
-    - Import changes from current debian package, needed for the new intel
-      driver.
-    - Rename serverabiver to videoabiver, value 1.0.
-    - Set serverminver as this version.
-  * debian/patches:
-    129_remove_extra_i2c_bittimeout.patch
-    130_slow_down_ddc_i2c.patch
-    - Patches from server-1.3 branch, which make probing the monitor more
-      robust.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Thu, 29 Mar 2007 00:56:17 +0300
-
-xorg-server (2:1.2.0-3ubuntu5) feisty; urgency=low
-
-  * debian/patches/120_fedora_disable_offscreen_pixmaps.diff
-    - Re-enable. Despite being a hack, it works and is needed for compositing
-      managers to work properly. (LP: #89189)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Tue, 27 Mar 2007 02:33:31 +0300
-
-xorg-server (2:1.2.0-3ubuntu4) feisty; urgency=low
-
-  * debian/patches/107_fedora_dont_backfill_bg_none.patch:
-    - Re-enable to see if it helps with performance regressions.
-  * debian/patches/127_check_for_clientgone.patch:
-    - A fix from upstream. (LP: #60288)
-  * debian/patches/128_fix_client_privates_leak.patch
-    - Plug a memory leak. (LP: #92882)
-  * debian/rules
-    - Fix a typo in --with-default-font-path.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Sat, 17 Mar 2007 00:38:09 +0200
-
-xorg-server (2:1.2.0-3ubuntu3) feisty; urgency=low
-
-  * debian/patches:
-    - Rename 019_ubuntu_enable_composite.diff to 119_* so that it is in line
-      with the rest of our patches
-    - Re-add 126_debian_always_use_default_font_path.diff. This was dropped
-      by Debian but needed by us since we still have legacy fontpaths in
-      old configurations, so new paths need to be appended to the list.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com>  Wed, 28 Feb 2007 11:54:18 +0200
-
-xorg-server (2:1.2.0-3ubuntu2) feisty; urgency=low
-
-  * debian/control:
-    - xvfb Depends on xauth, xfonts-base
-
- -- Sebastien Bacher <seb128@canonical.com>  Tue, 27 Feb 2007 23:31:06 +0100
-
-xorg-server (2:1.2.0-3ubuntu1) feisty; urgency=low
-
-  * Don't drop 42_build_int10_submodules.diff, it's useful
-  * 019_ubuntu_enable_composite.diff:
-    - enable composite
-  * debian/control:
-    - fixed Maintainer email
-  * debian/xserver-xorg-core.install:
-    - list ioport, gtf, pcitweak and scanpci
-      and manpages for scanpci, gtf, pcitweak
-
-  [ Timo Aaltonen ]
-  * Merge with Debian, remaining changes:
-    - debian/rules:
-      + build using -fno-stack-protector
-      + --with-os-vendor=Ubuntu
-    - debian/control:
-      + don't Conflict with xserver-xorg-video
-    - refreshed and renamed patches
-      102_ubuntu_sharevts_load_cpu.patch
-      104_fedora_init_origins_fix.patch
-      106_ubuntu_fpic_libxf86config.patch
-      114_fedora_no_composite_in_xnest.patch
-      121_only_switch_vt_when_active.diff
-      124_fix-pdripriv_null_deref.patch
-    - dropped for now:
-      42_build_int10_submodules.diff - causes "some regression"
-  * dropped patches (comments from Michel Daenzer):
-    - 107_fedora_dont_backfill_bg_none.patch
-      "Breaks X semantics and thus can't go in upstream. Apps/toolkits
-       need to be fixed not to use background none windows."
-    - 108_fedora_gl_include_inferiors.patch
-      "Breaks GLX semantics and should no longer be necessary now that
-       the GLX compositing managers default to using the Composite
-       Overlay Window."
-    - 120_fedora_disable_offscreen_pixmaps.diff
-      "Last time I looked at this, it was a gross hack to work around XAA
-       deficiencies in offscreen pixmap handling, which makes the server
-       die immediately when trying to use GLX_EXT_texture_from_pixmap
-       with EXA, due to calling XAA functions without checking it's
-       active or even loaded."
-  * debian/control:
-    - set Conflicts: xkb-data (<< 0.9), since xkb-path is
-      different from previous releases
-  * debian/patches/125_randr-version-supported.diff:
-    - The server supports protocol 1.1, make sure we use it.
-
- -- Sebastien Bacher <seb128@canonical.com>  Mon, 26 Feb 2007 09:36:38 +0100
-
-xorg-server (2:1.2.0-3) experimental; urgency=low
-
-  [ Julien Cristau ]
-  * Pass --with-os-name and --with-os-vendor to configure.
-  * Bump serverabiver to 2:1.2.0-1.
-  * Add patch from upstream git to set the supported damage version from the
-    server, instead of from the damage headers.  xserver 1.2.0 supports damage
-    1.0, not 1.1.
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 17 Feb 2007 12:03:03 +0100
-
-xorg-server (2:1.2.0-2) experimental; urgency=low
-
-  * Delete useless debian/substvars.
-  * Change my email address in debian/control.
-  * Fix patch 42_build_int10_submodules.diff.  The definition of
-    xf86InitInt10() was moved to int10/helper_exec.c between 1.1.1 and 1.2.0,
-    so we move it to int10/helper_mem.c, which we build in the main int10
-    module, not the vm86 and x86emu submodules.  Thanks to Cédric Augonnet and
-    Brice Goglin for the report and testing.
-
- -- Julien Cristau <jcristau@debian.org>  Sat, 10 Feb 2007 20:57:57 +0100
-
-xorg-server (2:1.2.0-1) experimental; urgency=low
-
-  * New upstream release.
-    + 40_xorg-xserver-1.1.0-dbe-render.diff dropped.
-    + 38_GetDrawableAttributes.patch dropped.
-    + 37_build-mesa-mipmap.patch dropped.
-    + 33_Xserver_man_typos.patch dropped.
-    + 24_hurd_support.diff massively reduced.
-    + 13_debian_add_xkbpath_env_variable.diff refreshed.
-    + 07_xorgconf_manpage_overhaul.diff updated.
-    + 42_build_int10_submodules.diff updated.
-  * Bump build-dep on mesa-swx11-source to >= 6.5.2.
-  * Version build-dependencies on x11proto-composite-dev and x11proto-kb-dev
-    to match configure.ac.
-  * Add build-dep on libxfixes-dev (needed for Xdmx).
-
- -- Julien Cristau <jcristau@debian.org>  Fri,  9 Feb 2007 20:54:27 +0100
-
-xorg-server (2:1.1.99.903-1) experimental; urgency=low
-
-  * New upstream release candidate.
-  * Forward-port patches:
-    * 07_xorgconf_manpage_overhaul.diff: refresh
-    * 12_security_policy_in_etc.diff: refresh
-    * 21_glx_align_fixes.patch: refresh
-    * 23_kfreebsd_support.diff: refresh
-    * 24_hurd_support.diff: refresh
-    * 34_xorg.conf_man_typos.patch: refresh
-    * 36_fix_ffs.patch: remove, applied upstream
-  * Bump build-dependency on libdrm-dev to (>= 2.3.0) because that is the X
-    server's minimum requirement.
-
- -- Thierry Reding <thierry@gilfi.de>  Sat,  2 Dec 2006 12:44:59 +0100
-
-xorg-server (2:1.1.99.902-1) experimental; urgency=low
-
-  * Update to latest upstream release candidate.
-  * Forward-port patches:
-    * 02_libvgahw_gcc4_volatile_fix.diff: update
-    * 04_read_rom_in_chunks.diff: update
-    * 05_arm_cache_flush.diff: remove, applied upstream
-    * 06_arm_is_not_x86_and_has_no_vga.diff: remove, applied upstream
-    * 07_xorgconf_manpage_overhaul.diff: update
-    * 08_s390_servermd.diff: update
-    * 09_debian_xserver_rtff.diff: update
-    * 12_security_policy_in_etc.diff: update
-    * 13_debian_add_xkbpath_env_variable.diff: update
-    * 15_symlink_mesa.diff: remove, fixed upstream
-    * 16_s390_fix.diff: update
-    * 17_ignoreabi.diff: remove, applied upstream
-    * 18_execinfo_only_for_backtrace.patch: remove, applied upstream
-    * 18_execinfo_configured.patch: remove, applied upstream
-    * 19_configurable_misc_utils.patch: remove, applied upstream
-    * 20_mesa_6.5.1.diff: remove, applied upstream
-    * 21_glx_align_fixes.patch: update
-    * 22_xkb_cycle_3layouts.diff: remove, applied upstream
-    * 23_kfreebsd_support.diff: update, partially applied upstream
-    * 24_hurd_support.diff: update, partially applied upstream
-    * 25_tfp_damage.diff: remove, applied upstream
-    * 26_aiglx_happy_vt_switch.diff: remove, applied upstream
-    * 27_aiglx_locking.diff: remove, applied upstream
-    * 28_mesa_copy_sub_buffer.diff: remove, applied upstream
-    * 29_mesa_reseed_makefile.diff: remove, fixed upstream
-    * 30_fix_vmode_switch.diff: remove, fixed upstream
-    * 31_blocksigio.diff: remove, fixed upstream
-    * 32_disable_sparc_pci_bridge.diff: update
-    * 34_xorg.conf_man_typos.patch: update
-    * 35_randr_byteswap.patch: update
-    * 36_fix_ffs.patch: update
-    * 37_Fix-__glXDRIbindTexImage-for-32-bpp-on-big-endian-platforms.diff:
-      remove, applied upstream
-  * Upstream no longer ships a changelog, so don't try to install it.
-  * Add 37_build-mesa-mipmap.patch that adds the missing mipmap.c to libmain's
-    sources.
-  * Add 38_GetDrawableAttributes.patch which readds support for the
-    GetDrawableAttributes extension that's needed for compiz to work properly.
-
- -- Thierry Reding <thierry@gilfi.de>  Fri,  1 Dec 2006 20:32:34 +0100
-
-xorg-server (2:1.1.1-21) unstable; urgency=emergency
-
-  * Security update.
-  * Fix integer overflow in the ProcXCMiscGetXIDList() function in the XC-MISC
-    extension.  Reference: CVE-2007-1003.
-
- -- Julien Cristau <jcristau@debian.org>  Wed, 04 Apr 2007 00:34:51 +0200
-
-xorg-server (2:1.1.1-20) unstable; urgency=low
-
-  * xephyr: Add patch from upstream git to fix memory leak in
-    ephyrScreenFini().  Thanks, Guillem Jover!
-
- -- Julien Cristau <jcristau@debian.org>  Tue,  6 Mar 2007 22:20:14 +0100
-
-xorg-server (2:1.1.1-19) unstable; urgency=high
-
-  [ Drew Parsons ]
-  * Removed spurious space in default font line
-    (/usr/X11R6/lib/X11/fonts/Type1 not "/usr/X11R6/lib/  X11/fonts/Type1")
-
-  [ David Nusinow ]
-  * Conflict with and replace xserver-common, because that package used to
-    provide the SecurityPolicy file. This is an RC bugfix because it breaks
-    upgrades, so it gets a high urgency. Thanks Christian Tsotras and Lionel
-    Elie Mamane for reporting and it. Closes: #402658
-
- -- David Nusinow <dnusinow@debian.org>  Wed, 28 Feb 2007 21:48:19 -0500
-
-xorg-server (2:1.1.1-18) unstable; urgency=medium
-
-  * Add patch from Fedora to make xephyr work on 64bit architectures
-    (closes: #405928).
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 16 Feb 2007 22:20:08 +0100
-
-xorg-server (2:1.1.1-17) unstable; urgency=medium
-
-  * Make the int10 module usable on i386 with a 64bit kernel (closes: #409730).
-    + New patch 42_build_int10_submodules.diff, which allows us to build vm86
-      and x86emu as two separate submodules, and make the int10 module itself
-      fall back to loading x86emu if vm86 calls fail.
-    + Add workaround for https://bugs.freedesktop.org/show_bug.cgi?id=7299 to
-      the above patch: move definition of Int10Current from int10/xf86int10.c
-      to int10/helper_mem.c.
-    + Drop the part of 39_alpha_build_flags.patch applying to
-      hw/xfree86/os-support/linux/Makefile.in, and run autoreconf with all
-      patches applied.
-
- -- Julien Cristau <jcristau@debian.org>  Wed,  7 Feb 2007 20:37:19 +0100
-
-xorg-server (2:1.1.1-16) unstable; urgency=medium
-
-  * New patch 41_xfree86_linux_acpi_fix_tokenizing.diff from upstream git to
-    fix a crash on acpi events (closes: #409443).
-
- -- Julien Cristau <julien.cristau@ens-lyon.org>  Sat,  3 Feb 2007 22:56:04 +0100
-
-xorg-server (2:1.1.1-15) unstable; urgency=high
-
-  * High-urgency upload for security bugfix.
-  * New patch 40_xorg-xserver-1.1.0-dbe-render.diff to fix multiple integer
-    overflows in the dbe and render extensions.
-    CVE IDs: CVE-2006-6101 CVE-2006-6102 CVE-2006-6103
-  * Add myself to Uploaders, and remove Fabio and Branden, with their
-    permission.  They're of course welcome back when they have more time!
-
- -- Julien Cristau <julien.cristau@ens-lyon.org>  Tue,  9 Jan 2007 15:45:46 +0100
-
-xorg-server (2:1.1.1-14) unstable; urgency=high
-
-  * The "let's drop 20 years of build logic and replace it with autoconf in a
-    single release, trust me, what could go wrong? <gibber, gibber>" release
-  * High-urgency upload for RC bugfix
-  * New patch 39_alpha_build_flags.patch: no really, when they said
-    lnx_ev56.c should be built with -mcpu=ev56, they really meant it.
-    Closes: #392500.
-
- -- Steve Langasek <vorlon@debian.org>  Sun,  7 Jan 2007 15:19:08 -0800
-
-xorg-server (2:1.1.1-13) unstable; urgency=medium
-
-  [ Julien Cristau ]
-  * xserver-xorg-core recommends xfonts-base and suggests xfonts-100dpi |
-    xfonts-75dpi and xfonts-scalable.  Also add explanation about fonts to the
-    long description, stolen from the old xserver-common package (closes:
-    #400654).
-
-  [ David Nusinow ]
-  * This is important for upgrades to etch, and has no notable risk, so bump
-    priority to medium.
-
- -- David Nusinow <dnusinow@debian.org>  Fri, 29 Dec 2006 19:57:51 -0500
-
-xorg-server (2:1.1.1-12) unstable; urgency=low
-
-  [ Julien Cristau ]
-  * Delete hw/xfree86/common/xf86Build.h in debian/rules clean, since it's
-    wrongly included in the upstream tarball.
-
-  [ David Nusinow ]
-  * Pull fix for the ignore_abi.diff patch. This one's a major brown bag on my
-    part. Thanks Michel Dänzer.
-  * Add 38_wait_for_something_force_timer_reset.diff which forces the server
-    to reset timers when they've overrun in some cases rather than wait
-    forever. Patch by Daniel Stone. Thanks Michel Dänzer for pointing the
-    changes out. Closes: #374026
-
- -- David Nusinow <dnusinow@debian.org>  Tue, 12 Dec 2006 21:13:20 -0500
-
-xorg-server (2:1.1.1-11) unstable; urgency=low
-
-  [ Drew Parsons ]
-  * Patches 33_Xserver_man_typos.patch and 34_xorg.conf_man_typos.patch
-    fix minor typos in Xserver and xorg.conf man pages.
-    Closes: #364556, #308899.
-  * Add patch 35_randr_byteswap.patch from upstream. Fixes a client/server
-    byteswapping problem. Closes: #291100.
-
-  [ Julien Cristau ]
-  * Don't build-depend on libdrm-dev on hurd-i386 (closes: #358015). Thanks,
-    Samuel Thibault.
-  * Update hurd support patch (closes: #356300). Thanks, Samuel Thibault.
-  * Add reportbug script stolen from the monolith, to add the user's config
-    and log file in every bug report.
-  * Delete hw/xfree86/common/xf86Build.h from our source tree, so that the
-    build date is correctly calculated at build time, and not hardcoded to
-    07 July 2006.  Thanks to Jurij Smakov for noticing.
-  * Add patch 36_fix_ffs.patch by Jurij Smakov to fix infinite loop in ffs()
-    if called with an argument of 0 (closes: #395564).
-  * Add patch 37_Fix-__glXDRIbindTexImage-for-32-bpp-on-big-endian-platforms
-    from upstream git to fix color issue on big endian platforms
-    (closes: #392453). Thanks to Michel Dänzer for the patch!
-  * Fix typo in xvfb-run (closes: #337703).
-  * Install xdmxconfig and its manpage in xdmx-tools (closes: #393991).
-  * Add Replaces: xdmx (<= 2:1.1.1-10) to xdmx-tools because of the xmdxconfig
-    manpage move.
-
- -- David Nusinow <dnusinow@debian.org>  Fri, 24 Nov 2006 15:44:52 -0500
-
-xorg-server (2:1.1.1-10) unstable; urgency=low
-
-  [ Denis Barbier ]
-  * Fix video mode switching.  Closes: #391052
-  * Fix FTBFS on kfreebsd-i386 and kfreebsd-amd64.  Thanks Petr Salinger.
-    Closes: #363517
-
-  [ David Nusinow ]
-  * Add depends on xserver-xorg so that /etc/X11/X gets installed. Thanks
-    Frans Pop. Closes: #392295
-  * Add 31_blocksigio.diff. This patch by Alan Hourihane, and it prevents a
-    race condition when a driver tries to set the cursor state when the server
-    is in the middle of switching resolution. Thanks to Frans Pop for
-    reporting the bug, Michel Dänzer for reading through the backtrace and
-    diagnosing the problem, and Alan for the final patch. Closes: #390646.
-
-  [ Jurij Smakov ]
-  * Add 32_disable_sparc_pci_bridge.diff. Disable PCI bridge handling on
-    sparc, which is broken and causes filesystem corruption (by poking
-    the PCI bus in the wrong places) on some machines. Closes: #392312.
-
-  [ Drew Parsons ]
-  * Use __appmansuffix__ not __mansuffix__ in
-    03_xnest_manpage_overhaul.diff.  Closes: #390599.
-  * Install upstream ChangeLog.  Closes: #365274.
-
- -- David Nusinow <dnusinow@debian.org>  Mon, 16 Oct 2006 21:59:51 -0400
-
-xorg-server (2:1.1.1-9) unstable; urgency=low
-
-  [ Jurij Smakov ]
-  * Add 21_glx_align_fixes.patch to reintroduce the setting of __GLX_ALIGN64
-    variable, lost during the modular transition. This setting is essential
-    for architectures with strong alignment requirements. Patch affects
-    alpha, sparc, amd64, ia64 and s390, mimicking the behaviour of the
-    monolithic build. Closes: #388125.
-
-  [ Denis Barbier ]
-  * Add 22_xkb_cycle_3layouts.diff to fix layout switching when 3 layouts
-    are present.  Thanks Ivan Pascal for the patch.  Closes: #345803
-
-  [ David Nusinow ]
-  * Add kFreeBSD support patch (23). Thanks to Robert Millan, Petr Salinger,
-    Daniel Stone, and Michael Banck for input and patch writing.
-    Closes: #363517
-  * Add hurd support patch (24). Thanks Samuel Thibault, Daniel Stone, and
-    Michael Banck. Closes: #356300
-  * Disable the explicit enabling of dri in the configure. The configure
-    script autodetects whether or not to use this anyway, and enabling it
-    explicitly breaks the build on hurd. Thanks Samuel Thibault and Michael
-    Banck. Closes: #358015
-  * Add several patches written by Kristian Høgsberg for allowing compiz to
-    work with AIGLX. These patches were vetted by Theirry Reding with valuable
-    advice from Michel Dänzer, and feedback from Kristian himself.
-    - 25_tfp_damage.diff
-    - 26_aiglx_happy_vt_switch.diff
-    - 27_aiglx_locking.diff
-    - 28_mesa_copy_sub_buffer.diff
-    - 29_mesa_reseed_makefile.diff
-    - update of 20_mesa_6.5.1.diff
-  * Remove bizarre wholesale inclusion of another patch in the 23_kbsd patch
-
-  [ Eugene Konev ]
-  * Use --with-default-font-path instead of --with-fontdir.
-  * Set RGBPath through --with-rgb-path.
-  * Drop 11_debian_always_use_default_font_path.diff.
-  * Drop 14_debian_always_look_in_our_module_path.diff.
-  * Ship SecurityPolicy in xserver-xorg-core.
-
- -- David Nusinow <dnusinow@debian.org>  Thu, 28 Sep 2006 23:59:35 -0400
-
-xorg-server (2:1.1.1-8) unstable; urgency=low
-
-  * Update mesa symlink patch to the latest from HEAD
-  * Add 20_mesa_6.5.1.diff to allow the server to build with mesa 6.5.1
-  * Bump build-dep versions on x11proto-gl to 1.4.8, and mesa to 6.5.1
-
- -- David Nusinow <dnusinow@debian.org>  Mon, 25 Sep 2006 22:21:37 -0400
-
-xorg-server (2:1.1.1-7) unstable; urgency=low
-
-  * Fix s390 build issue. Thanks Bastian Blank for the report and Eugene Konev
-    for the patch. Closes: #388628.
-  * Disable build of various utilities that we don't ship anyway. Patch thanks
-    to Eugene Konev.
-
- -- David Nusinow <dnusinow@debian.org>  Thu, 21 Sep 2006 23:07:16 -0400
-
-xorg-server (2:1.1.1-6) unstable; urgency=low
-
-  * Upload 7.1 to unstable.
-
-  [ Drew Parsons ]
-  * Added SGI FreeB licence to debian/copyright. Closes: #368563.
-  * Apply upstream patches 18_execinfo_only_for_backtrace.patch, to use
-    execinfo.h for and only for backtrace. Applied git patch
-    5a3488ccac8e5dabd9fc98bc41ef178ead1b2faf directly into configure scripts,
-    activated with autoreconf.  Closes: #363218.
-  * Only requires build-depends version of x11proto-gl-dev on 1.4.6.
-
-  [ Steve Langasek ]
-  * Add versioned build-depends on x11proto-fixes-dev (>= 4.0), to
-    ensure the package is built against the right protocol version.
-    Closes: #383778.
-
- -- David Nusinow <dnusinow@debian.org>  Mon, 18 Sep 2006 18:30:07 -0400
-
-xorg-server (2:1.1.1-5) experimental; urgency=low
-
-  * Fix error in 16_s390_fix.diff caused by my idiot copying. Thanks Yannick
-    Roehlly and Daniel Stone.
-
- -- David Nusinow <dnusinow@debian.org>  Sun, 27 Aug 2006 23:25:21 +0000
-
-xorg-server (2:1.1.1-4) experimental; urgency=low
-
-  [ Drew Parsons ]
-  * Tighten dependencies between X11R7.1 server and video drivers.
-    xserver-xorg-core no longer Depends: xserver-xorg-video-all
-    | xserver-xorg-video but instead Conflicts: xserver-xorg-video.
-    (closes: #383873)
-    The dependency on xserver-xorg-video-all | xserver-xorg-video-1.0 is
-    managed by the xserver-xorg binary package (not included here in
-    order to avoid circular dependencies). (closes: #362313)
-  * Likewise remove Depends: xserver-xorg-input-all | xserver-xorg-input
-    (again, handled by xserver-xorg) to avoid circular dependency with drivers.
-
-  [ David Nusinow ]
-  * Epoch bump
-  * Add 17_ignoreabi.diff to allow users to simply set a value in xorg.conf
-    rather than pass -ignoreABI to the server every time it starts
-
- -- David Nusinow <dnusinow@debian.org>  Wed, 23 Aug 2006 22:03:06 +0000
-
-xorg-server (1:1.1.1-3) unstable; urgency=low
-
-  * Add 16_s390_fix.diff to fix FTBFS on s390. Thanks Bastian Blank.
-    (closes: #362641)
-  * Bump build-depends version of libgl1-mesa-dev to 6.5.x package we have in
-    experimental currently
-  * Bump build-depends version of x11proto-gl-dev to 1.4.7 or greater
-
- -- David Nusinow <dnusinow@debian.org>  Tue, 22 Aug 2006 00:57:31 +0000
-
-xorg-server (1:1.1.1-2) experimental; urgency=low
-
-  [ Drew Parsons ]
-  * Updated mesa-swx11-source build-depends to (>> 6.5.0), required
-    for xserver 1.1.1. (closes: #383334)
-
-  [ David Nusinow ]
-  * Enable and ship xephyr
-  * Hack off the 'x' manpage suffix
-  * Install Xnest manpage
-  * Bump policy version to 3.7.2.0. No changes necessary.
-
- -- David Nusinow <dnusinow@debian.org>  Wed, 16 Aug 2006 21:14:44 +0000
-
-xorg-server (1:1.1.1-1) experimental; urgency=low
-
-  [ David Nusinow ]
-  * New upstream release
-  * Move patch target call so that we don't try and build twice
-  * Remove obsolete 15_security_allocate_local.diff and
-    16_SECURITY_setuid.diff
-  * Add 15_symlink_mesa.diff
-
- -- David Nusinow <dnusinow@debian.org>  Sun,  6 Aug 2006 16:12:25 +0000
-
-xorg-server (2:1.0.2-10) unstable; urgency=low
-
-  * Upload to unstable to fixed messed up last upload which was supposed to go
-    to experimental. Brown bag o' joy.
-
- -- David Nusinow <dnusinow@debian.org>  Tue, 22 Aug 2006 19:31:08 +0000
-
-xorg-server (1:1.1.1-0ubuntu14) feisty; urgency=low
-
-  * Add 'debian/patches/38_Fix-pDRIPriv_NULL_deref.patch': NULL-init DRI
-    screen private data, thanks to Tormod Volden (LP: #60288).
-
- -- Kees Cook <kees@ubuntu.com>  Sat, 10 Feb 2007 20:27:44 -0800
-
-xorg-server (1:1.1.1-0ubuntu13) feisty; urgency=low
-
-  * 19_revert_xkb_change_breaking_XkbGetKeyboard.patch:
-    - patch from fedora (with extra Makefile.in change), revert change that
-      broke XkbGetKeyboard() (Ubuntu: #58083)
-  * 37_Fix-__glXDRIbindTexImage-for-32-bpp-on-big-endian-platforms.diff:
-    - upstream patch copied from the Debian package, fix blue screen with
-      compiz on ppc (Ubuntu: #58373)
-
- -- Sebastien Bacher <seb128@canonical.com>  Fri, 12 Jan 2007 12:17:28 +0100
-
-xorg-server (1:1.1.1-0ubuntu12.1) edgy-security; urgency=low
-
-  * SECURITY UPDATE: Arbitrary code execution with root privileges via heap
-    overflows in DBE and Render extensions.
-  * Add 'debian/patches/021_ubuntu_dbe-render_overflows.diff' from
-    upstream
-  * References
-    CVE-2006-6101 CVE-2006-6102 CVE-2006-6103
-
- -- Kees Cook <kees@ubuntu.com>  Mon,  8 Jan 2007 12:45:41 -0800
-
-xorg-server (1:1.1.1-0ubuntu12) edgy; urgency=low
-
-  * debian/patches/17_no_composite_for_xvfb.patch:
-    - fix a crasher by not using composite for Xvfb when using -render
-  * debian/patches/18_no_composite_for_xvfb_run.patch:
-    - use "-extension Composite" to fix xvfb-run crashing
-
- -- Sebastien Bacher <seb128@canonical.com>  Fri, 13 Oct 2006 17:12:49 +0200
-
-xorg-server (1:1.1.1-0ubuntu11) edgy; urgency=low
-
-  * debian/patches/16_only_switch_vt_when_active.patch:
-    Add a check to prevent the X server from changing the VT when killing
-    GDM from the console.
-
- -- Ryan Lortie <desrt@ubuntu.com>  Thu, 21 Sep 2006 01:26:35 -0400
-
-xorg-server (1:1.1.1-0ubuntu10) edgy; urgency=low
-
-  * Build xserver-xephyr from xorg-server package.  Malone: #57077, #57084
-
- -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed,  6 Sep 2006 12:57:32 +0200
-
-xorg-server (1:1.1.1-0ubuntu9) edgy; urgency=low
-
-  * Enable composite extension by default
-  * Add patch from fd.o bugzilla #7916 to avoid aiglx hangs on vt
-    switches
-
- -- Matthew Garrett <mjg59@srcf.ucam.org>  Sat, 26 Aug 2006 03:20:31 +0100
-
-xorg-server (1:1.1.1-0ubuntu8) edgy; urgency=low
-
-  * Steal patch from Fedora to allow compiz to trigger the disabling of
-   XAA off-screen pixmaps
-
- -- Matthew Garrett <mjg59@srcf.ucam.org>  Wed, 23 Aug 2006 21:26:08 +0100
-
-xorg-server (1:1.1.1-0ubuntu7) edgy; urgency=low
-
-  * (temporarily) Removed Breaks: section from xserver-xorg-core (necessary
-    until apt-get properly supports this feature)
-  * Tightened Build-Depends: mesa-swx11-source to >=
-    6.5.0.git.20060810-0ubuntu1
-  * Tightened Build-Depends of libgl1-mesa-dev to >=
-    6.5.0.git.20060810-0ubuntu1
-
- -- Rodrigo Parra Novo <rodarvus@ubuntu.com>  Tue, 15 Aug 2006 07:26:07 -0300
-
-xorg-server (1:1.1.1-0ubuntu6) edgy; urgency=low
-
-  * Tightened Build-Depends of mesa-swx11-source to version 6.5.0.git.20060809
-  * Removed patch 003_fedora_root_window_black_pattern.patch (not necessary
-    for Ubuntu)
-
- -- Rodrigo Parra Novo <rodarvus@ubuntu.com>  Fri, 11 Aug 2006 11:41:29 -0300
-
-xorg-server (1:1.1.1-0ubuntu5) edgy; urgency=low
-
-  * Renamed 003_ubuntu_sharevts_load_cpu.patch to
-    002_ubuntu_sharevts_load_cpu.patch
-  * Added 003_fedora_root_window_black_pattern.patch (black background
-    pattern instead of default X background pattern. Feel free to revert if
-    you feel strongly against this one)
-  * Added 005_fdo4320_composite_fastpath.patch and
-    016_fdo7482_xdmx_render_fix.patch (upstream bug fixes, bug numbers
-    annotated on patch names)
-  * Added 004_fedora_init_origins_fix.patch (multihead initialization)
-  * Added 006_ubuntu_fpic_libxf86config.patch
-  * Added 007_fedora_dont_backfill_bg_none.patch
-  * Added 008_fedora_gl_include_inferiors.patch,
-    009_fedora_mesa_copy_sub_buffer.patch,
-    010_fedora_no_move_damage.patch,
-    012_fedora_tfp_damage.patch and
-    014_fedora_no_composite_in_xnest.patch (further aiglx support)
-  * 011_fedora_pci_scan_fixes.patch (pci scan fixes - testing is needed to
-    check if an extra upstream patch for pci domains is also necessary)
-  * Added 015_fedora_sane_default_mode.patch (tweak default mode - please feel
-    free to revert this patch if you feel strongly against it)
-  * Added 017_fedora_add_missing_headers_to_sdk.patch
-  * Added 018_ubuntu_linux_kernel_include_fixes.patch and
-    013_ubuntu_symlink_mesa_source.patch (build fixes against current
-    linux-kernel-modules * mesa-swx11-source - these already existed before,
-    but were applied directly to the source tree, instead of being quilt
-    patches)
-  * Just for reference: debian patch #02 is candidate for removal on next
-    upload. I'll refrain from removing it now to diminish the chances of this
-    being a breaks-for-everyone release
-  * Moved SecurityPolicy example from /usr/share/doc/examples/ to
-    /usr/share/doc/xserver-xorg-core/
-
- -- Rodrigo Parra Novo <rodarvus@ubuntu.com>  Mon,  7 Aug 2006 17:21:05 -0300
-
-xorg-server (1:1.1.1-0ubuntu4) edgy; urgency=low
-
-  * Added new Breaks: section to xorg-server-core:
-      xserver-xorg-driver-all, xserver-xorg-driver-apm,
-      xserver-xorg-driver-ark, xserver-xorg-driver-ati,
-      xserver-xorg-driver-chips, xserver-xorg-driver-cirrus,
-      xserver-xorg-driver-cyrix, xserver-xorg-driver-dummy,
-      xserver-xorg-driver-fbdev, xserver-xorg-driver-glint,
-      xserver-xorg-driver-i128, xserver-xorg-driver-i740,
-      xserver-xorg-driver-i810, xserver-xorg-driver-imstt,
-      xserver-xorg-driver-mga, xserver-xorg-driver-neomagic,
-      xserver-xorg-driver-newport, xserver-xorg-driver-nsc,
-      xserver-xorg-driver-nv, xserver-xorg-driver-rendition,
-      xserver-xorg-driver-s3, xserver-xorg-driver-s3virge,
-      xserver-xorg-driver-savage, xserver-xorg-driver-siliconmotion,
-      xserver-xorg-driver-sis, xserver-xorg-driver-sisusb,
-      xserver-xorg-driver-tdfx, xserver-xorg-driver-tga,
-      xserver-xorg-driver-trident, xserver-xorg-driver-tseng,
-      xserver-xorg-driver-v4l, xserver-xorg-driver-vesa,
-      xserver-xorg-driver-vga, xserver-xorg-driver-via,
-      xserver-xorg-driver-vmware, xserver-xorg-driver-voodoo,
-      xserver-xorg-video-all (<< 7.0.22ubuntu7),
-      xserver-xorg-video-apm (<< 1:1.1.1-0ubuntu1),
-      xserver-xorg-video-ark (<< 1:0.6.0-0ubuntu1),
-      xserver-xorg-video-ati (<< 1:6.6.1-0ubuntu1),
-      xserver-xorg-video-chips (<< 1:1.1.1-0ubuntu1),
-      xserver-xorg-video-cirrus (<< 1:1.1.0-0ubuntu1),
-      xserver-xorg-video-cyrix (<< 1:1.1.0-0ubuntu1),
-      xserver-xorg-video-dummy (<< 1:0.2.0-0ubuntu1),
-      xserver-xorg-video-fbdev (<< 1:0.3.0-0ubuntu1),
-      xserver-xorg-video-glint (<< 1:1.1.1-0ubuntu1),
-      xserver-xorg-video-i128 (<< 1:1.2.0-0ubuntu1),
-      xserver-xorg-video-i740 (<< 1:1.1.0-0ubuntu1),
-      xserver-xorg-video-i810 (<< 1:1.6.1-0ubuntu1),
-      xserver-xorg-video-imstt (<< 1:1.1.0-0ubuntu1),
-      xserver-xorg-video-mga (<< 1:1.4.1-0ubuntu1),
-      xserver-xorg-video-neomagic (<< 1:1.1.1-0ubuntu1),
-      xserver-xorg-video-newport (<< 1:0.2.0-0ubuntu1),
-      xserver-xorg-video-nsc (<< 1:2.8.1-0ubuntu1),
-      xserver-xorg-video-nv (<< 1:1.2.0-0ubuntu1),
-      xserver-xorg-video-rendition (<< 1:4.1.0-0ubuntu1),
-      xserver-xorg-video-s3 (<< 1:0.4.1-0ubuntu1),
-      xserver-xorg-video-s3virge (<< 1:1.9.1-0ubuntu1),
-      xserver-xorg-video-savage (<< 1:2.1.1-0ubuntu1),
-      xserver-xorg-video-siliconmotion (<< 1:1.4.1-0ubuntu1),
-      xserver-xorg-video-sis (<< 1:0.9.1-0ubuntu1),
-      xserver-xorg-video-sisusb (<< 1:0.8.1-0ubuntu1),
-      xserver-xorg-video-tdfx (<< 1:1.2.1-0ubuntu1),
-      xserver-xorg-video-tga (<< 1:1.1.0-0ubuntu1),
-      xserver-xorg-video-trident (<< 1:1.2.1-0ubuntu1),
-      xserver-xorg-video-tseng (<< 1:1.1.0-0ubuntu1),
-      xserver-xorg-video-v4l (<< 1:0.1.1-0ubuntu1),
-      xserver-xorg-video-vesa (<< 1:1.2.1-0ubuntu1),
-      xserver-xorg-video-vga (<< 1:4.1.0-0ubuntu1),
-      xserver-xorg-video-via (<< 1:0.2.1-0ubuntu1),
-      xserver-xorg-video-vmware (<< 1:10.13.0-0ubuntu1),
-      xserver-xorg-video-voodoo (<< 1:1.1.0-oubuntu1)
-
- -- Rodrigo Parra Novo <rodarvus@ubuntu.com>  Tue,  1 Aug 2006 22:59:55 -0300
-
-xorg-server (1:1.1.1-0ubuntu3) edgy; urgency=low
-
-  * Build with -fno-stack-protector (see LP#54650)
-
- -- Matt Zimmerman <mdz@ubuntu.com>  Mon, 31 Jul 2006 16:28:59 -0700
-
-xorg-server (1:1.1.1-0ubuntu2) edgy; urgency=low
-
-  * (sparc only) removed stale inclusion of asm/kbio.h on
-    hw/xfree86/os-support/linux/lnx_io.c and
-    hw/xfree86/os-support/linux/lnx_kbd.c
-  * Update debian/serverabiver to 1:1.1.1
-
- -- Rodrigo Parra Novo <rodarvus@ubuntu.com>  Mon, 31 Jul 2006 12:53:22 -0300
-
-xorg-server (1:1.1.1-0ubuntu1) edgy; urgency=low
-
-  * New Upstream version
-  * Changed Build-Depends from mesa-swrast-source to mesa-swx11-source,
-    following Debian package nomenclature
-  * Re-did 12_security_policy_in_etc.diff for 1.1.1
-  * Dropped 15_security_allocate_local.diff (applied upstream)
-  * Dropped 16_SECURITY_setuid.diff (applied upstream)
-  * Dropped 000_ubuntu_fix_read_kernel_mapping.patch (applied upstream)
-  * Dropped 002_ubuntu_fix_for_certain_intel_chipsets.patch (applied upstream)
-  * Updated versioned Build-Depends on mesa-swx11-source to version
-    6.5.0.cvs.20060725-0ubuntu1
-  * Added arrayobj.c, arrayobj.h, bitset.h & rbadaptors.h to
-    GL/symlink-mesa.sh (linked from mesa-swx11-source)
-  * Added arrayobj.c to default build target on GL/mesa/main
-
- -- Rodrigo Parra Novo <rodarvus@ubuntu.com>  Tue, 25 Jul 2006 20:06:28 -0300
-
-xorg-server (2:1.0.2-10) unstable; urgency=low
-
-  * Upload to unstable to fixed messed up last upload which was supposed to go
-    to experimental. Brown bag o' joy.
-
- -- David Nusinow <dnusinow@debian.org>  Tue, 22 Aug 2006 19:31:08 +0000
-
-xorg-server (1:1.0.2-9) UNRELEASED; urgency=high
-
-  [ Denis Barbier ]
-  * Fix 13_debian_add_xkbpath_env_variable.diff, XKBPATH environment
-    variable was not always taken into account.
-
-  [ David Nusinow ]
-  * Remove two Ubuntu packaging holdovers. Have xvfb recommend xbase-clients
-    rather than xauth, and have xserver-xorg-core recommend xkb-data rather
-    than xkeyboard-config. Thanks Sterling MacNay.
-  * Security update. Fix for setuid privledge escalation vulernabilities.
-    See http://lists.freedesktop.org/archives/xorg/2006-June/016146.html for
-    the full advisory.
-
-  [ Jurij Smakov ]
-  * Stop including the non-existent asm/kbio.h header file in
-    hw/xfree86/os-support/linux/lnx_{io,kbd}.c to avoid the build failure
-    on sparc.
-
- -- David Nusinow <dnusinow@debian.org>  Sat,  1 Jul 2006 17:20:45 -0400
-
-xorg-server (1:1.0.2-8) unstable; urgency=low
-
-  * Move xserverrc back to xbase-clients. Thanks Benjamin Mesing.
-  * Add 15_security_allocate_local.diff. This fixes Bug fd.o bug #6642.
-    Fix buffer overflow in Render.  (CVE 2006-1526). Patch by Eric Anholt.
-
- -- David Nusinow <dnusinow@debian.org>  Tue,  2 May 2006 21:47:17 -0400
-
-xorg-server (1:1.0.2-7) unstable; urgency=low
-
-  * Ship xserverrc again in /etc/X11/xinit. Thanks Bastian Kleineidam and
-    Vasilis Vasaitis. (closes: #357713)
-
- -- David Nusinow <dnusinow@debian.org>  Wed, 26 Apr 2006 00:01:16 -0400
-
-xorg-server (1:1.0.2-6) unstable; urgency=low
-
-  [ David Nusinow ]
-  * Use -DNO_INLINE on s390. Thanks Bastian Blank and Julien Cristau.
-    (closes: #362641)
-  * Re-add xvfb-run and manpage to xvfb package. Thanks Josselin Mouette and
-    Jamie Wilkinson. (closes: #363494)
-  * Add 014_debian_always_look_in_our_module_path.diff. This will cause the
-    server to always look in the default module path even if they've specified
-    an alternate path in their xorg.conf file via the ModulePath option. A
-    note to users: you should remove this part of your xorg.conf unless you
-    need it, as the server will look in the right place for modules if you
-    don't specify a location.
-  * Run dh_install with --list-missing
-  * Add missing manpages all around. Thanks Roland Mas and Jan Hudec.
-    (closes: #362489, #364199)
-  * Actually install apps to xdmx-tools. Thanks Xavier Bestel.
-    (closes: #356813)
-
-  [ Denis Barbier ]
-  * Add 13_debian_add_xkbpath_env_variable.diff so that the server takes
-    the XKBPATH environment variable into account. (closes: #363229)
-
- -- David Nusinow <dnusinow@debian.org>  Sat, 22 Apr 2006 17:06:23 -0400
-
-xorg-server (1:1.0.2-5) unstable; urgency=low
-
-  * Add 11_debian_always_use_default_font_path.diff from Eugene Konev. This
-    patch causes the server to add the default font path to whatever the user
-    has specified. Right now, that's /usr/share/fonts/X11, as defined on
-    configure in debian/rules. Thanks Eugene, this will definitely go a long
-    way.
-  * Document how to get rid of error loading glcore (and other modules) in
-    NEWS.Debian. Thanks Matej Vela and others.
-  * Provide the virtual 'xserver' package. Thanks Steve Langasek and Daniel
-    Stone. (closes: #362750)
-  * Add 12_security_policy_in_etc.diff from Eugene Konev. This will allow us
-    to tell the server on configure to look in /etc/X11/xserver for the
-    SecurityPolicy file. Thanks Joey Hess and Eugene. (closes: #362246)
-
- -- David Nusinow <dnusinow@debian.org>  Mon, 17 Apr 2006 00:34:08 -0400
-
-xorg-server (1:1.0.2-4) unstable; urgency=low
-
-  * Document the need to update paths in xserver-xorg-core's NEWS file.
-    (closes: #362077, #362244, #362431)
-  * Make xserver-xorg-core Architecture: any. (closes: #362150)
-  * Build with --with-fontdir=/usr/share/fonts/X11. Remove
-    --with-default-font-path option to make this work. Thanks Eugene Konev.
-
- -- David Nusinow <dnusinow@debian.org>  Thu, 13 Apr 2006 23:54:06 -0400
-
-xorg-server (1:1.0.2-3) unstable; urgency=low
-
-  * Add build-conflicts on xlibs-static-dev. Thanks Zephaniah E. Hull.
-
- -- David Nusinow <dnusinow@debian.org>  Tue, 11 Apr 2006 18:44:51 -0400
-
-xorg-server (1:1.0.2-2) unstable; urgency=low
-
-  * Upload to unstable
-  * Add versioned build-dep on libdmx-dev. Thanks Frank Lichtenheld.
-    (closes: #361752)
-
- -- David Nusinow <dnusinow@debian.org>  Mon, 10 Apr 2006 19:34:04 -0400
-
-xorg-server (1:1.0.2-1) experimental; urgency=low
-
-  [ David Nusinow ]
-  * New upstream release. Fixes CVE-2006-0745
-
-  [ Denis Barbier ]
-  * Set XKB base path to /usr/share/X11/xkb.
-
- -- David Nusinow <dnusinow@debian.org>  Mon, 20 Mar 2006 21:41:04 -0500
-
-xorg-server (1:1.0.2-0ubuntu10) dapper; urgency=low
-
-  * Backport a fix for Intel bridge handling:
-  debian/patches/002_fix_for_certain_intel_chipsets.patch
-  (Closes Ubuntu: #29880)
-
- -- Paul Sladen <ubuntu@paul.sladen.org>  Sun, 14 May 2006 19:01:32 +0100
-
-xorg-server (1:1.0.2-0ubuntu9) dapper; urgency=low
-
-  * Add 1680x1050 60 and 85Hz Modelines. Thanks to Bart Verwilst for the data.
-  (Closes Ubuntu: #6096)
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Fri, 05 May 2006 12:38:22 +0200
-
-xorg-server (1:1.0.2-0ubuntu8) dapper; urgency=low
-
-  * Fix "XCB rendertest crashes server":
-    - Add patch 001-CVE-2006-1526.patch.dpatch.
-  (CVE-2006-1526)
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Wed, 03 May 2006 09:01:09 +0200
-
-xorg-server (1:1.0.2-0ubuntu7) dapper; urgency=low
-
-  * Ship again xorg.conf(5)
-  (Closes Ubuntu: #33703)
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Mon, 01 May 2006 13:37:40 +0200
-
-xorg-server (1:1.0.2-0ubuntu6) dapper; urgency=low
-
-  * Fix severe internal memory corruption:
-    - Add patch: 000-fix-read-kernel-mapping.patch.dpatch.
-    (freedesktop bugzilla: #6472)
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Fri, 21 Apr 2006 08:07:33 +0200
-
-xorg-server (1:1.0.2-0ubuntu5) dapper; urgency=low
-
-  * Fix CPU load when using -sharevts:
-    - Add patch: 991_sharevts-load-cpu.patch
-    (Thanks for the initial patch to Michael Witrant)
-    (Closes Ubuntu: #33611)
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Mon, 10 Apr 2006 13:30:26 +0200
-
-xorg-server (1:1.0.2-0ubuntu4) dapper; urgency=low
-
-  * Fix SecurityPolicy path to /etc/X11/xserver/SecurityPolicy
-    and ship an example. NOTE: this file is NOT installed by default,
-    the WARNING you see in Xorg.0.log is an harmless WARNING.
-    Add patch: 990_ubuntu_fix_security_policy_path.patch.
-    (Close Ubuntu: #31608)
-
-  * Readd manpages to the different packages.
-
-  * Ship again ioport, gtf, pcitweak and scanpci.
-    (Closes Ubuntu: #37720)
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Tue, 04 Apr 2006 16:33:00 +0200
-
-xorg-server (1:1.0.2-0ubuntu3) dapper; urgency=low
-
-  * What about shipping xorg-server.m4 to make developer life easier?
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Thu, 23 Mar 2006 10:32:55 +0100
-
-xorg-server (1:1.0.2-0ubuntu2) dapper; urgency=low
-
-  * xserver-xorg-dev Depends: x11proto-randr-dev.
-  (Closes Ubuntu: #35594)
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Wed, 22 Mar 2006 08:09:46 +0100
-
-xorg-server (1:1.0.2-0ubuntu1) dapper; urgency=low
-
-  * New upstream release:
-    - Drop patches:
-      + CVE-2006-0745
-      + add-missing-sparc-include
-      + fix-backtrace
-      + fix-crash-on-null-addr
-
-  * UVF execption granted by mdz.
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Tue, 21 Mar 2006 05:39:01 +0100
-
-xorg-server (1:1.0.1-2) experimental; urgency=low
-
-  [ David Nusinow ]
-  * Add versioned dependency on x11-common
-  * Remove old cruft in our patches directory
-  * Port patches from trunk
-    + 030_libvgahw_gcc4_volatile_fix.diff
-    + general/026_xc_programs_manpage_overhaul.diff
-    + arm/303_arm_cache_flush.diff
-    + arm/315_arm_is_not_x86_and_has_no_vga.diff
-    + general/099e_xorgconf_manpage_overhaul.diff
-    + s390/500_s390_support.diff
-    + debian/910_debian_Xserver_RTFF.diff
-  * add 04_read_rom_in_chunks.diff. This reads PCI ROM in large chunks rather
-    than one byte at a time. This patch by Alex Williamson and forwarded to us
-    by Dann Frazier. Thanks to both of them. (closes: #353168)
-  * Don't build xserver-xorg-core on s390. This means putting all the other
-    arches as being explicitly listed. Damn !s390.
-  * Version the conflict with xserver-xfree86 to allow for the transition
-    package to be installed
-  * Remove README.DRI, as it is non-free. Add it to prune list.
-  * Add 10_dont_look_in_home_for_config.diff to prevent looking in a user's
-    home directory for xorg.conf. Thanks Daniel Stone for the patch.
-
- -- David Nusinow <dnusinow@debian.org>  Sun, 12 Mar 2006 16:18:13 -0500
-
-xorg-server (1:1.0.1-1) experimental; urgency=low
-
-  * First upload to Debian
-  * Add bison and flex to the build-depends
-  * Define INSTALL in debian/rules
-  * Add xserver-xorg-core dependency xserver-xorg-video-all |
-    xserver-xorg-video. The former is a metapackage that depends on all the
-    video drivers we ship and the latter is a virtual package that each video
-    driver provides. This scheme will install the metapackage by default but
-    will permit any single video driver to satsify the dependency. Do the same
-    thing for the input drivers.
-  * switch dpatch build-dependency to quilt
-  * Deal with mesa packaging rename: build-dep on mesa-swrast-source ->
-    mesa-swx11-source
-  * Change xserver-core depends to be on x11-common rather than xorg-common
-  * Have xserver-xorg-dev install the files in /usr/share/aclocal so we get
-    xorg-server.m4
-  * Manually set permissions on serverabiver installation
-  * Set the default font path to /usr/share/fonts/X11 instead of
-    /usr/share/X11/fonts. Thanks Eugene Konev.
-
- -- David Nusinow <dnusinow@debian.org>  Mon, 20 Feb 2006 00:18:45 -0500
-
-xorg-server (1:1.0.1-0ubuntu8) dapper; urgency=low
-
-  * [SECURITY] Fix CVE-2006-0745.
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Tue, 21 Mar 2006 05:33:50 +0100
-
-xorg-server (1:1.0.1-0ubuntu7) dapper; urgency=low
-
-  * debian/control:
-    - xvfb Depends on xfonts-base too, fix pointed by fabbione
-
- -- Sebastien Bacher <seb128@canonical.com>  Fri,  3 Mar 2006 22:21:56 +0100
-
-xorg-server (1:1.0.1-0ubuntu5) dapper; urgency=low
-
-  * Add missing include on sparc. Fix FTBFS.
-
- -- Fabio M. Di Nitto <fabbione@ubuntu.com>  Wed, 01 Feb 2006 13:45:41 +0100
-
-xorg-server (1:1.0.1-0ubuntu4) dapper; urgency=low
-
-  * Backport from upstream HEAD at Daniel's request:
-    - Add forgotten HAVE_BACKTRACE define, so that we actually get
-      backtraces when Xorg segfaults.
-
- -- Colin Watson <cjwatson@ubuntu.com>  Fri, 27 Jan 2006 13:47:56 +0000
-
-xorg-server (1:1.0.1-0ubuntu3) dapper; urgency=low
-
-  * Depend on x11-common rather than xorg-common and xserver-common
-
- -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed, 18 Jan 2006 17:13:12 +0100
-
-xorg-server (1:1.0.1-0ubuntu2) dapper; urgency=low
-
-  * Add flex to build-deps, fixing FTBFS.
-
- -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed, 18 Jan 2006 12:34:03 +0100
-
-xorg-server (1:1.0.1-0ubuntu1) dapper; urgency=low
-
-  * New upstream release.
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Fri,  6 Jan 2006 08:00:52 +1100
-
-xorg-server (1:1.0.0-0ubuntu1) dapper; urgency=low
-
-  * New upstream release.
-    + fbCompositeGeneral is now around 97.3% less stuffed (closes:
-      Ubuntu#20286).
-    + 'Fix' mouse issues in the DIX by adding XFree86Server defines (sigh;
-      closes: Ubuntu#20200).
-    + Fix Emulate3Buttons mouse posting (closes: Ubuntu#11308).
-  * Bump Build-Depends on libxt-dev (appdefaultdir), libdrm-dev (libdrm2), and
-    mesa-swrast-source (new files).
-  * Add --with-fontdir and scotch --with-default-font-path to fix font paths
-    for non-Xorg servers (closes: Ubuntu#20157).
-  * Fix path to SecurityPolicy and RGB_DB.
-  * Move update-linux-hardened-support call to xserver-xorg-core postinst
-    (from xserver-xorg postinst).
-  * Add patch to os/access.c so we don't crash on a null-addressed interface
-    (closes: Ubuntu#20414).
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Tue, 13 Dec 2005 07:27:13 +1100
-
-xorg-server (1:0.99.3-0ubuntu6) dapper; urgency=low
-
-  * Fix xserver-xorg-dev Depends field to only depend on the headers this
-    this package actually uses.
-  * Re-add xvfb-run to xfvb (closes: Ubuntu#20157).
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Mon,  5 Dec 2005 15:04:14 +1100
-
-xorg-server (1:0.99.3-0ubuntu5) dapper; urgency=low
-
-  * Add -ffunction-sections where needed
-  * Depend: xserver-common: needed for dexconf and /usr/X11R6/bin/X
-
- -- LaMont Jones <lamont@ubuntu.com>  Sat, 26 Nov 2005 05:15:36 +0000
-
-xorg-server (1:0.99.3-0ubuntu4) dapper; urgency=low
-
-  * Add two more dependencies to build the other half of the video drivers:
-    - x11proto-xext-dev, x11proto-video-dev
-
- -- Adam Conrad <adconrad@ubuntu.com>  Fri, 25 Nov 2005 02:36:44 +1100
-
-xorg-server (1:0.99.3-0ubuntu3) dapper; urgency=low
-
-  * Add a few dependencies to xorg-server-dev as the path of least resistance
-    to get all the various input and video drivers to build again:
-    - For the video drivers: x11proto-randr-dev, x11proto-render-dev,
-      x11proto-fonts-dev, x11proto-xf86dri-dev, libdrm-dev
-    - For the input drivers: x11proto-core-dev, x11proto-input-dev,
-      x11proto-randr-dev (why do input drivers want randr?)
-
- -- Adam Conrad <adconrad@ubuntu.com>  Thu, 24 Nov 2005 18:51:25 +1100
-
-xorg-server (1:0.99.3-0ubuntu2) dapper; urgency=low
-
-  * Add missing libfreetype6-dev build-depends.
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Thu, 24 Nov 2005 10:26:44 +1100
-
-xorg-server (1:0.99.3-0ubuntu1) dapper; urgency=low
-
-  * New upstream release.
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Mon, 21 Nov 2005 14:13:41 +1100
-
-xorg-server (1:0.99.2+cvs.20051025-3) dapper; urgency=low
-
-  * Version mesa-swrast-source Build-Dep to 6.4.0 or higher, so GLcore is a
-    little less crash-happy (e.g. when moving your glxgears window).
-  * Export /usr/share/xserver-xorg/serverabiver to xserver-xorg-dev, which
-    describes the relationship needed from a driver on xserver-xorg-core.
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Fri, 28 Oct 2005 13:00:26 +1000
-
-xorg-server (1:0.99.2+cvs.20051025-2) dapper; urgency=low
-
-  * Add Build-Deps on libxaw7-dev, libxmu-dev, libxt-dev, libxpm-dev,
-    libx11-dev, libxtst-dev, and libxres-dev for DMX utils.
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Wed, 26 Oct 2005 14:34:40 +1000
-
-xorg-server (1:0.99.2+cvs.20051025-1) dapper; urgency=low
-
-  * Update to new upstream version.
-  * All applicable patches have been committed upstream, bar #989 and #990.
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Thu, 20 Oct 2005 10:26:33 +1000
-
-xorg-server (1:0.99.0+cvs.20050901-1) breezy; urgency=low
-
-  * First xorg-server release.
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Wed,  6 Jul 2005 15:48:17 +1000
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100755 (executable)
index 309959f..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-Source: xorg-server
-Section: x11
-Priority: optional
-Maintainer: Sung-Jin Park <sj76.park@samsung.com>, SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>
-#Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
-Uploaders: Sung-Jin Park <sj76.park@samsung.com>, SooChan Lim <sc1.lim@samsung.com>, YoungHoon Jung <yhoon.jung@samsung.com>
-#Uploaders: David Nusinow <dnusinow@debian.org>, Steve Langasek <vorlon@debian.org>, Drew Parsons <dparsons@debian.org>, Brice Goglin <bgoglin@debian.org>, Cyril Brulebois <kibi@debian.org>
-# all the Build-Depends up to x11proto-xf86-dri-dev are for the normal Xorg
-# server, and common dependencies for the DIX.
-# x11proto-xf86dri-dev and libdrm-dev are for DRI support for the Xorg server.
-# x11proto-print-dev and libfreetype6-dev are for Xprint
-# everything on is for the DMX and Xnest servers.
-Build-Depends: debhelper (>= 5.0.0), quilt, pkg-config, automake, libtool, xutils-dev (>= 1:7.5-1slp2+1), xfonts-utils (>= 1:7.5-3slp2), x11proto-bigreqs-dev (>= 1:1.1.0), x11proto-composite-dev (>= 1:0.4), x11proto-core-dev (>= 7.0.17), x11proto-damage-dev (>= 1.1), x11proto-fixes-dev (>= 1:4.1), x11proto-kb-dev (>= 1.0.3), x11proto-xinerama-dev, x11proto-randr-dev (>= 1.2.99.3), x11proto-record-dev (>= 1.13.99.1), x11proto-render-dev (>= 2:0.11), x11proto-resource-dev, x11proto-scrnsaver-dev, x11proto-video-dev, x11proto-xcmisc-dev (>= 1.2.0), x11proto-xext-dev (>= 7.0.99.3), x11proto-xf86bigfont-dev (>= 1.2.0), x11proto-xf86dga-dev (>= 2.0.99.1), x11proto-xf86vidmode-dev (>= 2.2.99.1), xtrans-dev (>= 1.2.2), libxau-dev (>= 1:1.0.5-2), x11proto-input-dev (>= 1.9.99.902), x11proto-dri2-dev (>= 2.3), libxdmcp-dev (>= 1:0.99.1), libxfont-dev (>= 1:1.4.2), libxkbfile-dev (>= 1:0.99.1), libpixman-1-dev (>= 0.15.20), libpciaccess-dev (>= 0.11.0-2), libgcrypt11-dev, libdbus-1-dev [kfreebsd-amd64 kfreebsd-i386], libhal-dev [kfreebsd-amd64 kfreebsd-i386], libudev-dev (>= 151), x11proto-xf86dri-dev (>= 2.1.0), libdrm-dev (>= 2.4.3) [!hurd-i386], libxmuu-dev (>= 1:0.99.1), libxext-dev (>= 1:0.99.1), libx11-dev (>= 1:0.99.2), libxrender-dev (>= 1:0.9.0), libxi-dev (>= 2:1.2.99.1), x11proto-dmx-dev (>= 1:2.2.99.1), libdmx-dev (>= 1:1.0.1), libxpm-dev (>= 1:3.5.3), libxaw7-dev (>= 1:0.99.1), libxt-dev (>= 1:0.99.1), libxmu-dev (>= 1:0.99.1), libxtst-dev (>= 1:0.99.1), libxres-dev (>= 1:0.99.1), libxfixes-dev (>= 1:3.0.0), libxv-dev, libxinerama-dev, x11-xkb-utils, x11proto-gesture-dev (>= 0.1.0-1 )
-Standards-Version: 3.9.0
-Vcs-Git: git://git.debian.org/git/pkg-xorg/xserver/xorg-server
-Vcs-Browser: http://git.debian.org/?p=pkg-xorg/xserver/xorg-server.git
-
-Package: xserver-xorg-core
-Architecture: any
-Depends: xserver-common (>= ${source:Version}), libudev0 (>= 151) , udev (>= 151) , ${shlibs:Depends}, ${misc:Depends}, libkms1
-Recommends: libgl1-mesa-dri (>= 7.1~rc1)
-Suggests: xfonts-100dpi | xfonts-75dpi, xfonts-scalable
-Conflicts: xserver-xorg (<< 6.8.2-38), xserver-xfree86 (<< 1:7.0.0), x11-common (<< 7), xserver-xorg-video, xserver-xorg-video-1.0, xserver-xorg-video-1.9, xserver-xorg-video-2, xserver-xorg-video-4, xserver-xorg-video-5, xserver-xorg-input, xserver-xorg-input-2, xserver-xorg-input-2.1, xserver-xorg-input-4, xserver-xorg-input-wacom (<< 0.7.8), xserver-xorg-tool (<< 1.5.4)
-#Conflicts: xserver-xorg (<< 6.8.2-38), xserver-xfree86 (<< 1:7.0.0), xserver-common (<< 1.7), xserver-xorg-video, xserver-xorg-video-1.0, xserver-xorg-video-1.9, xserver-xorg-video-2, xserver-xorg-video-4, xserver-xorg-video-5, xserver-xorg-input, xserver-xorg-input-2, xserver-xorg-input-2.1, xserver-xorg-input-4, xserver-xorg-input-wacom (<< 0.7.8),
-Replaces: xserver-xorg (<< 6.8.2-38), xserver-xfree86 (<< 1:7.0.0), x11-common (<< 7)
-#Replaces: xserver-xorg (<< 6.8.2-38), xserver-xfree86 (<< 1:7.0.0), x11-common (<< 7)
-Provides: xserver
-#Conflicts:  xserver-xorg-input, xserver-xorg-input-2, xserver-xorg-input-2.1, xserver-xorg-input-4, xserver-xorg-input-7
-#Breaks: xserver-xorg-video, xserver-xorg-video-1.0, xserver-xorg-video-1.9, xserver-xorg-video-2, xserver-xorg-video-4, xserver-xorg-video-5, xserver-xorg-video-6, xserver-xorg-input-wacom (<< 0.7.8), xserver-xorg-input-joystick (<= 1:1.5.0-3), xserver-xorg-input-synaptics (<= 1.2.2-1ubuntu4), xserver-xorg-input-tslib (<= 0.0.6-3), xserver-xorg-input-vmmouse (<= 1:12.6.5-4ubuntu2), xserver-xorg-input-wacom (<= 0.10.5+20100415-1), xserver-xorg-video-cyrix (<= 1:1.1.0-8), xserver-xorg-video-i810 (<< 2:2.4), xserver-xorg-video-imstt (<= 1:1.1.0-7), xserver-xorg-video-nsc (<= 1:2.8.3-4), xserver-xorg-video-sunbw2 (<= 1:1.1.0-5), xserver-xorg-video-vga (<= 1:4.1.0-8), xserver-xorg-video-v4l (<< 1:0.2.0-4ubuntu1), xserver-xorg-video-dummy (<= 1:0.3.3-2build1), xserver-xorg-video-radeonhd (<= 1.3.0-2), xserver-xorg-video-glamo (<= 0.0.0+20091108.git9918e082-1), xserver-xorg-video-glide (<= 1.0.3-2), xserver-xorg-video-newport (<= 1:0.2.1-4ubuntu1), xserver-xorg-video-psb (<= 0.2.1-1ubuntu3), xserver-xorg-video-tga (<= 1:1.1.0-9ubuntu1), xserver-xorg-video-unichrome (<= 1:0.2.6.99-0ubuntu1),
-#Provides: xserver, ${videoabi}, ${inputabi},
-Description: Xorg X server - core server
- The Xorg X server is an X server for several architectures and operating
- systems, which is derived from the XFree86 4.x series of X servers.
- .
- The Xorg server supports most modern graphics hardware from most vendors,
- and supersedes all XFree86 X servers.
- .
- More information about X.Org can be found at:
- <URL:http://www.X.org>
- .
- This package is built from the X.org xserver module.
-
-Package: xserver-xorg-dev
-Architecture: any
-Depends: libpixman-1-dev (>= 0.15.20), x11proto-core-dev (>= 7.0.17), x11proto-input-dev (>= 1.9.99.902), x11proto-xext-dev (>= 7.0.99.3), x11proto-video-dev, x11proto-randr-dev (>= 1.2.99.3), x11proto-render-dev (>= 2:0.11), x11proto-dri2-dev (>= 2.3), x11proto-fonts-dev, x11proto-xinerama-dev, x11proto-kb-dev, libxkbfile-dev, libpciaccess-dev, ${misc:Depends},
-Description: Xorg X server - development files
- This package provides development files for the X.Org ('Xorg') X server.
- This is not quite the same as the DDK (Driver Development Kit) from the
- XFree86 4.x and X.Org 6.7, 6.8 and 6.9 series of servers; it provides
- headers and a pkg-config file for drivers using autotools to build
- against.
- .
- Unless you are developing or building a driver, you probably want
- xserver-xorg and/or xserver-xorg-core instead.
- .
- More information about X.Org can be found at:
- <URL:http://www.X.org>
- .
- This package is built from the X.org xserver module.
-
-Package: xserver-xorg-core-dbg
-Architecture: any
-Depends: xserver-xorg-core (= ${binary:Version}), ${misc:Depends},
-Priority: extra
-Section: debug
-Description: Xorg - the X.Org X server (debugging symbols)
- The Xorg X server is an X server for several architectures and operating
- systems, which is derived from the XFree86 4.x series of X servers.
- .
- The Xorg server supports most modern graphics hardware from most vendors,
- and supersedes all XFree86 X servers.
- .
- This package provides debugging symbols for the Xorg X server and associated
- modules.
-
-Package: xserver-common
-Architecture: all
-Depends: x11-common, xkb-data, x11-xkb-utils, ${misc:Depends},
-Recommends: xfonts-base, xauth,
-Replaces: xserver-xorg-core (<< 2:1.5.2)
-Description: common files used by various X servers
- This package provides files necessary for all X.Org based X servers.
-
-Package: xserver-xorg-tools
-Architecture: any
-Depends: xserver-common (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends},
-Conflicts: xserver-xorg-tools (<< 1.5.4)
-Replaces: xserver-xorg-tools (<< 1.5.4)
-Provides: xserver
-Description: Xorg X server - tool (dummy for removing old version of xserver-xorg-tools)
- The Xorg X server is an X server for several architectures and operating
- systems, which is derived from the XFree86 4.x series of X servers.
- .
- The Xorg server supports most modern graphics hardware from most vendors,
- and supersedes all XFree86 X servers.
- .
- More information about X.Org can be found at:
- <URL:http://www.X.org>
- <URL:http://xorg.freedesktop.org>
- <URL:http://lists.freedesktop.org/mailman/listinfo/xorg>
- .
- This package is built from the X.org xserver module.
-
-#Package: xserver-xorg-core-udeb
-#XC-Package-Type: udeb
-#Section: debian-installer
-# exclude sparc because of linker errors
-#Architecture: alpha amd64 armel hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390
-#Depends: xkb-data-udeb, x11-xkb-utils-udeb, udev-udeb (>= 149) [linux-any], ${shlibs:Depends}, ${misc:Depends},
-#Provides: xserver
-#Description: Xorg X server - core server
-# This is a udeb, or a microdeb, for the debian-installer.
-
-#Package: xdmx
-#Architecture: any
-#Depends: xserver-common (>= ${source:Version}), ${shlibs:Depends}, ${misc:Depends},
-#Description: distributed multihead X server
-# Xdmx is a proxy X server that uses one or more other X servers as its
-# display device(s). It provides multi-head X functionality for displays that
-# might be located on different machines. Xdmx functions as a front-end X server
-# that acts as a proxy to a set of back-end X servers. All of the visible
-# rendering is passed to the back-end X servers. Clients connect to the Xdmx
-# front-end, and everything appears as it would in a regular multi-head
-# configuration. If Xinerama is enabled (e.g., with +xinerama on the command
-# line), the clients see a single large screen.
-# .
-# More information about X.Org can be found at:
-# <URL:http://www.X.org>
-# .
-# This package is built from the X.org xserver module.
-
-#Package: xdmx-tools
-#Architecture: any
-#Depends: xdmx, ${shlibs:Depends}, ${misc:Depends},
-#Replaces: xdmx (<= 2:1.1.1-10)
-#Description: Distributed Multihead X tools
-# This package provides a collection of tools used for administration of
-# the Xdmx server; see the xdmx package for more information.
-# .
-# More information about X.Org can be found at:
-# <URL:http://www.X.org>
-# .
-# This package is built from the X.org xserver module.
-
-#Package: xnest
-#Architecture: any
-#Depends: xserver-common (>= ${source:Version}), ${shlibs:Depends}, ${misc:Depends},
-#Recommends: libgl1-mesa-dri (>= 7.1~rc1)
-#Description: Nested X server
-# Xnest is a nested X server that simply relays all its requests to another
-# X server, where it runs as a client.  This means that it appears as another
-# window in your current X session.  Xnest relies upon its parent X server
-# for font services.
-# .
-# Use of the Xephyr X server instead of Xnest is recommended.
-# .
-# More information about X.Org can be found at:
-# <URL:http://www.X.org>
-# .
-# This package is built from the X.org xserver module.
-
-#Package: xvfb
-#Architecture: any
-#Depends: xserver-common (>= ${source:Version}), ${shlibs:Depends}, ${misc:Depends}, xauth, x11-xkb-utils
-#Recommends: libgl1-mesa-dri
-#Description: Virtual Framebuffer 'fake' X server
-# Xvfb provides an X server that can run on machines with no display hardware
-# and no physical input devices. It emulates a dumb framebuffer using virtual
-# memory. The primary use of this server was intended to be server testing,
-# but other novel uses for it have been found, including testing clients
-# against unusual depths and screen configurations, doing batch processing with
-# Xvfb as a background rendering engine, load testing, as an aid to porting the
-# X server to a new platform, and providing an unobtrusive way to run
-# applications that don't really need an X server but insist on having one
-# anyway.
-# .
-# This package also contains a convenience script called xvfb-run which
-# simplifies the automated execution of X clients in a virtual server
-# environment. This convenience script requires the use of the xauth
-# program.
-# .
-# More information about X.Org can be found at:
-# <URL:http://www.X.org>
-# .
-# This package is built from the X.org xserver module.
-
-#Package: xserver-xephyr
-#Architecture: any
-#Depends: xserver-common (>= ${source:Version}), ${shlibs:Depends}, ${misc:Depends},
-#Recommends: libgl1-mesa-dri (>= 7.1~rc1)
-#Description: nested X server
-# Xephyr is an X server that can be run inside another X server,
-# much like Xnest. It is based on the kdrive X server, and as a
-# result it supports newer extensions than Xnest, including render and
-# composite.
-# .
-# More information about X.Org can be found at:
-# <URL:http://www.X.org>
-# .
-# This package is built from the X.org xserver module.
-
-#Package: xserver-xfbdev
-#Architecture: alpha amd64 arm armeb armel hppa i386 ia64 lpia m32r m68k mips mipsel powerpc ppc64 sh3 sh3eb sh4 sh4eb sparc
-#Depends: xserver-common (>= ${source:Version}), ${shlibs:Depends}, ${misc:Depends},
-#Description: Linux framebuffer device tiny X server
-# xserver-xfbdev is a Linux framebuffer device tiny X server based on the
-# kdrive X server.
-# .
-# More information about X.Org can be found at:
-# <URL:http://www.X.org>
-# .
-# This package is built from the X.org xserver module.
-
-
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644 (file)
index af52f60..0000000
+++ /dev/null
@@ -1,560 +0,0 @@
-This package was downloaded from
-http://xorg.freedesktop.org/releases/individual/xserver/
-
-                                  Licenses
-
-                            The X.Org Foundation
-
-                                 March 2004
-
-1.  Introduction
-
-The X.org Foundation X Window System distribution is a compilation of code
-and documentation from many sources.  This document is intended primarily as
-a guide to the licenses used in the distribution: you must check each file
-and/or package for precise redistribution terms. None-the-less, this summary
-may be useful to many users.  No software incorporating the XFree86 1.1
-license has been incorporated.
-
-This document is based on the compilation from XFree86.
-
-2.  XFree86 License
-
-XFree86 code without an explicit copyright is covered by the following copy-
-right/license:
-
-Copyright (C) 1994-2003 The XFree86 Project, Inc.  All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is fur-
-nished 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, FIT-
-NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
-NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the XFree86 Project shall not
-be used in advertising or otherwise to promote the sale, use or other deal-
-ings in this Software without prior written authorization from the XFree86
-Project.
-
-3.  Other Licenses
-
-Portions of code are covered by the following licenses/copyrights.  See indi-
-vidual files for the copyright dates.
-
-3.1  X/MIT Copyrights
-
-3.1.1  X Consortium
-
-Copyright (C) <date> X Consortium
-
-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 fur-
-nished 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, FIT-
-NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X
-CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-X Window System is a trademark of X Consortium, Inc.
-
-3.1.2  The Open Group
-
-Copyright <date>  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting documentation.
-
-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, FIT-
-NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-3.2  Berkeley-based copyrights:
-
-o
-
-3.2.1  General
-
-Redistribution and use in source and binary forms, with or without modifica-
-tion, are permitted provided that the following conditions are met:
-
-  1.  Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-  2.  Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-  3.  The name of the author may not be used to endorse or promote products
-      derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
-CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
-EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
-CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH-
-ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
-3.2.2  UCB/LBL
-
-Copyright (c) 1993 The Regents of the University of California.  All rights
-reserved.
-
-This software was developed by the Computer Systems Engineering group at
-Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and contributed to
-Berkeley.
-
-All advertising materials mentioning features or use of this software must
-display the following acknowledgement: This product includes software devel-
-oped by the University of California, Lawrence Berkeley Laboratory.
-
-Redistribution and use in source and binary forms, with or without modifica-
-tion, are permitted provided that the following conditions are met:
-
-  1.  Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-  2.  Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-  3.  All advertising materials mentioning features or use of this software
-      must display the following acknowledgement: This product includes soft-
-      ware developed by the University of California, Berkeley and its con-
-      tributors.
-
-  4.  Neither the name of the University nor the names of its contributors
-      may be used to endorse or promote products derived from this software
-      without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS-
-CLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-3.2.3  The NetBSD Foundation, Inc.
-
-Copyright (c) 2003 The NetBSD Foundation, Inc.  All rights reserved.
-
-This code is derived from software contributed to The NetBSD Foundation by
-Ben Collver <collver1@attbi.com>
-
-Redistribution and use in source and binary forms, with or without modifica-
-tion, are permitted provided that the following conditions are met:
-
-  1.   Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-  2.   Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-  3.   All advertising materials mentioning features or use of this software
-      must display the following acknowledgement: This product includes soft-
-      ware developed by the NetBSD Foundation, Inc. and its contributors.
-
-  4.   Neither the name of The NetBSD Foundation nor the names of its con-
-      tributors may be used to endorse or promote products derived from this
-      software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSE-
-QUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAM-
-AGE.
-
-3.2.4  Theodore Ts'o.
-
-Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999.  All rights
-reserved.
-
-Redistribution and use in source and binary forms, with or without modifica-
-tion, are permitted provided that the following conditions are met:
-
-  1.  Redistributions of source code must retain the above copyright notice,
-      and the entire permission notice in its entirety, including the dis-
-      claimer of warranties.
-
-  2.  Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-  3.  he name of the author may not be used to endorse or promote products
-      derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE, ALL OF WHICH ARE HEREBY DISCLAIMED.  IN NO
-EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
-CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH-
-ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF NOT
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-3.2.5  Theo de Raadt and Damien Miller
-
-Copyright (c) 1995,1999 Theo de Raadt.  All rights reserved.  Copyright (c)
-2001-2002 Damien Miller.  All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modifica-
-tion, are permitted provided that the following conditions are met:
-
-  1.   Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-  2.   Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
-CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
-EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
-CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH-
-ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
-3.2.6  Todd C. Miller
-
-Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
-
-Permission to use, copy, modify, and distribute this software for any purpose
-with or without fee is hereby granted, provided that the above copyright
-notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MER-
-CHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE FOR ANY
-SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
-RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CON-
-TRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-3.2.7  Thomas Winischhofer
-
-Copyright (C) 2001-2004 Thomas Winischhofer
-
-Redistribution and use in source and binary forms, with or without modifica-
-tion, are permitted provided that the following conditions are met:
-
-  1.   Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-  2.   Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-  3.   The name of the author may not be used to endorse or promote products
-      derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
-CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH-
-ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
-3.3  NVIDIA Corp
-
-Copyright (c) 1996 NVIDIA, Corp.  All rights reserved.
-
-NOTICE TO USER: The source code is copyrighted under U.S. and international
-laws.  NVIDIA, Corp. of Sunnyvale, California owns the copyright and as
-design patents pending on the design and interface of the NV chips.  Users
-and possessors of this source code are hereby granted a nonexclusive, roy-
-alty-free copyright and design patent license to use this code in individual
-and commercial software.
-
-Any use of this source code must include, in the user documentation and
-internal comments to the code, notices to the end user as follows:
-
-Copyright (c) 1996 NVIDIA, Corp.  NVIDIA design patents pending in the U.S.
-and foreign countries.
-
-NVIDIA, CORP.  MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
-CODE FOR ANY PURPOSE.  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WAR-
-RANTY OF ANY KIND.  NVIDIA, CORP. DISCLAIMS ALL WARRANTIES WITH REGARD TO
-THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA, CORP.  BE LIABLE
-FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAM-
-AGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE.
-
-3.6  Bitstream Vera Fonts Copyright
-
-The fonts have a generous copyright, allowing derivative works (as long as
-"Bitstream" or "Vera" are not in the names), and full redistribution (so long
-as they are not *sold* by themselves). They can be be bundled, redistributed
-and sold with any software.
-
-The fonts are distributed under the following copyright:
-
-Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
-a trademark of Bitstream, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of the fonts accompanying this license ("Fonts") and associated documentation
-files (the "Font Software"), to reproduce and distribute the Font Software,
-including without limitation the rights to use, copy, merge, publish, dis-
-tribute, and/or sell copies of the Font Software, and to permit persons to
-whom the Font Software is furnished to do so, subject to the following condi-
-tions:
-
-The above copyright and trademark notices and this permission notice shall be
-included in all copies of one or more of the Font Software typefaces.
-
-The Font Software may be modified, altered, or added to, and in particular
-the designs of glyphs or characters in the Fonts may be modified and addi-
-tional glyphs or characters may be added to the Fonts, only if the fonts are
-renamed to names not containing either the words "Bitstream" or the word
-"Vera".
-
-This License becomes null and void to the extent applicable to Fonts or Font
-Software that has been modified and is distributed under the "Bitstream Vera"
-names.
-
-The Font Software may be sold as part of a larger software package but no
-copy of one or more of the Font Software typefaces may be sold by itself.
-
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
-TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDA-
-TION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GEN-
-ERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN
-ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR
-INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFT-
-WARE.
-
-Except as contained in this notice, the names of Gnome, the Gnome Foundation,
-and Bitstream Inc., shall not be used in advertising or otherwise to promote
-the sale, use or other dealings in this Font Software without prior written
-authorization from the Gnome Foundation or Bitstream Inc., respectively. For
-further information, contact: fonts at gnome dot org.
-
-3.7  Bigelow & Holmes Inc and URW++ GmbH Luxi font license
-
-Luxi fonts copyright (c) 2001 by Bigelow & Holmes Inc. Luxi font instruction
-code copyright (c) 2001 by URW++ GmbH. All Rights Reserved. Luxi is a regis-
-tered trademark of Bigelow & Holmes Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of these Fonts and associated documentation files (the "Font Software"), to
-deal in the Font Software, including without limitation the rights to use,
-copy, merge, publish, distribute, sublicense, and/or sell copies of the Font
-Software, and to permit persons to whom the Font Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright and trademark notices and this permission notice shall be
-included in all copies of one or more of the Font Software.
-
-The Font Software may not be modified, altered, or added to, and in particu-
-lar the designs of glyphs or characters in the Fonts may not be modified nor
-may additional glyphs or characters be added to the Fonts. This License
-becomes null and void when the Fonts or Font Software have been modified.
-
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
-TRADEMARK, OR OTHER RIGHT.  IN NO EVENT SHALL BIGELOW & HOLMES INC. OR URW++
-GMBH. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GEN-
-ERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN
-ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR
-INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFT-
-WARE.
-
-Except as contained in this notice, the names of Bigelow & Holmes Inc. and
-URW++ GmbH. shall not be used in advertising or otherwise to promote the
-sale, use or other dealings in this Font Software without prior written
-authorization from Bigelow & Holmes Inc. and URW++ GmbH.
-
-For further information, contact:
-
-info@urwpp.de or design@bigelowandholmes.com
-
-     $Id: LICENSE,v 1.3 2004/09/03 23:41:21 kem Exp $
-
-
-========================================================================
-Certain files in this package (e.g. GL/glx/g_*) are covered by the SGI
-Free Software License B, Version 1.1, http://oss.sgi.com/projects/FreeB
-
-SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
-
-Copyright (C) [dates of first publication] Silicon Graphics, Inc. All Rights
-Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, 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 including the dates of first publication and either
-this permission notice or a reference to http://oss.sgi.com/projects/FreeB/
-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 SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc. shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Silicon
-Graphics, Inc.
-
-=============================================================================
-Xprint uses ttf2pt1 for Freetype support.
-
-     -- ttf2pt1 licence --
-
-The following copyright notice applies to all the files provided
-in this distribution unless explicitly noted otherwise
-(the most notable exception being t1asm.c).
-
-  Copyright (c) 1997-2002 by the AUTHORS:
-   Andrew Weeks <ccsaw@bath.ac.uk>
-   Frank M. Siegert <fms@this.net>
-   Mark Heath <mheath@netspace.net.au>
-   Thomas Henlich <thenlich@rcs.urz.tu-dresden.de>
-   Sergey Babkin <babkin@users.sourceforge.net>, <sab123@hotmail.com>
-   Turgut Uyar <uyar@cs.itu.edu.tr>
-   Rihardas Hepas <rch@WriteMe.Com>
-   Szalay Tamas <tomek@elender.hu>
-   Johan Vromans <jvromans@squirrel.nl>
-   Petr Titera <P.Titera@sh.cvut.cz>
-   Lei Wang <lwang@amath8.amt.ac.cn>
-   Chen Xiangyang <chenxy@sun.ihep.ac.cn>
-   Zvezdan Petkovic <z.petkovic@computer.org>
-   Rigel <rigel863@yahoo.com>
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions
-  are met:
-  1. Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in the
-     documentation and/or other materials provided with the distribution.
-  3. All advertising materials mentioning features or use of this software
-     must display the following acknowledgement:
-       This product includes software developed by the TTF2PT1 Project
-       and its contributors.
-
-  THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
-  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
-  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-  SUCH DAMAGE.
-
-For the approximate list of the AUTHORS' responsibilities see the
-project history.
-
-Other contributions to the project are:
-
-Turgut Uyar <uyar@cs.itu.edu.tr>
- The Unicode translation table for the Turkish language.
-
-Rihardas Hepas <rch@WriteMe.Com>
- The Unicode translation table for the Baltic languages.
-
-Szalay Tamas <tomek@elender.hu>
- The Unicode translation table for the Central European languages.
-
-Johan Vromans <jvromans@squirrel.nl>
- The RPM file.
-
-Petr Titera <P.Titera@sh.cvut.cz>
- The Unicode map format with names, the forced Unicode option.
-
-Frank M. Siegert <frank@this.net>
- Port to Windows
-
-Lei Wang <lwang@amath8.amt.ac.cn>
-Chen Xiangyang <chenxy@sun.ihep.ac.cn>
- Translation maps for Chinese fonts.
-
-Zvezdan Petkovic <z.petkovic@computer.org>
- The Unicode translation tables for the Cyrillic alphabet.
-
-Rigel <rigel863@yahoo.com>
- Generation of the dvips encoding files, modification to the Chinese maps.
-
-I. Lee Hetherington <ilh@lcs.mit.edu>
- The Type1 assembler (from the package 't1utils'), its full copyright
- notice:
-  Copyright (c) 1992 by I. Lee Hetherington, all rights reserved.
-  Permission is hereby granted to use, modify, and distribute this program
-  for any purpose provided this copyright notice and the one below remain
-  intact.
diff --git a/debian/gbp.conf b/debian/gbp.conf
deleted file mode 100644 (file)
index 4a3e532..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-[DEFAULT]
-# the default branch for upstream sources:
-upstream-branch = upstream-experimental
-# the default branch for the debian patch:
-debian-branch = ubuntu
-# use pristine-tar:
-pristine-tar = True
diff --git a/debian/inputabiver b/debian/inputabiver
deleted file mode 100644 (file)
index b4de394..0000000
+++ /dev/null
@@ -1 +0,0 @@
-11
diff --git a/debian/install_orig/xdmx-tools.install b/debian/install_orig/xdmx-tools.install
deleted file mode 100644 (file)
index 3eac31a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-main/usr/bin/dmx*      usr/bin
-main/usr/bin/vdltodmx  usr/bin
-main/usr/bin/xdmxconfig        usr/bin
-main/usr/share/man/man1/vdltodmx.1     usr/share/man/man1
-main/usr/share/man/man1/dmxtodmx.1     usr/share/man/man1
-main/usr/share/man/man1/xdmxconfig.1   usr/share/man/man1
diff --git a/debian/install_orig/xdmx.install b/debian/install_orig/xdmx.install
deleted file mode 100644 (file)
index c6a37eb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-main/usr/bin/Xdmx      usr/bin
-main/usr/share/man/man1/Xdmx.1 usr/share/man/man1
diff --git a/debian/install_orig/xnest.install b/debian/install_orig/xnest.install
deleted file mode 100644 (file)
index b11a15e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-main/usr/bin/Xnest     usr/bin
-main/usr/share/man/man1/Xnest.1        usr/share/man/man1
diff --git a/debian/install_orig/xserver-xephyr.docs b/debian/install_orig/xserver-xephyr.docs
deleted file mode 100644 (file)
index 059d734..0000000
+++ /dev/null
@@ -1 +0,0 @@
-hw/kdrive/ephyr/README
diff --git a/debian/install_orig/xserver-xephyr.install b/debian/install_orig/xserver-xephyr.install
deleted file mode 100644 (file)
index c0939e6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-main/usr/bin/Xephyr    usr/bin
-main/usr/share/man/man1/Xephyr.1       usr/share/man/man1
diff --git a/debian/install_orig/xserver-xfbdev.install b/debian/install_orig/xserver-xfbdev.install
deleted file mode 100644 (file)
index 32abbb7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-main/usr/bin/Xfbdev    usr/bin
diff --git a/debian/install_orig/xserver-xorg-core-udeb.install b/debian/install_orig/xserver-xorg-core-udeb.install
deleted file mode 100644 (file)
index 8092696..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# from xserver-common:
-udeb/usr/lib/xorg/protocol.txt usr/lib/xorg
-
-# from xserver-xorg-core:
-udeb/usr/lib/xorg/modules      usr/lib/xorg
-udeb/usr/bin/Xorg      usr/bin
-udeb/usr/share/X11/xorg.conf.d usr/share/X11/
diff --git a/debian/install_orig/xvfb.install b/debian/install_orig/xvfb.install
deleted file mode 100644 (file)
index 9fb2663..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-main/usr/bin/Xvfb      usr/bin
-main/usr/bin/xvfb-run  usr/bin
-main/usr/share/man/man1/xvfb-run.1     usr/share/man/man1
-main/usr/share/man/man1/Xvfb.1 usr/share/man/man1
diff --git a/debian/jobs b/debian/jobs
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/debian/local/10-kbd.conf b/debian/local/10-kbd.conf
deleted file mode 100644 (file)
index fee5fc8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-Section "InputClass"
-       Identifier "kbd catchall"
-       MatchIsKeyboard "on"
-       Driver "kbd"
-EndSection
diff --git a/debian/local/10-mouse.conf b/debian/local/10-mouse.conf
deleted file mode 100644 (file)
index 39183ea..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-Section "InputClass"
-       Identifier "mouse catchall"
-       MatchIsPointer "on"
-       Driver "mouse"
-EndSection
diff --git a/debian/local/64-xorg-xkb.rules b/debian/local/64-xorg-xkb.rules
deleted file mode 100644 (file)
index 25d42b6..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-ACTION!="add|change", GOTO="xorg_xkb_end"
-SUBSYSTEM!="input", GOTO="xorg_xkb_end"
-KERNEL!="event*", GOTO="xorg_xkb_end"
-
-# import keyboard layout from /etc/default/keyboard
-ENV{ID_INPUT_KEY}=="?*", IMPORT{program}="/bin/grep ^XKB /etc/default/console-setup"
-
-# ignore "SKIP" keyboard model, which is a magic value from console-setup's debconf
-ENV{XKBMODEL}=="SKIP", ENV{XKBMODEL}=""
-# Similarly, ignore this broken default variant, which breaks keyboard entirely
-ENV{XKBVARIANT}=="U.S. English", ENV{XKBVARIANT}=""
-
-LABEL="xorg_xkb_end"
diff --git a/debian/local/xvfb-run b/debian/local/xvfb-run
deleted file mode 100644 (file)
index d9884a9..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-#!/bin/sh
-
-# $Id: xvfb-run 2027 2004-11-16 14:54:16Z branden $
-
-# This script starts an instance of Xvfb, the "fake" X server, runs a command
-# with that server available, and kills the X server when done.  The return
-# value of the command becomes the return value of this script, except in cases
-# where this script encounters an error.
-#
-# If anyone is using this to build a Debian package, make sure the package
-# Build-Depends on xvfb, xbase-clients, and xfonts-base.
-
-set -e
-
-PROGNAME=xvfb-run
-SERVERNUM=99
-AUTHFILE=
-ERRORFILE=/dev/null
-STARTWAIT=3
-XVFBARGS="-screen 0 640x480x8"
-LISTENTCP="-nolisten tcp"
-XAUTHPROTO=.
-
-# Query the terminal to establish a default number of columns to use for
-# displaying messages to the user.  This is used only as a fallback in the event
-# the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while the
-# script is running, and this cannot, only being calculated once.)
-DEFCOLUMNS=$(stty size 2>/dev/null | awk '{print $2}') || true
-if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" >/dev/null 2>&1; then
-    DEFCOLUMNS=80
-fi
-
-# Display a message, wrapping lines at the terminal width.
-message () {
-    echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS}
-}
-
-# Display an error message.
-error () {
-    message "error: $*" >&2
-}
-
-# Display a usage message.
-usage () {
-    if [ -n "$*" ]; then
-        message "usage error: $*"
-    fi
-    cat <<EOF
-Usage: $PROGNAME [OPTION ...] COMMAND
-Run COMMAND (usually an X client) in a virtual X server environment.
-Options:
--a        --auto-servernum          try to get a free server number, starting at
-                                    --server-num
--e FILE   --error-file=FILE         file used to store xauth errors and Xvfb
-                                    output (default: $ERRORFILE)
--f FILE   --auth-file=FILE          file used to store auth cookie
-                                    (default: ./.Xauthority)
--h        --help                    display this usage message and exit
--n NUM    --server-num=NUM          server number to use (default: $SERVERNUM)
--l        --listen-tcp              enable TCP port listening in the X server
--p PROTO  --xauth-protocol=PROTO    X authority protocol name to use
-                                    (default: xauth command's default)
--s ARGS   --server-args=ARGS        arguments (other than server number and
-                                    "-nolisten tcp") to pass to the Xvfb server
-                                    (default: "$XVFBARGS")
--w DELAY  --wait=DELAY              delay in seconds to wait for Xvfb to start
-                                    before running COMMAND (default: $STARTWAIT)
-EOF
-}
-
-# Find a free server number by looking at .X*-lock files in /tmp.
-find_free_servernum() {
-    # Sadly, the "local" keyword is not POSIX.  Leave the next line commented in
-    # the hope Debian Policy eventually changes to allow it in /bin/sh scripts
-    # anyway.
-    #local i
-
-    i=$SERVERNUM
-    while [ -f /tmp/.X$i-lock ]; do
-        i=$(($i + 1))
-    done
-    echo $i
-}
-
-# Clean up files
-clean_up() {
-    if [ -e "$AUTHFILE" ]; then
-        XAUTHORITY=$AUTHFILE xauth remove ":$SERVERNUM" >>"$ERRORFILE" 2>&1
-    fi
-    if [ -n "$XVFB_RUN_TMPDIR" ]; then
-        if ! rm -r "$XVFB_RUN_TMPDIR"; then
-            error "problem while cleaning up temporary directory"
-            exit 5
-        fi
-    fi
-}
-
-# Parse the command line.
-ARGS=$(getopt --options +ae:f:hn:lp:s:w: \
-       --long auto-servernum,error-file:,auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \
-       --name "$PROGNAME" -- "$@")
-GETOPT_STATUS=$?
-
-if [ $GETOPT_STATUS -ne 0 ]; then
-    error "internal error; getopt exited with status $GETOPT_STATUS"
-    exit 6
-fi
-
-eval set -- "$ARGS"
-
-while :; do
-    case "$1" in
-        -a|--auto-servernum) SERVERNUM=$(find_free_servernum); AUTONUM="yes" ;;
-        -e|--error-file) ERRORFILE="$2"; shift ;;
-        -f|--auth-file) AUTHFILE="$2"; shift ;;
-        -h|--help) SHOWHELP="yes" ;;
-        -n|--server-num) SERVERNUM="$2"; shift ;;
-        -l|--listen-tcp) LISTENTCP="" ;;
-        -p|--xauth-protocol) XAUTHPROTO="$2"; shift ;;
-        -s|--server-args) XVFBARGS="$2"; shift ;;
-        -w|--wait) STARTWAIT="$2"; shift ;;
-        --) shift; break ;;
-        *) error "internal error; getopt permitted \"$1\" unexpectedly"
-           exit 6
-           ;;
-    esac
-    shift
-done
-
-if [ "$SHOWHELP" ]; then
-    usage
-    exit 0
-fi
-
-if [ -z "$*" ]; then
-    usage "need a command to run" >&2
-    exit 2
-fi
-
-if ! which xauth >/dev/null; then
-    error "xauth command not found"
-    exit 3
-fi
-
-# tidy up after ourselves
-trap clean_up EXIT
-
-# If the user did not specify an X authorization file to use, set up a temporary
-# directory to house one.
-if [ -z "$AUTHFILE" ]; then
-    XVFB_RUN_TMPDIR="$(mktemp -d -t $PROGNAME.XXXXXX)"
-    # Create empty file to avoid xauth warning
-    AUTHFILE=$(tempfile -n "$XVFB_RUN_TMPDIR/Xauthority")
-fi
-
-# Start Xvfb.
-MCOOKIE=$(mcookie)
-tries=10
-while [ $tries -gt 0 ]; do
-    tries=$(( $tries - 1 ))
-    XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1
-add :$SERVERNUM $XAUTHPROTO $MCOOKIE
-EOF
-    XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >>"$ERRORFILE" 2>&1 &
-    XVFBPID=$!
-
-    sleep "$STARTWAIT"
-    if kill -0 $XVFBPID 2>/dev/null; then
-        break
-    elif [ -n "$AUTONUM" ]; then
-        # The display is in use so try another one (if '-a' was specified).
-        SERVERNUM=$((SERVERNUM + 1))
-        SERVERNUM=$(find_free_servernum)
-        continue
-    fi
-    error "Xvfb failed to start" >&2
-    exit 1
-done
-
-# Start the command and save its exit status.
-set +e
-DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
-RETVAL=$?
-set -e
-
-# Kill Xvfb now that the command has exited.
-kill $XVFBPID
-
-# Return the executed command's exit status.
-exit $RETVAL
-
-# vim:set ai et sts=4 sw=4 tw=80:
diff --git a/debian/local/xvfb-run.1 b/debian/local/xvfb-run.1
deleted file mode 100644 (file)
index 4444f17..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-.\" $Id: xvfb-run.1 2138 2005-01-17 23:40:27Z branden $
-.\"
-.\" Copyright 1998-2004 Branden Robinson <branden@debian.org>.
-.\"
-.\" This is free software; you may redistribute it and/or modify
-.\" it under the terms of the GNU General Public License as
-.\" published by the Free Software Foundation; either version 2,
-.\" or (at your option) any later version.
-.\"
-.\" This is distributed in the hope that it will be useful, but
-.\" WITHOUT ANY WARRANTY; without even the implied warranty of
-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-.\" GNU General Public License for more details.
-.\"
-.\" You should have received a copy of the GNU General Public License with
-.\" the Debian operating system, in /usr/share/common-licenses/GPL;  if
-.\" not, write to the Free Software Foundation, Inc., 59 Temple Place,
-.\" Suite 330, Boston, MA 02111-1307 USA
-.\"
-.\" We need the URL macro from groff's www macro package, but also want
-.\" things to work all right for people who don't have it.  So we define
-.\" our own URL macro and let the www macro package override it if it's
-.\" available.
-.de URL
-\\$2 \(laURL: \\$1 \(ra\\$3
-..
-.if \n[.g] .mso www.tmac
-.TH xvfb\-run 1 "2004\-11\-12" "Debian Project"
-.SH NAME
-xvfb\-run \- run specified X client or command in a virtual X server environment
-.SH SYNOPSIS
-.B xvfb\-run
-[
-.I options
-]
-.I command
-.SH DESCRIPTION
-.B xvfb\-run
-is a wrapper for the
-.BR Xvfb (1x)
-command which simplifies the task of running commands (typically an X
-client, or a script containing a list of clients to be run) within a virtual
-X server environment.
-.PP
-.B xvfb\-run
-sets up an X authority file (or uses an existing user\-specified one),
-writes a cookie to it (see
-.BR xauth (1x))
-and then starts the
-.B Xvfb
-X server as a background process.
-The process ID of
-.B Xvfb
-is stored for later use.
-The specified
-.I command
-is then run using the X display corresponding to the
-.B Xvfb
-server
-just started and the X authority file created earlier.
-.PP
-When the
-.I command
-exits, its status is saved, the
-.B Xvfb
-server is killed (using the process ID stored earlier), the X authority
-cookie removed, and the authority file deleted (if the user did not specify
-one to use).
-.B xvfb\-run
-then exits with the exit status of
-.IR command ,
-except in error conditions (see
-.SM
-.B EXIT STATUS
-below).
-.PP
-.B xvfb\-run
-requires the
-.B xauth
-command to function.
-.SH OPTIONS
-.TP
-.B \-a\fR,\fB \-\-auto\-servernum
-Try to get a free server number, starting at 99, or the argument to
-.BR \-\-server\-num .
-.TP
-.BI \-e\  file \fR,\fB\ \-\-error\-file= file
-Store output from
-.B xauth
-and
-.B Xvfb
-in
-.IR file .
-The default is
-.IR /dev/null .
-.TP
-.BI \-f\  file \fR,\fB\ \-\-auth\-file= file
-Store X authentication data in
-.IR file .
-By default, a temporary directory called
-.IR xvfb\-run. PID
-(where PID is the process ID of
-.B xvfb\-run
-itself) is created in the directory specified by the environment variable
-.B TMPDIR
-(or
-.I /tmp
-if that variable is null or unset), and the
-.BR tempfile (1)
-command is used to create a file in that temporary directory called
-.IR Xauthority .
-.TP
-.B \-h\fR,\fB \-\-help
-Display a usage message and exit.
-.TP
-.BI \-n\  servernumber \fR,\fB\ \-\-server\-num= servernumber
-Use
-.I servernumber
-as the server number (but see the
-.B \-a\fR,\fB \-\-auto\-servernum
-option above).
-The default is 99.
-.TP
-.B \-l\fR,\fB \-\-listen\-tcp
-Enable TCP port listening in the X server.
-For security reasons (to avoid denial\-of\-service attacks or exploits),
-TCP port listening is disabled by default.
-.TP
-.BI \-p\  protocolname \fR,\fB\ \-\-xauth\-protocol= protocolname
-Use
-.I protocolname
-as the X authority protocol to use.
-The default is \(oq.\(cq, which
-.B xauth
-interprets as its own default protocol, which is MIT\-MAGIC\-COOKIE\-1.
-.TP
-.BI \-s\  arguments \fR,\fB\ \-\-server\-args= arguments
-Pass
-.I arguments
-to the
-.B Xvfb
-server.
-Be careful to quote any whitespace characters that may occur within
-.I arguments
-to prevent them from regarded as separators for
-.BR xvfb\-run 's
-own arguments.
-Also, note that specification of \(oq\-nolisten tcp\(cq in
-.I arguments
-may override the function of
-.BR xvfb\-run 's
-own
-.B \-l\fR,\fB \-\-listen\-tcp
-option, and that specification of the server number (e.g., \(oq:1\(cq) may
-be ignored because of the way the X server parses its argument list.
-Use the
-.B xvfb\-run
-option
-.BI \-n\  servernumber \fR,\fB\ \-\-server\-num= servernumber
-to achieve the latter function.
-The default is \(oq\-screen 0 640x480x8\(cq.
-.TP
-.BI \-w\  delay \fR,\fB\ \-\-wait= delay
-Wait
-.I delay
-seconds after launching
-.B Xvfb
-before attempting to start the specified command.
-The default is 3.
-.SH ENVIRONMENT
-.TP
-.B COLUMNS
-indicates the width of the terminal device in character cells.
-This value is used for formatting diagnostic messages.
-If not set, the terminal is queried using
-.BR stty (1)
-to determine its width.
-If that fails, a value of \(oq80\(cq is assumed.
-.TP
-.B TMPDIR
-specifies the directory in which to place
-.BR xvfb\-run 's
-temporary directory for storage of the X authority file; only used if the
-.B \-f
-or
-.B \-\-auth\-file
-options are not specified.
-.SH "OUTPUT FILES"
-.PP
-Unless the
-.B \-f
-or
-.B \-\-auth\-file
-options are specified, a temporary
-directory and file within it are created (and deleted) to store the X
-authority cookies used by the
-.B Xvfb
-server and client(s) run under it.
-See
-.BR tempfile (1).
-If \-f or \-\-auth\-file are used, then the specified X authority file is
-only written to, not created or deleted (though
-.B xauth
-creates an authority file itself if told to use use that does not already
-exist).
-.PP
-An error file with a user\-specified name is also created if the
-.B \-e
-or
-.B \-\-error\-file
-options are specifed; see above.
-.SH "EXIT STATUS"
-.B xvfb\-run
-uses its exit status as well as output to standard error to communicate
-diagnostics.
-.TP
-0
-.B xvfb\-run
-only uses this exit status if the
-.B \-h\fR,\fB \-\-help
-option is given.
-In all other situations, this may be interpreted as success of the specified
-command.
-.TP
-1
-.B Xvfb
-did not start correctly.
-.TP
-2
-No command to run was specified.
-.TP
-3
-The
-.B xauth
-command is not available.
-.TP
-4
-The temporary directory that was going to be used already exists; since
-.B xvfb\-run
-produces a uniquely named directory, this may indicate an attempt by another
-process on the system to exploit a temporary file race condition.
-.TP
-5
-A problem was encountered while cleaning up the temporary directory.
-.TP
-6
-A problem was encountered while using
-.BR getopt (1)
-to parse the command\-line arguments.
-.SH EXAMPLES
-.TP
-.B xvfb\-run \-\-auto\-servernum \-\-server\-num=1 xlogo
-runs the
-.BR xlogo (1x)
-demonstration client inside the
-.B Xvfb
-X server on the first available server number greater than or equal to 1.
-.TP
-.B xvfb\-run \-\-server\-args="\-screen 0 1024x768x24" ico \-faces
-runs the
-.BR ico (1x)
-demonstration client (and passes it the
-.B \-faces
-argument) inside the
-.B Xvfb
-X server, configured with a root window of 1024 by 768 pixels and a color
-depth of 24 bits.
-.PP
-Note that the demo X clients used in the above examples will not exit on
-their own, so they will have to be killed before
-.B xvfb\-run
-will exit.
-.SH BUGS
-See
-.URL "http://bugs.debian.org/xvfb" "the Debian Bug Tracking System" .
-If you wish to report a bug in
-.BR xvfb\-run ,
-please use the 
-.BR reportbug (1)
-command.
-.SH AUTHOR
-.B xvfb\-run
-was written by Branden Robinson and Jeff Licquia with sponsorship from
-Progeny Linux Systems.
-.SH "SEE ALSO"
-.BR Xvfb (1x),
-.BR xauth (1x)
-.\" vim:set et tw=80:
diff --git a/debian/patches/001_fedora_extramodes.patch b/debian/patches/001_fedora_extramodes.patch
deleted file mode 100644 (file)
index 30743b8..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-From: Adam Jackson <ajax@redhat.com>
-Date: Sun, 28 Oct 2007 09:37:52 +0100
-Subject: [PATCH] Fedora extra modes list
-
----
-Index: xorg-server/hw/xfree86/common/extramodes
-===================================================================
---- xorg-server.orig/hw/xfree86/common/extramodes
-+++ xorg-server/hw/xfree86/common/extramodes
-@@ -3,16 +3,75 @@
- //
- // $XFree86: xc/programs/Xserver/hw/xfree86/etc/extramodes,v 1.5 2002/06/05 19:43:05 dawes Exp $
- //
-+// NOTE:  Please keep all video modes sorted in order of X res, then Y res for
-+//        ease of maintenance and readability.
- # 832x624 @ 75Hz (74.55Hz) (fix if the official/Apple spec is different) hsync: 49.725kHz
- ModeLine "832x624" 57.284 832  864  928 1152  624  625  628  667 -Hsync -Vsync
-+# 1152x864 @ 60.00 Hz (GTF) hsync: 53.70 kHz; pclk: 81.62 MHz
-+Modeline "1152x864"  81.62  1152 1216 1336 1520  864 865 868 895  -HSync +Vsync
-+
-+# 1152x864 @ 70.00 Hz (GTF) hsync: 63.00 kHz; pclk: 96.77 MHz
-+Modeline "1152x864"  96.77  1152 1224 1344 1536  864 865 868 900  -HSync +Vsync
-+
-+# 1152x864 @ 75.00 Hz (GTF) hsync: 67.65 kHz; pclk: 104.99 MHz
-+Modeline "1152x864"  104.99  1152 1224 1352 1552  864 865 868 902  -HSync +Vsync
-+
-+# 1152x864 @ 85.00 Hz (GTF) hsync: 77.10 kHz; pclk: 119.65 MHz
-+Modeline "1152x864"  119.65  1152 1224 1352 1552  864 865 868 907  -HSync +Vsync
-+
-+# 1152x864 @ 85Hz (Red Hat custom modeline)
-+ModeLine "1152x864"  121.5 1152 1216 1344 1568    864  865  868  911 +hsync -vsync
-+
-+# 1152x864 @ 100.00 Hz (GTF) hsync: 91.50 kHz; pclk: 143.47 MHz
-+Modeline "1152x864"  143.47  1152 1232 1360 1568  864 865 868 915  -HSync +Vsync
-+
-+# 1360x768 59.96 Hz (CVT) hsync: 47.37 kHz; pclk: 72.00 MHz
-+Modeline "1360x768"   72.00  1360 1408 1440 1520  768 771 781 790 +hsync -vsync
-+
-+# 1360x768 59.80 Hz (CVT) hsync: 47.72 kHz; pclk: 84.75 MHz
-+Modeline "1360x768"   84.75  1360 1432 1568 1776  768 771 781 798 -hsync +vsync
-+
- # 1400x1050 @ 60Hz (VESA GTF) hsync: 65.5kHz
- ModeLine "1400x1050" 122.0 1400 1488 1640 1880   1050 1052 1064 1082 +hsync +vsync
-+# 1400x1050 @ 70.00 Hz (GTF) hsync: 76.51 kHz; pclk: 145.06 MHz
-+Modeline "1400x1050"  145.06  1400 1496 1648 1896  1050 1051 1054 1093  -HSync +Vsync
-+
- # 1400x1050 @ 75Hz (VESA GTF) hsync: 82.2kHz
- ModeLine "1400x1050" 155.8 1400 1464 1784 1912   1050 1052 1064 1090 +hsync +vsync
-+# 1400x1050 @ 85.00 Hz (GTF) hsync: 93.76 kHz; pclk: 179.26 MHz
-+Modeline "1400x1050"  179.26  1400 1504 1656 1912  1050 1051 1054 1103  -HSync +Vsync
-+
-+# 1440x900 @ 60.00 Hz (CVT) field rate 59.89 Hz; hsync: 55.93 kHz; pclk: 106.50 MHz
-+Modeline "1440x900"  106.50  1440 1520 1672 1904  900 903 909 934  -HSync +Vsync
-+
-+# 1600x1024 for SGI 1600 SW
-+ModeLine "1600x1024" 103.125 1600 1600 1656 1664 1024 1024 1029 1030 +Hsync +Vsync
-+
-+# 1680x1050 59.88 Hz (CVT 1.76MA-R) hsync: 64.67 kHz; pclk: 119.00 MHz
-+Modeline "1680x1050"  119.00  1680 1728 1760 1840  1050 1053 1059 1080 +hsync -vsync
-+
-+# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
-+Modeline "1680x1050"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
-+
-+# 1680x1050 69.88 Hz (CVT) hsync: 76.58 kHz; pclk: 174.00 MHz
-+Modeline "1680x1050"  174.00  1680 1800 1976 2272  1050 1053 1059 1096 -hsync +vsync
-+
-+# 1680x1050 74.89 Hz (CVT 1.76MA) hsync: 82.31 kHz; pclk: 187.00 MHz
-+Modeline "1680x1050"  187.00  1680 1800 1976 2272  1050 1053 1059 1099 -hsync +vsync
-+
-+# 1680x1050 84.94 Hz (CVT 1.76MA) hsync: 93.86 kHz; pclk: 214.75 MHz
-+Modeline "1680x1050"  214.75  1680 1808 1984 2288  1050 1053 1059 1105 -hsync +vsync
-+
-+# 1920x1080 59.93 Hz (CVT 2.07M9-R) hsync: 66.59 kHz; pclk: 138.50 MHz
-+Modeline "1920x1080"  138.50  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync
-+
-+# 1920x1200 59.95 Hz (CVT 2.30MA-R) hsync: 74.04 kHz; pclk: 154.00 MHz
-+Modeline "1920x1200"  154.00  1920 1968 2000 2080  1200 1203 1209 1235 +hsync -vsync
-+
- # 1920x1440 @ 85Hz (VESA GTF) hsync: 128.5kHz
- Modeline "1920x1440" 341.35  1920 2072 2288 2656  1440 1441 1444 1512 -hsync +vsync
diff --git a/debian/patches/02_Add-libnettle-as-option-for-sha1.diff b/debian/patches/02_Add-libnettle-as-option-for-sha1.diff
deleted file mode 100644 (file)
index 263c9ed..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-From a6119f6cd7e47041044fcc9c15a6e3f9f189b3ed Mon Sep 17 00:00:00 2001
-From: Cyril Brulebois <kibi@debian.org>
-Date: Sun, 14 Mar 2010 22:01:47 +0100
-Subject: [PATCH] Add libnettle as option for sha1.
-
-Signed-off-by: Cyril Brulebois <kibi@debian.org>
-
-[jcristau: forward-ported from 1.7 to 1.8]
-Signed-off-by: Julien Cristau <jcristau@debian.org>
----
-Index: xorg-server/configure.ac
-===================================================================
---- xorg-server.orig/configure.ac      2010-07-05 16:58:09.868394001 +1000
-+++ xorg-server/configure.ac   2010-07-05 16:59:02.628394001 +1000
-@@ -1358,7 +1358,7 @@
- # SHA1 hashing
- AC_ARG_WITH([sha1],
--            [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto],
-+            [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto|nettle],
-                             [choose SHA1 implementation])])
- AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
- if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then
-@@ -1441,6 +1441,16 @@
-               SHA1_CFLAGS="$OPENSSL_CFLAGS"
-       fi
- fi
-+AC_CHECK_LIB([nettle], [nettle_sha1_init], [HAVE_LIBNETTLE=yes])
-+if test "x$with_sha1" = x && test "x$HAVE_LIBNETTLE" = xyes; then
-+      with_sha1=nettle
-+fi
-+if test "x$with_sha1" = xnettle; then
-+      AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1],
-+                [Use libnettle SHA1 functions])
-+      # XXX hack for d-i: use the static lib
-+      SHA1_LIBS=-l:libnettle.a
-+fi
- AC_MSG_CHECKING([for SHA1 implementation])
- if test "x$with_sha1" = x; then
-       AC_MSG_ERROR([No suitable SHA1 implementation found])
-Index: xorg-server/include/dix-config.h.in
-===================================================================
---- xorg-server.orig/include/dix-config.h.in   2010-07-05 16:58:09.888394001 +1000
-+++ xorg-server/include/dix-config.h.in        2010-07-05 16:59:02.628394001 +1000
-@@ -175,6 +175,9 @@
- /* Define to use libsha1 for SHA1 */
- #undef HAVE_SHA1_IN_LIBSHA1
-+/* Define to use libnettle SHA1 */
-+#undef HAVE_SHA1_IN_LIBNETTLE
-+
- /* Define to 1 if you have the `shmctl64' function. */
- #undef HAVE_SHMCTL64
-Index: xorg-server/os/xsha1.c
-===================================================================
---- xorg-server.orig/os/xsha1.c        2010-07-05 16:58:09.898394001 +1000
-+++ xorg-server/os/xsha1.c     2010-07-05 16:59:02.628394001 +1000
-@@ -127,6 +127,31 @@
-     return 1;
- }
-+#elif defined(HAVE_SHA1_IN_LIBNETTLE)
-+
-+# include <nettle/sha.h>
-+
-+void *x_sha1_init(void)
-+{
-+    struct sha1_ctx *ctx = xalloc(sizeof(*ctx));
-+    if (!ctx)
-+      return NULL;
-+    sha1_init(ctx);
-+    return ctx;
-+}
-+
-+int x_sha1_update(void *ctx, void *data, int size)
-+{
-+    sha1_update(ctx, size, data);
-+    return 1;
-+}
-+
-+int x_sha1_final(void *ctx, unsigned char result[20])
-+{
-+    sha1_digest(ctx, 20, result);
-+    return 1;
-+}
-+
- #else /* Use OpenSSL's libcrypto */
- # include <stddef.h>  /* buggy openssl/sha.h wants size_t */
diff --git a/debian/patches/06_dont_trap_access_to_timer_and_keyboard.diff b/debian/patches/06_dont_trap_access_to_timer_and_keyboard.diff
deleted file mode 100644 (file)
index 23d8dc7..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-[PATCH] Do not trap access to timer and keyboard
-
-Some VESA BIOSes need to access to them.
-
-Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
----
- hw/xfree86/os-support/hurd/hurd_video.c |    2 --
- 1 files changed, 0 insertions(+), 2 deletions(-)
-
-diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c
-index 4a99db3..e049ceb 100644
---- a/hw/xfree86/os-support/hurd/hurd_video.c
-+++ b/hw/xfree86/os-support/hurd/hurd_video.c
-@@ -124,8 +124,6 @@ xf86EnableIO()
-       FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
-       return FALSE;
-     }
--    ioperm(0x40,4,0); /* trap access to the timer chip */
--    ioperm(0x60,4,0); /* trap access to the keyboard controller */
-     return TRUE;
- }
-       
diff --git a/debian/patches/07-xfree86-fix-build-with-xv-disabled.diff b/debian/patches/07-xfree86-fix-build-with-xv-disabled.diff
deleted file mode 100644 (file)
index d240b66..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-From fe7575e929d65e8c798104ec2f72b879051694d3 Mon Sep 17 00:00:00 2001
-From: Julien Cristau <jcristau@debian.org>
-Date: Mon, 8 Feb 2010 02:04:33 +0100
-Subject: [PATCH] xfree86: fix build with xv disabled
-
----
- hw/xfree86/modes/xf86Crtc.c |    2 ++
- hw/xfree86/modes/xf86Crtc.h |    2 ++
- 2 files changed, 4 insertions(+), 0 deletions(-)
-
-Index: xorg-server/hw/xfree86/modes/xf86Crtc.c
-===================================================================
---- xorg-server.orig/hw/xfree86/modes/xf86Crtc.c       2010-07-05 16:58:09.758394001 +1000
-+++ xorg-server/hw/xfree86/modes/xf86Crtc.c    2010-07-05 16:59:15.268394002 +1000
-@@ -3084,6 +3084,7 @@
-     return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1);
- }
-+#ifdef XV
- /*
-  * Return the crtc covering 'box'. If two crtcs cover a portion of
-  * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc
-@@ -3172,6 +3173,7 @@
-     return ret;
- }
-+#endif
- xf86_crtc_notify_proc_ptr
- xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new)
-Index: xorg-server/hw/xfree86/modes/xf86Crtc.h
-===================================================================
---- xorg-server.orig/hw/xfree86/modes/xf86Crtc.h       2010-07-05 16:58:09.778394001 +1000
-+++ xorg-server/hw/xfree86/modes/xf86Crtc.h    2010-07-05 16:59:15.268394002 +1000
-@@ -934,6 +934,7 @@
- extern _X_EXPORT void
- xf86_cursors_fini (ScreenPtr screen);
-+#ifdef XV
- /*
-  * For overlay video, compute the relevant CRTC and
-  * clip video to that.
-@@ -952,6 +953,7 @@
-                           RegionPtr   reg,
-                           INT32       width,
-                           INT32       height);
-+#endif
-     
- extern _X_EXPORT xf86_crtc_notify_proc_ptr
- xf86_wrap_crtc_notify (ScreenPtr pScreen, xf86_crtc_notify_proc_ptr new);
diff --git a/debian/patches/100_rethrow_signals.patch b/debian/patches/100_rethrow_signals.patch
deleted file mode 100644 (file)
index 187310d..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-Index: xorg-server/hw/dmx/dmxinit.c
-===================================================================
---- xorg-server.orig/hw/dmx/dmxinit.c  2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/hw/dmx/dmxinit.c       2010-07-14 14:02:26.161453002 +1000
-@@ -830,7 +830,7 @@
- /** This function is called in Xserver/os/utils.c from \a AbortServer().
-  * We must ensure that backend and console state is restored in the
-  * event the server shutdown wasn't clean. */
--void AbortDDX(void)
-+void SigAbortDDX(int signo)
- {
-     int i;
-@@ -848,6 +848,11 @@
- }
- #endif
-+void AbortDDX(void)
-+{
-+    SigAbortDDX(0);
-+}
-+
- /** This function is called in Xserver/dix/main.c from \a main() when
-  * dispatchException & DE_TERMINATE (which is the only way to exit the
-  * main loop without an interruption. */
-Index: xorg-server/hw/kdrive/src/kdrive.c
-===================================================================
---- xorg-server.orig/hw/kdrive/src/kdrive.c    2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/hw/kdrive/src/kdrive.c 2010-07-14 14:02:26.161453002 +1000
-@@ -321,7 +321,7 @@
- }
- void
--AbortDDX(void)
-+SigAbortDDX(int signo)
- {
-     KdDisableScreens ();
-     if (kdOsFuncs)
-@@ -338,6 +338,12 @@
- }
- void
-+AbortDDX(void)
-+{
-+    SigAbortDDX(0);
-+}
-+
-+void
- ddxGiveUp (void)
- {
-     AbortDDX ();
-Index: xorg-server/hw/vfb/InitOutput.c
-===================================================================
---- xorg-server.orig/hw/vfb/InitOutput.c       2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/hw/vfb/InitOutput.c    2010-07-14 14:02:26.161453002 +1000
-@@ -201,11 +201,17 @@
- }
- void
--AbortDDX(void)
-+SigAbortDDX(int signo)
- {
-     ddxGiveUp();
- }
-+void
-+AbortDDX(void)
-+{
-+    SigAbortDDX(0);
-+}
-+
- #ifdef __APPLE__
- void
- DarwinHandleGUI(int argc, char *argv[])
-Index: xorg-server/hw/xfree86/common/xf86Events.c
-===================================================================
---- xorg-server.orig/hw/xfree86/common/xf86Events.c    2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/hw/xfree86/common/xf86Events.c 2010-07-14 14:02:26.171453002 +1000
-@@ -348,6 +348,8 @@
- int
- xf86SigWrapper(int signo)
- {
-+  static Bool beenhere = FALSE;
-+
-   if ((signo == SIGILL) && xf86SigIllHandler) {
-     (*xf86SigIllHandler)();
-     return 0; /* continue */
-Index: xorg-server/hw/xfree86/common/xf86Init.c
-===================================================================
---- xorg-server.orig/hw/xfree86/common/xf86Init.c      2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/hw/xfree86/common/xf86Init.c   2010-07-14 14:02:26.171453002 +1000
-@@ -899,14 +899,17 @@
- }
- /*
-- * ddxGiveUp --
-+ * ddxSigGiveUp --
-  *      Device dependent cleanup. Called by by dix before normal server death.
-  *      For SYSV386 we must switch the terminal back to normal mode. No error-
-  *      checking here, since there should be restored as much as possible.
-+ *
-+ *      If a non-zero signo is passed, re-raise that signal rather than
-+ *      calling abort().
-  */
- void
--ddxGiveUp(void)
-+ddxSigGiveUp(int signo)
- {
-     int i;
-@@ -933,24 +936,45 @@
-     if (xorgHWOpenConsole)
-       xf86CloseConsole();
-+    ErrorF (" ddxSigGiveUp: Closing log\n");
-     xf86CloseLog();
-     /* If an unexpected signal was caught, dump a core for debugging */
--    if (xf86Info.caughtSignal)
--      OsAbort();
-+    if (xf86Info.caughtSignal) {
-+        if (signo != 0) {
-+            raise(signo);
-+        } else {
-+            OsAbort();
-+        }
-+    }
- }
-+/*
-+ * ddxGiveUp --
-+ *      Device dependent cleanup. Called by by dix before normal server death.
-+ *      For SYSV386 we must switch the terminal back to normal mode. No error-
-+ *      checking here, since there should be restored as much as possible.
-+ */
-+
-+void
-+ddxGiveUp()
-+{
-+    ddxSigGiveUp(0);
-+}
- /*
-- * AbortDDX --
-+ * SigAbortDDX --
-  *      DDX - specific abort routine.  Called by AbortServer(). The attempt is
-  *      made to restore all original setting of the displays. Also all devices
-  *      are closed.
-+ *
-+ *      If a non-zero signo is passed, re-raise that signal rather than calling
-+ *      abort()
-  */
- void
--AbortDDX(void)
-+SigAbortDDX(int signo)
- {
-   int i;
-@@ -983,7 +1007,20 @@
-    * This is needed for an abnormal server exit, since the normal exit stuff
-    * MUST also be performed (i.e. the vt must be left in a defined state)
-    */
--  ddxGiveUp();
-+  ddxSigGiveUp(signo);
-+}
-+
-+/*
-+ * AbortDDX --
-+ *      DDX - specific abort routine.  The attempt is made to restore
-+ *      all original setting of the displays. Also all devices are
-+ *      closed.
-+ */
-+
-+void
-+AbortDDX()
-+{
-+    SigAbortDDX(0);
- }
- void
-Index: xorg-server/hw/xnest/Init.c
-===================================================================
---- xorg-server.orig/hw/xnest/Init.c   2010-07-05 15:56:19.000000000 +1000
-+++ xorg-server/hw/xnest/Init.c        2010-07-14 14:02:26.171453002 +1000
-@@ -117,12 +117,17 @@
- /*
-  * DDX - specific abort routine.  Called by AbortServer().
-  */
--void AbortDDX(void)
-+void SigAbortDDX(int signo)
- {
-   xnestDoFullGeneration = True;
-   xnestCloseDisplay();
- }
-+void AbortDDX(void)
-+{
-+    SigAbortDDX(0);
-+}
-+
- /* Called by GiveUp(). */
- void ddxGiveUp(void)
- {
-Index: xorg-server/hw/xquartz/darwin.c
-===================================================================
---- xorg-server.orig/hw/xquartz/darwin.c       2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/hw/xquartz/darwin.c    2010-07-14 14:02:26.171453002 +1000
-@@ -765,17 +765,22 @@
- /*
-- * AbortDDX --
-+ * [Sig]AbortDDX --
-  *      DDX - specific abort routine.  Called by AbortServer(). The attempt is
-  *      made to restore all original setting of the displays. Also all devices
-  *      are closed.
-  */
--void AbortDDX( void )
-+void SigAbortDDX( void )
- {
-     ErrorF( "   AbortDDX\n" );
-     OsAbort();
- }
-+void AbortDDX( void )
-+{
-+    SigAbortDDX(0);
-+}
-+
- #include "mivalidate.h" // for union _Validate used by windowstr.h
- #include "windowstr.h"  // for struct _Window
- #include "scrnintstr.h" // for struct _Screen
-Index: xorg-server/hw/xwin/InitOutput.c
-===================================================================
---- xorg-server.orig/hw/xwin/InitOutput.c      2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/hw/xwin/InitOutput.c   2010-07-14 14:02:26.171453002 +1000
-@@ -288,7 +288,7 @@
- /* See Porting Layer Definition - p. 57 */
- void
--AbortDDX (void)
-+SigAbortDDX (int signo)
- {
- #if CYGDEBUG
-   winDebug ("AbortDDX\n");
-@@ -296,6 +296,12 @@
-   ddxGiveUp ();
- }
-+void
-+AbortDDX (void)
-+{
-+    SigAbortDDX(0);
-+}
-+
- #ifdef __CYGWIN__
- /* hasmntopt is currently not implemented for cygwin */
- static const char *winCheckMntOpt(const struct mntent *mnt, const char *opt)
-Index: xorg-server/include/os.h
-===================================================================
---- xorg-server.orig/include/os.h      2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/include/os.h   2010-07-14 14:02:26.171453002 +1000
-@@ -477,7 +477,9 @@
- /* stuff for FlushCallback */
- extern _X_EXPORT CallbackListPtr FlushCallback;
-+extern _X_EXPORT void SigAbortDDX(int signo);
- extern _X_EXPORT void AbortDDX(void);
-+extern _X_EXPORT void ddxSigGiveUp(int signo);
- extern _X_EXPORT void ddxGiveUp(void);
- extern _X_EXPORT int TimeSinceLastInputEvent(void);
-Index: xorg-server/os/log.c
-===================================================================
---- xorg-server.orig/os/log.c  2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/os/log.c       2010-07-14 14:06:06.531453001 +1000
-@@ -411,9 +411,11 @@
- void
- AbortServer(void) _X_NORETURN;
-+void
-+SigAbortServer(int signo) _X_NORETURN;
- void
--AbortServer(void)
-+SigAbortServer(int signo)
- {
- #ifdef XF86BIGFONT
-     XF86BigfontCleanup();
-@@ -421,11 +423,21 @@
-     CloseWellKnownConnections();
-     OsCleanup(TRUE);
-     CloseDownDevices();
--    AbortDDX();
-+    SigAbortDDX(signo);
-     fflush(stderr);
--    if (CoreDump)
--      OsAbort();
--    exit (1);
-+    if (CoreDump) {
-+        if (signo != 0)
-+            raise(signo);
-+        else
-+            OsAbort();
-+    } else
-+       exit (1);
-+}
-+
-+void
-+AbortServer(void)
-+{
-+    SigAbortServer(0);
- }
- #define AUDIT_PREFIX "AUDIT: %s: %ld: "
-@@ -528,6 +540,27 @@
- }
- void
-+FatalSignal(int signo)
-+{
-+    static Bool beenhere = FALSE;
-+
-+    if (beenhere)
-+      ErrorF("\nFatalSignal re-entered, aborting\n");
-+    else
-+      ErrorF("\nCaught signal %d (%s). Server aborting\n",
-+               signo, strsignal(signo));
-+
-+    if (!beenhere)
-+      OsVendorFatalError();
-+    if (!beenhere) {
-+      beenhere = TRUE;
-+      SigAbortServer(signo);
-+    } else
-+      abort();
-+    /*NOTREACHED*/
-+}
-+
-+void
- FatalError(const char *f, ...)
- {
-     va_list args;
-Index: xorg-server/os/osinit.c
-===================================================================
---- xorg-server.orig/os/osinit.c       2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/os/osinit.c    2010-07-14 14:02:26.181453002 +1000
-@@ -148,13 +148,13 @@
-           case SIGBUS:
-           case SIGILL:
-           case SIGFPE:
-+            signal(signo,SIG_DFL);
-             ErrorF("%s at address %p\n", strsignal(signo), sip->si_addr);
-       }
-   }
- #endif
--  FatalError("Caught signal %d (%s). Server aborting\n",
--           signo, strsignal(signo));
-+  FatalSignal(signo);
- }
- void
diff --git a/debian/patches/104_nvidia_autodetect.patch b/debian/patches/104_nvidia_autodetect.patch
deleted file mode 100644 (file)
index ac3383b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
-index 19c06c8..e40551e 100644
---- a/hw/xfree86/common/xf86AutoConfig.c
-+++ b/hw/xfree86/common/xf86AutoConfig.c
-@@ -181,7 +181,34 @@ videoPtrToDriverList(struct pci_device *dev,
-       case 0x102b:                driverList[0] = "mga";      break;
-       case 0x10c8:                driverList[0] = "neomagic"; break;
-       case 0x105d:                driverList[0] = "i128";     break;
--      case 0x10de: case 0x12d2:   driverList[0] = "nv";       break;
-+      case 0x10de: case 0x12d2:
-+          switch (dev->device_id) {
-+          /* NV1 */
-+          case 0x0008:
-+          case 0x0009:
-+              driverList[0] = "vesa";
-+              break;
-+          /* NV3 */
-+          case 0x0018:
-+          case 0x0019:
-+              driverList[0] = "nv";
-+              break;
-+          default:
-+              switch (dev->device_id & 0xfff0) {
-+              /* Non-functional with both nouveau and nv */
-+              case 0x0840:
-+              case 0x0860:
-+                  driverList[0] = "nvidia";
-+                  driverList[1] = "vesa";
-+                  break;
-+              default:
-+                  driverList[0] = "nvidia";
-+                  driverList[1] = "nouveau";
-+                  driverList[2] = "nv";
-+                  break;
-+              }
-+              break;
-+          }
-       case 0x1163:                driverList[0] = "rendition"; break;
-       case 0x5333:
-           switch (dev->device_id)
-
diff --git a/debian/patches/105_fglrx_autodetect.patch b/debian/patches/105_fglrx_autodetect.patch
deleted file mode 100644 (file)
index 74e93e3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-Binary files patched/.git/index and working/.git/index differ
-diff -Nurp patched/hw/xfree86/common/xf86AutoConfig.c working/hw/xfree86/common/xf86AutoConfig.c
---- patched/hw/xfree86/common/xf86AutoConfig.c 2009-07-02 15:11:52.000000000 -0700
-+++ working/hw/xfree86/common/xf86AutoConfig.c 2009-07-02 16:16:59.000000000 -0700
-@@ -165,7 +165,15 @@ videoPtrToDriverList(struct pci_device *
-       case 0x1142:                driverList[0] = "apm"; break;
-       case 0xedd8:                driverList[0] = "ark"; break;
-       case 0x1a03:                driverList[0] = "ast"; break;
--      case 0x1002:                driverList[0] = "ati"; break;
-+      case 0x1002:
-+            /* Technical fglrx works only on 0x791e and newer, but
-+               if the user has it installed, -ati and -radeonhd
-+               probably won't work anyway so we may as well try it
-+               in case it randomly does work.  */
-+            driverList[0] = "fglrx"; /* Supports R600 and newer only */
-+            driverList[1] = "radeonhd";
-+            driverList[2] = "ati";
-+            break;
-       case 0x102c:                driverList[0] = "chips"; break;
-       case 0x1013:                driverList[0] = "cirrus"; break;
-       case 0x8086:
diff --git a/debian/patches/111_armel-drv-fallbacks.patch b/debian/patches/111_armel-drv-fallbacks.patch
deleted file mode 100644 (file)
index b2afd99..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
----
- hw/xfree86/common/xf86AutoConfig.c |   32 ++++++++++++++++++++++++++++++++
- 1 file changed, 32 insertions(+)
-
-Index: xorg-server/hw/xfree86/common/xf86AutoConfig.c
-===================================================================
---- xorg-server.orig/hw/xfree86/common/xf86AutoConfig.c        2010-08-05 11:18:59.709693301 +1000
-+++ xorg-server/hw/xfree86/common/xf86AutoConfig.c     2010-08-05 11:21:21.854896555 +1000
-@@ -44,6 +44,12 @@
- # include "xf86sbusBus.h"
- #endif
-+#if defined(__arm__) && defined(__linux__)
-+# include "loaderProcs.h"
-+# include <sys/types.h> /* For opendir in test_sysfs_device */
-+# include <dirent.h>    /* For opendir in test_sysfs_device */
-+#endif
-+
- #ifdef sun
- # include <sys/visual_io.h>
- # include <ctype.h>
-@@ -188,6 +194,28 @@
-     return ret == CONFIG_OK;
- }
-+#if defined(__arm__) && defined(__linux__)
-+static int
-+test_sysfs_device (char * device_name, char * driver_name)
-+{
-+    DIR* dir = opendir("/sys/devices/platform");
-+    struct dirent *current_dir;
-+    int len = strlen(device_name);
-+
-+    while (current_dir = readdir(dir)) {
-+        if (strlen(current_dir->d_name) >= len && strncmp(device_name, current_dir->d_name, len) == 0)
-+            break;
-+    }
-+    closedir(dir);
-+    if(!current_dir)
-+        return 0;
-+
-+    if (!LoadModule(driver_name, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
-+        return 0;
-+    return 1;
-+}
-+#endif /* defined(__arm__) && defined(__linux__) */
-+
- static void
- listPossibleVideoDrivers(char *matches[], int nmatches)
- {
-@@ -272,7 +300,18 @@
- #if !defined(__linux__) && defined(__sparc__)
-       matches[i++] = xnfstrdup("wsfb");
- #else
-+#if defined(__linux__) && defined(__arm__)
-+        if (test_sysfs_device("mxc_gpu", "imx"))
-+           matches[i++] = xnfstrdup("imx");
-+        else if (test_sysfs_device("dovefb", "dovefb"))
-+           matches[i++] = xnfstrdup("dovefb");
-+        else if (test_sysfs_device("omapfb", "omapfb"))
-+           matches[i++] = xnfstrdup("omapfb");
-+        else
-+          matches[i++] = xnfstrdup("fbdev");
-+#else
-       matches[i++] = xnfstrdup("fbdev");
-+#endif /* defined(__linux__) && defined(__arm__) */
- #endif
-     }
- }
diff --git a/debian/patches/121_only_switch_vt_when_active.diff b/debian/patches/121_only_switch_vt_when_active.diff
deleted file mode 100644 (file)
index e35467b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
---- a/hw/xfree86/os-support/linux/lnx_init.c
-+++ b/hw/xfree86/os-support/linux/lnx_init.c
-@@ -336,10 +336,25 @@ xf86CloseConsole(void)
-     if (VTSwitch)
-     {
-+        struct vt_stat vts;
-+
-         /*
--         * Perform a switch back to the active VT when we were started
-+         * Perform a switch back to the active VT when we were started.
-+         * We cannot rely on vtSema to determine if the server was the
-+         * active VT at the time of shutdown since it has already been
-+         * released.  Instead, we manually check the current VT and
-+         * compare it with the VT we were running on.
-          */
--        if (activeVT >= 0) {
-+        if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &vts) < 0)
-+        {
-+            /* If this failed, fall back to old behaviour
-+             * of always switching. */
-+            xf86Msg(X_WARNING,"xf86OpenConsole: VT_GETSTATE failed: %s\n",
-+                    strerror(errno));
-+            vts.v_active = xf86Info.vtno;
-+        }
-+
-+        if (activeVT >= 0 && vts.v_active == xf86Info.vtno) {
-           if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT) < 0)
-               xf86Msg(X_WARNING, "xf86CloseConsole: VT_ACTIVATE failed: %s\n",
-                       strerror(errno));
diff --git a/debian/patches/122_xext_fix_card32_overflow_in_xauth.patch b/debian/patches/122_xext_fix_card32_overflow_in_xauth.patch
deleted file mode 100644 (file)
index ad8287a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Description:  Xext: "xauth generate" with large timeout crashes Xorg #27134
- The security timout CARD32 millis would overflow with large timeouts, causing 
- the timer callback to be called immediately and hit an assertion in
- SecurityAuthorizationExpired.
- .
- This has not been applied upstream yet.  Discussion of the patch faltered
- without resolution.  This patch has a problem when the epoch time is
- sufficiently far in the future (about 2035) that it doesn't matter right now.
-Origin: http://patchwork.freedesktop.org/patch/242/
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27134
-Bug-Ubuntu: https://launchpad.net/bugs/519049
-
-diff --git a/Xext/security.c b/Xext/security.c
-index af8d205..e81e560 100644
---- a/Xext/security.c
-+++ b/Xext/security.c
-@@ -279,10 +279,10 @@ SecurityComputeAuthorizationTimeout(
-     /* maxSecs is the number of full seconds that can be expressed in
-      * 32 bits worth of milliseconds
-      */
--    CARD32 maxSecs = (CARD32)(~0) / (CARD32)MILLI_PER_SECOND;
-+    CARD32 maxSecs = (CARD32)(MAXINT) / (CARD32)MILLI_PER_SECOND;
-     if (seconds > maxSecs)
--    { /* only come here if we want to wait more than 49 days */
-+    { /* only come here if we want to wait more than 24 days */
-       pAuth->secondsRemaining = seconds - maxSecs;
-       return maxSecs * MILLI_PER_SECOND;
-     }
-@@ -320,8 +320,6 @@ SecurityAuthorizationExpired(
- {
-     SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval;
--    assert(pAuth->timer == timer);
--
-     if (pAuth->secondsRemaining)
-     {
-       return SecurityComputeAuthorizationTimeout(pAuth,
diff --git a/debian/patches/13_debian_add_xkbpath_env_variable.diff b/debian/patches/13_debian_add_xkbpath_env_variable.diff
deleted file mode 100644 (file)
index bd6ca5b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
---- xorg-server.orig/xkb/xkbInit.c
-+++ xorg-server/xkb/xkbInit.c
-@@ -805,6 +805,14 @@
- extern unsigned char  XkbDfltAccessXOptions;
- int
-+xkbInitGlobals()
-+{
-+    char * xkbpath= getenv("XKBPATH");
-+    if (xkbpath!=NULL)
-+      XkbBaseDirectory= xkbpath;
-+}
-+
-+int
- XkbProcessArguments(int argc,char *argv[],int i)
- {
-     if (strcmp(argv[i],"-kb")==0) {
---- xorg-server.orig/os/utils.c
-+++ xorg-server/os/utils.c
-@@ -685,6 +685,7 @@
-  */
- void InitGlobals(void)
- {
-+    xkbInitGlobals();
-     ddxInitGlobals();
- }
diff --git a/debian/patches/143_default_to_vesa.patch b/debian/patches/143_default_to_vesa.patch
deleted file mode 100644 (file)
index 086b644..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Binary files patched/.git/index and working/.git/index differ
-diff -Nurp patched/hw/xfree86/common/xf86AutoConfig.c working/hw/xfree86/common/xf86AutoConfig.c
---- patched/hw/xfree86/common/xf86AutoConfig.c 2008-10-21 09:49:35.000000000 -0700
-+++ working/hw/xfree86/common/xf86AutoConfig.c 2008-10-21 09:59:08.000000000 -0700
-@@ -422,6 +422,22 @@ matchDriverFromFiles (char** matches, ui
-         }
-         direntry = readdir(idsdir);
-     }
-+    /* If we failed to find any driver, at least try 'vesa' (LP: #261977) */
-+    if (matches[0] == NULL) {
-+        xf86Msg(X_INFO, "No matches found for this device in %s\n",  PCI_TXT_IDS_PATH);
-+
-+#if defined(__i386__) || defined(__amd64__) || defined(__hurd__)
-+        xf86Msg(X_DEFAULT, "Registering 'vesa' as fallback\n");
-+        matches[0] = xnfstrdup("vesa");
-+#elif defined(__sparc__) && !defined(sun)
-+        xf86Msg(X_DEFAULT, "Registering 'sunffb' as fallback\n");
-+        matches[0] = xnfstrdup("sunffb");
-+#else
-+        xf86Msg(X_DEFAULT, "Registering 'fbdev' as fallback\n");
-+        matches[0] = xnfstrdup("fbdev");
-+#endif
-+    }
-+
-  end:
-     xfree(line);
-     closedir(idsdir);
diff --git a/debian/patches/15-nouveau.diff b/debian/patches/15-nouveau.diff
deleted file mode 100644 (file)
index 39035fb..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-From a685b5cf34532cef96fc9b05f735088ac0c0c7ad Mon Sep 17 00:00:00 2001
-From: Fedora X Ninjas <x@fedoraproject.org>
-Date: Tue, 16 Feb 2010 11:38:17 +1000
-Subject: [PATCH 08/17] autoconfig: select nouveau by default for NVIDIA GPUs
-
-Also, don't treat DRI setup failure as an error for nouveau.
----
- glx/glxdri.c                       |    7 +++++--
- glx/glxdri2.c                      |    7 +++++--
- hw/xfree86/common/xf86AutoConfig.c |   19 ++++++++++++++++++-
- 3 files changed, 28 insertions(+), 5 deletions(-)
-
-Index: xorg-server/glx/glxdri.c
-===================================================================
---- xorg-server.orig/glx/glxdri.c
-+++ xorg-server/glx/glxdri.c
-@@ -981,6 +981,7 @@
-     const __DRIconfig **driConfigs;
-     const __DRIextension **extensions;
-     int i;
-+    int from = X_ERROR;
-     if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
-       !DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
-@@ -1060,7 +1061,9 @@
-     screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
-     if (screen->driver == NULL) {
--      LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
-+      if (!strcmp(driverName, "nouveau"))
-+          from = X_INFO;
-+      LogMessage(from, "AIGLX error: dlopen of %s failed (%s)\n",
-                  filename, dlerror());
-         goto handle_error;
-     }
-@@ -1198,7 +1201,7 @@
-     free(screen);
--    LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
-+    LogMessage(from, "AIGLX: reverting to software rendering\n");
-     return NULL;
- }
-Index: xorg-server/glx/glxdri2.c
-===================================================================
---- xorg-server.orig/glx/glxdri2.c
-+++ xorg-server/glx/glxdri2.c
-@@ -709,6 +709,7 @@
-     const __DRIextension **extensions;
-     const __DRIconfig **driConfigs;
-     int i;
-+    int from = X_ERROR;
-     screen = calloc(1, sizeof *screen);
-     if (screen == NULL)
-@@ -735,7 +736,9 @@
-     screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
-     if (screen->driver == NULL) {
--      LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
-+      if (!strcmp(driverName, "nouveau"))
-+          from = X_INFO;
-+      LogMessage(from, "AIGLX error: dlopen of %s failed (%s)\n",
-                  filename, dlerror());
-         goto handle_error;
-     }
-@@ -829,7 +832,7 @@
-     free(screen);
--    LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
-+    LogMessage(from, "AIGLX: reverting to software rendering\n");
-     return NULL;
- }
-Index: xorg-server/hw/xfree86/common/xf86pciBus.c
-===================================================================
---- xorg-server.orig/hw/xfree86/common/xf86pciBus.c
-+++ xorg-server/hw/xfree86/common/xf86pciBus.c
-@@ -1118,7 +1118,24 @@
-           break;
-       case 0x102b:                driverList[0] = "mga";      break;
-       case 0x10c8:                driverList[0] = "neomagic"; break;
--      case 0x10de: case 0x12d2:   driverList[0] = "nv";       break;
-+      case 0x10de: case 0x12d2:
-+          switch (dev->device_id) {
-+          /* NV1 */
-+          case 0x0008:
-+          case 0x0009:
-+              driverList[0] = "vesa";
-+              break;
-+          /* NV3 */
-+          case 0x0018:
-+          case 0x0019:
-+              driverList[0] = "nv";
-+              break;
-+          default:
-+              driverList[0] = "nouveau";
-+              driverList[1] = "nv";
-+              break;
-+          }
-+          break;
-       case 0x1106:                driverList[0] = "openchrome"; break;
-         case 0x1b36:              driverList[0] = "qxl"; break;
-       case 0x1163:                driverList[0] = "rendition"; break;
diff --git a/debian/patches/157_check_null_modes.patch b/debian/patches/157_check_null_modes.patch
deleted file mode 100644 (file)
index 7a63fa5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: xorg-server/hw/xfree86/common/xf86VidMode.c
-===================================================================
---- xorg-server.orig/hw/xfree86/common/xf86VidMode.c   2009-12-02 23:06:16.000000000 +0200
-+++ xorg-server/hw/xfree86/common/xf86VidMode.c        2009-12-02 23:06:21.000000000 +0200
-@@ -220,6 +220,9 @@
-     pScrn = xf86Screens[scrnIndex];
-     pVidMode = VMPTR(pScrn->pScreen);
-+    if (pScrn->modes == NULL)
-+        return FALSE;
-+
-     pVidMode->First = pScrn->modes;
-     pVidMode->Next =  pVidMode->First->next;
diff --git a/debian/patches/158_raise_maxclients.patch b/debian/patches/158_raise_maxclients.patch
deleted file mode 100644 (file)
index cc30d58..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Nurp patched/include/misc.h working/include/misc.h
---- patched/include/misc.h     2009-02-05 01:09:03.000000000 -0800
-+++ working/include/misc.h     2009-02-05 02:12:57.000000000 -0800
-@@ -86,7 +86,7 @@ extern unsigned long serverGeneration;
- #ifndef MAXSCREENS
- #define MAXSCREENS    16
- #endif
--#define MAXCLIENTS    256
-+#define MAXCLIENTS    512
- #define MAXEXTENSIONS   128
- #define MAXFORMATS    8
- #define MAXDEVICES    20 /* input devices */
diff --git a/debian/patches/16-xaa-fbcomposite-fix-negative-size.diff b/debian/patches/16-xaa-fbcomposite-fix-negative-size.diff
deleted file mode 100644 (file)
index b8d2716..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: xorg-server/fb/fbpict.c
-===================================================================
---- xorg-server.orig/fb/fbpict.c       2010-07-05 16:12:34.118394001 +1000
-+++ xorg-server/fb/fbpict.c    2010-07-05 17:20:51.548394001 +1000
-@@ -35,7 +35,7 @@
- #include "mipict.h"
- #include "fbpict.h"
--#define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
-+#define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-(a)) % (b))
- void
- fbWalkCompositeRegion (CARD8 op,
diff --git a/debian/patches/162_null_crtc_in_rotation.patch b/debian/patches/162_null_crtc_in_rotation.patch
deleted file mode 100644 (file)
index 7f07226..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/hw/xfree86/modes/xf86RandR12.c
-+++ b/hw/xfree86/modes/xf86RandR12.c
-@@ -946,7 +946,8 @@ xf86RandR12SetRotations (ScreenPtr pScre
-     for (c = 0; c < config->num_crtc; c++) {
-       xf86CrtcPtr    crtc = config->crtc[c];
--      RRCrtcSetRotations (crtc->randr_crtc, rotations);
-+        if (crtc != NULL)
-+            RRCrtcSetRotations (crtc->randr_crtc, rotations);
-     }
- #endif
-     randrp->supported_rotations = rotations;
diff --git a/debian/patches/165_man_xorg_conf_no_device_ident.patch b/debian/patches/165_man_xorg_conf_no_device_ident.patch
deleted file mode 100644 (file)
index 1c63dbe..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From b3bb14b11a58f7bfc3ba5617c524d01a6e683de1 Mon Sep 17 00:00:00 2001
-From: Bryce Harrington <bryce@bryceharrington.org>
-Date: Wed, 18 Mar 2009 21:08:19 -0700
-Subject: [PATCH] X boots up without a 'Device' identifier; don't need to say it
- is mandatory in the xorg.conf man page anymore.
-
-Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
----
- hw/xfree86/doc/man/xorg.conf.man.pre |    4 +---
- 1 files changed, 1 insertions(+), 3 deletions(-)
-
---- a/hw/xfree86/doc/man/xorg.conf.man.pre
-+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
-@@ -1760,9 +1760,7 @@ sections have the following format:
- .PP
- The
- .B Identifier
--and
--.B Device
--entries are mandatory.
-+entry is mandatory.
- All others are optional.
- .PP
- The
diff --git a/debian/patches/166_nullptr_xinerama_keyrepeat.patch b/debian/patches/166_nullptr_xinerama_keyrepeat.patch
deleted file mode 100644 (file)
index b0e3699..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-From f0ef98d8d54f5dfa3081b62ff672e0fe992b0a01 Mon Sep 17 00:00:00 2001
-From: Bryce Harrington <bryce@bryceharrington.org>
-Date: Wed, 18 Mar 2009 23:28:51 -0700
-Subject: [PATCH] Check for null pointer dereference to prevent crash
- on non-primary Xinerama screens when key repeating.
- (LP: #324465)
-
-Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
----
- mi/mipointer.c |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
-
-Index: xorg-server/mi/mipointer.c
-===================================================================
---- xorg-server.orig/mi/mipointer.c    2009-12-02 23:07:03.000000000 +0200
-+++ xorg-server/mi/mipointer.c 2009-12-02 23:08:42.000000000 +0200
-@@ -306,6 +306,10 @@
-     SetupScreen (pScreen);
-     pPointer = MIPOINTER(pDev);
-+    /* Null pointer causes crash on keyrepeat with Xinerama LP: (#324465) */
-+    if (pPointer == NULL)
-+        return;
-+
-     if (pPointer->pScreen != pScreen)
-     {
-       (*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, TRUE);
diff --git a/debian/patches/167_nullptr_xisbread.patch b/debian/patches/167_nullptr_xisbread.patch
deleted file mode 100644 (file)
index 38921dd..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -Nurp patched/hw/xfree86/common/xisb.c working/hw/xfree86/common/xisb.c
---- patched/hw/xfree86/common/xisb.c   2009-02-02 21:53:58.000000000 +0100
-+++ working/hw/xfree86/common/xisb.c   2009-02-02 21:55:09.000000000 +0100
-@@ -98,6 +98,9 @@ XisbRead (XISBuffer *b)
- {
-       int ret;
-+        if (b == NULL)
-+            return -2;
-+
-       if (b->current >= b->end)
-       {
-               if (b->block_duration >= 0)
diff --git a/debian/patches/168_glibc_trace_to_stderr.patch b/debian/patches/168_glibc_trace_to_stderr.patch
deleted file mode 100644 (file)
index cc1199c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-Report abort traces to stderr instead of terminal.  This enables apport
-to catch the error so it can file a bug report about the crash.
-
---- a/hw/xfree86/common/xf86Init.c
-+++ b/hw/xfree86/common/xf86Init.c
-@@ -1167,6 +1167,9 @@ OsVendorInit(void)
-   if (!beenHere) {
-     umask(022);
-+    /* have glibc report internal abort traces to stderr instead of
-+       the controlling terminal */
-+    setenv("LIBC_FATAL_STDERR_","1",0);
-     xf86LogInit();
-   }
diff --git a/debian/patches/169_mipointer_nullptr_checks.patch b/debian/patches/169_mipointer_nullptr_checks.patch
deleted file mode 100644 (file)
index ed5fa7e..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-From 179cec1d2f919d8d8096d6030b0ad9b6285dfd4d Mon Sep 17 00:00:00 2001
-From: Bryce Harrington <bryce@bryceharrington.org>
-Date: Mon, 23 Mar 2009 14:25:18 -0700
-Subject: [PATCH] Check null pointers to not crash on keyrepeat with Xinerama LP: (#324465)
-
-With -nvidia, when using Xinerama, holding down a key in a text field
-on a non-primary screen can cause an X crash.  This is caused because
-the MIPOINTER(pDev) can return a NULL pointer for a non-null pDev in
-some cases, and the mipointer.c code lacks checks for this condition.
-
-MIPOINTER() is a macro #defined locally to mipointer.c, which calls into
-dixLookupPrivate(), a routine which returns NULL in at least some
-circumstances - such as if the memory could not be xcalloc'd for
-whatever reason.  Hopefully upstream can provide a better fix for this,
-but for now it seems reasonable to check the return values of this macro
-for NULL before usage, as a minimum.
-
-UPDATE:  (Dec 3, 2009) Refreshed for xserver 1.7
-
-Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
----
- mi/mipointer.c |   38 ++++++++++++++++++++++++++++++++++++--
- 1 files changed, 36 insertions(+), 2 deletions(-)
-
---- a/mi/mipointer.c
-+++ b/mi/mipointer.c
-@@ -139,6 +139,10 @@ miPointerCloseScreen (int index, ScreenP
-         if (DevHasCursor(pDev))
-         {
-             pPointer = MIPOINTER(pDev);
-+            if (pPointer == NULL) {
-+                ErrorF("miPointerCloseScreen: Invalid input device pointer\n");
-+                return FALSE;
-+            }
-             if (pScreen == pPointer->pScreen)
-                 pPointer->pScreen = 0;
-@@ -191,6 +195,10 @@ miPointerDisplayCursor (DeviceIntPtr pDe
-             return FALSE;
-     pPointer = MIPOINTER(pDev);
-+    if (pPointer == NULL) {
-+        ErrorF("miPointerDisplayCursor: Invalid input device pointer\n");
-+        return FALSE;
-+    }
-     pPointer->pCursor = pCursor;
-     pPointer->pScreen = pScreen;
-@@ -204,6 +212,10 @@ miPointerConstrainCursor (DeviceIntPtr p
-     miPointerPtr pPointer;
-     pPointer = MIPOINTER(pDev);
-+    if (pPointer == NULL) {
-+        ErrorF("miPointerConstrainCursor: Invalid input device pointer\n");
-+        return FALSE;
-+    }
-     pPointer->limits = *pBox;
-     pPointer->confined = PointerConfinedToScreen(pDev);
-@@ -310,6 +322,11 @@ miPointerWarpCursor (DeviceIntPtr pDev, 
-     if (pPointer == NULL)
-         return;
-+    if (pPointer == NULL) {
-+        ErrorF("miPointerWarpCursor: Invalid input device pointer\n");
-+        return;
-+    }
-+
-     if (pPointer->pScreen != pScreen)
-     {
-       (*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, TRUE);
-@@ -370,6 +387,10 @@ miPointerUpdateSprite (DeviceIntPtr pDev
-         return;
-     pPointer = MIPOINTER(pDev);
-+    if (pPointer == NULL) {
-+        ErrorF("miPointerUpdateSprite: Invalid input device pointer\n");
-+        return;
-+    }
-     if (!pPointer)
-         return;
-@@ -440,13 +461,17 @@ miPointerSetScreen(DeviceIntPtr pDev, in
-       ScreenPtr pScreen;
-         miPointerPtr pPointer;
--        pPointer = MIPOINTER(pDev);
--
-       pScreen = screenInfo.screens[screen_no];
-       pScreenPriv = GetScreenPrivate (pScreen);
-       (*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, FALSE);
-       NewCurrentScreen (pDev, pScreen, x, y);
-+        pPointer = MIPOINTER(pDev);
-+        if (pPointer == NULL) {
-+            ErrorF("miPointerSetScreen: Invalid input device pointer\n");
-+            return;
-+        }
-+
-         pPointer->limits.x2 = pScreen->width;
-         pPointer->limits.y2 = pScreen->height;
- }
-@@ -473,6 +498,10 @@ miPointerMoved (DeviceIntPtr pDev, Scree
-     SetupScreen(pScreen);
-     pPointer = MIPOINTER(pDev);
-+    if (pPointer == NULL) {
-+        ErrorF("miPointerMoved: Invalid input device pointer\n");
-+        return;
-+    }
-     /* Hack: We mustn't call into ->MoveCursor for anything but the
-      * VCP, as this may cause a non-HW rendered cursor to be rendered during
-@@ -502,6 +531,11 @@ miPointerSetPosition(DeviceIntPtr pDev, 
-     miPointerPtr        pPointer; 
-     pPointer = MIPOINTER(pDev);
-+    if (pPointer == NULL) {
-+        ErrorF("miPointerSetPosition: Invalid input device pointer\n");
-+        return;
-+    }
-+
-     pScreen = pPointer->pScreen;
-     if (!pScreen)
-       return;     /* called before ready */
diff --git a/debian/patches/172_cwgetbackingpicture_nullptr_check.patch b/debian/patches/172_cwgetbackingpicture_nullptr_check.patch
deleted file mode 100644 (file)
index 9a91113..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From 7813adf66be31d8b0e8df21821e786e688f7fe78 Mon Sep 17 00:00:00 2001
-From: Bryce Harrington <bryce@bryceharrington.org>
-Date: Fri, 27 Mar 2009 19:01:32 -0700
-Subject: [PATCH] cwGetBackingPicture can segfault when minimizing/maximizing firefox with
- a flash video playing.  This appears to be a race condition in which the
- backing picture's data is not always fully defined.
-
-Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
----
- miext/cw/cw_render.c |   13 +++++++++----
- 1 files changed, 9 insertions(+), 4 deletions(-)
-
-diff --git a/miext/cw/cw_render.c b/miext/cw/cw_render.c
-index 6e0c727..fe8cba7 100644
---- a/miext/cw/cw_render.c
-+++ b/miext/cw/cw_render.c
-@@ -125,10 +125,15 @@ cwGetBackingPicture (PicturePtr pPicture, int *x_off, int *y_off)
-       WindowPtr   pWindow = (WindowPtr) pDrawable;
-       PixmapPtr   pPixmap = getCwPixmap (pWindow);
--      *x_off = pDrawable->x - pPixmap->screen_x;
--      *y_off = pDrawable->y - pPixmap->screen_y;
--
--      return pPicturePrivate->pBackingPicture;
-+        if (pDrawable && pPixmap) {
-+            *x_off = pDrawable->x - pPixmap->screen_x;
-+            *y_off = pDrawable->y - pPixmap->screen_y;
-+
-+            return pPicturePrivate->pBackingPicture;
-+        } else {
-+            *x_off = *y_off = 0;
-+            return pPicture;
-+        }
-     }
-     else
-     {
--- 
-1.6.0.4
-
diff --git a/debian/patches/187_edid_quirk_hp_nc8430.patch b/debian/patches/187_edid_quirk_hp_nc8430.patch
deleted file mode 100644 (file)
index 6ee87f1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/hw/xfree86/modes/xf86EdidModes.c
-+++ b/hw/xfree86/modes/xf86EdidModes.c
-@@ -150,6 +150,11 @@ static Bool quirk_detailed_v_in_cm (int 
-       DDC->vendor.prod_id == 1157)
-       return TRUE;
-+    /* LP #380009: HP Compaq NC8430 LP154W01-TLA8 */
-+    if (memcmp (DDC->vendor.name, "LPL", 4) == 0 &&
-+        DDC->vendor.prod_id == 5750)
-+        return TRUE;
-+
-     return FALSE;
- }
diff --git a/debian/patches/188_default_primary_to_first_busid.patch b/debian/patches/188_default_primary_to_first_busid.patch
deleted file mode 100644 (file)
index 4dd4ec9..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-If there seems to be more than one possible primary device, just
-pick the first device and carry on (LP 459512)
-
-signed-off-by: Bryce Harrington <bryce@canonical.com>
-
-diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
-index ac018e7..c00391c 100644
---- a/hw/xfree86/common/xf86pciBus.c
-+++ b/hw/xfree86/common/xf86pciBus.c
-@@ -141,8 +141,8 @@ xf86PciProbe(void)
-                   primaryBus.id.pci = info;
-               } else {
-                   xf86Msg(X_NOTICE,
--                          "More than one possible primary device found\n");
--                  primaryBus.type ^= (BusType)(-1);
-+                          "More than one possible primary device found.  Using first one seen.\n");
-+                    break;
-               }
-           }
-       }
diff --git a/debian/patches/189_xserver_1.5.0_bg_none_root.patch b/debian/patches/189_xserver_1.5.0_bg_none_root.patch
deleted file mode 100644 (file)
index 2a2c28b..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-From b4e4b980663692a3af5787eeaf2d48eb6c0188ed Mon Sep 17 00:00:00 2001
-From: Fedora X Ninjas <airlied@redhat.com>
-Date: Tue, 4 Aug 2009 14:45:58 +1000
-Subject: [PATCH] Add nr for background=none root
-
----
- dix/globals.c                |    1 +
- dix/window.c                 |   12 +++++++-----
- hw/xfree86/common/xf86Init.c |   11 +++++++++++
- hw/xfree86/common/xf86str.h  |    5 ++++-
- include/opaque.h             |    1 +
- os/utils.c                   |    3 +++
- 6 files changed, 27 insertions(+), 6 deletions(-)
-
---- a/dix/globals.c
-+++ b/dix/globals.c
-@@ -124,6 +124,7 @@ FontPtr defaultFont;   /* not declared i
- CursorPtr rootCursor;
- Bool party_like_its_1989 = FALSE;
- Bool whiteRoot = FALSE;
-+Bool bgNoneRoot = FALSE;
- int cursorScreenDevPriv[MAXSCREENS];
---- a/dix/window.c
-+++ b/dix/window.c
-@@ -466,22 +466,24 @@ InitRootWindow(WindowPtr pWin)
-     pWin->optional->cursor = rootCursor;
-     rootCursor->refcnt++;
-+    pWin->backingStore = defaultBackingStore;
-+    pWin->forcedBS = (defaultBackingStore != NotUseful);
-     if (party_like_its_1989) {
-         MakeRootTile(pWin);
-         backFlag |= CWBackPixmap;
-+        pScreen->ChangeWindowAttributes(pWin, backFlag);
-+    } else if (bgNoneRoot) {
-+       /* nothing, handled in xf86CreateRootWindow */
-     } else {
-       if (whiteRoot)
-             pWin->background.pixel = pScreen->whitePixel;
-         else
-             pWin->background.pixel = pScreen->blackPixel;
-         backFlag |= CWBackPixel;
--    } 
--    pWin->backingStore = defaultBackingStore;
--    pWin->forcedBS = (defaultBackingStore != NotUseful);
--    /* We SHOULD check for an error value here XXX */
--    (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
-+        pScreen->ChangeWindowAttributes(pWin, backFlag);
-+    }
-     MapWindow(pWin, serverClient);
- }
---- a/hw/xfree86/common/xf86Init.c
-+++ b/hw/xfree86/common/xf86Init.c
-@@ -77,6 +77,7 @@
- #ifdef RENDER
- #include "picturestr.h"
- #endif
-+#include "xace.h"
- #include "xf86VGAarbiter.h"
- #include "globals.h"
-@@ -256,6 +257,7 @@ xf86CreateRootWindow(WindowPtr pWin)
-   int ret = TRUE;
-   int err = Success;
-   ScreenPtr pScreen = pWin->drawable.pScreen;
-+  ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   RootWinPropPtr pProp;
-   CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr)
-       dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey);
-@@ -307,6 +309,15 @@ xf86CreateRootWindow(WindowPtr pWin)
-     }
-   }
-+  if (bgNoneRoot && pScrn->canDoBGNoneRoot) {
-+      pWin->backgroundState = XaceBackgroundNoneState(pWin);
-+      pWin->background.pixel = pScreen->whitePixel;
-+      pScreen->ChangeWindowAttributes(pWin, CWBackPixmap | CWBorderPixel | CWCursor | CWBackingStore);
-+  } else {
-+      pWin->background.pixel = pScreen->blackPixel;
-+      pScreen->ChangeWindowAttributes(pWin, CWBackPixel | CWBorderPixel | CWCursor | CWBackingStore);
-+  }
-+
-   DebugF("xf86CreateRootWindow() returns %d\n", ret);
-   return (ret);
- }
---- a/hw/xfree86/common/xf86str.h
-+++ b/hw/xfree86/common/xf86str.h
-@@ -503,7 +503,7 @@ typedef struct _confdrirec {
- } confDRIRec, *confDRIPtr;
- /* These values should be adjusted when new fields are added to ScrnInfoRec */
--#define NUM_RESERVED_INTS             16
-+#define NUM_RESERVED_INTS             15
- #define NUM_RESERVED_POINTERS         14
- #define NUM_RESERVED_FUNCS            11
-@@ -775,6 +775,9 @@ typedef struct _ScrnInfoRec {
-     ClockRangePtr     clockRanges;
-     int                       adjustFlags;
-+    /* -nr support */
-+    int                 canDoBGNoneRoot;
-+
-     /*
-      * These can be used when the minor ABI version is incremented.
-      * The NUM_* parameters must be reduced appropriately to keep the
---- a/include/opaque.h
-+++ b/include/opaque.h
-@@ -71,6 +71,7 @@ extern _X_EXPORT Bool defeatAccessContro
- extern _X_EXPORT long maxBigRequestSize;
- extern _X_EXPORT Bool party_like_its_1989;
- extern _X_EXPORT Bool whiteRoot;
-+extern _X_EXPORT Bool bgNoneRoot;
- extern _X_EXPORT Bool CoreDump;
---- a/os/utils.c
-+++ b/os/utils.c
-@@ -511,6 +511,7 @@ void UseMsg(void)
- #endif
-     ErrorF("-nolisten string       don't listen on protocol\n");
-     ErrorF("-noreset               don't reset after last client exists\n");
-+    ErrorF("-nr                    create root window with no background\n");
-     ErrorF("-reset                 reset after last client exists\n");
-     ErrorF("-p #                   screen-saver pattern duration (minutes)\n");
-     ErrorF("-pn                    accept failure to listen on all ports\n");
-@@ -852,6 +853,8 @@ ProcessCommandLine(int argc, char *argv[
-           defaultBackingStore = WhenMapped;
-         else if ( strcmp( argv[i], "-wr") == 0)
-             whiteRoot = TRUE;
-+        else if ( strcmp( argv[i], "-nr") == 0)
-+            bgNoneRoot = TRUE;
-         else if ( strcmp( argv[i], "-maxbigreqsize") == 0) {
-              if(++i < argc) {
-                  long reqSizeArg = atol(argv[i]);
diff --git a/debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch b/debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch
deleted file mode 100644 (file)
index e2d6cc3..0000000
+++ /dev/null
@@ -1,346 +0,0 @@
-Patch from Moblin to cache xkbcomp output for faster booting
-
-Signed-off-by: Bryce Harrington <bryce@canonical.com>
----
-
-Index: xorg-server/configure.ac
-===================================================================
---- xorg-server.orig/configure.ac      2010-07-14 14:02:00.000000000 +1000
-+++ xorg-server/configure.ac   2010-07-14 14:18:57.201453001 +1000
-@@ -540,9 +540,9 @@
- AC_ARG_WITH(xkb-path,         AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]),
-                               [ XKBPATH="$withval" ],
-                               [ XKBPATH="${datadir}/X11/xkb" ])
--AC_ARG_WITH(xkb-output,       AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]),
-+AC_ARG_WITH(xkb-output,       AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${localstatedir}/cache/xkb)]),
-                               [ XKBOUTPUT="$withval" ],
--                              [ XKBOUTPUT="compiled" ])
-+                              [ XKBOUTPUT="${localstatedir}/cache/xkb" ])
- AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES],
-                                    [Keyboard ruleset (default: base/evdev)]),
-                                 [ XKB_DFLT_RULES="$withval" ],
-@@ -1175,7 +1175,7 @@
- dnl Make sure XKM_OUTPUT_DIR is an absolute path
- XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1`
- if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then
--   XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT"
-+   AC_MSG_ERROR([xkb-output must be an absolute path.])
- fi
- dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed
-Index: xorg-server/xkb/README.compiled
-===================================================================
---- xorg-server.orig/xkb/README.compiled       2010-06-18 12:58:19.000000000 +1000
-+++ xorg-server/xkb/README.compiled    2010-07-14 14:18:57.201453001 +1000
-@@ -4,10 +4,10 @@
- or some other tool might destroy or replace the files in this directory,
- so it is not a safe place to store compiled keymaps for long periods of
- time.  The default keymap for any server is usually stored in:
--     X<num>-default.xkm
--where <num> is the display number of the server in question, which makes
--it possible for several servers *on the same host* to share the same 
--directory.
-+     server-<SHA1>.xkm
-+
-+where <SHA1> is the SHA1 hash of keymap source, so that compiled
-+keymap of different keymap sources are stored in different files.
- Unless the X server is modified, sharing this directory between servers on
- different hosts could cause problems.
-Index: xorg-server/xkb/ddxLoad.c
-===================================================================
---- xorg-server.orig/xkb/ddxLoad.c     2010-07-14 13:21:02.000000000 +1000
-+++ xorg-server/xkb/ddxLoad.c  2010-07-14 14:51:09.761453001 +1000
-@@ -30,6 +30,12 @@
- #include <xkb-config.h>
-+#ifdef HAVE_SHA1_IN_LIBGCRYPT /* Use libgcrypt for SHA1 */
-+# include <gcrypt.h>
-+#else /* Use OpenSSL's libcrypto */
-+#warning "xkbcomp caching support disabled"
-+#endif
-+
- #include <stdio.h>
- #include <ctype.h>
- #include <X11/X.h>
-@@ -43,24 +49,13 @@
- #define       XKBSRV_NEED_FILE_FUNCS
- #include <xkbsrv.h>
- #include <X11/extensions/XI.h>
-+#include <errno.h>
- #include "xkb.h"
- #if defined(CSRG_BASED) || defined(linux) || defined(__GNU__)
- #include <paths.h>
- #endif
--      /*
--       * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is
--       * relative to the top-level XKB configuration directory.
--       * Making the server write to a subdirectory of that directory
--       * requires some work in the general case (install procedure
--       * has to create links to /var or somesuch on many machines),
--       * so we just compile into /usr/tmp for now.
--       */
--#ifndef XKM_OUTPUT_DIR
--#define       XKM_OUTPUT_DIR  "compiled/"
--#endif
--
- #define       PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\""
- #define       ERROR_PREFIX    "\"> \""
- #define       POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\""
-@@ -174,6 +169,47 @@
-     }
- }
-+#ifndef SHA_DIGEST_LENGTH
-+#define SHA_DIGEST_LENGTH 20
-+#endif
-+
-+static Bool
-+Sha1Asc(char sha1Asc[SHA_DIGEST_LENGTH*2+1], const char * input)
-+{
-+    int i;
-+    unsigned char sha1[SHA_DIGEST_LENGTH];
-+
-+#ifdef HAVE_SHA1_IN_LIBGCRYPT /* Use libgcrypt for SHA1 */
-+    static int init;
-+    gcry_md_hd_t h;
-+    gcry_error_t err;
-+
-+    if (!init) {
-+      if (!gcry_check_version(NULL))
-+          return BadAlloc;
-+      gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
-+      gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
-+      init = 1;
-+    }
-+
-+    err = gcry_md_open(&h, GCRY_MD_SHA1, 0);
-+    if (err)
-+      return BadAlloc;
-+    gcry_md_write(h, input, strlen(input));
-+    memcpy(sha1, gcry_md_read(h, GCRY_MD_SHA1), 20);
-+    gcry_md_close(h);
-+#endif
-+
-+    /* convert sha1 to sha1_asc */
-+    for(i=0; i<SHA_DIGEST_LENGTH; ++i) {
-+        sprintf(sha1Asc+i*2, "%02X", sha1[i]);
-+    }
-+
-+    return Success;
-+}
-+
-+/* call xkbcomp and compile XKB keymap, return xkm file name in
-+   nameRtrn */
- static Bool
- XkbDDXCompileKeymapByNames(   XkbDescPtr              xkb,
-                               XkbComponentNamesPtr    names,
-@@ -183,7 +219,11 @@
-                               int                     nameRtrnLen)
- {
-     FILE *    out;
--    char      *buf = NULL, keymap[PATH_MAX], xkm_output_dir[PATH_MAX];
-+    char *    buf = NULL, xkmfile[PATH_MAX], xkm_output_dir[PATH_MAX];
-+    char *    tmpXkmFile = NULL;
-+    char *    canonicalXkmFileName = NULL;
-+    char      sha1Asc[SHA_DIGEST_LENGTH*2+1], xkbKeyMapBuf[100*1024];
-+    int       ret, result;
-     const char        *emptystring = "";
-     char *xkbbasedirflag = NULL;
-@@ -194,14 +234,67 @@
-     /* WIN32 has no popen. The input must be stored in a file which is
-        used as input for xkbcomp. xkbcomp does not read from stdin. */
-     char tmpname[PATH_MAX];
--    const char *xkmfile = tmpname;
-+    const char *xkbfile = tmpname;
- #else
--    const char *xkmfile = "-";
-+    const char *xkbfile = "-";
-+#endif
-+
-+    /* Write keymap source (xkbfile) to memory buffer `xkbKeyMapBuf',
-+       of which SHA1 is generated and used as result xkm file name  */
-+    memset(xkbKeyMapBuf, 0, sizeof(xkbKeyMapBuf));
-+    out = fmemopen(xkbKeyMapBuf, sizeof(xkbKeyMapBuf), "w");
-+    if (NULL == out) {
-+        ErrorF("[xkb] Open xkbKeyMapBuf for writing failed\n");
-+        return FALSE;
-+    }
-+    ret = XkbWriteXKBKeymapForNames(out, names, xkb, want, need);
-+    if (fclose(out) !=0)
-+    {
-+        ErrorF("[xkb] XkbWriteXKBKeymapForNames error, perhaps xkbKeyMapBuf is too small\n");
-+        return FALSE;
-+    }
-+#ifdef DEBUG
-+    if (xkbDebugFlags) {
-+       ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n");
-+       fputs(xkbKeyMapBuf, stderr);
-+    }
- #endif
-+    if (!ret) {
-+        ErrorF("[xkb] Generating XKB Keymap failed, giving up compiling keymap\n");
-+        return FALSE;
-+    }
--    snprintf(keymap, sizeof(keymap), "server-%s", display);
-+    DebugF("[xkb] computing SHA1 of keymap\n");
-+    if (Success == Sha1Asc(sha1Asc, xkbKeyMapBuf)) {
-+        snprintf(xkmfile, sizeof(xkmfile), "server-%s", sha1Asc);
-+    }
-+    else {
-+        ErrorF("[xkb] Computing SHA1 of keymap failed, "
-+               "using display name instead as xkm file name\n");
-+        snprintf(xkmfile, sizeof(xkmfile), "server-%s", display);
-+    }
-     OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir));
-+    /* set nameRtrn, fail if it's too small */
-+    if ((strlen(xkmfile)+1 > nameRtrnLen) && nameRtrn) {
-+        ErrorF("[xkb] nameRtrn too small to hold xkmfile name\n");
-+        return FALSE;
-+    }
-+    strncpy(nameRtrn, xkmfile, nameRtrnLen);
-+
-+    /* if the xkm file already exists, reuse it */
-+    canonicalXkmFileName = Xprintf("%s%s.xkm", xkm_output_dir, xkmfile);
-+    if (access(canonicalXkmFileName, R_OK) == 0) {
-+        /* yes, we can reuse the old xkm file */
-+        LogMessage(X_INFO, "XKB: reuse xkmfile %s\n", canonicalXkmFileName);
-+        result = TRUE;
-+        goto _ret;
-+    }
-+    LogMessage(X_INFO, "XKB: generating xkmfile %s\n", canonicalXkmFileName);
-+
-+    /* continue to call xkbcomp to compile the keymap. to avoid race
-+       condition, we compile it to a tmpfile then rename it to
-+       xkmfile */
- #ifdef WIN32
-     strcpy(tmpname, Win32TempDir());
-@@ -225,14 +318,20 @@
-       }
-     }
-+    if ( (tmpXkmFile = tempnam(xkm_output_dir, NULL)) == NULL ) {
-+      ErrorF("[xkb] Can't generate temp xkm file name");
-+      result = FALSE;
-+      goto _ret;
-+    }
-+
-     buf = Xprintf("\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
--                "-em1 %s -emp %s -eml %s \"%s%s.xkm\"",
-+                "-em1 %s -emp %s -eml %s \"%s\"",
-                 xkbbindir, xkbbindirsep,
-                 ( (xkbDebugFlags < 2) ? 1 :
-                   ((xkbDebugFlags > 10) ? 10 : (int)xkbDebugFlags) ),
--                xkbbasedirflag ? xkbbasedirflag : "", xkmfile,
-+                xkbbasedirflag ? xkbbasedirflag : "", xkbfile,
-                 PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1,
--                xkm_output_dir, keymap);
-+                tmpXkmFile);
-     free(xkbbasedirflag);
-@@ -241,6 +340,11 @@
-         return FALSE;
-     }
-     
-+    /* there's a potential race condition between calling tempnam()
-+       and invoking xkbcomp to write the result file (potential temp
-+       file name conflicts), but since xkbcomp is a standalone
-+       program, we have to live with this */
-+
- #ifndef WIN32
-     out= Popen(buf,"w");
- #else
-@@ -248,31 +352,42 @@
- #endif
-     
-     if (out!=NULL) {
--#ifdef DEBUG
--    if (xkbDebugFlags) {
--       ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n");
--       XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need);
--    }
--#endif
--      XkbWriteXKBKeymapForNames(out,names,xkb,want,need);
-+      /* write XKBKeyMapBuf to xkbcomp */
-+      if (EOF==fputs(xkbKeyMapBuf, out))
-+      {
-+          ErrorF("[xkb] Sending keymap to xkbcomp failed\n");
-+          result = FALSE;
-+          goto _ret;
-+      }
- #ifndef WIN32
-       if (Pclose(out)==0)
- #else
-       if (fclose(out)==0 && System(buf) >= 0)
- #endif
-       {
-+          /* xkbcomp success */
-             if (xkbDebugFlags)
-                 DebugF("[xkb] xkb executes: %s\n",buf);
--          if (nameRtrn) {
--              strncpy(nameRtrn,keymap,nameRtrnLen);
--              nameRtrn[nameRtrnLen-1]= '\0';
-+
-+          /* if canonicalXkmFileName already exists now, we simply
-+             overwrite it, this is OK */
-+          ret = rename(tmpXkmFile, canonicalXkmFileName);
-+          if (0 != ret) {
-+              ErrorF("[xkb] Can't rename %s to %s, error: %s\n",
-+                       tmpXkmFile, canonicalXkmFileName,
-+                       strerror(errno));
-+
-+                /* in case of error, don't unlink tmpXkmFile, leave it
-+                   for debugging */
-+
-+                result = FALSE;
-+                goto _ret;
-           }
--            if (buf != NULL)
--                free(buf);
--          return TRUE;
-+          result = TRUE;
-+          goto _ret;
-       }
-       else
--          LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap);
-+          LogMessage(X_ERROR, "Error compiling keymap (%s)\n", xkbfile);
- #ifdef WIN32
-         /* remove the temporary file */
-         unlink(tmpname);
-@@ -287,9 +402,17 @@
-     }
-     if (nameRtrn)
-       nameRtrn[0]= '\0';
--    if (buf != NULL)
--        free(buf);
--    return FALSE;
-+    result = FALSE;
-+
-+_ret:
-+    if (tmpXkmFile)
-+      free(tmpXkmFile);
-+    if (canonicalXkmFileName)
-+      free(canonicalXkmFileName);
-+    if (buf)
-+      free(buf);
-+    
-+    return result;
- }
- static FILE *
-@@ -373,7 +496,6 @@
-       DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined);
-     }
-     fclose(file);
--    (void) unlink (fileName);
-     return (need|want)&(~missing);
- }
diff --git a/debian/patches/191-Xorg-add-an-extra-module-path.patch b/debian/patches/191-Xorg-add-an-extra-module-path.patch
deleted file mode 100644 (file)
index 6c7e13c..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-From 416a66de9d428a11776331926c23a61188b8fc16 Mon Sep 17 00:00:00 2001
-From: Ander Conselvan de Oliveira <ander@localhost.(none)>
-Date: Thu, 12 Mar 2009 09:45:57 -0300
-Subject: [PATCH 908/911] Xorg: add an extra module path
-
-If the extra module path is not an empty string (the default value),
-module path will be searched first in the extra module path and then in
-the default module path. This should simplify the alternatives system
-used on Mandriva's fglrx package.
----
---- a/configure.ac
-+++ b/configure.ac
-@@ -492,6 +492,10 @@ AC_ARG_WITH(module-dir,      AS_HELP_STR
-                                 [Directory where modules are installed (default: $libdir/xorg/modules)]),
-                               [ moduledir="$withval" ],
-                               [ moduledir="${libdir}/xorg/modules" ])
-+AC_ARG_WITH(extra-module-dir,AS_HELP_STRING([--with-extra-module-dir=DIR],
-+                                [Extra module directory to search for modules before the default one (default: empty)]),
-+                              [ extra_moduledir="$withval" ],
-+                              [ extra_moduledir="" ])
- AC_ARG_WITH(log-dir,         AS_HELP_STRING([--with-log-dir=DIR],
-                                 [Directory where log files are kept (default: $localstatedir/log)]),
-                               [ logdir="$withval" ],
-@@ -1805,6 +1809,7 @@ if test "x$XORG" = xyes; then
-       AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file])
-       AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory])
-       AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path])
-+      AC_DEFINE_DIR(EXTRA_MODULE_PATH, extra_moduledir, [Extra module search path, searched before the default one])
-       AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path])
-       AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location])
-       AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
---- a/hw/xfree86/common/xf86Config.c
-+++ b/hw/xfree86/common/xf86Config.c
-@@ -653,11 +653,21 @@ configFiles(XF86ConfFilesPtr fileconf)
-   
-   /* ModulePath */
--  if (fileconf) {
--    if (xf86ModPathFrom != X_CMDLINE && fileconf->file_modulepath) {
-+  if (xf86ModPathFrom != X_CMDLINE) {
-+    if (fileconf && fileconf->file_modulepath) {
-       xf86ModulePath = fileconf->file_modulepath;
-       xf86ModPathFrom = X_CONFIG;
-     }
-+    else if (strcmp(xf86ExtraModulePath, "") != 0) {
-+      char *newpath = malloc(strlen(xf86ExtraModulePath)
-+                           + strlen(xf86ModulePath)
-+                           + 2);
-+      strcpy(newpath, xf86ExtraModulePath);
-+      strcat(newpath, ",");
-+      strcat(newpath, xf86ModulePath);
-+
-+      xf86ModulePath = newpath;
-+    }
-   }
-   xf86Msg(xf86ModPathFrom, "ModulePath set to \"%s\"\n", xf86ModulePath);
---- a/hw/xfree86/common/xf86Globals.c
-+++ b/hw/xfree86/common/xf86Globals.c
-@@ -145,6 +145,7 @@ xf86InfoRec xf86Info = {
- const char *xf86ConfigFile = NULL;
- const char *xf86ConfigDir = NULL;
- const char *xf86ModulePath = DEFAULT_MODULE_PATH;
-+const char *xf86ExtraModulePath = EXTRA_MODULE_PATH;
- MessageType xf86ModPathFrom = X_DEFAULT;
- const char *xf86LogFile = DEFAULT_LOGPREFIX;
- MessageType xf86LogFileFrom = X_DEFAULT;
---- a/hw/xfree86/common/xf86Priv.h
-+++ b/hw/xfree86/common/xf86Priv.h
-@@ -78,6 +78,7 @@ extern _X_EXPORT  struct pci_slot_match 
- extern _X_EXPORT  xf86InfoRec xf86Info;
- extern _X_EXPORT  const char *xf86ModulePath;
-+extern _X_EXPORT  const char *xf86ExtraModulePath;
- extern _X_EXPORT  MessageType xf86ModPathFrom;
- extern _X_EXPORT  const char *xf86LogFile;
- extern _X_EXPORT  MessageType xf86LogFileFrom;
---- a/include/xorg-config.h.in
-+++ b/include/xorg-config.h.in
-@@ -42,6 +42,9 @@
- /* Path to loadable modules. */
- #undef DEFAULT_MODULE_PATH
-+/* Path to extra loadable modules. */
-+#undef EXTRA_MODULE_PATH
-+
- /* Path to installed libraries. */
- #undef DEFAULT_LIBRARY_PATH
diff --git a/debian/patches/197_xvfb-randr.patch b/debian/patches/197_xvfb-randr.patch
deleted file mode 100644 (file)
index d29bbf1..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-=== modified file 'hw/vfb/InitOutput.c'
-Index: xorg-server/hw/vfb/InitOutput.c
-===================================================================
---- xorg-server.orig/hw/vfb/InitOutput.c       2010-07-14 15:06:03.511453001 +1000
-+++ xorg-server/hw/vfb/InitOutput.c    2010-07-14 15:07:00.101453002 +1000
-@@ -66,6 +66,7 @@
- #endif /* HAS_SHM */
- #include "dix.h"
- #include "miline.h"
-+#include "randrstr.h"
- #define VFB_DEFAULT_WIDTH      1280
- #define VFB_DEFAULT_HEIGHT     1024
-@@ -881,6 +882,12 @@
-     if (!ret) return FALSE;
-+    if (!miRandRInit(pScreen))
-+        /* Not sure how to emit warnings in xorg. Should warn here though:
-+       * ("Could not initialise RANDR\n");
-+       */
-+        return FALSE;
-+
-     miInitializeBackingStore(pScreen);
-     /*
diff --git a/debian/patches/198_nohwaccess.patch b/debian/patches/198_nohwaccess.patch
deleted file mode 100644 (file)
index 8073770..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-Two chunks of jbarne's nohwaccess patch got taken upstream; this patch
-contains just the remainder, which implements a -nohwaccess option.
-
---- a/hw/xfree86/os-support/linux/lnx_init.c
-+++ b/hw/xfree86/os-support/linux/lnx_init.c
-@@ -42,6 +42,7 @@ static Bool KeepTty = FALSE;
- static int VTnum = -1;
- static Bool VTSwitch = TRUE;
- static Bool ShareVTs = FALSE;
-+Bool NoHwAccess = FALSE;
- static int activeVT = -1;
- static int vtPermSave[4];
-@@ -392,6 +393,11 @@ xf86ProcessArgument(int argc, char *argv
-                 ShareVTs = TRUE;
-                 return(1);
-         }
-+      if (!strcmp(argv[i], "-nohwaccess"))
-+      {
-+              NoHwAccess = TRUE;
-+              return(1);
-+      }
-       if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
-       {
-               if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
-@@ -413,4 +419,5 @@ xf86UseMsg(void)
-       ErrorF("don't detach controlling tty (for debugging only)\n");
-       ErrorF("-novtswitch            don't immediately switch to new VT\n");
-       ErrorF("-sharevts              share VTs with another X server\n");
-+      ErrorF("-nohwaccess            don't access hardware ports directly\n");
- }
---- a/hw/xfree86/os-support/linux/lnx_video.c
-+++ b/hw/xfree86/os-support/linux/lnx_video.c
-@@ -50,6 +50,7 @@
- #define MAP_FAILED ((void *)-1)
- #endif
-+extern Bool NoHwAccess;
- static Bool ExtendedEnabled = FALSE;
- #ifdef __ia64__
-@@ -496,6 +497,9 @@ xf86EnableIO(void)
-       int fd;
-       unsigned int ioBase_phys;
- #endif
-+      /* Fake it... */
-+      if (NoHwAccess)
-+              return TRUE;
-       if (ExtendedEnabled)
-               return TRUE;
diff --git a/debian/patches/200_randr-null.patch b/debian/patches/200_randr-null.patch
deleted file mode 100644 (file)
index 63a875b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-=== modified file 'randr/randr.c'
---- a/randr/randr.c    2009-12-19 01:44:12 +0000
-+++ b/randr/randr.c    2010-02-02 16:28:26 +0000
-@@ -234,7 +234,7 @@
-     /*
-      * Calling function best set these function vectors
-      */
--    pScrPriv->rrGetInfo = 0;
-+    pScrPriv->rrGetInfo = NULL;
-     pScrPriv->maxWidth = pScrPriv->minWidth = pScreen->width;
-     pScrPriv->maxHeight = pScrPriv->minHeight = pScreen->height;
-     
-
diff --git a/debian/patches/201_report-real-dpi.patch b/debian/patches/201_report-real-dpi.patch
deleted file mode 100644 (file)
index 253f38d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-Description: Report physical DPI when EDID data exists.
- .
- This reverts git commit fff00df94d7ebd18a8e24537ec96073717375a3f, which 
- made X report 96DPI via the core protocol.
- .
- We want to make this policy decision higher up the stack than the X server,
- so revert this and make X report the physical DPI when the EDID contains
- physical size data.
-Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
-
-Index: xorg-server/hw/xfree86/modes/xf86RandR12.c
-===================================================================
---- xorg-server.orig/hw/xfree86/modes/xf86RandR12.c    2010-08-03 15:59:57.750272356 +1000
-+++ xorg-server/hw/xfree86/modes/xf86RandR12.c 2010-08-03 16:00:00.750380508 +1000
-@@ -805,6 +805,7 @@
-       else
-       {
-           xf86OutputPtr   output = xf86CompatOutput(pScrn);
-+          rrScrPriv(pScreen);
-           if (output &&
-               output->conf_monitor &&
-@@ -817,6 +818,23 @@
-               mmWidth = output->conf_monitor->mon_width;
-               mmHeight = output->conf_monitor->mon_height;
-           }
-+          else if (pScrPriv && pScrPriv->primaryOutput)
-+          {
-+              /* Calculate DPI based on primary display size, not the entire display size */
-+              mmWidth = pScrPriv->primaryOutput->mmWidth * width / pScrPriv->primaryOutput->crtc->mode->mode.width;
-+              mmHeight = pScrPriv->primaryOutput->mmHeight * height / pScrPriv->primaryOutput->crtc->mode->mode.height;
-+          }
-+          else if (output && output->crtc && output->crtc->mode.HDisplay &&
-+                   output->mm_width && output->mm_height)
-+          {
-+              /*
-+               * If the output has a mode and a declared size, use that
-+               * to scale the screen size
-+               */
-+              DisplayModePtr  mode = &output->crtc->mode;
-+              mmWidth = output->mm_width * width / mode->HDisplay;
-+              mmHeight = output->mm_height * height / mode->VDisplay;
-+          }
-           else
-           {
-               /*
diff --git a/debian/patches/202_xf86CoordinationsToWindows.patch b/debian/patches/202_xf86CoordinationsToWindows.patch
deleted file mode 100644 (file)
index 6c2d1f1..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-From 0e750eff9ba7987ef31acaabd3ef771bfd2e2ce5 Mon Sep 17 00:00:00 2001
-From: Chase Douglas <chase.douglas@canonical.com>
-Date: Wed, 21 Jul 2010 12:00:04 +0200
-Subject: [PATCH 1/5] Add XFixesCoordinatesToWindow request
-
----
- dix/events.c                   |   48 ++++++++++++++++++++++++++++++++++++++++
- hw/xfree86/common/xf86Xinput.c |    7 +++++
- hw/xfree86/common/xf86Xinput.h |    2 +
- include/events.h               |    3 ++
- 4 files changed, 60 insertions(+), 0 deletions(-)
-
---- xorg-server-debian.orig/dix/events.c
-+++ xorg-server-debian/dix/events.c
-@@ -5840,3 +5840,47 @@
-     return FALSE;
- }
-+WindowPtr
-+CoordinatesToWindow(int x, int y, int screen)
-+{
-+    WindowPtr pWin;
-+    WindowPtr ret = NullWindow;
-+    BoxRec box;
-+
-+    pWin = screenInfo.screens[screen]->root;
-+    while (pWin)
-+    {
-+      if ((pWin->mapped) &&
-+          (x >= pWin->drawable.x - wBorderWidth (pWin)) &&
-+          (x < pWin->drawable.x + (int)pWin->drawable.width +
-+           wBorderWidth(pWin)) &&
-+          (y >= pWin->drawable.y - wBorderWidth (pWin)) &&
-+          (y < pWin->drawable.y + (int)pWin->drawable.height +
-+           wBorderWidth (pWin))
-+          /* When a window is shaped, a further check
-+           * is made to see if the point is inside
-+           * borderSize
-+           */
-+          && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y))
-+          && (!wInputShape(pWin) ||
-+              RegionContainsPoint(wInputShape(pWin),
-+                                  x - pWin->drawable.x,
-+                                  y - pWin->drawable.y, &box))
-+#ifdef ROOTLESS
-+    /* In rootless mode windows may be offscreen, even when
-+     * they're in X's stack. (E.g. if the native window system
-+     * implements some form of virtual desktop system).
-+     */
-+              && !pWin->rootlessUnhittable
-+#endif
-+          )
-+      {
-+            ret = pWin;
-+            pWin = pWin->firstChild;
-+        }
-+        else
-+            pWin = pWin->nextSib;
-+    }
-+    return ret;
-+}
-+
---- xorg-server-debian.orig/hw/xfree86/common/xf86Xinput.c
-+++ xorg-server-debian/hw/xfree86/common/xf86Xinput.c
-@@ -1362,4 +1362,10 @@
-     EnableDevice(dev, TRUE);
- }
-+WindowPtr
-+xf86CoordinatesToWindow(int x, int y, int screen)
-+{
-+    return CoordinatesToWindow(x, y, screen);
-+}
-+
- /* end of xf86Xinput.c */
---- xorg-server-debian.orig/hw/xfree86/common/xf86Xinput.h
-+++ xorg-server-debian/hw/xfree86/common/xf86Xinput.h
-@@ -212,6 +212,8 @@
- extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
-                            pointer extraOpts);
-+extern _X_EXPORT WindowPtr xf86CoordinatesToWindow(int x, int y, int screen);
-+
- /* Legacy hatred */
- #define SendCoreEvents 59
---- xorg-server-debian.orig/include/events.h
-+++ xorg-server-debian/include/events.h
-@@ -24,6 +24,7 @@
- #ifndef EVENTS_H
- #define EVENTS_H
-+
- typedef struct _DeviceEvent DeviceEvent;
- typedef struct _DeviceChangedEvent DeviceChangedEvent;
- #if XFreeXDGA
-@@ -35,4 +36,6 @@
- #endif
- typedef union _InternalEvent InternalEvent;
-+extern WindowPtr CoordinatesToWindow(int x, int y, int screen);
-+
- #endif
diff --git a/debian/patches/203_gestures-extension.patch b/debian/patches/203_gestures-extension.patch
deleted file mode 100644 (file)
index d786914..0000000
+++ /dev/null
@@ -1,1327 +0,0 @@
-From 2b3600e55fdc8270181a1e818ad1c607c7406b16 Mon Sep 17 00:00:00 2001
-From: Chase Douglas <chase.douglas@canonical.com>
-Date: Sat, 24 Jul 2010 06:02:59 -0400
-Subject: [PATCH] Gesture Extension
-
----
- Makefile.am                 |    5 +
- configure.ac                |   26 ++-
- dix/window.c                |    7 +
- gesture/Makefile.am         |   10 +
- gesture/gesture.c           |  421 +++++++++++++++++++++++++++++++++++++++++++
- gesture/gesture.h           |   77 ++++++++
- gesture/gestureint.h        |   49 +++++
- gesture/gestureproto.h      |  141 +++++++++++++++
- gesture/init.c              |  282 +++++++++++++++++++++++++++++
- include/dix-config.h.in     |    3 +
- include/protocol-versions.h |    4 +
- include/windowstr.h         |   10 +
- mi/miinitext.c              |   15 ++
- os/utils.c                  |    3 +
- 14 files changed, 1045 insertions(+), 8 deletions(-)
- create mode 100644 gesture/Makefile.am
- create mode 100644 gesture/gesture.c
- create mode 100644 gesture/gesture.h
- create mode 100644 gesture/gestureint.h
- create mode 100644 gesture/gestureproto.h
- create mode 100644 gesture/init.c
-
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -17,6 +17,10 @@ if RECORD
- RECORD_DIR=record
- endif
-+if GESTURES
-+GESTURE_DIR=gesture
-+endif
-+
- SUBDIRS = \
-       doc \
-       include \
-@@ -37,6 +41,7 @@ SUBDIRS = \
-       $(COMPOSITE_DIR) \
-       $(GLX_DIR) \
-       exa \
-+      $(GESTURE_DIR) \
-       config \
-       hw \
-       test
---- a/configure.ac
-+++ b/configure.ac
-@@ -602,6 +602,8 @@ AC_ARG_ENABLE(visibility,     AC_HELP_ST
- AC_ARG_ENABLE(pc98,           AC_HELP_STRING([--enable-pc98], [Enable PC98 support in Xorg (default: auto)]),
-                               [SUPPORT_PC98=$enableval],
-                               [SUPPORT_PC98=auto])
-+AC_ARG_ENABLE(gestures,         AC_HELP_STRING([--enable-gestures], [Enable gesture support (default: disabled)]),
-+                              [GESTURES=$enableval])
- dnl GLX build options
- AC_ARG_WITH(dri-driver-path,  AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]),
-@@ -1360,6 +1362,13 @@ MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/
- MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la'
- CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
-+AM_CONDITIONAL(GESTURES, [test "x$GESTURES" = "xyes"])
-+if test "x$GESTURES" = xyes; then
-+      AC_DEFINE(GESTURES, 1, [Enable gesture support])
-+      GESTURE_LIB='$(top_builddir)/gesture/libgesture.la'
-+      GESTURE_INC='-I$(top_srcdir)/gesture'
-+fi
-+
- # SHA1 hashing
- AC_ARG_WITH([sha1],
-             [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto|nettle],
-@@ -1507,7 +1516,7 @@ AC_EGREP_CPP([I_AM_SVR4],[
- AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4])
- AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
--XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC"
-+XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC $GESTURE_INC"
- dnl ---------------------------------------------------------------------------
- dnl DDX section.
-@@ -1520,7 +1529,7 @@ AC_MSG_RESULT([$XVFB])
- AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
- if test "x$XVFB" = xyes; then
--      XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB"
-+      XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $GESTURE_LIB"
-       XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS"
-       AC_SUBST([XVFB_LIBS])
-       AC_SUBST([XVFB_SYS_LIBS])
-@@ -1541,7 +1550,7 @@ if test "x$XNEST" = xyes; then
-       if test "x$have_xnest" = xno; then
-               AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.])
-       fi
--      XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB"
-+      XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB $GESTURE_LIB"
-       XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS"
-       AC_SUBST([XNEST_LIBS])
-       AC_SUBST([XNEST_SYS_LIBS])
-@@ -1569,7 +1578,7 @@ if test "x$XORG" = xyes; then
-       XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
-       XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
-       XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
--      XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB"
-+      XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $GESTURE_LIB"
-       dnl ==================================================================
-       dnl symbol visibility
-@@ -1905,7 +1914,7 @@ if test "x$XWIN" = xyes; then
-                       XWIN_SYS_LIBS=-lwinsock2
-                       ;;
-       esac
--      XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB"
-+      XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB $GESTURE_LIB"
-       XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS"
-       AC_SUBST(XWIN_LIBS)
-       AC_SUBST(XWIN_SERVER_NAME)
-@@ -1935,7 +1944,7 @@ if test "x$XQUARTZ" = xyes; then
-       AC_DEFINE(XQUARTZ,1,[Have Quartz])
-       AC_DEFINE(ROOTLESS,1,[Build Rootless code])
--      DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB"
-+      DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $GESTURE_LIB"
-       AC_SUBST([DARWIN_LIBS])
-       AC_CHECK_LIB([Xplugin],[xp_init],[:])
-@@ -1996,7 +2005,7 @@ if test "x$DMX" = xyes; then
-       fi
-       DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
-       XDMX_CFLAGS="$DMXMODULES_CFLAGS"
--      XDMX_LIBS="$FB_LIB $MI_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XEXT_LIB $MAIN_LIB $DIX_LIB $OS_LIB $FIXES_LIB"
-+      XDMX_LIBS="$FB_LIB $MI_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XEXT_LIB $MAIN_LIB $DIX_LIB $OS_LIB $FIXES_LIB $GESTURE_LIB"
-       XDMX_SYS_LIBS="$DMXMODULES_LIBS"
-       AC_SUBST([XDMX_CFLAGS])
-       AC_SUBST([XDMX_LIBS])
-@@ -2104,7 +2113,7 @@ if test "$KDRIVE" = yes; then
-     
-     KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS"
--    KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB"
-+    KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB $GESTURE_LIB"
-     KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la'
-     case $host_os in
-       *linux*)
-@@ -2215,6 +2224,7 @@ Xext/Makefile
- Xi/Makefile
- xfixes/Makefile
- exa/Makefile
-+gesture/Makefile
- hw/Makefile
- hw/xfree86/Makefile
- hw/xfree86/common/Makefile
---- a/dix/window.c
-+++ b/dix/window.c
-@@ -397,6 +397,9 @@ CreateRootWindow(ScreenPtr pScreen)
-     pWin->optional->deviceCursors = NULL;
-     pWin->optional->colormap = pScreen->defColormap;
-     pWin->optional->visual = pScreen->rootVisual;
-+#ifdef GESTURES
-+    pWin->optional->gestureMasks = NULL;
-+#endif
-     pWin->nextSib = NullWindow;
-@@ -3397,6 +3400,10 @@ CheckWindowOptionalNeed (WindowPtr w)
-             pNode = pNode->next;
-         }
-     }
-+#ifdef GESTURES
-+    if (optional->gestureMasks != NULL)
-+        return;
-+#endif
-     parentOptional = FindWindowWithOptional(w)->optional;
-     if (optional->visual != parentOptional->visual)
-@@ -3440,6 +3447,9 @@ MakeWindowOptional (WindowPtr pWin)
-     optional->inputShape = NULL;
-     optional->inputMasks = NULL;
-     optional->deviceCursors = NULL;
-+#ifdef GESTURES
-+    optional->gestureMasks = NULL;
-+#endif
-     parentOptional = FindWindowWithOptional(pWin)->optional;
-     optional->visual = parentOptional->visual;
---- /dev/null
-+++ b/gesture/Makefile.am
-@@ -0,0 +1,10 @@
-+noinst_LTLIBRARIES = libgesture.la
-+
-+AM_CFLAGS = $(DIX_CFLAGS)
-+
-+libgesture_la_SOURCES =       \
-+      init.c                  \
-+      gesture.c               \
-+      gesture.h
-+
-+sdk_HEADERS = gesture.h
---- /dev/null
-+++ b/gesture/gesture.c
-@@ -0,0 +1,430 @@
-+/*
-+ * Copyright © 2010 Canonical, Ltd.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice (including the next
-+ * paragraph) shall be included in all copies or substantial portions of the
-+ * Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ *
-+ * Authors: Chase Douglas <chase.douglas@canonical.com>
-+ *
-+ */
-+
-+#include "windowstr.h"
-+#include "gestureint.h"
-+
-+int
-+SProcGestureQueryVersion(ClientPtr client)
-+{
-+    char n;
-+
-+    REQUEST(GestureQueryVersionReq);
-+    swaps(&stuff->length, n);
-+    REQUEST_AT_LEAST_SIZE(GestureQueryVersionReq);
-+    swaps(&stuff->major_version, n);
-+    swaps(&stuff->minor_version, n);
-+    return (ProcGestureQueryVersion(client));
-+}
-+
-+GestureExtensionVersion GestureVersion;
-+/**
-+ * Return the supported Gesture version.
-+ *
-+ * Saves the version the client claims to support as well, for future
-+ * reference.
-+ */
-+int
-+ProcGestureQueryVersion(ClientPtr client)
-+{
-+    GestureQueryVersionReply rep;
-+    GestureClientPtr gestureClient;
-+    int major, minor;
-+    unsigned int sversion, cversion;
-+
-+    REQUEST(GestureQueryVersionReq);
-+    REQUEST_SIZE_MATCH(GestureQueryVersionReq);
-+
-+    gestureClient = dixLookupPrivate(&client->devPrivates,
-+                                     &GestureClientPrivateKeyRec);
-+
-+    sversion = GestureVersion.major_version * 1000 + GestureVersion.minor_version;
-+    cversion = stuff->major_version * 1000 + stuff->minor_version;
-+
-+    if (sversion > cversion)
-+    {
-+        major = stuff->major_version;
-+        minor = stuff->minor_version;
-+    } else
-+    {
-+        major = GestureVersion.major_version;
-+        minor = GestureVersion.minor_version;
-+    }
-+
-+    gestureClient->major_version = major;
-+    gestureClient->minor_version = minor;
-+
-+    memset(&rep, 0, sizeof(GestureQueryVersionReply));
-+    rep.repType = X_Reply;
-+    rep.RepType = X_GestureQueryVersion;
-+    rep.length = 0;
-+    rep.sequenceNumber = client->sequence;
-+    rep.major_version = major;
-+    rep.minor_version = minor;
-+
-+    WriteReplyToClient(client, sizeof(GestureQueryVersionReply), &rep);
-+
-+    return Success;
-+}
-+
-+void
-+SRepGestureQueryVersion(ClientPtr client, int size, GestureQueryVersionReply *rep)
-+{
-+    char n;
-+    swaps(&rep->sequenceNumber, n);
-+    swapl(&rep->length, n);
-+    swaps(&rep->major_version, n);
-+    swaps(&rep->minor_version, n);
-+    WriteToClient(client, size, (char *)rep);
-+}
-+
-+static Bool
-+MakeGestureMasks(WindowPtr pWin)
-+{
-+    struct _GestureMasks *masks;
-+
-+    masks = calloc(1, sizeof(struct _GestureMasks));
-+    if (!masks)
-+        return FALSE;
-+    pWin->optional->gestureMasks = masks;
-+    return TRUE;
-+}
-+
-+static int
-+AddGestureClient(WindowPtr pWin, ClientPtr client)
-+{
-+    GestureClientsPtr others;
-+
-+    if (!pWin->optional && !MakeWindowOptional(pWin))
-+        return BadAlloc;
-+    others = calloc(1, sizeof(GestureClients));
-+    if (!others)
-+        return BadAlloc;
-+    if (!pWin->optional->gestureMasks && !MakeGestureMasks(pWin))
-+        return BadAlloc;
-+    others->resource = FakeClientID(client->index);
-+    others->next = pWin->optional->gestureMasks->clients;
-+    pWin->optional->gestureMasks->clients = others;
-+    if (!AddResource(others->resource, RT_GESTURECLIENT, (pointer) pWin))
-+        return BadAlloc;
-+    return Success;
-+}
-+
-+/**
-+ * Check the given mask (in len bytes) for invalid mask bits.
-+ * Invalid mask bits are any bits above GestureLastEvent.
-+ *
-+ * @return BadValue if at least one invalid bit is set or Success otherwise.
-+ */
-+static int
-+GestureCheckInvalidMaskBits(unsigned char *mask, int len)
-+{
-+    if (len >= GESTUREMASKSIZE)
-+    {
-+        int i;
-+        for (i = GESTURELASTEVENT + 1; i < len * 8; i++)
-+            if (BitIsOn(mask, i))
-+                return BadValue;
-+    }
-+
-+    return Success;
-+}
-+
-+int
-+SProcGestureSelectEvents(ClientPtr client)
-+{
-+    char n;
-+    int i;
-+
-+    REQUEST(GestureSelectEventsReq);
-+    swaps(&stuff->length, n);
-+    REQUEST_AT_LEAST_SIZE(GestureSelectEventsReq);
-+    swapl(&stuff->window, n);
-+    swaps(&stuff->mask.device_id, n);
-+    swaps(&stuff->mask.mask_len, n);
-+
-+    for (i = 0; i < stuff->mask.mask_len; i++)
-+        swapl(((uint32_t *)(stuff + 1)) + i, n);
-+
-+    return (ProcGestureSelectEvents(client));
-+}
-+
-+static void
-+RecalculateGestureDeliverableEvents(WindowPtr win)
-+{
-+    GestureClientsPtr others;
-+    int i;
-+
-+    if (!win->optional || !wGestureMasks(win))
-+        return;
-+
-+    memset(&wGestureMasks(win)->mask, 0, sizeof(wGestureMasks(win)->mask));
-+
-+    for (others = wGestureMasks(win)->clients; others; others = others->next)
-+        for (i = 0; i < sizeof(others->gestureMask) * 8; i++)
-+            if (BitIsOn(&others->gestureMask, i))
-+                SetBit(wGestureMasks(win)->mask, i % (GESTURELASTEVENT + 1));
-+}
-+
-+static int
-+GestureSetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
-+                    unsigned int len, unsigned char* mask)
-+{
-+    GestureMasks *masks;
-+    GestureClientsPtr others = NULL;
-+
-+    masks = wGestureMasks(win);
-+    if (masks)
-+    {
-+        for (others = masks->clients; others;
-+             others = others->next) {
-+            if (SameClient(others, client)) {
-+                memset(others->gestureMask[dev->id], 0,
-+                       sizeof(others->gestureMask[dev->id]));
-+                break;
-+            }
-+        }
-+    }
-+
-+    len = min(len, sizeof(others->gestureMask[dev->id]));
-+
-+    if (len && !others)
-+    {
-+        if (AddGestureClient(win, client) != Success)
-+            return BadAlloc;
-+        masks = wGestureMasks(win);
-+        others = masks->clients;
-+    }
-+
-+    if (others)
-+        memset(others->gestureMask[dev->id], 0,
-+               sizeof(others->gestureMask[dev->id]));
-+
-+    if (len)
-+        memcpy(others->gestureMask[dev->id], mask, len);
-+
-+    RecalculateGestureDeliverableEvents(win);
-+
-+    return Success;
-+}
-+
-+int
-+ProcGestureSelectEvents(ClientPtr client)
-+{
-+    int rc;
-+    WindowPtr win;
-+    DeviceIntPtr dev;
-+    DeviceIntRec dummy;
-+
-+    REQUEST(GestureSelectEventsReq);
-+    REQUEST_AT_LEAST_SIZE(GestureSelectEventsReq);
-+
-+    if (sizeof(GestureSelectEventsReq) + stuff->mask.mask_len * 4 >
-+        stuff->length * 4)
-+        return BadLength;
-+
-+    rc = dixLookupWindow(&win, stuff->window, client, DixReceiveAccess);
-+    if (rc != Success)
-+        return rc;
-+
-+    if (GestureCheckInvalidMaskBits((unsigned char*)(stuff + 1),
-+                                    stuff->mask.mask_len * 4) != Success)
-+        return BadValue;
-+
-+    if (stuff->mask.device_id == GestureAllDevices)
-+    {
-+        dummy.id = stuff->mask.device_id;
-+        dev = &dummy;
-+    } else {
-+        rc = dixLookupDevice(&dev, stuff->mask.device_id, client, DixUseAccess);
-+        if (rc != Success)
-+            return rc;
-+    }
-+
-+    if (GestureSetEventMask(dev, win, client, stuff->mask.mask_len * 4,
-+                            (unsigned char*)(stuff + 1)) != Success)
-+        return BadAlloc;
-+
-+    return Success;
-+}
-+
-+int
-+SProcGestureGetSelectedEvents(ClientPtr client)
-+{
-+    char n;
-+
-+    REQUEST(GestureGetSelectedEventsReq);
-+    swaps(&stuff->length, n);
-+    REQUEST_SIZE_MATCH(GestureGetSelectedEventsReq);
-+    swapl(&stuff->window, n);
-+
-+    return (ProcGestureGetSelectedEvents(client));
-+}
-+
-+int
-+ProcGestureGetSelectedEvents(ClientPtr client)
-+{
-+    int rc, i;
-+    WindowPtr win;
-+    char n;
-+    char *buffer = NULL;
-+    GestureGetSelectedEventsReply reply;
-+    GestureMasks *masks;
-+    GestureClientsPtr others = NULL;
-+    GestureEventMask *evmask = NULL;
-+    DeviceIntPtr dev;
-+
-+    REQUEST(GestureGetSelectedEventsReq);
-+    REQUEST_SIZE_MATCH(GestureGetSelectedEventsReq);
-+
-+    rc = dixLookupWindow(&win, stuff->window, client, DixGetAttrAccess);
-+    if (rc != Success)
-+        return rc;
-+
-+    reply.repType = X_Reply;
-+    reply.RepType = X_GestureGetSelectedEvents;
-+    reply.length = 0;
-+    reply.sequenceNumber = client->sequence;
-+    reply.num_masks = 0;
-+
-+    masks = wGestureMasks(win);
-+    if (masks)
-+    {
-+        for (others = masks->clients; others; others = others->next) {
-+            if (SameClient(others, client)) {
-+                break;
-+            }
-+        }
-+    }
-+
-+    if (!others)
-+    {
-+        WriteReplyToClient(client, sizeof(GestureGetSelectedEventsReply), &reply);
-+        return Success;
-+    }
-+
-+    buffer = calloc(MAXDEVICES, sizeof(GestureEventMask) + pad_to_int32(GESTUREMASKSIZE));
-+    if (!buffer)
-+        return BadAlloc;
-+
-+    evmask = (GestureEventMask*)buffer;
-+    for (i = 0; i < MAXDEVICES; i++)
-+    {
-+        int j;
-+        unsigned char *devmask = others->gestureMask[i];
-+
-+        if (i > 2)
-+        {
-+            rc = dixLookupDevice(&dev, i, client, DixGetAttrAccess);
-+            if (rc != Success)
-+                continue;
-+        }
-+
-+
-+        for (j = GESTUREMASKSIZE - 1; j >= 0; j--)
-+        {
-+            if (devmask[j] != 0)
-+            {
-+                int mask_len = (j + 4)/4; /* j is an index, hence + 4, not + 3 */
-+                evmask->device_id = i;
-+                evmask->mask_len = mask_len;
-+                reply.num_masks++;
-+                reply.length += sizeof(GestureEventMask)/4 + evmask->mask_len;
-+
-+                if (client->swapped)
-+                {
-+                    swaps(&evmask->device_id, n);
-+                    swaps(&evmask->mask_len, n);
-+                }
-+
-+                memcpy(&evmask[1], devmask, j + 1);
-+                evmask = (GestureEventMask*)((char*)evmask +
-+                           sizeof(GestureEventMask) + mask_len * 4);
-+                break;
-+            }
-+        }
-+    }
-+
-+    WriteReplyToClient(client, sizeof(GestureGetSelectedEventsReply), &reply);
-+
-+    if (reply.num_masks)
-+        WriteToClient(client, reply.length * 4, buffer);
-+
-+    free(buffer);
-+    return Success;
-+}
-+
-+void
-+SRepGestureGetSelectedEvents(ClientPtr client,
-+                             int len, GestureGetSelectedEventsReply *rep)
-+{
-+    char n;
-+
-+    swaps(&rep->sequenceNumber, n);
-+    swapl(&rep->length, n);
-+    swaps(&rep->num_masks, n);
-+    WriteToClient(client, len, (char *)rep);
-+}
-+
-+int
-+GestureClientGone(WindowPtr pWin, XID id)
-+{
-+    GestureClientsPtr other, prev;
-+
-+    if (!wGestureMasks(pWin))
-+        return (Success);
-+    prev = 0;
-+    for (other = wGestureMasks(pWin)->clients; other;
-+         other = other->next) {
-+        if (other->resource == id) {
-+            if (prev) {
-+                prev->next = other->next;
-+                free(other);
-+            } else if (!(other->next)) {
-+                free(wGestureMasks(pWin));
-+                pWin->optional->gestureMasks = (GestureMasks *) NULL;
-+                CheckWindowOptionalNeed(pWin);
-+                free(other);
-+            } else {
-+                wGestureMasks(pWin)->clients = other->next;
-+                free(other);
-+            }
-+            RecalculateGestureDeliverableEvents(pWin);
-+            return (Success);
-+        }
-+        prev = other;
-+    }
-+    FatalError("client not on device event list");
-+}
-+
-+void
-+DeleteWindowFromGestureEvents(WindowPtr pWin)
-+{
-+    struct _GestureMasks *gestureMasks;
-+
-+    while ((gestureMasks = wGestureMasks(pWin)) != 0)
-+        FreeResource(gestureMasks->clients->resource, RT_NONE);
-+}
---- /dev/null
-+++ b/gesture/gesture.h
-@@ -0,0 +1,78 @@
-+/*
-+ * Copyright © 2010 Canonical, Ltd.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice (including the next
-+ * paragraph) shall be included in all copies or substantial portions of the
-+ * Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ *
-+ * Authors: Chase Douglas <chase.douglas@canonical.com>
-+ *
-+ */
-+
-+#ifndef _GESTURE_H_
-+#define _GESTURE_H_
-+
-+#ifdef HAVE_DIX_CONFIG_H
-+#include <dix-config.h>
-+#endif
-+
-+#include "inputstr.h"
-+
-+/* This is the last Gesture event supported by the server. If you add
-+ * events to the protocol, the server will not support these events until
-+ * this number here is bumped.
-+ */
-+#define GESTURELASTEVENT     63
-+#define GESTUREMASKSIZE      (GESTURELASTEVENT/8 + 1) /* no of bits for masks */
-+
-+extern _X_EXPORT int GestureReqCode;
-+
-+/**
-+ * Attached to the devPrivates of each client. Specifies the version number as
-+ * supported by the client.
-+ */
-+typedef struct _GestureClientRec {
-+        int major_version;
-+        int minor_version;
-+} GestureClientRec, *GestureClientPtr;
-+
-+typedef struct _GestureClients *GestureClientsPtr;
-+
-+/**
-+ * This struct stores the Gesture event mask for each client.
-+ *
-+ * Each window that has events selected has at least one of these masks. If
-+ * multiple client selected for events on the same window, these masks are in
-+ * a linked list.
-+ */
-+typedef struct _GestureClients {
-+    GestureClientsPtr  next; /**< Pointer to the next mask */
-+    XID                resource; /**< id for putting into resource manager */
-+    /** Gesture event masks. One per device, each bit is a mask of (1 << type) */
-+    unsigned char      gestureMask[EMASKSIZE][GESTUREMASKSIZE];
-+} GestureClients;
-+
-+typedef struct _GestureMasks {
-+    GestureClientsPtr   clients;
-+    unsigned char       mask[GESTUREMASKSIZE];
-+} GestureMasks;
-+
-+extern int GestureClientGone(WindowPtr pWin, XID id);
-+extern void DeleteWindowFromGestureEvents(WindowPtr pWin);
-+
-+#endif /* _GESTURE_H_ */
---- /dev/null
-+++ b/gesture/gestureint.h
-@@ -0,0 +1,49 @@
-+/*
-+ * Copyright © 2010 Canonical, Ltd.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice (including the next
-+ * paragraph) shall be included in all copies or substantial portions of the
-+ * Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ *
-+ * Authors: Chase Douglas <chase.douglas@canonical.com>
-+ *
-+ */
-+
-+#ifndef _GESTUREINT_H_
-+#define _GESTUREINT_H_
-+
-+#include "gestureproto.h"
-+
-+typedef struct {
-+        short   major_version;
-+        short   minor_version;
-+} GestureExtensionVersion;
-+
-+extern DevPrivateKeyRec GestureClientPrivateKeyRec;
-+extern int RT_GESTURECLIENT;
-+
-+extern int ProcGestureQueryVersion(ClientPtr client);
-+extern int ProcGestureSelectEvents(ClientPtr client);
-+extern int ProcGestureGetSelectedEvents(ClientPtr client);
-+extern int SProcGestureQueryVersion(ClientPtr client);
-+extern int SProcGestureSelectEvents(ClientPtr client);
-+extern int SProcGestureGetSelectedEvents(ClientPtr client);
-+extern void SRepGestureQueryVersion(ClientPtr client, int size, GestureQueryVersionReply *rep);
-+extern void SRepGestureGetSelectedEvents(ClientPtr client, int len, GestureGetSelectedEventsReply *rep);
-+
-+#endif /* _GESTUREINT_H_ */
---- /dev/null
-+++ b/gesture/gestureproto.h
-@@ -0,0 +1,132 @@
-+/*
-+ * Copyright © 2010 Canonical, Ltd.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice (including the next
-+ * paragraph) shall be included in all copies or substantial portions of the
-+ * Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ *
-+ * Authors: Chase Douglas <chase.douglas@canonical.com>
-+ *
-+ */
-+
-+#ifndef _GESTUREPROTO_H_
-+#define _GESTUREPROTO_H_
-+
-+#include <stdint.h>
-+#include <X11/X.h>
-+
-+#define Window  uint32_t
-+#define Time    uint32_t
-+
-+#define X_GestureQueryVersion                1
-+#define X_GestureSelectEvents                2
-+#define X_GestureGetSelectedEvents           3
-+
-+#define GESTUREREQUESTS (X_GestureGetSelectedEvents - X_GestureQueryVersion + 1)
-+
-+#define GestureAllDevices 0
-+
-+/**
-+ * Used to select for events on a given window.
-+ * Struct is followed by (mask_len * CARD8), with each bit set representing
-+ * the event mask for the given type. A mask bit represents an event type if
-+ * (mask == (1 << type)).
-+ */
-+typedef struct {
-+    uint16_t    device_id;       /**< Device id to select for        */
-+    uint16_t    mask_len;        /**< Length of mask in 4 byte units */
-+} GestureEventMask;
-+
-+typedef struct {
-+    uint8_t     reqType;                /**< Gesture extension major code */
-+    uint8_t     ReqType;                /**< Always ::X_GestureQueryVersion */
-+    uint16_t    length;                 /**< Length in 4 byte units */
-+    uint16_t    major_version;
-+    uint16_t    minor_version;
-+} GestureQueryVersionReq;
-+
-+typedef struct {
-+    uint8_t     repType;                /**< ::X_Reply */
-+    uint8_t     RepType;                /**< Always ::X_GestureQueryVersion */
-+    uint16_t    sequenceNumber;
-+    uint32_t    length;
-+    uint16_t    major_version;
-+    uint16_t    minor_version;
-+    uint32_t    pad1;
-+    uint32_t    pad2;
-+    uint32_t    pad3;
-+    uint32_t    pad4;
-+    uint32_t    pad5;
-+} GestureQueryVersionReply;
-+
-+typedef struct {
-+    uint8_t     reqType;                /**< Gesture extension major code */
-+    uint8_t     ReqType;                /**< Always ::X_GestureSelectEvents */
-+    uint16_t    length;                 /**< Length in 4 byte units */
-+    Window      window;
-+    GestureEventMask mask;
-+} GestureSelectEventsReq;
-+
-+typedef struct {
-+    uint8_t     reqType;                /**< Gesture extension major code */
-+    uint8_t     ReqType;                /**< Always ::X_GestureGetSelectedEvents */
-+    uint16_t    length;                 /**< Length in 4 byte units */
-+    Window      window;
-+} GestureGetSelectedEventsReq;
-+
-+typedef struct {
-+    uint8_t     repType;                /**< Gesture extension major opcode */
-+    uint8_t     RepType;                /**< Always ::X_GestureGetSelectedEvents */
-+    uint16_t    sequenceNumber;
-+    uint32_t    length;
-+    uint16_t    num_masks;              /**< Number of GestureEventMask structs
-+                                             trailing the reply */
-+    uint16_t    pad0;
-+    uint32_t    pad1;
-+    uint32_t    pad2;
-+    uint32_t    pad3;
-+    uint32_t    pad4;
-+    uint32_t    pad5;
-+} GestureGetSelectedEventsReply;
-+
-+typedef struct
-+{
-+    uint8_t     type;                   /**< Always GenericEvent */
-+    uint8_t     extension;              /**< Gesture extension offset */
-+    uint16_t    sequenceNumber;         /**< Xevent sequence number */
-+    uint32_t    length;                 /**< Length in 4 byte uints */
-+    uint16_t    evtype;                 /**< X generic event type */
-+    uint16_t    gesture_id;             /**< Unique ID for gesture */
-+    uint16_t    gesture_type;           /**< Gesture type (zoom, rotate, etc.) */
-+    uint16_t    device_id;              /**< Device that generated this gesture */
-+    Time        time;                   /**< Time of gesture event */
-+    Window      root;                   /**< Root window event occurred on */
-+    Window      event;                  /**< Window selecting this event for a client */
-+    Window      child;                  /**< Top-most window of gesture event */
-+/* └──────── 32 byte boundary ────────┘ */
-+    float       focus_x;                /**< Always window coords, 16.16 fixed point */
-+    float       focus_y;                /**< Relative to event window */
-+    uint16_t    status;                 /**< Gesture event status */
-+    uint16_t    num_props;               /**< Number of properties for gesture event */
-+/* └──── Gesture properties below ────┘ */
-+} GestureEvent;
-+
-+#undef Window
-+#undef Time
-+
-+#endif /* _GESTUREPROTO_H_ */
---- /dev/null
-+++ b/gesture/init.c
-@@ -0,0 +1,280 @@
-+/************************************************************
-+
-+Copyright 2010 Canonical, Ltd.
-+Copyright 1989, 1998  The Open Group
-+
-+Permission to use, copy, modify, distribute, and sell this software and its
-+documentation for any purpose is hereby granted without fee, provided that
-+the above copyright notice appear in all copies and that both that
-+copyright notice and this permission notice appear in supporting
-+documentation.
-+
-+The above copyright notice and this permission notice shall be included in
-+all copies or substantial portions of the Software.
-+
-+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-+
-+Except as contained in this notice, the name of The Open Group shall not be
-+used in advertising or otherwise to promote the sale, use or other dealings
-+in this Software without prior written authorization from The Open Group.
-+
-+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-+
-+                      All Rights Reserved
-+
-+Permission to use, copy, modify, and distribute this software and its
-+documentation for any purpose and without fee is hereby granted,
-+provided that the above copyright notice appear in all copies and that
-+both that copyright notice and this permission notice appear in
-+supporting documentation, and that the name of Hewlett-Packard not be
-+used in advertising or publicity pertaining to distribution of the
-+software without specific, written prior permission.
-+
-+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-+SOFTWARE.
-+
-+********************************************************/
-+
-+/********************************************************************
-+ *
-+ *  Dispatch routines and initialization routines for the X gesture extension.
-+ *
-+ */
-+
-+#define        NUMTYPES 15
-+
-+#ifdef HAVE_DIX_CONFIG_H
-+#include <dix-config.h>
-+#endif
-+
-+#include "gcstruct.h" /* pointer for extnsionst.h */
-+#include "extnsionst.h"       /* extension entry   */
-+#include "gesture.h"
-+#include "gestureint.h"
-+#include <X11/extensions/geproto.h>
-+#include "geext.h" /* extension interfaces for ge */
-+
-+#include "swaprep.h"
-+#include "privates.h"
-+#include "protocol-versions.h"
-+#include "dixstruct.h"
-+
-+#define GESTURE_NAME "GestureExtension"
-+#define GESTURE_EVENTS 0
-+#define GESTURE_ERRORS 0
-+
-+void GestureExtensionInit(void);
-+
-+/**
-+ * Dispatch vector. Functions defined in here will be called when the matching
-+ * request arrives.
-+ */
-+static int (*ProcGestureVector[])(ClientPtr) = {
-+        NULL,                                   /*  0 */
-+      ProcGestureQueryVersion,                     /*  1 */
-+      ProcGestureSelectEvents,                     /*  2 */
-+      ProcGestureGetSelectedEvents,                /*  3 */
-+};
-+
-+/* For swapped clients */
-+static int (*SProcGestureVector[])(ClientPtr) = {
-+        NULL,                                    /*  0 */
-+      SProcGestureQueryVersion,                     /*  1 */
-+      SProcGestureSelectEvents,                     /*  2 */
-+      SProcGestureGetSelectedEvents,                /*  3 */
-+};
-+
-+/*****************************************************************
-+ *
-+ * Globals referenced elsewhere in the server.
-+ *
-+ */
-+
-+int GestureReqCode = 0;
-+int GestureNotify = 0;
-+
-+int RT_GESTURECLIENT;
-+
-+/*****************************************************************
-+ *
-+ * Externs defined elsewhere in the X server.
-+ *
-+ */
-+
-+extern GestureExtensionVersion GestureVersion;
-+
-+
-+/*****************************************************************
-+ *
-+ * Versioning support
-+ *
-+ */
-+
-+DevPrivateKeyRec GestureClientPrivateKeyRec;
-+
-+
-+/*****************************************************************
-+ *
-+ * Declarations of local routines.
-+ *
-+ */
-+
-+static void
-+GestureClientCallback(CallbackListPtr        *list,
-+                      pointer                closure,
-+                      pointer                data)
-+{
-+    NewClientInfoRec *clientinfo = (NewClientInfoRec*)data;
-+    ClientPtr client = clientinfo->client;
-+    GestureClientPtr gestureClient;
-+
-+    gestureClient = dixLookupPrivate(&client->devPrivates,
-+                                     &GestureClientPrivateKeyRec);
-+    gestureClient->major_version = 0;
-+    gestureClient->minor_version = 0;
-+}
-+
-+/*************************************************************************
-+ *
-+ * ProcGestureDispatch - main dispatch routine for requests to this extension.
-+ * This routine is used if server and client have the same byte ordering.
-+ *
-+ */
-+
-+static int
-+ProcGestureDispatch(ClientPtr client)
-+{
-+    REQUEST(xReq);
-+    if (stuff->data > GESTUREREQUESTS || !ProcGestureVector[stuff->data])
-+        return BadRequest;
-+
-+    return (*ProcGestureVector[stuff->data])(client);
-+}
-+
-+/*******************************************************************************
-+ *
-+ * SProcXDispatch
-+ *
-+ * Main swapped dispatch routine for requests to this extension.
-+ * This routine is used if server and client do not have the same byte ordering.
-+ *
-+ */
-+
-+static int
-+SProcGestureDispatch(ClientPtr client)
-+{
-+    REQUEST(xReq);
-+    if (stuff->data > GESTUREREQUESTS || !SProcGestureVector[stuff->data])
-+        return BadRequest;
-+
-+    return (*SProcGestureVector[stuff->data])(client);
-+}
-+
-+/**********************************************************************
-+ *
-+ * SReplyGestureDispatch
-+ * Swap any replies defined in this extension.
-+ *
-+ */
-+
-+static void
-+SReplyGestureDispatch(ClientPtr client, int len, GestureQueryVersionReply *rep)
-+{
-+    if (rep->RepType == X_GestureQueryVersion)
-+        SRepGestureQueryVersion(client, len, (GestureQueryVersionReply*)rep);
-+    else if (rep->RepType == X_GestureGetSelectedEvents)
-+      SRepGestureGetSelectedEvents(client, len, (GestureGetSelectedEventsReply *) rep);
-+    else {
-+      FatalError("Gesture confused sending swapped reply");
-+    }
-+}
-+
-+static void SGestureEvent(GestureEvent *from, GestureEvent *to)
-+{
-+    char n;
-+
-+    memcpy(to, from, sizeof(xEvent) + from->length * 4);
-+
-+    swaps(&to->sequenceNumber, n);
-+    swapl(&to->length, n);
-+    swaps(&to->evtype, n);
-+    swaps(&to->gesture_id, n);
-+    swaps(&to->gesture_type, n);
-+    swaps(&to->device_id, n);
-+    swapl(&to->time, n);
-+    swapl(&to->root, n);
-+    swapl(&to->event, n);
-+    swapl(&to->child, n);
-+    swapl(&to->focus_x, n);
-+    swapl(&to->focus_y, n);
-+    swaps(&to->status, n);
-+    swaps(&to->num_props, n);
-+}
-+
-+static void
-+GestureEventSwap(xGenericEvent *from, xGenericEvent *to)
-+{
-+    SGestureEvent((GestureEvent *)from, (GestureEvent *)to);
-+}
-+
-+static void
-+CloseGestureExt(ExtensionEntry *unused)
-+{
-+    ReplySwapVector[GestureReqCode] = ReplyNotSwappd;
-+    GestureReqCode = 0;
-+    GestureNotify = 0;
-+}
-+
-+/**********************************************************************
-+ *
-+ * GestureExtensionInit - initialize the gesture extension.
-+ *
-+ * Called from InitExtensions in main() or from QueryExtension() if the
-+ * extension is dynamically loaded.
-+ *
-+ * This extension has several events and errors.
-+ */
-+
-+void
-+GestureExtensionInit(void)
-+{
-+    ExtensionEntry *extEntry;
-+    GestureExtensionVersion thisversion = {
-+        SERVER_GESTURE_MAJOR_VERSION,
-+        SERVER_GESTURE_MINOR_VERSION,
-+    };
-+
-+    if (!dixRegisterPrivateKey(&GestureClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GestureClientRec)))
-+        FatalError("Cannot request private for Gesture.\n");
-+
-+    if (!AddCallback(&ClientStateCallback, GestureClientCallback, 0))
-+        FatalError("Failed to add callback to Gesture.\n");
-+
-+    extEntry = AddExtension(GESTURE_NAME, GESTURE_EVENTS, GESTURE_ERRORS,
-+                            ProcGestureDispatch, SProcGestureDispatch, CloseGestureExt,
-+                            StandardMinorOpcode);
-+    if (extEntry) {
-+      GestureReqCode = extEntry->base;
-+      GestureVersion = thisversion;
-+      RT_GESTURECLIENT = CreateNewResourceType((DeleteType) GestureClientGone,
-+                                               "GESTURECLIENT");
-+      if (!RT_GESTURECLIENT)
-+          FatalError("Failed to add resource type for Gesture.\n");
-+      ReplySwapVector[GestureReqCode] = (ReplySwapPtr) SReplyGestureDispatch;
-+
-+      GERegisterExtension(GestureReqCode, GestureEventSwap);
-+    } else {
-+      FatalError("GestureExtensionInit: AddExtensions failed\n");
-+    }
-+}
-+
---- a/include/dix-config.h.in
-+++ b/include/dix-config.h.in
-@@ -30,6 +30,9 @@
- /* Support Damage extension */
- #undef DAMAGE
-+/* Support Gesture extension */
-+#undef GESTURES
-+
- /* Build for darwin with Quartz support */
- #undef DARWIN_WITH_QUARTZ
---- a/include/protocol-versions.h
-+++ b/include/protocol-versions.h
-@@ -141,4 +141,8 @@
- #define SERVER_XVMC_MAJOR_VERSION             1
- #define SERVER_XVMC_MINOR_VERSION             1
-+/* Gesture */
-+#define SERVER_GESTURE_MAJOR_VERSION          0
-+#define SERVER_GESTURE_MINOR_VERSION          5
-+
- #endif
---- a/include/windowstr.h
-+++ b/include/windowstr.h
-@@ -48,6 +48,10 @@ SOFTWARE.
- #ifndef WINDOWSTRUCT_H
- #define WINDOWSTRUCT_H
-+#ifdef HAVE_DIX_CONFIG_H
-+#include <dix-config.h>
-+#endif
-+
- #include "window.h"
- #include "pixmapstr.h"
- #include "regionstr.h"
-@@ -60,6 +64,10 @@ SOFTWARE.
- #include <X11/Xprotostr.h>
- #include "opaque.h"
-+#ifdef GESTURES
-+#include "gesture.h"
-+#endif
-+
- #define GuaranteeNothing      0
- #define GuaranteeVisBack      1
-@@ -94,6 +102,9 @@ typedef struct _WindowOpt {
-     RegionPtr         inputShape;        /* default: NULL */
-     struct _OtherInputMasks *inputMasks;   /* default: NULL */
-     DevCursorList       deviceCursors;     /* default: NULL */
-+#ifdef GESTURES
-+    struct _GestureMasks *gestureMasks;    /* default: NULL */
-+#endif
- } WindowOptRec, *WindowOptPtr;
- #define BackgroundPixel           2L
-@@ -199,6 +210,9 @@ extern _X_EXPORT Mask      DontPropagateMasks
- #define wInputShape(w)          wUseDefault(w, inputShape, NULL)
- #define wClient(w)            (clients[CLIENT_ID((w)->drawable.id)])
- #define wBorderWidth(w)               ((int) (w)->borderWidth)
-+#ifdef GESTURES
-+#define wGestureMasks(w)        wUseDefault(w, gestureMasks, NULL)
-+#endif
- /* true when w needs a border drawn. */
---- a/mi/miinitext.c
-+++ b/mi/miinitext.c
-@@ -152,6 +152,9 @@ extern Bool noSELinuxExtension;
- #ifdef XV
- extern Bool noXvExtension;
- #endif
-+#ifdef GESTURES
-+extern Bool noGestureExtension;
-+#endif
- extern Bool noGEExtension;
- #ifndef XFree86LOADER
-@@ -263,6 +266,9 @@ extern void DamageExtensionInit(INITARGS
- extern void CompositeExtensionInit(INITARGS);
- #endif
- extern void GEExtensionInit(INITARGS);
-+#ifdef GESTURES
-+extern void GestureExtensionInit(INITARGS);
-+#endif
- /* The following is only a small first step towards run-time
-  * configurable extensions.
-@@ -334,6 +340,9 @@ static ExtensionToggle ExtensionToggleLi
- #ifdef XV
-     { "XVideo", &noXvExtension },
- #endif
-+#ifdef GESTURES
-+    { "Gesture", &noGestureExtension },
-+#endif
-     { NULL, NULL }
- };
-@@ -472,6 +481,9 @@ InitExtensions(int argc, char *argv[])
-       GlxPushProvider(&__glXDRISWRastProvider);
-     if (!noGlxExtension) GlxExtensionInit();
- #endif
-+#ifdef GESTURES
-+    if (!noGestureExtension) GestureExtensionInit();
-+#endif
- }
- #else /* XFree86LOADER */
-@@ -513,6 +525,9 @@ static ExtensionModule staticExtensions[
- #ifdef DAMAGE
-     { DamageExtensionInit, "DAMAGE", &noDamageExtension, NULL },
- #endif
-+#ifdef GESTURES
-+    { GestureExtensionInit, "GESTURE", &noGestureExtension, NULL },
-+#endif
-     { NULL, NULL, NULL, NULL, NULL }
- };
-     
---- a/os/utils.c
-+++ b/os/utils.c
-@@ -185,6 +185,9 @@ Bool noXvExtension = FALSE;
- #ifdef DRI2
- Bool noDRI2Extension = FALSE;
- #endif
-+#ifdef GESTURES
-+Bool noGestureExtension = FALSE;
-+#endif
- Bool noGEExtension = FALSE;
---- a/dix/events.c
-+++ b/dix/events.c
-@@ -5471,6 +5471,9 @@ DeleteWindowFromAnyEvents(WindowPtr pWin
-           FreeResource(oc->resource, RT_NONE);
-       while ( (passive = wPassiveGrabs(pWin)) )
-           FreeResource(passive->resource, RT_NONE);
-+#ifdef GESTURES
-+        DeleteWindowFromGestureEvents(pWin);
-+#endif
-      }
-     DeleteWindowFromAnyExtEvents(pWin, freeResources);
diff --git a/debian/patches/204_fix-neg-sync-transition.patch b/debian/patches/204_fix-neg-sync-transition.patch
deleted file mode 100644 (file)
index f10fb32..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-commit da218289275e67e49d801d58dd818d237de8a9bc
-Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
-Date:   Tue Aug 24 13:30:25 2010 +1000
-
-    Xext: Fix edge case with {Positive,Negative}Transition triggers.
-    
-    The {Positive,Negative}Transition triggers only fire when the counter
-    goes from strictly {below,above} the threshold.  If
-    SyncComputeBracketValues gets called exactly at this threshold we may update
-    the bracket values so that the counter is not updated past the threshold.
-    
-    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
-
-diff --git a/Xext/sync.c b/Xext/sync.c
-index a51262a..c00e692 100644
---- a/Xext/sync.c
-+++ b/Xext/sync.c
-@@ -959,6 +959,17 @@ SyncComputeBracketValues(SyncCounter *pCounter)
-           {
-               psci->bracket_less = pTrigger->test_value;
-               pnewltval = &psci->bracket_less;
-+          } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
-+                     XSyncValueLessThan(pTrigger->test_value,
-+                                        psci->bracket_greater))
-+          {
-+              /*
-+               * The value is exactly equal to our threshold.  We want one
-+               * more event in the positive direction to ensure we pick up
-+               * when the value *exceeds* this threshold.
-+               */
-+              psci->bracket_greater = pTrigger->test_value;
-+              pnewgtval = &psci->bracket_greater;
-           }
-       }
-         else if (pTrigger->test_type == XSyncPositiveTransition &&
-@@ -969,6 +980,17 @@ SyncComputeBracketValues(SyncCounter *pCounter)
-           {
-               psci->bracket_greater = pTrigger->test_value;
-               pnewgtval = &psci->bracket_greater;
-+          } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
-+                     XSyncValueGreaterThan(pTrigger->test_value,
-+                                           psci->bracket_less))
-+          {
-+              /*
-+               * The value is exactly equal to our threshold.  We want one
-+               * more event in the negative direction to ensure we pick up
-+               * when the value is less than this threshold.
-+               */
-+              psci->bracket_less = pTrigger->test_value;
-+              pnewltval = &psci->bracket_less;
-           }
-       }
-     } /* end for each trigger */
-commit d9e9c0c3cf0456f78b6eed3290e6a418e38963fb
-Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
-Date:   Tue Aug 24 13:35:05 2010 +1000
-
-    IDLETIME: Fix edge-case in IdleTimeBlockHandler
-    
-    Ensure that if we're called exactly on the threshold of a
-    NegativeTransition trigger that we reshedule to pick up
-    an idle time over the threshold.
-    
-    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
-
-diff --git a/Xext/sync.c b/Xext/sync.c
-index c00e692..314b63e 100644
---- a/Xext/sync.c
-+++ b/Xext/sync.c
-@@ -2322,6 +2322,14 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
-               break;
-           }
-       }
-+      /* 
-+       * We've been called exactly on the idle time, but we have a
-+       * NegativeTransition trigger which requires a transition from an
-+       * idle time greater than this.  Schedule a wakeup for the next
-+       * millisecond so we won't miss a transition.
-+       */
-+      if (XSyncValueEqual (idle, *pIdleTimeValueLess))
-+          AdjustWaitForDelay(wt, 1);
-     }
-     else if (pIdleTimeValueGreater)
-     {
diff --git a/debian/patches/205_udev-product-ids.patch b/debian/patches/205_udev-product-ids.patch
deleted file mode 100644 (file)
index 18537e7..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-From 7925e8945649d4af237e6c3c5593b895a461bd1e Mon Sep 17 00:00:00 2001
-From: Chase Douglas <chase.douglas@ubuntu.com>
-Date: Wed, 01 Sep 2010 04:45:34 +0000
-Subject: Fix udev population of Bluetooth input device product IDs
-
-The udev device_added function takes the vendor and model IDs of added
-devices and converts them into an attribute that can be matched for by
-an InputClass configuration using MatchUSBID. Currently, the udev
-mechanism works for USB devices, but fails to work properly for
-Bluetooth devices. The product IDs of the event node are actually the
-IDs of the Bluetooth receiver instead of the device.
-
-This patch reads the product ID from the PRODUCT property of the parent
-of the added device. This tag is set correctly for both USB and
-Bluetooth input devices. The following devices have been tested by
-specifying individual InputClass sections in xorg.conf:
-
-* Apple Keyboard (Bluetooth)
-* Apple Magic Trackpad (Bluetooth)
-* Apple Magic Mouse (Bluetooth)
-* Microsoft Bluetooth Notebook Mouse 5000 (Bluetooth)
-* Microsoft IntelliMouse Optical (USB)
-* N-Trig Touchscreen (USB)
-* Wacom Bamboo Touch (USB)
-
-Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
-Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
----
-diff --git a/config/udev.c b/config/udev.c
-index 9934490..b7717c9 100644
---- a/config/udev.c
-+++ b/config/udev.c
-@@ -58,7 +58,6 @@ device_added(struct udev_device *udev_device)
-     char *config_info = NULL;
-     const char *syspath;
-     const char *tags_prop;
--    const char *usb_vendor = NULL, *usb_model = NULL;
-     const char *key, *value, *tmp;
-     InputOption *options = NULL, *tmpo;
-     InputAttributes attrs = {};
-@@ -94,6 +93,8 @@ device_added(struct udev_device *udev_device)
-     parent = udev_device_get_parent(udev_device);
-     if (parent) {
-         const char *ppath = udev_device_get_devnode(parent);
-+        const char *product = udev_device_get_property_value(parent, "PRODUCT");
-+        unsigned int usb_vendor, usb_model;
-         name = udev_device_get_sysattr_value(parent, "name");
-         LOG_SYSATTR(ppath, "name", name);
-@@ -104,6 +105,13 @@ device_added(struct udev_device *udev_device)
-         attrs.pnp_id = udev_device_get_sysattr_value(parent, "id");
-         LOG_SYSATTR(ppath, "id", attrs.pnp_id);
-+
-+        /* construct USB ID in lowercase hex - "0000:ffff" */
-+        if (product && sscanf(product, "%*x/%4x/%4x/%*x", &usb_vendor, &usb_model) == 2) {
-+            attrs.usb_id = Xprintf("%04x:%04x", usb_vendor, usb_model);
-+            if (attrs.usb_id)
-+                LOG_PROPERTY(path, "PRODUCT", product);
-+        }
-     }
-     if (!name)
-         name = "(unnamed)";
-@@ -152,12 +160,6 @@ device_added(struct udev_device *udev_device)
-         } else if (!strcmp(key, "ID_VENDOR")) {
-             LOG_PROPERTY(path, key, value);
-             attrs.vendor = value;
--        } else if (!strcmp(key, "ID_VENDOR_ID")) {
--            LOG_PROPERTY(path, key, value);
--            usb_vendor = value;
--        } else if (!strcmp(key, "ID_VENDOR_MODEL")) {
--            LOG_PROPERTY(path, key, value);
--            usb_model = value;
-         } else if (!strcmp(key, "ID_INPUT_KEY")) {
-             LOG_PROPERTY(path, key, value);
-             attrs.flags |= ATTR_KEYBOARD;
-@@ -179,16 +181,6 @@ device_added(struct udev_device *udev_device)
-         }
-     }
--    /* construct USB ID in lowercase hex - "0000:ffff" */
--    if (usb_vendor && usb_model) {
--        attrs.usb_id = Xprintf("%s:%s", usb_vendor, usb_model);
--        if (attrs.usb_id) {
--            char *cur;
--            for (cur = attrs.usb_id; *cur; cur++)
--                *cur = tolower(*cur);
--        }
--    }
--
-     LogMessage(X_INFO, "config/udev: Adding input device %s (%s)\n",
-                name, path);
-     rc = NewInputDeviceRequest(options, &attrs, &dev);
---
-cgit v0.8.3-6-g21f6
diff --git a/debian/patches/206_intel_8xx_default_to_fbdev.patch b/debian/patches/206_intel_8xx_default_to_fbdev.patch
deleted file mode 100644 (file)
index c6a0d44..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Description: Drop intel from the autoloaded drivers for i830, i845g, i855
- .
- These remain too unstable with the intel DDX.
-Author: Christopher James Halse Rogers <christohper.halse.rogers@canonical.com>
-
-Index: xorg-server/hw/xfree86/common/xf86pciBus.c
-===================================================================
---- xorg-server.orig/hw/xfree86/common/xf86pciBus.c    2010-09-13 19:54:39.330148002 +1000
-+++ xorg-server/hw/xfree86/common/xf86pciBus.c 2010-09-13 20:54:08.000000000 +1000
-@@ -1112,6 +1112,12 @@
-               driverList[0] = "i740";
-             } else if (dev->device_id == 0x8108) {
-                 break; /* "hooray" for poulsbo */
-+          } else if (dev->device_id == 0x3577) {
-+              break; /* Let i830 fall back to fbdev / vesa */
-+          } else if (dev->device_id == 0x2562) {
-+              break; /* Let i845g fall back to fbdev / vesa */
-+          } else if (dev->device_id == 0x3582) {
-+              break; /* Let i855 fall back to fbdev / vesa */
-           } else {
-               driverList[0] = "intel";
-           }
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644 (file)
index 39e0c56..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-## Patches with a number < 100 are applied in debian.
-## Ubuntu patches start with 100.
-001_fedora_extramodes.patch
-02_Add-libnettle-as-option-for-sha1.diff
-06_dont_trap_access_to_timer_and_keyboard.diff
-07-xfree86-fix-build-with-xv-disabled.diff
-#13_debian_add_xkbpath_env_variable.diff
-15-nouveau.diff
-16-xaa-fbcomposite-fix-negative-size.diff
-100_rethrow_signals.patch
-#104_nvidia_autodetect.patch
-#105_fglrx_autodetect.patch
-111_armel-drv-fallbacks.patch
-121_only_switch_vt_when_active.diff
-122_xext_fix_card32_overflow_in_xauth.patch
-#143_default_to_vesa.patch
-157_check_null_modes.patch
-162_null_crtc_in_rotation.patch
-165_man_xorg_conf_no_device_ident.patch
-166_nullptr_xinerama_keyrepeat.patch
-167_nullptr_xisbread.patch
-168_glibc_trace_to_stderr.patch
-169_mipointer_nullptr_checks.patch
-172_cwgetbackingpicture_nullptr_check.patch
-187_edid_quirk_hp_nc8430.patch
-188_default_primary_to_first_busid.patch
-189_xserver_1.5.0_bg_none_root.patch
-190_cache-xkbcomp_output_for_fast_start_up.patch
-191-Xorg-add-an-extra-module-path.patch
-197_xvfb-randr.patch
-198_nohwaccess.patch
-200_randr-null.patch
-#201_report-real-dpi.patch
-202_xf86CoordinationsToWindows.patch
-203_gestures-extension.patch
-204_fix-neg-sync-transition.patch
-205_udev-product-ids.patch
-206_intel_8xx_default_to_fbdev.patch
diff --git a/debian/rules b/debian/rules
deleted file mode 100755 (executable)
index e7e57a9..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-#!/usr/bin/make -f
-# debian/rules for the Debian xorg-server package.
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
-# Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
-# Copyright © 2005 David Nusinow <dnusinow@debian.org>
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-include debian/xsfbs/xsfbs.mk
-
-CFLAGS += -Wall -g
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-else
-       CFLAGS += -O2
-endif
-ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-       NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-       MAKEFLAGS += -j$(NUMJOBS)
-endif
-
-#CPPFLAGS += -DPRE_RELEASE=0
-
-#######SLP features##############################################################
-# to print udev debug message
-CFLAGS += -D_F_UDEV_DEBUG_
-# not to print error messages related to floating devices
-CFLAGS += -D_F_NO_FLOATINGDEVICE_ERROR_
-# not to deal with the specific sinals at the signal handler(those are dealt at sys-assert) - SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS
-CFLAGS += -D_F_NO_CATCH_SIGNAL_
-# ubuntu patch : 189_xserver_1.5.0_bg_none_root.patch
-CFLAGS += -D_F_BG_NONE_ROOT_
-# apply/enable XI2 sendevent patch
-CFLAGS += -D_F_ENABLE_XI2_SENDEVENT_
-# check the null client - fix the crash of the xserver
-CFLAGS += -D_F_CHECK_NULL_CLIENT_
-# enable dynamic miEventQueue handling
-CFLAGS += -D_F_DYNAMIC_MIEQ_
-# disable updating grabTime for the first pointer(1st mt) device with the other mt device's grabTime
-CFLAGS += -D_F_NO_GRABTIME_UPDATE_
-# change DRI2 invalidate event
-#CFLAGS += -D_F_DRI2_INVALIDATE_
-# change DRI2 for async swap buffer
-#CFLAGS += -D_F_DRI2_CW_PATCH
-# change Composite for H/W Overlay layer
-CFLAGS += -D_F_COMP_OVL_PATCH
-# enable gesture support
-CFLAGS += -D_F_GESTURE_EXTENSION_
-# put video on pixman
-CFLAGS += -D_F_PUT_ON_PIXMAP_
-###########################################################################################
-
-DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_ARCH_OS   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
-ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-       confflags += --build=$(DEB_HOST_GNU_TYPE)
-else
-       confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
-endif
-
-# udeb is arch-dependent...
-ifneq (, $(filter %-udeb, $(shell dh_listpackages -s)))
-       udeb = yes
-endif
-
-# ...but let's support disabling it to speed up debug builds:
-ifneq (,$(filter noudeb,$(DEB_BUILD_OPTIONS)))
-       udeb =
-       DH_INSTALL_OPTIONS = -Nxserver-xorg-core-udeb
-endif
-
-build_xfbdev = --disable-xfbdev
-selinux = --disable-xselinux
-dri = --disable-dri --enable-dri2
-config_backend = --disable-config-dbus
-ifneq (,$(findstring arm,$(DEB_HOST_ARCH)))
-       config_backend += --enable-config-udev --disable-config-hal
-else
-       config_backend += --enable-config-udev --disable-config-hal
-endif
-config_tests = --disable-unit-tests
-
-#ifeq ($(DEB_HOST_ARCH_OS), linux)
-#      build_xfbdev = --disable-xfbdev
-#      selinux = --disable-xselinux
-#else
-#      build_xfbdev = --disable-xfbdev
-#      selinux = --disable-xselinux
-#endif
-#ifeq ($(DEB_HOST_ARCH_OS), hurd)
-#      dri = --disable-dri --disable-dri2
-#else
-#      dri = --disable-dri --enable-dri2
-#endif
-#config_backend = --disable-config-dbus
-#ifeq ($(DEB_HOST_ARCH_OS), linux)
-#      config_backend += --enable-config-udev --disable-config-hal
-#else ifeq ($(DEB_HOST_ARCH_OS), kfreebsd)
-#      config_backend += --disable-config-udev --enable-config-hal
-#else # hurd
-#      config_backend += --disable-config-udev --disable-config-hal
-#endif
-#ifneq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
-#      config_tests = --disable-unit-tests
-#else
-#      config_tests = --enable-unit-tests
-#endif
-
-INSTALL=/usr/bin/install
-
-VENDOR=SLP(Samsung Linux Platform)
-BUILDER=For technical support please see http://
-
-# disable-static is so we don't get libfoo.a for modules.  now if only we could
-# kill the .las.
-confflags += \
-            --disable-strict-compilation \
-            --disable-static \
-            --disable-debug \
-            $(config_tests) \
-            --disable-sparkle \
-            --disable-builddocs \
-            --disable-install-libxf86config \
-            --disable-aiglx \
-            --disable-glx-tls \
-            --enable-registry \
-            --enable-gesture \
-            --enable-composite \
-            --enable-shm \
-            --enable-xres \
-            --enable-record \
-            --enable-xv \
-            --enable-xvmc \
-            --disable-dga \
-            --disable-screensaver \
-            --enable-xdmcp \
-            --enable-xdm-auth-1 \
-            --disable-glx \
-            $(dri) \
-            --enable-xinerama \
-            --enable-xf86vidmode \
-            --enable-xace \
-            $(selinux) \
-            --disable-xcsecurity \
-            --disable-xcalibrate \
-            --disable-tslib \
-            --disable-dbe \
-            --disable-xf86bigfont \
-            --enable-dpms \
-            $(config_backend) \
-            --enable-xfree86-utils \
-            --disable-xaa \
-            --disable-vgahw \
-            --disable-vbe \
-            --with-int10=x86emu \
-            --disable-windowswm \
-            --enable-libdrm \
-            --enable-xorg \
-            --disable-dmx \
-            --disable-xvfb \
-            --disable-xnest \
-            --disable-xquartz \
-            --disable-xwin \
-            --disable-kdrive \
-            --disable-xephyr \
-            --disable-xfake \
-            $(build_xfbdev) \
-            --disable-kdrive-kbd \
-            --disable-kdrive-mouse \
-            --disable-kdrive-evdev \
-            --disable-doc \
-            --disable-devel-doc \
-            --without-dtrace \
-            --with-extra-module-dir="/usr/lib/xorg/extra-modules" \
-            --with-os-vendor="$(VENDOR)" \
-            --with-builderstring="$(SOURCE_NAME) $(SOURCE_VERSION) ($(BUILDER))" \
-            --with-xkb-path=/usr/etc/X11/xkb \
-            --with-xkb-output=/usr/etc/X11/xkb \
-            --with-default-font-path="built-ins" \
-            --disable-install-setuid \
-            --with-sha1=libgcrypt \
-            --enable-gestures
-
-#configure: $(STAMP_DIR)/patch
-configure:
-       dh_testdir
-       autoreconf -vfi
-
-obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure
-       dh_testdir
-       mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
-       cd obj-$(DEB_BUILD_GNU_TYPE) && \
-       ../configure \
-         --prefix=/usr \
-         --mandir=\$${prefix}/share/man \
-         --infodir=\$${prefix}/share/info \
-         --sysconfdir=/etc \
-         --localstatedir=/var \
-         $(confflags) \
-         CFLAGS="$(CFLAGS)" \
-         CPPFLAGS="$(CPPFLAGS)"
-
-build: build-stamp
-build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status
-       dh_testdir
-       cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
-       >$@
-
-clean: xsfclean
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp
-
-       rm -f config.cache config.log config.status
-       rm -f */config.cache */config.log */config.status
-       rm -f conftest* */conftest*
-       rm -rf autom4te.cache */autom4te.cache
-       rm -rf obj-*
-       # generated file, left over in the upstream tarball
-       # see https://bugs.freedesktop.org/show_bug.cgi?id=9277
-       rm -f hw/xfree86/common/xf86Build.h
-       # more generated files
-       rm -f include/dix-config.h include/do-not-use-config.h \
-               include/xorg-config.h include/xorg-server.h
-       #rm -f compile config.guess config.sub depcomp install-sh
-       rm -f compile config.guess config.sub configure depcomp install-sh
-       rm -f missing INSTALL aclocal.m4 ylwrap
-       #rm -f ltmain.sh missing INSTALL aclocal.m4 ylwrap
-       rm -f ltmain.sh
-       rm -f include/do-not-use-config.h.in
-       rm -f m4/lt*.m4 m4/libtool.m4
-       find -name Makefile.in -exec rm -f {} \;
-       #find -name Makefile.in -delete
-
-       dh_clean
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k
-       dh_installdirs
-
-       cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-       # oh, yuck.
-       find $(CURDIR)/debian/tmp/usr/lib/xorg -type f -name '*.la' | \
-         xargs rm -f
-
-       rm -f $(CURDIR)/debian/tmp/usr/lib/xorg/modules/multimedia/*
-       rm -f $(CURDIR)/debian/tmp/usr/lib/xorg/modules/libvbe.so
-       rm -f $(CURDIR)/debian/tmp/usr/lib/xorg/modules/libvgahw.so
-       rm -f $(CURDIR)/debian/tmp/usr/lib/xorg/modules/libwfb.so
-       rm -f $(CURDIR)/debian/tmp/usr/lib/xorg/modules/libxaa.so
-       rm -f $(CURDIR)/debian/tmp/usr/lib/xorg/modules/libwfb.so
-       rm -f $(CURDIR)/debian/tmp/usr/lib/xorg/modules/libxf8_16bpp.so
-
-#      install -m 755 debian/local/xvfb-run debian/tmp/main/usr/bin
-#      install debian/local/xvfb-run.1 debian/tmp/main/usr/share/man/man1
-ifneq ($(DEB_HOST_ARCH_OS), linux)
-       install -d debian/tmp/main/usr/share/X11/xorg.conf.d
-       install -m 644 debian/local/10-*.conf debian/tmp/main/usr/share/X11/xorg.conf.d
-#ifeq ($(udeb), yes)
-#      install -d debian/tmp/udeb/usr/share/X11/xorg.conf.d
-#      install -m 644 debian/local/10-*.conf debian/tmp/udeb/usr/share/X11/xorg.conf.d
-#endif
-endif
-
-# stub to start building deb files, used by binary-indep and binary-arch
-binary-initial:
-       dh_testdir
-       dh_testroot
-
-# stub to build deb files, used by binary-indep and binary-arch
-binary-deb:
-       dh_compress
-       dh_fixperms
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-serverminver = $(shell cat debian/serverminver)
-
-# Build architecture-dependent files here.
-binary-arch: build install
-       $(MAKE) -f debian/rules DH_OPTIONS=-s binary-initial
-
-       dh_installdocs -s
-       dh_installchangelogs -s ChangeLog
-       dh_install -s --sourcedir=debian/tmp --list-missing
-       $(INSTALL) -d $(CURDIR)/debian/xserver-xorg-dev/usr/share/xserver-xorg
-       # XXX might want to only extract the major ABI versions?
-       #abi_videodrv=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/pkgconfig pkg-config --variable=abi_videodrv xorg-server`; \
-       #echo videoabi=xorg-video-abi-$$abi_videodrv > debian/xserver-xorg-core.substvars && \
-       #echo "xorg-video-abi-$$abi_videodrv, xserver-xorg-core (>= $(serverminver))" > debian/xserver-xorg-dev/usr/share/xserver-xorg/videodrvdep
-       #abi_xinput=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/pkgconfig pkg-config --variable=abi_xinput xorg-server`; \
-       #echo inputabi=xorg-input-abi-$$abi_xinput >> debian/xserver-xorg-core.substvars && \
-       #echo "xorg-input-abi-$$abi_xinput, xserver-xorg-core (>= $(serverminver))" > debian/xserver-xorg-dev/usr/share/xserver-xorg/xinputdep
-
-       $(INSTALL) -m644 $(CURDIR)/debian/videoabiver \
-                  $(CURDIR)/debian/xserver-xorg-dev/usr/share/xserver-xorg/videoabiver
-       $(INSTALL) -m644 $(CURDIR)/debian/inputabiver \
-                  $(CURDIR)/debian/xserver-xorg-dev/usr/share/xserver-xorg/inputabiver
-       $(INSTALL) -m644 $(CURDIR)/debian/serverminver \
-                  $(CURDIR)/debian/xserver-xorg-dev/usr/share/xserver-xorg/serverminver
-       $(INSTALL) -m 755 -d debian/xserver-xorg-core/usr/share/bug/xserver-xorg-core
-       $(INSTALL) -m 755 debian/xserver-xorg-core.bug.script debian/xserver-xorg-core/usr/share/bug/xserver-xorg-core/script
-       install -d debian/xserver-xorg-core/lib/udev/rules.d
-       install -m 644 debian/local/64-xorg-xkb.rules debian/xserver-xorg-core/lib/udev/rules.d
-#ifeq ($(udeb), yes)
-#      install -d debian/xserver-xorg-core-udeb/lib/udev/rules.d
-#      install -m 644 debian/local/64-xorg-xkb.rules debian/xserver-xorg-core-udeb/lib/udev/rules.d
-#endif
-       dh_installdebconf -s
-#      dh_installman -s
-       dh_link -s
-       dh_strip -pxserver-xorg-core --dbg-package=xserver-xorg-core-dbg
-       dh_strip -s
-       #dh_strip -s --remaining-packages
-       $(MAKE) -f debian/rules DH_OPTIONS=-s binary-deb
-
-
-# Build architecture-independent files here
-binary-indep: build install
-       $(MAKE) -f debian/rules DH_OPTIONS=-i binary-initial
-       dh_install -i --sourcedir=debian/tmp
-#      dh_installdocs -i
-#      dh_installchangelogs -i
-
-       $(MAKE) -f debian/rules DH_OPTIONS=-i binary-deb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/serverminver b/debian/serverminver
deleted file mode 100644 (file)
index 81e7b33..0000000
+++ /dev/null
@@ -1 +0,0 @@
-2:1.8.99.905-1ubuntu3
diff --git a/debian/videoabiver b/debian/videoabiver
deleted file mode 100644 (file)
index 45a4fb7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/debian/watch b/debian/watch
deleted file mode 100644 (file)
index 249555d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-version=3
-http://xorg.freedesktop.org/releases/individual/xserver/ xorg-server-(.*)\.tar\.gz
diff --git a/debian/xserver-common.install b/debian/xserver-common.install
deleted file mode 100644 (file)
index 102b58c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/xorg/protocol.txt      
diff --git a/debian/xserver-xorg-core.NEWS b/debian/xserver-xorg-core.NEWS
deleted file mode 100644 (file)
index 1048b56..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-xorg-server (2:1.3.0.0.dfsg-3) unstable; urgency=low
-
-  * The server now includes a patch to always include the font paths
-    defined at compile-time by default. This will help prevent errors with
-    finding fonts when a xorg.conf has alternate font paths specified. 
-    
-    As a result of this, many of the font paths shipped in our default
-    xorg.conf are obsolete, and may be deleted. If you have no customized
-    your xorg.conf, a future update to the xserver-xorg package will
-    re-create the file from your stored preferences.
-
-    If for some reason you do not want the server to look in the default
-    font paths, you can set the boolean variable "UseDefaultFontPath" to
-    "False" in the ServerFlags section of your xorg.conf.
-
- -- David Nusinow <dnusinow@debian.org>  Tue, 24 Apr 2007 00:18:04 -0400
-
-xorg-server (2:1.2.99.905-3) experimental; urgency=low
-
-  * This server update includes a patch to enable proper module defaults in
-    the server. A default set of modules will be loaded unless you
-    specifically specify that they don't load. You may do this in the module
-    section of your xorg.conf using the "Disable" instruction. Note that
-    this will only override the default, not an explicit "Load".
-
-    This change will not affect most users, however if you have a customized
-    xorg.conf in which you comment out "Load" lines to disable modules, you
-    will want to change those lines so that they are uncommented and say
-    "Disable" instead of "Load". The most notable example of this is the dri
-    module, which is now loaded by default. Those who experience crashes
-    when dri is enabled will want to make this change to ensure that their
-    system does not begin to crash again.
-
- -- David Nusinow <dnusinow@debian.org>  Sat, 14 Apr 2007 12:41:37 -0400
-
-xserver-xorg-core (1:1.0.2-5) unstable; urgency=low
-
-  * Several users have reported an error on load like the following:
-
-     "(EE) Failed to load module "GLcore" (loader failed, 7)"
-
-    To resolve this error and the related ones in the logfile above it,
-    remove the line to load the glcore module in your /etc/X11/xorg.conf.
-    Other similar errors about module loading can be resolved the same way.
-    If you have not customized your config file by hand, you can run the
-    command "dpkg-reconfigure xserver-xorg" as root to do this for you.
-
- -- David Nusinow <dnusinow@debian.org>  Wed, 12 Apr 2006 19:38:51 -0400
-
-xserver-xorg-core (1:1.0.2-3) unstable; urgency=low
-
-  * With the latest updates of Xorg, we have transitioned from X11R6 to
-    X11R7. Part of this transition involves changing the paths to the
-    xfonts and the xkb data files, as well as the modules loaded by the X
-    server. One way to automatically update the paths is to run
-    "dpkg-reconfigure xserver-xorg" as root and it will automatically
-    generate a new config file for you. Note that this will currently not
-    work for people who have customized config files due to a bug, so
-    you'll have to manually edit your config if you have customized it
-    previously.
-
- -- David Nusinow <dnusinow@debian.org>  Wed, 12 Apr 2006 19:38:51 -0400
diff --git a/debian/xserver-xorg-core.bug.script b/debian/xserver-xorg-core.bug.script
deleted file mode 100644 (file)
index a24bd0f..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/bin/sh
-
-# $Id$
-
-PATH="/sbin:$PATH"
-CONFIG_DIR=/etc/X11
-SERVER_SYMLINK="$CONFIG_DIR/X"
-XORGCONFIG="$CONFIG_DIR/xorg.conf"
-XORGCONFIG_DIR="$CONFIG_DIR/xorg.conf.d"
-CONFIG_AUX_DIR=/var/lib/x11
-SERVER_SYMLINK_CHECKSUM="$CONFIG_AUX_DIR/${SERVER_SYMLINK##*/}.md5sum"
-SERVER_SYMLINK_ROSTER="$CONFIG_AUX_DIR/${SERVER_SYMLINK##*/}.roster"
-XORGCONFIG_CHECKSUM="$CONFIG_AUX_DIR/${XORGCONFIG##*/}.md5sum"
-XORGCONFIG_ROSTER="$CONFIG_AUX_DIR/${XORGCONFIG##*/}.roster"
-
-exec >&3
-
-if [ -e "$SERVER_SYMLINK_ROSTER" ]; then
-    printf "Contents of $SERVER_SYMLINK_ROSTER:\n"
-    cat "$SERVER_SYMLINK_ROSTER"
-else
-    printf "$SERVER_SYMLINK_ROSTER does not exist.\n"
-fi
-
-printf "\n"
-
-if [ -e "$SERVER_SYMLINK" ]; then
-    if [ -e "$SERVER_SYMLINK_CHECKSUM" ]; then
-        if [ "$(readlink "$SERVER_SYMLINK" | md5sum)" = \
-             "$(cat "$SERVER_SYMLINK_CHECKSUM")" ]; then
-            printf "%s target unchanged from checksum in %s.\n" \
-              "$SERVER_SYMLINK" "$SERVER_SYMLINK_CHECKSUM"
-        else
-            printf "%s target does not match checksum in %s.\n" \
-              "$SERVER_SYMLINK" "$SERVER_SYMLINK_CHECKSUM"
-        fi
-    else
-        printf "$SERVER_SYMLINK_CHECKSUM does not exist.\n"
-    fi
-    printf "\n"
-    printf "X server symlink status:\n"
-    ls -dl "$SERVER_SYMLINK"
-    ls -dl "$(readlink "$SERVER_SYMLINK")"
-else
-    printf "$SERVER_SYMLINK does not exist.\n"
-fi
-
-if ! [ -L "$SERVER_SYMLINK" ]; then
-    printf "$SERVER_SYMLINK is not a symlink.\n"
-fi
-
-if ! [ -x "$SERVER_SYMLINK" ]; then
-    printf "$SERVER_SYMLINK is not executable.\n"
-fi
-
-printf "\n"
-
-if [ -e "$XORGCONFIG_ROSTER" ]; then
-    printf "Contents of $XORGCONFIG_ROSTER:\n"
-    cat "$XORGCONFIG_ROSTER"
-else
-    printf "$XORGCONFIG_ROSTER does not exist.\n"
-fi
-
-printf "\n"
-
-if which lspci > /dev/null 2>&1; then
-    printf "VGA-compatible devices on PCI bus:\n"
-    LC_ALL=C lspci | grep 'VGA compatible controller:'
-    LC_ALL=C lspci -n | grep 'Class 0300:'
-else
-    printf "The lspci command was not found; not including PCI data.\n"
-fi
-
-printf "\n"
-
-if [ -e "$XORGCONFIG" ]; then
-    if [ -e "$XORGCONFIG_CHECKSUM" ]; then
-        if [ "$(md5sum "$XORGCONFIG")" = "$(cat "$XORGCONFIG_CHECKSUM")" ]; then
-            printf "%s unchanged from checksum in %s.\n" "$XORGCONFIG" \
-              "$XORGCONFIG_CHECKSUM"
-        else
-            printf "%s does not match checksum in %s.\n" "$XORGCONFIG" \
-              "$XORGCONFIG_CHECKSUM"
-        fi
-    else
-        printf "$XORGCONFIG_CHECKSUM does not exist.\n"
-    fi
-    printf "\n"
-    printf "Xorg X server configuration file status:\n"
-    ls -dl "$XORGCONFIG"
-    printf "\n"
-    printf "Contents of $XORGCONFIG:\n"
-    iconv -c -t ascii "$XORGCONFIG"
-    printf "\n"
-    if [ -d "$XORGCONFIG_DIR" ]; then
-        printf "Contents of $XORGCONFIG_DIR:\n"
-        ls -l "$XORGCONFIG_DIR"
-        printf "\n"
-    fi
-else
-    printf "$XORGCONFIG does not exist.\n"
-fi
-
-printf "\n"
-
-KERNEL_VERSION=/proc/version
-
-if [ -e "$KERNEL_VERSION" ]; then
-    printf "Kernel version ($KERNEL_VERSION):\n"
-    cat /proc/version
-else
-    printf "No kernel version found (missing $KERNEL_VERSION).\n"
-fi
-
-printf "\n"
-
-XORG_LOGS=$(ls -dt /var/log/Xorg.*.log 2>/dev/null)
-
-if [ -n "$XORG_LOGS" ]; then
-    printf "Xorg X server log files on system:\n"
-    ls -dlrt /var/log/Xorg.*.log 2>/dev/null
-    printf "\n"
-    for LOG in $XORG_LOGS; do
-        if [ -f "$LOG" ]; then
-            printf "Contents of most recent Xorg X server log file\n"
-            printf "%s:\n" "$LOG"
-            cat "$LOG"
-            # the log files are large; only show the most recent
-            break
-        fi
-    done
-else
-    printf "No Xorg X server log files found.\n"
-fi
-
-if [ -x /sbin/udevadm ]; then
-    printf "\nudev information:\n"
-    /sbin/udevadm info --export-db | awk -F '\n' -v RS='\n\n' '/E: ID_INPUT/ { print; print "" }'
-fi
-
-if [ -x /bin/dmesg ]; then
-    printf "DRM Information from dmesg:\n"
-    dmesg | egrep -i 'drm|agp'
-fi
-
-printf "\n"
-
-# vim:set ai et sts=4 sw=4 tw=0:
diff --git a/debian/xserver-xorg-core.install b/debian/xserver-xorg-core.install
deleted file mode 100755 (executable)
index c2bcd9a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib/xorg/modules
-usr/bin/Xorg
diff --git a/debian/xserver-xorg-core.postinst.in b/debian/xserver-xorg-core.postinst.in
deleted file mode 100644 (file)
index 14383db..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-set -e
-
-THIS_PACKAGE=xserver-xorg-core
-THIS_SCRIPT=postinst
-
-#INCLUDE_SHELL_LIB#
-
-case "$1" in
-  configure)
-  if dpkg --compare-versions "$2" lt-nl 2:1.5.2-1; then
-    remove_conffile_commit /etc/X11/xserver/SecurityPolicy
-    rmdir /etc/X11/xserver 2>/dev/null || true
-  fi
-  if dpkg --compare-versions "$2" lt 2:1.7.3.901-2; then
-    if [ `uname -s` = "Linux" ]; then
-      udevadm trigger --subsystem-match=input --action=change
-    fi
-  fi
-esac
-
-#DEBHELPER#
-
-exit 0
-
-# vim:set ai et sw=2 ts=2 tw=80:
diff --git a/debian/xserver-xorg-core.postrm.in b/debian/xserver-xorg-core.postrm.in
deleted file mode 100644 (file)
index 19bec1e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-set -e
-
-THIS_PACKAGE=xserver-xorg-core
-THIS_SCRIPT=postrm
-
-#INCLUDE_SHELL_LIB#
-
-case "$1" in
-abort-install|abort-upgrade)
-  if dpkg --compare-versions "$2" lt-nl "2:1.5.2-1"; then
-    remove_conffile_rollback /etc/X11/xserver/SecurityPolicy
-  fi
-  ;;
-purge)
-  rm /var/log/Xorg.*.log || true
-  rm /var/log/Xorg.*.log.old || true
-  ;;
-esac
-
-#DEBHELPER#
-
-# vim:set ai et sts=2 sw=2 tw=0:
diff --git a/debian/xserver-xorg-core.preinst.in b/debian/xserver-xorg-core.preinst.in
deleted file mode 100644 (file)
index c1b84a2..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-set -e
-
-THIS_PACKAGE=xserver-xorg-core
-THIS_SCRIPT=preinst
-
-#INCLUDE_SHELL_LIB#
-
-case "$1" in
-upgrade|install)
-  if dpkg --compare-versions "$2" lt-nl 2:1.5.2-1; then
-    remove_conffile_lookup xserver-xorg-core /etc/X11/xserver/SecurityPolicy
-  fi
-esac
-
-#DEBHELPER#
-
-exit 0
-
-# vim:set ai et sw=2 ts=2 tw=80:
diff --git a/debian/xserver-xorg-dev.install b/debian/xserver-xorg-dev.install
deleted file mode 100644 (file)
index fc37d0b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/include/xorg       
-usr/lib/pkgconfig/xorg-server.pc       
-usr/share/aclocal      
diff --git a/debian/xserver-xorg-tools.install b/debian/xserver-xorg-tools.install
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/debian/xsfbs/repack.sh b/debian/xsfbs/repack.sh
deleted file mode 100644 (file)
index 5935cc9..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if ! [ -d debian/prune ]; then
-       exit 0
-fi
-
-if [ "x$1" != x--upstream-version ]; then
-       exit 1
-fi
-
-version="$2"
-filename="$3"
-
-if [ -z "$version" ] || ! [ -f "$filename" ]; then
-       exit 1
-fi
-
-dir="$(pwd)"
-tempdir="$(mktemp -d)"
-
-cd "$tempdir"
-tar xf "$dir/$filename"
-cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done
-
-tar czf "$dir/$filename" *
-cd "$dir"
-rm -rf "$tempdir"
-echo "Done pruning upstream tarball"
-
-exit 0
diff --git a/debian/xsfbs/xsfbs.mk b/debian/xsfbs/xsfbs.mk
deleted file mode 100644 (file)
index 77c4a39..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-#!/usr/bin/make -f
-
-# Debian X Strike Force Build System (XSFBS): Make portion
-
-# Copyright 1996 Stephen Early
-# Copyright 1997 Mark Eichin
-# Copyright 1998-2005, 2007 Branden Robinson
-# Copyright 2005 David Nusinow
-#
-# Licensed under the GNU General Public License, version 2.  See the file
-# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
-
-# Originally by Stephen Early <sde1000@debian.org>
-# Modified by Mark W. Eichin <eichin@kitten.gen.ma.us>
-# Modified by Adam Heath <doogie@debian.org>
-# Modified by Branden Robinson <branden@debian.org>
-# Modified by Fabio Massimo Di Nitto <fabbione@fabbione.net>
-# Modified by David Nusinow <dnusinow@debian.org>
-# Acknowledgements to Manoj Srivastava.
-
-# Pass $(DH_OPTIONS) into the environment for debhelper's benefit.
-export DH_OPTIONS
-
-# force quilt to not use ~/.quiltrc and to use debian/patches
-QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null
-
-# Set up parameters for the upstream build environment.
-
-# Determine (source) package name from Debian changelog.
-SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \
-                        | grep '^Source:' | awk '{print $$2}')
-
-# Determine package version from Debian changelog.
-SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \
-                        | grep '^Version:' | awk '{print $$2}')
-
-# Determine upstream version number.
-UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//')
-
-# Determine the source version without the epoch for make-orig-tar-gz
-NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://')
-
-# Figure out who's building this package.
-BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}})
-
-# Find out if this is an official build; an official build has nothing but
-# digits, dots, and/or the codename of a release in the Debian part of the
-# version number.  Anything else indicates an unofficial build.
-OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi)
-
-# Set up parameters for the Debian build environment.
-
-# Determine our architecture.
-BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
-# Work around some old-time dpkg braindamage.
-BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH))
-# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy.
-ifdef DEB_HOST_ARCH
- ARCH:=$(DEB_HOST_ARCH)
-else
- # dpkg-cross sets the ARCH environment variable; if set, use it.
- ifdef ARCH
-  ARCH:=$(ARCH)
- else
-  ARCH:=$(BUILD_ARCH)
- endif
-endif
-
-# $(STAMP_DIR) houses stamp files for complex targets.
-STAMP_DIR:=stampdir
-
-# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place
-# their files.
-DEBTREEDIR:=$(CURDIR)/debian/tmp
-
-# All "important" targets have four lines:
-#   1) A target name that is invoked by a package-building tool or the user.
-#      This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart.
-#   2) A line delcaring 1) as a phony target (".PHONY:").
-#   3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may
-#   depend on other targets.
-#   4) A line declaring 3) as a member of the $(stampdir_targets) variable; the
-#   "$(STAMP_DIR)/" prefix is omitted.
-#
-# This indirection is needed so that the "stamp" files that signify when a rule
-# is done can be located in a separate "stampdir".  Recall that make has no way
-# to know when a goal has been met for a phony target (like "build" or
-# "install").
-#
-# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@"
-# so that the target will not be run again.  Removing the file will make Make
-# run the target over.
-
-# All phony targets should be declared as dependencies of .PHONY, even if they
-# do not have "($STAMP_DIR)/"-prefixed counterparts.
-
-# Define a harmless default rule to keep things from going nuts by accident.
-.PHONY: default
-default:
-
-# Set up the $(STAMP_DIR) directory.
-.PHONY: stampdir
-stampdir_targets+=stampdir
-stampdir: $(STAMP_DIR)/stampdir
-$(STAMP_DIR)/stampdir:
-       mkdir $(STAMP_DIR)
-       >$@
-
-# Set up the package build directory as quilt expects to find it.
-.PHONY: prepare
-stampdir_targets+=prepare
-prepare: $(STAMP_DIR)/prepare
-$(STAMP_DIR)/prepare: $(STAMP_DIR)/logdir $(STAMP_DIR)/genscripts
-       >$@
-
-.PHONY: logdir
-stampdir_targets+=logdir
-logdir: $(STAMP_DIR)/logdir
-$(STAMP_DIR)/logdir: $(STAMP_DIR)/stampdir
-       mkdir -p $(STAMP_DIR)/log
-       >$@
-
-# Apply all patches to the upstream source.
-.PHONY: patch
-stampdir_targets+=patch
-patch: $(STAMP_DIR)/patch
-$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare
-       if ! [ `which quilt` ]; then \
-               echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \
-               exit 1; \
-       fi; \
-       if $(QUILT) next >/dev/null 2>&1; then \
-         echo -n "Applying patches..."; \
-         if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \
-           cat $(STAMP_DIR)/log/patch; \
-           echo "successful."; \
-         else \
-           cat $(STAMP_DIR)/log/patch; \
-           echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \
-           exit 1; \
-         fi; \
-       else \
-         echo "No patches to apply"; \
-       fi; \
-       >$@
-
-# Revert all patches to the upstream source.
-.PHONY: unpatch
-unpatch: $(STAMP_DIR)/logdir
-       rm -f $(STAMP_DIR)/patch
-       @echo -n "Unapplying patches..."; \
-       if $(QUILT) applied >/dev/null 2>/dev/null; then \
-         if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \
-           cat $(STAMP_DIR)/log/unpatch; \
-           echo "successful."; \
-         else \
-           cat $(STAMP_DIR)/log/unpatch; \
-           echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \
-           exit 1; \
-         fi; \
-       else \
-         echo "nothing to do."; \
-       fi
-
-# Clean the generated maintainer scripts.
-.PHONY: cleanscripts
-cleanscripts:
-       rm -f $(STAMP_DIR)/genscripts
-       rm -f debian/*.config \
-             debian/*.postinst \
-             debian/*.postrm \
-             debian/*.preinst \
-             debian/*.prerm
-
-# Clean the package build tree.
-.PHONY: xsfclean
-xsfclean: cleanscripts unpatch
-       dh_testdir
-       rm -rf .pc
-       rm -rf $(STAMP_DIR)
-       dh_clean
-
-# Remove files from the upstream source tree that we don't need, or which have
-# licensing problems.  It must be run before creating the .orig.tar.gz.
-#
-# Note: This rule is for Debian package maintainers' convenience, and is not
-# needed for conventional build scenarios.
-.PHONY: prune-upstream-tree
-prune-upstream-tree:
-       # Ensure we're in the correct directory.
-       dh_testdir
-       grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf
-
-# Verify that there are no offsets or fuzz in the patches we apply.
-#
-# Note: This rule is for Debian package maintainers' convenience, and is not
-# needed for conventional build scenarios.
-.PHONY: patch-audit
-patch-audit: prepare unpatch
-       @echo -n "Auditing patches..."; \
-       >$(STAMP_DIR)/log/patch; \
-       FUZZY=; \
-       while [ -n "$$($(QUILT) next)" ]; do \
-         RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\
-         case "$$RESULT" in \
-           succeeded) \
-             echo "fuzzy patch: $$($(QUILT) top)" \
-               | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \
-             FUZZY=yes; \
-             ;; \
-           FAILED) \
-             echo "broken patch: $$($(QUILT) next)" \
-               | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \
-             exit 1; \
-             ;; \
-         esac; \
-       done; \
-       if [ -n "$$FUZZY" ]; then \
-         echo "there were fuzzy patches; please fix."; \
-         exit 1; \
-       else \
-         echo "done."; \
-       fi
-
-# Generate the maintainer scripts.
-.PHONY: genscripts
-stampdir_targets+=genscripts
-genscripts: $(STAMP_DIR)/genscripts
-$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir
-       for FILE in debian/*.config.in \
-                   debian/*.postinst.in \
-                   debian/*.postrm.in \
-                   debian/*.preinst.in \
-                   debian/*.prerm.in; do \
-         if [ -e "$$FILE" ]; then \
-           MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \
-           sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \
-             | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \
-           cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \
-           sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \
-             | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \
-           sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \
-               -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \
-             <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \
-           rm $$MAINTSCRIPT.tmp; \
-         fi; \
-       done
-       # Validate syntax of generated shell scripts.
-       #sh debian/scripts/validate-posix-sh debian/*.config \
-       #                                    debian/*.postinst \
-       #                                    debian/*.postrm \
-       #                                    debian/*.preinst \
-       #                                    debian/*.prerm
-       >$@
-
-# Compute dependencies for drivers
-#
-VIDEODEP = $(shell cat /usr/share/xserver-xorg/videodrvdep 2>/dev/null)
-INPUTDEP = $(shell cat /usr/share/xserver-xorg/xinputdep 2>/dev/null)
-
-# these two can be removed post-squeeze
-VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
-INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null)
-VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI)
-INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI)
-
-ifeq ($(PACKAGE),)
-PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control)
-endif
-
-.PHONY: serverabi
-serverabi: install
-ifeq ($(VIDEODEP),)
-       @echo 'error: xserver-xorg-dev >= 1.7.6.901 needs to be installed'
-       @exit 1
-else
-       echo "xviddriver:Depends=$(VIDEODEP)" >> debian/$(PACKAGE).substvars
-       echo "xinpdriver:Depends=$(INPUTDEP)" >> debian/$(PACKAGE).substvars
-       # the following is there for compatibility...
-       echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
-       echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
-       echo "xserver:Depends=$(VIDEODEP), $(INPUTDEP)" >> debian/$(PACKAGE).substvars
-endif
-
-# vim:set noet ai sts=8 sw=8 tw=0:
diff --git a/debian/xsfbs/xsfbs.sh b/debian/xsfbs/xsfbs.sh
deleted file mode 100644 (file)
index 813fd8d..0000000
+++ /dev/null
@@ -1,622 +0,0 @@
-# This is the X Strike Force shell library for X Window System package
-# maintainer scripts.  It serves to define shell functions commonly used by
-# such packages, and performs some error checking necessary for proper operation
-# of those functions.  By itself, it does not "do" much; the maintainer scripts
-# invoke the functions defined here to accomplish package installation and
-# removal tasks.
-
-# If you are reading this within a Debian package maintainer script (e.g.,
-# /var/lib/dpkg/info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can
-# skip past this library by scanning forward in this file to the string
-# "GOBSTOPPER".
-
-SOURCE_VERSION=@SOURCE_VERSION@
-OFFICIAL_BUILD=@OFFICIAL_BUILD@
-
-# Use special abnormal exit codes so that problems with this library are more
-# easily tracked down.
-SHELL_LIB_INTERNAL_ERROR=86
-SHELL_LIB_THROWN_ERROR=74
-SHELL_LIB_USAGE_ERROR=99
-
-# old -> new variable names
-if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
-  DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
-fi
-if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
-  DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
-fi
-
-# initial sanity checks
-if [ -z "$THIS_PACKAGE" ]; then
-  cat >&2 <<EOF
-Error: package maintainer script attempted to use shell library without
-definining \$THIS_PACKAGE shell variable.  Please report the package name,
-version, and the text of this error message to the Debian Bug Tracking System.
-Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
-instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
-"doc-debian" package, or install the "reportbug" package and use the command of
-the same name to file a report against version $SOURCE_VERSION of this package.
-EOF
-  exit $SHELL_LIB_USAGE_ERROR
-fi
-
-if [ -z "$THIS_SCRIPT" ]; then
-  cat >&2 <<EOF
-Error: package maintainer script attempted to use shell library without
-definining \$THIS_SCRIPT shell variable.  Please report the package name,
-version, and the text of this error message to the Debian Bug Tracking System.
-Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
-instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
-"doc-debian" package, or install the "reportbug" package and use the command of
-the same name to file a report against version $SOURCE_VERSION of the
-"$THIS_PACKAGE" package.
-EOF
-  exit $SHELL_LIB_USAGE_ERROR
-fi
-
-if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
-  RECONFIGURE="true"
-else
-  RECONFIGURE=
-fi
-
-if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
-  FIRSTINST="yes"
-fi
-
-if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
-  UPGRADE="yes"
-fi
-
-trap "message;\
-      message \"Received signal.  Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
-      message;\
-      exit 1" HUP INT QUIT TERM
-
-reject_nondigits () {
-  # syntax: reject_nondigits [ operand ... ]
-  #
-  # scan operands (typically shell variables whose values cannot be trusted) for
-  # characters other than decimal digits and barf if any are found
-  while [ -n "$1" ]; do
-    # does the operand contain anything but digits?
-    if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
-      # can't use die(), because it wraps message() which wraps this function
-      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
-           "possibly malicious garbage \"$1\"" >&2
-      exit $SHELL_LIB_THROWN_ERROR
-    fi
-    shift
-  done
-}
-
-reject_unlikely_path_chars () {
-  # syntax: reject_unlikely_path_chars [ operand ... ]
-  #
-  # scan operands (typically shell variables whose values cannot be trusted) for
-  # characters unlikely to be seen in a path and which the shell might
-  # interpret and barf if any are found
-  while [ -n "$1" ]; do
-    # does the operand contain any funny characters?
-    if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
-      # can't use die(), because I want to avoid forward references
-      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
-           "encountered possibly malicious garbage \"$1\"" >&2
-      exit $SHELL_LIB_THROWN_ERROR
-    fi
-    shift
-  done
-}
-
-# Query the terminal to establish a default number of columns to use for
-# displaying messages to the user.  This is used only as a fallback in the
-# event the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while
-# the script is running, and this cannot, only being calculated once.)
-DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
-if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
-  DEFCOLUMNS=80
-fi
-
-message () {
-  # pretty-print messages of arbitrary length
-  reject_nondigits "$COLUMNS"
-  echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
-}
-
-observe () {
-  # syntax: observe message ...
-  #
-  # issue observational message suitable for logging someday when support for
-  # it exists in dpkg
-  if [ -n "$DEBUG_XORG_PACKAGE" ]; then
-    message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
-  fi
-}
-
-warn () {
-  # syntax: warn message ...
-  #
-  # issue warning message suitable for logging someday when support for
-  # it exists in dpkg; also send to standard error
-  message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
-}
-
-die () {
-  # syntax: die message ...
-  #
-  # exit script with error message
-  message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
-  exit $SHELL_LIB_THROWN_ERROR
-}
-
-internal_error () {
-  # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
-  message "internal error: $*"
-  if [ -n "$OFFICIAL_BUILD" ]; then
-    message "Please report a bug in the $THIS_SCRIPT script of the" \
-            "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
-            "Tracking System.  Include all messages above that mention the" \
-            "$THIS_PACKAGE package.  Visit " \
-            "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
-            "instructions, read the file" \
-            "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
-            "package, or install the reportbug package and use the command of" \
-            "the same name to file a report."
-  fi
-  exit $SHELL_LIB_INTERNAL_ERROR
-}
-
-usage_error () {
-  message "usage error: $*"
-  message "Please report a bug in the $THIS_SCRIPT script of the" \
-          "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
-          "Tracking System.  Include all messages above that mention the" \
-          "$THIS_PACKAGE package.  Visit " \
-          "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
-          "instructions, read the file" \
-          "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
-          "package, or install the reportbug package and use the command of" \
-          "the same name to file a report."
-  exit $SHELL_LIB_USAGE_ERROR
-}
-
-font_update () {
-  # run $UPDATECMDS in $FONTDIRS
-
-  local dir cmd shortcmd x_font_dir_prefix
-
-  x_font_dir_prefix="/usr/share/fonts/X11"
-
-  if [ -z "$UPDATECMDS" ]; then
-    usage_error "font_update() called but \$UPDATECMDS not set"
-  fi
-  if [ -z "$FONTDIRS" ]; then
-    usage_error "font_update() called but \$FONTDIRS not set"
-  fi
-
-  reject_unlikely_path_chars "$UPDATECMDS"
-  reject_unlikely_path_chars "$FONTDIRS"
-
-  for dir in $FONTDIRS; do
-    if [ -d "$x_font_dir_prefix/$dir" ]; then
-      for cmd in $UPDATECMDS; do
-        if which "$cmd" > /dev/null 2>&1; then
-          shortcmd=${cmd##*/}
-          observe "running $shortcmd in $dir font directory"
-         cmd_opts=
-          if [ "$shortcmd" = "update-fonts-alias" ]; then
-            cmd_opts=--x11r7-layout
-          fi
-          if [ "$shortcmd" = "update-fonts-dir" ]; then
-            cmd_opts=--x11r7-layout
-          fi
-          if [ "$shortcmd" = "update-fonts-scale" ]; then
-            cmd_opts=--x11r7-layout
-          fi
-          $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \
-                              "failed; font directory data may not" \
-                              "be up to date"
-        else
-          warn "$cmd not found; not updating corresponding $dir font" \
-               "directory data"
-        fi
-      done
-    else
-      warn "$dir is not a directory; not updating font directory data"
-    fi
-  done
-}
-
-remove_conffile_prepare () {
-  # syntax: remove_conffile_prepare filename official_md5sum ...
-  #
-  # Check a conffile "filename" against a list of canonical MD5 checksums.
-  # If the file's current MD5 checksum matches one of the "official_md5sum"
-  # operands provided, then prepare the conffile for removal from the system.
-  # We defer actual deletion until the package is configured so that we can
-  # roll this operation back if package installation fails.
-  #
-  # Call this function from a preinst script in the event $1 is "upgrade" or
-  # "install" and verify $2 to ensure the package is being upgraded from a
-  # version (or installed over a version removed-but-not-purged) prior to the
-  # one in which the conffile was obsoleted.
-
-  local conffile current_checksum
-
-  # validate arguments
-  if [ $# -lt 2 ]; then
-    usage_error "remove_conffile_prepare() called with wrong number of" \
-                "arguments; expected at least 2, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  conffile="$1"
-  shift
-
-  # does the conffile even exist?
-  if [ -e "$conffile" ]; then
-    # calculate its checksum
-    current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
-    # compare it to each supplied checksum
-    while [ -n "$1" ]; do
-      if [ "$current_checksum" = "$1" ]; then
-        # we found a match; move the confffile and stop looking
-        observe "preparing obsolete conffile $conffile for removal"
-        mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
-        break
-      fi
-      shift
-    done
-  fi
-}
-
-remove_conffile_lookup () {
-  # syntax: remove_conffile_lookup package filename
-  #
-  # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal
-  # if it matches the actual file's md5sum.
-  #
-  # Call this function when you would call remove_conffile_prepare but only
-  # want to check against dpkg's status database instead of known checksums.
-
-  local package conffile old_md5sum
-
-  # validate arguments
-  if [ $# -ne 2 ]; then
-    usage_error "remove_conffile_lookup() called with wrong number of" \
-                "arguments; expected 1, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  package="$1"
-  conffile="$2"
-
-  if ! [ -e "$conffile" ]; then
-    return
-  fi
-  old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \
-    awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')"
-  if [ -n "$old_md5sum" ]; then
-    remove_conffile_prepare "$conffile" "$old_md5sum"
-  fi
-}
-
-remove_conffile_commit () {
-  # syntax: remove_conffile_commit filename
-  #
-  # Complete the removal of a conffile "filename" that has become obsolete.
-  #
-  # Call this function from a postinst script after having used
-  # remove_conffile_prepare() in the preinst.
-
-  local conffile
-
-  # validate arguments
-  if [ $# -ne 1 ]; then
-    usage_error "remove_conffile_commit() called with wrong number of" \
-                "arguments; expected 1, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  conffile="$1"
-
-  # if the temporary file created by remove_conffile_prepare() exists, remove it
-  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
-    observe "committing removal of obsolete conffile $conffile"
-    rm "$conffile.$THIS_PACKAGE-tmp"
-  fi
-}
-
-remove_conffile_rollback () {
-  # syntax: remove_conffile_rollback filename
-  #
-  # Roll back the removal of a conffile "filename".
-  #
-  # Call this function from a postrm script in the event $1 is "abort-upgrade"
-  # or "abort-install" is  after having used remove_conffile_prepare() in the
-  # preinst.
-
-  local conffile
-
-  # validate arguments
-  if [ $# -ne 1 ]; then
-    usage_error "remove_conffile_rollback() called with wrong number of" \
-                "arguments; expected 1, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  conffile="$1"
-
-  # if the temporary file created by remove_conffile_prepare() exists, move it
-  # back
-  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
-    observe "rolling back removal of obsolete conffile $conffile"
-    mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
-  fi
-}
-
-replace_conffile_with_symlink_prepare () {
-  # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \
-  # official_md5sum ...
-  #
-  # Check a conffile "oldfilename" against a list of canonical MD5 checksums.
-  # If the file's current MD5 checksum matches one of the "official_md5sum"
-  # operands provided, then prepare the conffile for removal from the system.
-  # We defer actual deletion until the package is configured so that we can
-  # roll this operation back if package installation fails. Otherwise copy it
-  # to newfilename and let dpkg handle it through conffiles mechanism.
-  #
-  # Call this function from a preinst script in the event $1 is "upgrade" or
-  # "install" and verify $2 to ensure the package is being upgraded from a
-  # version (or installed over a version removed-but-not-purged) prior to the
-  # one in which the conffile was obsoleted.
-
-  local conffile current_checksum
-
-  # validate arguments
-  if [ $# -lt 3 ]; then
-    usage_error "replace_conffile_with_symlink_prepare() called with wrong" \
-                " number of arguments; expected at least 3, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  oldconffile="$1"
-  shift
-  newconffile="$1"
-  shift
-
-  remove_conffile_prepare "$_oldconffile" "$@"
-  # If $oldconffile still exists, then md5sums didn't match.
-  # Copy it to new one.
-  if [ -f "$oldconffile" ]; then
-    cp "$oldconffile" "$newconffile"
-  fi
-
-}
-
-replace_conffile_with_symlink_commit () {
-  # syntax: replace_conffile_with_symlink_commit oldfilename
-  #
-  # Complete the removal of a conffile "oldfilename" that has been
-  # replaced by a symlink.
-  #
-  # Call this function from a postinst script after having used
-  # replace_conffile_with_symlink_prepare() in the preinst.
-
-  local conffile
-
-  # validate arguments
-  if [ $# -ne 1 ]; then
-    usage_error "replace_conffile_with_symlink_commit() called with wrong" \
-                "number of arguments; expected 1, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  conffile="$1"
-
-  remove_conffile_commit "$conffile"
-}
-
-replace_conffile_with_symlink_rollback () {
-  # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename
-  #
-  # Roll back the replacing of a conffile "oldfilename" with symlink to
-  # "newfilename".
-  #
-  # Call this function from a postrm script in the event $1 is "abort-upgrade"
-  # or "abort-install" and verify $2 to ensure the package failed to upgrade
-  # from a version (or install over a version removed-but-not-purged) prior
-  # to the one in which the conffile was obsoleted.
-  # You should have  used replace_conffile_with_symlink_prepare() in the
-  # preinst.
-
-  local conffile
-
-  # validate arguments
-  if [ $# -ne 2 ]; then
-    usage_error "replace_conffile_with_symlink_rollback() called with wrong" \
-                "number of arguments; expected 2, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  oldconffile="$1"
-  newconffile="$2"
-
-  remove_conffile_rollback "$_oldconffile"
-  if [ -f "$newconffile" ]; then
-    rm "$newconffile"
-  fi
-}
-
-run () {
-  # syntax: run command [ argument ... ]
-  #
-  # Run specified command with optional arguments and report its exit status.
-  # Useful for commands whose exit status may be nonzero, but still acceptable,
-  # or commands whose failure is not fatal to us.
-  #
-  # NOTE: Do *not* use this function with db_get or db_metaget commands; in
-  # those cases the return value of the debconf command *must* be checked
-  # before the string returned by debconf is used for anything.
-
-  local retval
-
-  # validate arguments
-  if [ $# -lt 1 ]; then
-    usage_error "run() called with wrong number of arguments; expected at" \
-                "least 1, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  "$@" || retval=$?
-
-  if [ ${retval:-0} -ne 0 ]; then
-    observe "command \"$*\" exited with status $retval"
-  fi
-}
-
-make_symlink_sane () {
-  # syntax: make_symlink_sane symlink target
-  #
-  # Ensure that the symbolic link symlink exists, and points to target.
-  #
-  # If symlink does not exist, create it and point it at target.
-  #
-  # If symlink exists but is not a symbolic link, back it up.
-  #
-  # If symlink exists, is a symbolic link, but points to the wrong location, fix
-  # it.
-  #
-  # If symlink exists, is a symbolic link, and already points to target, do
-  # nothing.
-  #
-  # This function wouldn't be needed if ln had an -I, --idempotent option.
-
-  # Validate arguments.
-  if [ $# -ne 2 ]; then
-    usage_error "make_symlink_sane() called with wrong number of arguments;" \
-      "expected 2, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  # We could just use the positional parameters as-is, but that makes things
-  # harder to follow.
-  local symlink target
-
-  symlink="$1"
-  target="$2"
-
-  if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then
-      observe "link from $symlink to $target already exists"
-  else
-    observe "creating symbolic link from $symlink to $target"
-    mkdir -p "${target%/*}" "${symlink%/*}"
-    ln -s -b -S ".dpkg-old" "$target" "$symlink"
-  fi
-}
-
-migrate_dir_to_symlink () {
-  # syntax: migrate_dir_to_symlink old_location new_location
-  #
-  # Per Debian Policy section 6.5.4, "A directory will never be replaced by a
-  # symbolic link to a directory or vice versa; instead, the existing state
-  # (symlink or not) will be left alone and dpkg will follow the symlink if
-  # there is one."
-  #
-  # We have to do it ourselves.
-  #
-  # This function moves the contents of old_location, a directory, into
-  # new_location, a directory, then makes old_location a symbolic link to
-  # new_location.
-  #
-  # old_location need not exist, but if it does, it must be a directory (or a
-  # symlink to a directory).  If it is not, it is backed up.  If new_location
-  # exists already and is not a directory, it is backed up.
-  #
-  # This function should be called from a package's preinst so that other
-  # packages unpacked after this one --- but before this package's postinst runs
-  # --- are unpacked into new_location even if their payloads contain
-  # old_location filespecs.
-
-  # Validate arguments.
-  if [ $# -ne 2 ]; then
-    usage_error "migrate_dir_to_symlink() called with wrong number of"
-                "arguments; expected 2, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  # We could just use the positional parameters as-is, but that makes things
-  # harder to follow.
-  local new old
-
-  old="$1"
-  new="$2"
-
-  # Is old location a symlink?
-  if [ -L "$old" ]; then
-    # Does it already point to new location?
-    if [ "$(readlink "$old")" = "$new" ]; then
-      # Nothing to do; migration has already been done.
-      observe "migration of $old to $new already done"
-      return 0
-    else
-      # Back it up.
-      warn "backing up symbolic link $old as $old.dpkg-old"
-      mv -b "$old" "$old.dpkg-old"
-    fi
-  fi
-
-  # Does old location exist, but is not a directory?
-  if [ -e "$old" ] && ! [ -d "$old" ]; then
-      # Back it up.
-      warn "backing up non-directory $old as $old.dpkg-old"
-      mv -b "$old" "$old.dpkg-old"
-  fi
-
-  observe "migrating $old to $new"
-
-  # Is new location a symlink?
-  if [ -L "$new" ]; then
-    # Does it point the wrong way, i.e., back to where we're migrating from?
-    if [ "$(readlink "$new")" = "$old" ]; then
-      # Get rid of it.
-      observe "removing symbolic link $new which points to $old"
-      rm "$new"
-    else
-      # Back it up.
-      warn "backing up symbolic link $new as $new.dpkg-old"
-      mv -b "$new" "$new.dpkg-old"
-    fi
-  fi
-
-  # Does new location exist, but is not a directory?
-  if [ -e "$new" ] && ! [ -d "$new" ]; then
-    warn "backing up non-directory $new as $new.dpkg-old"
-    mv -b "$new" "$new.dpkg-old"
-  fi
-
-  # Create new directory if it does not yet exist.
-  if ! [ -e "$new" ]; then
-    observe "creating $new"
-    mkdir -p "$new"
-  fi
-
-  # Copy files in old location to new location.  Back up any filenames that
-  # already exist in the new location with the extension ".dpkg-old".
-  observe "copying files from $old to $new"
-  if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then
-    die "error(s) encountered while copying files from $old to $new"
-  fi
-
-  # Remove files at old location.
-  observe "removing $old"
-  rm -r "$old"
-
-  # Create symlink from old location to new location.
-  make_symlink_sane "$old" "$new"
-}
-
-# vim:set ai et sw=2 ts=2 tw=80:
-
-# GOBSTOPPER: The X Strike Force shell library ends here.
index daf3faf..60ebbcd 100644 (file)
@@ -54,7 +54,8 @@ extern "C" {
        __dtrace_Xserver___resource__free(arg0, arg1, arg2, arg3)
 #define        XSERVER_SEND_EVENT(arg0, arg1, arg2) \
        __dtrace_Xserver___send__event(arg0, arg1, arg2)
-
+#define        XSERVER_INPUT_EVENT(arg0, arg1, arg2, arg3, arg4, arg5, arg6) \
+       __dtrace_Xserver___input__event(arg0, arg1, arg2, arg3, arg4, arg5, arg6)
 
 extern void __dtrace_Xserver___client__auth(int, string, pid_t, zoneid_t);
 extern void __dtrace_Xserver___client__connect(int, int);
@@ -64,6 +65,8 @@ extern void __dtrace_Xserver___request__start(string, uint8_t, uint16_t, int, vo
 extern void __dtrace_Xserver___resource__alloc(uint32_t, uint32_t, void *, string);
 extern void __dtrace_Xserver___resource__free(uint32_t, uint32_t, void *, string);
 extern void __dtrace_Xserver___send__event(int, uint8_t, void *);
+extern void __dtrace_Xserver___input__event(int, uint16_t, uint32_t, uint32_t, int8_t, uint8_t *, double *);
+
 
 #else
 
@@ -75,6 +78,7 @@ extern void __dtrace_Xserver___send__event(int, uint8_t, void *);
 #define        XSERVER_RESOURCE_ALLOC(arg0, arg1, arg2, arg3)
 #define        XSERVER_RESOURCE_FREE(arg0, arg1, arg2, arg3)
 #define        XSERVER_SEND_EVENT(arg0, arg1, arg2)
+#define        XSERVER_INPUT_EVENT(arg0, arg1, arg2, arg3, arg4, arg5, arg6)
 
 #endif
 
@@ -86,6 +90,7 @@ extern void __dtrace_Xserver___send__event(int, uint8_t, void *);
 #define        XSERVER_RESOURCE_ALLOC_ENABLED() (1)
 #define        XSERVER_RESOURCE_FREE_ENABLED() (1)
 #define        XSERVER_SEND_EVENT_ENABLED() (1)
+#define        XSERVER_INPUT_EVENT_ENABLED() (1)
 
 #ifdef __cplusplus
 }
index 2ad3373..248d48e 100644 (file)
@@ -48,6 +48,8 @@ provider Xserver {
        probe resource__free(uint32_t, uint32_t, void *, string);
        /* client id, event type, event* */
        probe send__event(int, uint8_t, void *);
+       /* deviceid, type, button/keycode/touchid, flags, nvalues, mask, values */
+       probe input__event(int, int, uint32_t, uint32_t, int8_t, uint8_t*, double*);
 };
 
 #pragma D attributes Unstable/Unstable/Common provider Xserver provider
index 1030628..a43e279 100644 (file)
@@ -450,15 +450,15 @@ FreeColormap(pointer value, XID mid)
 static int
 TellNoMap(WindowPtr pwin, Colormap * pmid)
 {
-    xEvent xE;
-
     if (wColormap(pwin) == *pmid) {
         /* This should be call to DeliverEvent */
+        xEvent xE = {
+            .u.colormap.window = pwin->drawable.id,
+            .u.colormap.colormap = None,
+            .u.colormap.new = TRUE,
+            .u.colormap.state = ColormapUninstalled
+        };
         xE.u.u.type = ColormapNotify;
-        xE.u.colormap.window = pwin->drawable.id;
-        xE.u.colormap.colormap = None;
-        xE.u.colormap.new = TRUE;
-        xE.u.colormap.state = ColormapUninstalled;
 #ifdef PANORAMIX
         if (noPanoramiXExtension || !pwin->drawable.pScreen->myNum)
 #endif
@@ -477,7 +477,6 @@ int
 TellLostMap(WindowPtr pwin, pointer value)
 {
     Colormap *pmid = (Colormap *) value;
-    xEvent xE;
 
 #ifdef PANORAMIX
     if (!noPanoramiXExtension && pwin->drawable.pScreen->myNum)
@@ -485,11 +484,13 @@ TellLostMap(WindowPtr pwin, pointer value)
 #endif
     if (wColormap(pwin) == *pmid) {
         /* This should be call to DeliverEvent */
+        xEvent xE = {
+            .u.colormap.window = pwin->drawable.id,
+            .u.colormap.colormap = *pmid,
+            .u.colormap.new = FALSE,
+            .u.colormap.state = ColormapUninstalled
+        };
         xE.u.u.type = ColormapNotify;
-        xE.u.colormap.window = pwin->drawable.id;
-        xE.u.colormap.colormap = *pmid;
-        xE.u.colormap.new = FALSE;
-        xE.u.colormap.state = ColormapUninstalled;
         DeliverEvents(pwin, &xE, 1, (WindowPtr) NULL);
     }
 
@@ -501,7 +502,6 @@ int
 TellGainedMap(WindowPtr pwin, pointer value)
 {
     Colormap *pmid = (Colormap *) value;
-    xEvent xE;
 
 #ifdef PANORAMIX
     if (!noPanoramiXExtension && pwin->drawable.pScreen->myNum)
@@ -509,11 +509,13 @@ TellGainedMap(WindowPtr pwin, pointer value)
 #endif
     if (wColormap(pwin) == *pmid) {
         /* This should be call to DeliverEvent */
+        xEvent xE = {
+            .u.colormap.window = pwin->drawable.id,
+            .u.colormap.colormap = *pmid,
+            .u.colormap.new = FALSE,
+            .u.colormap.state = ColormapInstalled
+        };
         xE.u.u.type = ColormapNotify;
-        xE.u.colormap.window = pwin->drawable.id;
-        xE.u.colormap.colormap = *pmid;
-        xE.u.colormap.new = FALSE;
-        xE.u.colormap.state = ColormapInstalled;
         DeliverEvents(pwin, &xE, 1, (WindowPtr) NULL);
     }
 
@@ -576,7 +578,7 @@ CopyFree(int channel, int client, ColormapPtr pmapSrc, ColormapPtr pmapDst)
     int nalloc;
 
     switch (channel) {
-    default:                   /* so compiler can see that everything gets initialized */
+    default:         /* so compiler can see that everything gets initialized */
     case REDMAP:
         ppix = (pmapSrc->clientPixelsRed)[client];
         npix = (pmapSrc->numPixelsRed)[client];
@@ -653,7 +655,7 @@ FreeCell(ColormapPtr pmap, Pixel i, int channel)
     int *pCount;
 
     switch (channel) {
-    default:                   /* so compiler can see that everything gets initialized */
+    default:         /* so compiler can see that everything gets initialized */
     case PSEUDOMAP:
     case REDMAP:
         pent = (EntryPtr) & pmap->red[i];
@@ -2146,7 +2148,7 @@ FreeCo(ColormapPtr pmap, int client, int color, int npixIn, Pixel * ppixIn,
         ppixClient = pmap->clientPixelsBlue[client];
         npixClient = pmap->numPixelsBlue[client];
         break;
-    default:                   /* so compiler can see that everything gets initialized */
+    default:        /* so compiler can see that everything gets initialized */
     case PSEUDOMAP:
         cmask = ~((Pixel) 0);
         rgbbad = 0;
index 0125504..9cf04ed 100644 (file)
@@ -84,6 +84,7 @@ SOFTWARE.
 #include "enterleave.h"         /* for EnterWindow() */
 #include "xserver-properties.h"
 #include "xichangehierarchy.h"  /* For XISendDeviceHierarchyEvent */
+#include "syncsrv.h"
 
 /** @file
  * This file handles input device-related stuff.
@@ -177,12 +178,9 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
 
 /* Pair the keyboard to the pointer device. Keyboard events will follow the
  * pointer sprite. Only applicable for master devices.
- * If the client is set, the request to pair comes from some client. In this
- * case, we need to check for access. If the client is NULL, it's from an
- * internal automatic pairing, we must always permit this.
  */
 static int
-PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd)
+PairDevices(DeviceIntPtr ptr, DeviceIntPtr kbd)
 {
     if (!ptr)
         return BadDevice;
@@ -248,13 +246,17 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
 
     if (devid >= MAXDEVICES)
         return (DeviceIntPtr) NULL;
-    dev =
-        _dixAllocateObjectWithPrivates(sizeof(DeviceIntRec) +
-                                       sizeof(SpriteInfoRec),
-                                       sizeof(DeviceIntRec) +
-                                       sizeof(SpriteInfoRec),
-                                       offsetof(DeviceIntRec, devPrivates),
-                                       PRIVATE_DEVICE);
+    dev = calloc(1,
+                 sizeof(DeviceIntRec) +
+                 sizeof(SpriteInfoRec));
+    if (!dev)
+        return (DeviceIntPtr) NULL;
+
+    if (!dixAllocatePrivates(&dev->devPrivates, PRIVATE_DEVICE)) {
+        free(dev);
+        return NULL;
+    }
+
     if (!dev)
         return (DeviceIntPtr) NULL;
 
@@ -284,6 +286,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
     /*  security creation/labeling check
      */
     if (XaceHook(XACE_DEVICE_ACCESS, client, dev, DixCreateAccess)) {
+        dixFreePrivates(dev->devPrivates, PRIVATE_DEVICE);
         free(dev);
         return NULL;
     }
@@ -318,15 +321,14 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
 void
 SendDevicePresenceEvent(int deviceid, int type)
 {
-    DeviceIntRec dummyDev;
-    devicePresenceNotify ev;
+    DeviceIntRec dummyDev = { .id =  XIAllDevices };
+    devicePresenceNotify ev = {
+        .type = DevicePresenceNotify,
+        .time = currentTime.milliseconds,
+        .devchange = type,
+        .deviceid = deviceid
+    };
 
-    memset(&dummyDev, 0, sizeof(DeviceIntRec));
-    ev.type = DevicePresenceNotify;
-    ev.time = currentTime.milliseconds;
-    ev.devchange = type;
-    ev.deviceid = deviceid;
-    dummyDev.id = XIAllDevices;
     SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask,
                           (xEvent *) &ev, 1);
 }
@@ -364,13 +366,12 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
                 /* mode doesn't matter */
                 EnterWindow(dev, screenInfo.screens[0]->root, NotifyAncestor);
             }
-            else if ((other = NextFreePointerDevice()) == NULL) {
-                ErrorF("[dix] cannot find pointer to pair with. "
-                       "This is a bug.\n");
-                return FALSE;
+            else {
+                other = NextFreePointerDevice();
+                BUG_RETURN_VAL_MSG(other == NULL, FALSE,
+                                   "[dix] cannot find pointer to pair with.\n");
+                PairDevices(other, dev);
             }
-            else
-                PairDevices(NULL, other, dev);
         }
         else {
             if (dev->coreEvents)
@@ -406,9 +407,13 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
 
     RecalculateMasterButtons(dev);
 
+    /* initialise an idle timer for this device*/
+    dev->idle_counter = SyncInitDeviceIdleTime(dev);
+
     return TRUE;
 }
 
+
 /**
  * Switch a device off through the driver and push it onto the off_devices
  * list. A device will not send events while disabled. All clients are
@@ -427,11 +432,18 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
     BOOL enabled;
     int flags[MAXDEVICES] = { 0 };
 
+    if (!dev->enabled)
+        return TRUE;
+
     for (prev = &inputInfo.devices;
          *prev && (*prev != dev); prev = &(*prev)->next);
     if (*prev != dev)
         return FALSE;
 
+    ReleaseButtonsAndKeys(dev);
+    SyncRemoveDeviceIdleTime(dev->idle_counter);
+    dev->idle_counter = NULL;
+
     /* float attached devices */
     if (IsMaster(dev)) {
         for (other = inputInfo.devices; other; other = other->next) {
@@ -449,18 +461,19 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
     }
 
     if (IsMaster(dev) && dev->spriteInfo->sprite) {
-        for (other = inputInfo.devices; other; other = other->next) {
-            if (other->spriteInfo->paired == dev) {
-                ErrorF("[dix] cannot disable device, still paired. "
-                       "This is a bug. \n");
-                return FALSE;
-            }
-        }
+        for (other = inputInfo.devices; other; other = other->next)
+            if (other->spriteInfo->paired == dev && !other->spriteInfo->spriteOwner)
+                DisableDevice(other, sendevent);
     }
 
+    if (dev->spriteInfo->paired)
+        dev->spriteInfo->paired = NULL;
+
     (void) (*dev->deviceProc) (dev, DEVICE_OFF);
     dev->enabled = FALSE;
 
+    FreeSprite(dev);
+
     /* now that the device is disabled, we can reset the signal handler's
      * last.slave */
     OsBlockSignals();
@@ -492,6 +505,26 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
     return TRUE;
 }
 
+void
+DisableAllDevices(void)
+{
+    DeviceIntPtr dev, tmp;
+
+    nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
+        if (!IsMaster(dev))
+            DisableDevice(dev, FALSE);
+    }
+    /* master keyboards need to be disabled first */
+    nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
+        if (dev->enabled && IsMaster(dev) && IsKeyboardDevice(dev))
+            DisableDevice(dev, FALSE);
+    }
+    nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
+        if (dev->enabled)
+            DisableDevice(dev, FALSE);
+    }
+}
+
 /**
  * Initialise a new device through the driver and tell all clients about the
  * new device.
@@ -914,12 +947,7 @@ CloseDevice(DeviceIntPtr dev)
         free(classes);
     }
 
-    if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
-        if (dev->spriteInfo->sprite->current)
-            FreeCursor(dev->spriteInfo->sprite->current, None);
-        free(dev->spriteInfo->sprite->spriteTrace);
-        free(dev->spriteInfo->sprite);
-    }
+    FreeSprite(dev);
 
     /* a client may have the device set as client pointer */
     for (j = 0; j < currentMaxClients; j++) {
@@ -937,7 +965,8 @@ CloseDevice(DeviceIntPtr dev)
         free(dev->last.touches[j].valuators);
     free(dev->last.touches);
     dev->config_info = NULL;
-    dixFreeObjectWithPrivates(dev, PRIVATE_DEVICE);
+    dixFreePrivates(dev->devPrivates, PRIVATE_DEVICE);
+    free(dev);
 }
 
 /**
@@ -1323,13 +1352,10 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
 
 /* global list of acceleration schemes */
 ValuatorAccelerationRec pointerAccelerationScheme[] = {
-    {PtrAccelNoOp, NULL, NULL, NULL, NULL}
-    ,
+    {PtrAccelNoOp, NULL, NULL, NULL, NULL},
     {PtrAccelPredictable, acceleratePointerPredictable, NULL,
-     InitPredictableAccelerationScheme, AccelerationDefaultCleanup}
-    ,
-    {PtrAccelLightweight, acceleratePointerLightweight, NULL, NULL, NULL}
-    ,
+     InitPredictableAccelerationScheme, AccelerationDefaultCleanup},
+    {PtrAccelLightweight, acceleratePointerLightweight, NULL, NULL, NULL},
     {-1, NULL, NULL, NULL, NULL}        /* terminator */
 };
 
@@ -1366,8 +1392,7 @@ InitPointerAccelerationScheme(DeviceIntPtr dev, int scheme)
 
     if (pointerAccelerationScheme[i].AccelInitProc) {
         if (!pointerAccelerationScheme[i].AccelInitProc(dev,
-                                                        &pointerAccelerationScheme
-                                                        [i])) {
+                                            &pointerAccelerationScheme[i])) {
             return FALSE;
         }
     }
@@ -1640,9 +1665,11 @@ ProcSetModifierMapping(ClientPtr client)
                             bytes_to_int32(sizeof(xSetModifierMappingReq))))
         return BadLength;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xSetModifierMappingReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1],
                        stuff->numKeyPerModifier);
@@ -1670,15 +1697,16 @@ ProcGetModifierMapping(ClientPtr client)
     generate_modkeymap(client, PickKeyboard(client), &modkeymap,
                        &max_keys_per_mod);
 
-    memset(&rep, 0, sizeof(xGetModifierMappingReply));
-    rep.type = X_Reply;
-    rep.numKeyPerModifier = max_keys_per_mod;
-    rep.sequenceNumber = client->sequence;
+    rep = (xGetModifierMappingReply) {
+        .type = X_Reply,
+        .numKeyPerModifier = max_keys_per_mod,
+        .sequenceNumber = client->sequence,
     /* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
-    rep.length = max_keys_per_mod << 1;
+        .length = max_keys_per_mod << 1
+    };
 
     WriteReplyToClient(client, sizeof(xGetModifierMappingReply), &rep);
-    (void) WriteToClient(client, max_keys_per_mod * 8, (char *) modkeymap);
+    WriteToClient(client, max_keys_per_mod * 8, modkeymap);
 
     free(modkeymap);
 
@@ -1759,10 +1787,13 @@ ProcSetPointerMapping(ClientPtr client)
     if (client->req_len !=
         bytes_to_int32(sizeof(xSetPointerMappingReq) + stuff->nElts))
         return BadLength;
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.success = MappingSuccess;
+
+    rep = (xSetPointerMappingReply) {
+        .type = X_Reply,
+        .success = MappingSuccess,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     map = (BYTE *) &stuff[1];
 
     /* So we're bounded here by the number of core buttons.  This check
@@ -1831,12 +1862,13 @@ ProcGetKeyboardMapping(ClientPtr client)
     if (!syms)
         return BadAlloc;
 
-    memset(&rep, 0, sizeof(xGetKeyboardMappingReply));
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.keySymsPerKeyCode = syms->mapWidth;
-    /* length is a count of 4 byte quantities and KeySyms are 4 bytes */
-    rep.length = syms->mapWidth * stuff->count;
+    rep = (xGetKeyboardMappingReply) {
+        .type = X_Reply,
+        .keySymsPerKeyCode = syms->mapWidth,
+        .sequenceNumber = client->sequence,
+        /* length is a count of 4 byte quantities and KeySyms are 4 bytes */
+        .length = syms->mapWidth * stuff->count
+    };
     WriteReplyToClient(client, sizeof(xGetKeyboardMappingReply), &rep);
     client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
     WriteSwappedDataToClient(client,
@@ -1858,6 +1890,7 @@ ProcGetPointerMapping(ClientPtr client)
      * the ClientPointer could change. */
     DeviceIntPtr ptr = PickPointer(client);
     ButtonClassPtr butc = ptr->button;
+    int nElts;
     int rc;
 
     REQUEST_SIZE_MATCH(xReq);
@@ -1866,13 +1899,16 @@ ProcGetPointerMapping(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.nElts = (butc) ? butc->numButtons : 0;
-    rep.length = ((unsigned) rep.nElts + (4 - 1)) / 4;
+    nElts = (butc) ? butc->numButtons : 0;
+    rep = (xGetPointerMappingReply) {
+        .type = X_Reply,
+        .nElts = nElts,
+        .sequenceNumber = client->sequence,
+        .length = ((unsigned) nElts + (4 - 1)) / 4
+    };
     WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep);
     if (butc)
-        WriteToClient(client, (int) rep.nElts, (char *) &butc->map[1]);
+        WriteToClient(client, nElts, &butc->map[1]);
     return Success;
 }
 
@@ -2118,15 +2154,17 @@ ProcGetKeyboardControl(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.length = 5;
-    rep.sequenceNumber = client->sequence;
-    rep.globalAutoRepeat = ctrl->autoRepeat;
-    rep.keyClickPercent = ctrl->click;
-    rep.bellPercent = ctrl->bell;
-    rep.bellPitch = ctrl->bell_pitch;
-    rep.bellDuration = ctrl->bell_duration;
-    rep.ledMask = ctrl->leds;
+    rep = (xGetKeyboardControlReply) {
+        .type = X_Reply,
+        .globalAutoRepeat = ctrl->autoRepeat,
+        .sequenceNumber = client->sequence,
+        .length = 5,
+        .ledMask = ctrl->leds,
+        .keyClickPercent = ctrl->click,
+        .bellPercent = ctrl->bell,
+        .bellPitch = ctrl->bell_pitch,
+        .bellDuration = ctrl->bell_duration
+    };
     for (i = 0; i < 32; i++)
         rep.map[i] = ctrl->autoRepeats[i];
     WriteReplyToClient(client, sizeof(xGetKeyboardControlReply), &rep);
@@ -2261,12 +2299,14 @@ ProcGetPointerControl(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.threshold = ctrl->threshold;
-    rep.accelNumerator = ctrl->num;
-    rep.accelDenominator = ctrl->den;
+    rep = (xGetPointerControlReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .accelNumerator = ctrl->num,
+        .accelDenominator = ctrl->den,
+        .threshold = ctrl->threshold
+    };
     WriteReplyToClient(client, sizeof(xGenericReply), &rep);
     return Success;
 }
@@ -2310,8 +2350,10 @@ ProcGetMotionEvents(ClientPtr client)
 
     if (mouse->valuator->motionHintWindow)
         MaybeStopHint(mouse, client);
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
+    rep = (xGetMotionEventsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence
+    };
     nEvents = 0;
     start = ClientTimeToServerTime(stuff->start);
     stop = ClientTimeToServerTime(stuff->stop);
@@ -2359,20 +2401,23 @@ ProcQueryKeymap(ClientPtr client)
     CARD8 *down = keybd->key->down;
 
     REQUEST_SIZE_MATCH(xReq);
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 2;
+    rep = (xQueryKeymapReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 2
+    };
 
     rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess);
-    if (rc != Success && rc != BadAccess)
+    /* If rc is Success, we're allowed to copy out the keymap.
+     * If it's BadAccess, we leave it empty & lie to the client.
+     */
+    if (rc == Success) {
+        for (i = 0; i < 32; i++)
+            rep.map[i] = down[i];
+    }
+    else if (rc != BadAccess)
         return rc;
 
-    for (i = 0; i < 32; i++)
-        rep.map[i] = down[i];
-
-    if (rc == BadAccess)
-        memset(rep.map, 0, 32);
-
     WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep);
 
     return Success;
@@ -2406,18 +2451,17 @@ RecalculateMasterButtons(DeviceIntPtr slave)
 
     if (master->button && master->button->numButtons != maxbuttons) {
         int i;
-        DeviceChangedEvent event;
-
-        memset(&event, 0, sizeof(event));
+        DeviceChangedEvent event = {
+            .header = ET_Internal,
+            .type = ET_DeviceChanged,
+            .time = GetTimeInMillis(),
+            .deviceid = master->id,
+            .flags = DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE,
+            .buttons.num_buttons = maxbuttons
+        };
 
         master->button->numButtons = maxbuttons;
 
-        event.header = ET_Internal;
-        event.type = ET_DeviceChanged;
-        event.time = GetTimeInMillis();
-        event.deviceid = master->id;
-        event.flags = DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE;
-        event.buttons.num_buttons = maxbuttons;
         memcpy(&event.buttons.names, master->button->labels, maxbuttons *
                sizeof(Atom));
 
@@ -2630,6 +2674,8 @@ AllocDevicePair(ClientPtr client, const char *name,
 
     *ptr = *keybd = NULL;
 
+    XkbInitPrivates();
+
     pointer = AddInputDevice(client, ptr_proc, TRUE);
 
     if (!pointer)
index d971805..3c6a591 100644 (file)
@@ -466,8 +466,6 @@ Dispatch(void)
 static int VendorRelease = VENDOR_RELEASE;
 static char *VendorString = VENDOR_NAME;
 
-static const int padlength[4] = { 0, 3, 2, 1 };
-
 void
 SetVendorRelease(int release)
 {
@@ -528,7 +526,7 @@ CreateConnectionBlock(void)
     memmove(pBuf, VendorString, (int) setup.nbytesVendor);
     sizesofar += setup.nbytesVendor;
     pBuf += setup.nbytesVendor;
-    i = padlength[setup.nbytesVendor & 3];
+    i = padding_for_int32(setup.nbytesVendor);
     sizesofar += i;
     while (--i >= 0)
         *pBuf++ = 0;
@@ -926,10 +924,9 @@ GetGeometry(ClientPtr client, xGetGeometryReply * rep)
 int
 ProcGetGeometry(ClientPtr client)
 {
-    xGetGeometryReply rep;
+    xGetGeometryReply rep = { .type = X_Reply };
     int status;
 
-    memset(&rep, 0, sizeof(xGetGeometryReply));
     if ((status = GetGeometry(client, &rep)) != Success)
         return status;
 
@@ -951,14 +948,13 @@ ProcQueryTree(ClientPtr client)
     rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess);
     if (rc != Success)
         return rc;
-    memset(&reply, 0, sizeof(xQueryTreeReply));
-    reply.type = X_Reply;
-    reply.root = pWin->drawable.pScreen->root->drawable.id;
-    reply.sequenceNumber = client->sequence;
-    if (pWin->parent)
-        reply.parent = pWin->parent->drawable.id;
-    else
-        reply.parent = (Window) None;
+
+    reply = (xQueryTreeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .root = pWin->drawable.pScreen->root->drawable.id,
+        .parent = (pWin->parent) ? pWin->parent->drawable.id : (Window) None
+    };
     pHead = RealChildHead(pWin);
     for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
         numChildren++;
@@ -1003,13 +999,12 @@ ProcInternAtom(ClientPtr client)
     tchar = (char *) &stuff[1];
     atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists);
     if (atom != BAD_RESOURCE) {
-        xInternAtomReply reply;
-
-        memset(&reply, 0, sizeof(xInternAtomReply));
-        reply.type = X_Reply;
-        reply.length = 0;
-        reply.sequenceNumber = client->sequence;
-        reply.atom = atom;
+        xInternAtomReply reply = {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = 0,
+            .atom = atom
+        };
         WriteReplyToClient(client, sizeof(xInternAtomReply), &reply);
         return Success;
     }
@@ -1021,21 +1016,21 @@ int
 ProcGetAtomName(ClientPtr client)
 {
     const char *str;
-    xGetAtomNameReply reply;
-    int len;
 
     REQUEST(xResourceReq);
 
     REQUEST_SIZE_MATCH(xResourceReq);
     if ((str = NameForAtom(stuff->id))) {
-        len = strlen(str);
-        memset(&reply, 0, sizeof(xGetAtomNameReply));
-        reply.type = X_Reply;
-        reply.length = bytes_to_int32(len);
-        reply.sequenceNumber = client->sequence;
-        reply.nameLength = len;
+        int len = strlen(str);
+        xGetAtomNameReply reply = {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = bytes_to_int32(len),
+            .nameLength = len
+        };
+
         WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply);
-        (void) WriteToClient(client, len, str);
+        WriteToClient(client, len, str);
         return Success;
     }
     else {
@@ -1123,10 +1118,12 @@ ProcTranslateCoords(ClientPtr client)
     rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixGetAttrAccess);
     if (rc != Success)
         return rc;
-    memset(&rep, 0, sizeof(xTranslateCoordsReply));
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+
+    rep = (xTranslateCoordsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     if (!SAME_SCREENS(pWin->drawable, pDst->drawable)) {
         rep.sameScreen = xFalse;
         rep.child = None;
@@ -1288,17 +1285,19 @@ ProcQueryTextExtents(ClientPtr client)
     }
     if (!QueryTextExtents(pFont, length, (unsigned char *) &stuff[1], &info))
         return BadAlloc;
-    reply.type = X_Reply;
-    reply.length = 0;
-    reply.sequenceNumber = client->sequence;
-    reply.drawDirection = info.drawDirection;
-    reply.fontAscent = info.fontAscent;
-    reply.fontDescent = info.fontDescent;
-    reply.overallAscent = info.overallAscent;
-    reply.overallDescent = info.overallDescent;
-    reply.overallWidth = info.overallWidth;
-    reply.overallLeft = info.overallLeft;
-    reply.overallRight = info.overallRight;
+    reply = (xQueryTextExtentsReply) {
+        .type = X_Reply,
+        .drawDirection = info.drawDirection,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .fontAscent = info.fontAscent,
+        .fontDescent = info.fontDescent,
+        .overallAscent = info.overallAscent,
+        .overallDescent = info.overallDescent,
+        .overallWidth = info.overallWidth,
+        .overallLeft = info.overallLeft,
+        .overallRight = info.overallRight
+    };
     WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply);
     return Success;
 }
@@ -2143,8 +2142,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
                               BitsPerPixel(pDraw->depth), ClientOrder(client));
 
 /* Don't split me, gcc pukes when you do */
-                (void) WriteToClient(client,
-                                     (int) (nlines * widthBytesLine), pBuf);
+                WriteToClient(client, (int) (nlines * widthBytesLine), pBuf);
             }
             linesDone += nlines;
         }
@@ -2179,9 +2177,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
                                       1, ClientOrder(client));
 
 /* Don't split me, gcc pukes when you do */
-                        (void) WriteToClient(client,
-                                             (int) (nlines * widthBytesLine),
-                                             pBuf);
+                        WriteToClient(client, (int) (nlines * widthBytesLine),
+                                     pBuf);
                     }
                     linesDone += nlines;
                 }
@@ -2468,7 +2465,6 @@ ProcAllocColor(ClientPtr client)
 {
     ColormapPtr pmap;
     int rc;
-    xAllocColorReply acr;
 
     REQUEST(xAllocColorReq);
 
@@ -2476,13 +2472,15 @@ ProcAllocColor(ClientPtr client)
     rc = dixLookupResourceByType((pointer *) &pmap, stuff->cmap, RT_COLORMAP,
                                  client, DixAddAccess);
     if (rc == Success) {
-        acr.type = X_Reply;
-        acr.length = 0;
-        acr.sequenceNumber = client->sequence;
-        acr.red = stuff->red;
-        acr.green = stuff->green;
-        acr.blue = stuff->blue;
-        acr.pixel = 0;
+        xAllocColorReply acr = {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = 0,
+            .red = stuff->red,
+            .green = stuff->green,
+            .blue = stuff->blue,
+            .pixel = 0
+        };
         if ((rc = AllocColor(pmap, &acr.red, &acr.green, &acr.blue,
                              &acr.pixel, client->index)))
             return rc;
@@ -2511,12 +2509,11 @@ ProcAllocNamedColor(ClientPtr client)
     rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
                                  client, DixAddAccess);
     if (rc == Success) {
-        xAllocNamedColorReply ancr;
-
-        ancr.type = X_Reply;
-        ancr.length = 0;
-        ancr.sequenceNumber = client->sequence;
-
+        xAllocNamedColorReply ancr = {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = 0
+        };
         if (OsLookupColor
             (pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes,
              &ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) {
@@ -2557,7 +2554,6 @@ ProcAllocColorCells(ClientPtr client)
     rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
                                  client, DixAddAccess);
     if (rc == Success) {
-        xAllocColorCellsReply accr;
         int npixels, nmasks;
         long length;
         Pixel *ppixels, *pmasks;
@@ -2587,11 +2583,13 @@ ProcAllocColorCells(ClientPtr client)
         if (noPanoramiXExtension || !pcmp->pScreen->myNum)
 #endif
         {
-            accr.type = X_Reply;
-            accr.length = bytes_to_int32(length);
-            accr.sequenceNumber = client->sequence;
-            accr.nPixels = npixels;
-            accr.nMasks = nmasks;
+            xAllocColorCellsReply accr = {
+                .type = X_Reply,
+                .sequenceNumber = client->sequence,
+                .length = bytes_to_int32(length),
+                .nPixels = npixels,
+                .nMasks = nmasks
+            };
             WriteReplyToClient(client, sizeof(xAllocColorCellsReply), &accr);
             client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
             WriteSwappedDataToClient(client, length, ppixels);
@@ -2631,9 +2629,11 @@ ProcAllocColorPlanes(ClientPtr client)
             client->errorValue = stuff->contiguous;
             return BadValue;
         }
-        acpr.type = X_Reply;
-        acpr.sequenceNumber = client->sequence;
-        acpr.nPixels = npixels;
+        acpr = (xAllocColorPlanesReply) {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .nPixels = npixels
+        };
         length = (long) npixels *sizeof(Pixel);
 
         ppixels = malloc(length);
@@ -2771,11 +2771,12 @@ ProcQueryColors(ClientPtr client)
             free(prgbs);
             return rc;
         }
-        memset(&qcr, 0, sizeof(xQueryColorsReply));
-        qcr.type = X_Reply;
-        qcr.length = bytes_to_int32(count * sizeof(xrgb));
-        qcr.sequenceNumber = client->sequence;
-        qcr.nColors = count;
+        qcr = (xQueryColorsReply) {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = bytes_to_int32(count * sizeof(xrgb)),
+            .nColors = count
+        };
         WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr);
         if (count) {
             client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend;
@@ -2803,17 +2804,22 @@ ProcLookupColor(ClientPtr client)
     rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
                                  client, DixReadAccess);
     if (rc == Success) {
-        xLookupColorReply lcr;
+        CARD16 exactRed, exactGreen, exactBlue;
 
         if (OsLookupColor
             (pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes,
-             &lcr.exactRed, &lcr.exactGreen, &lcr.exactBlue)) {
-            lcr.type = X_Reply;
-            lcr.length = 0;
-            lcr.sequenceNumber = client->sequence;
-            lcr.screenRed = lcr.exactRed;
-            lcr.screenGreen = lcr.exactGreen;
-            lcr.screenBlue = lcr.exactBlue;
+             &exactRed, &exactGreen, &exactBlue)) {
+            xLookupColorReply lcr = {
+                .type = X_Reply,
+                .sequenceNumber = client->sequence,
+                .length = 0,
+                .exactRed = exactRed,
+                .exactGreen = exactGreen,
+                .exactBlue = exactBlue,
+                .screenRed = exactRed,
+                .screenGreen = exactGreen,
+                .screenBlue = exactBlue
+            };
             (*pcmp->pScreen->ResolveColor) (&lcr.screenRed,
                                             &lcr.screenGreen,
                                             &lcr.screenBlue, pcmp->pVisual);
@@ -2993,12 +2999,13 @@ ProcQueryBestSize(ClientPtr client)
         return rc;
     (*pScreen->QueryBestSize) (stuff->class, &stuff->width,
                                &stuff->height, pScreen);
-    memset(&reply, 0, sizeof(xQueryBestSizeReply));
-    reply.type = X_Reply;
-    reply.length = 0;
-    reply.sequenceNumber = client->sequence;
-    reply.width = stuff->width;
-    reply.height = stuff->height;
+    reply = (xQueryBestSizeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .width = stuff->width,
+        .height = stuff->height
+    };
     WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply);
     return Success;
 }
@@ -3078,13 +3085,15 @@ ProcGetScreenSaver(ClientPtr client)
             return rc;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.timeout = ScreenSaverTime / MILLI_PER_SECOND;
-    rep.interval = ScreenSaverInterval / MILLI_PER_SECOND;
-    rep.preferBlanking = ScreenSaverBlanking;
-    rep.allowExposures = ScreenSaverAllowExposures;
+    rep = (xGetScreenSaverReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .timeout = ScreenSaverTime / MILLI_PER_SECOND,
+        .interval = ScreenSaverInterval / MILLI_PER_SECOND,
+        .preferBlanking = ScreenSaverBlanking,
+        .allowExposures = ScreenSaverAllowExposures
+    };
     WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep);
     return Success;
 }
@@ -3111,6 +3120,7 @@ ProcListHosts(ClientPtr client)
 {
     xListHostsReply reply;
     int len, nHosts, result;
+    BOOL enabled;
     pointer pdata;
 
     /* REQUEST(xListHostsReq); */
@@ -3122,13 +3132,17 @@ ProcListHosts(ClientPtr client)
     if (result != Success)
         return result;
 
-    result = GetHosts(&pdata, &nHosts, &len, &reply.enabled);
+    result = GetHosts(&pdata, &nHosts, &len, &enabled);
     if (result != Success)
         return result;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.nHosts = nHosts;
-    reply.length = bytes_to_int32(len);
+
+    reply = (xListHostsReply) {
+        .type = X_Reply,
+        .enabled = enabled,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(len),
+        .nHosts = nHosts
+    };
     WriteReplyToClient(client, sizeof(xListHostsReply), &reply);
     if (nHosts) {
         client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend;
@@ -3243,15 +3257,16 @@ ProcGetFontPath(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = bytes_to_int32(stringLens + numpaths);
-    reply.nPaths = numpaths;
+    reply = (xGetFontPathReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(stringLens + numpaths),
+        .nPaths = numpaths
+    };
 
     WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply);
     if (stringLens || numpaths)
-        (void) WriteToClient(client, stringLens + numpaths,
-                             (char *) bufferStart);
+        WriteToClient(client, stringLens + numpaths, bufferStart);
     return Success;
 }
 
@@ -3523,8 +3538,8 @@ SendConnSetup(ClientPtr client, const char *reason)
         if (client->swapped)
             WriteSConnSetupPrefix(client, &csp);
         else
-            (void) WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp);
-        (void) WriteToClient(client, (int) csp.lengthReason, reason);
+            WriteToClient(client, sz_xConnSetupPrefix, &csp);
+        WriteToClient(client, (int) csp.lengthReason, reason);
         return client->noClientException = -1;
     }
 
@@ -3577,10 +3592,9 @@ SendConnSetup(ClientPtr client, const char *reason)
                              lConnectionInfo);
     }
     else {
-        (void) WriteToClient(client, sizeof(xConnSetupPrefix),
-                             (char *) lconnSetupPrefix);
-        (void) WriteToClient(client, (int) (lconnSetupPrefix->length << 2),
-                             lConnectionInfo);
+        WriteToClient(client, sizeof(xConnSetupPrefix), lconnSetupPrefix);
+        WriteToClient(client, (int) (lconnSetupPrefix->length << 2),
+                     lConnectionInfo);
     }
     client->clientState = ClientStateRunning;
     if (ClientStateCallback) {
@@ -3623,14 +3637,13 @@ void
 SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode,
                   XID resId, int errorCode)
 {
-    xError rep;
-
-    memset(&rep, 0, sizeof(xError));
-    rep.type = X_Error;
-    rep.errorCode = errorCode;
-    rep.majorCode = majorCode;
-    rep.minorCode = minorCode;
-    rep.resourceID = resId;
+    xError rep = {
+        .type = X_Error,
+        .errorCode = errorCode,
+        .resourceID = resId,
+        .minorCode = minorCode,
+        .majorCode = majorCode
+    };
 
     WriteEventsToClient(client, 1, (xEvent *) &rep);
 }
@@ -3724,35 +3737,29 @@ with its screen number, a pointer to its ScreenRec, argc, and argv.
 
 */
 
-int
-AddScreen(Bool (*pfnInit) (int /*index */ ,
-                           ScreenPtr /*pScreen */ ,
-                           int /*argc */ ,
-                           char **      /*argv */
-          ), int argc, char **argv)
+static int init_screen(ScreenPtr pScreen, int i, Bool gpu)
 {
-
-    int i;
     int scanlinepad, format, depth, bitsPerPixel, j, k;
-    ScreenPtr pScreen;
-
-    i = screenInfo.numScreens;
-    if (i == MAXSCREENS)
-        return -1;
 
-    pScreen = (ScreenPtr) calloc(1, sizeof(ScreenRec));
-    if (!pScreen)
-        return -1;
+    dixInitScreenSpecificPrivates(pScreen);
 
     if (!dixAllocatePrivates(&pScreen->devPrivates, PRIVATE_SCREEN)) {
-        free(pScreen);
         return -1;
     }
     pScreen->myNum = i;
+    if (gpu) {
+        pScreen->myNum += GPU_SCREEN_OFFSET;
+        pScreen->isGPU = TRUE;
+    }
     pScreen->totalPixmapSize = 0;       /* computed in CreateScratchPixmapForScreen */
     pScreen->ClipNotify = 0;    /* for R4 ddx compatibility */
     pScreen->CreateScreenResources = 0;
 
+    xorg_list_init(&pScreen->pixmap_dirty_list);
+    xorg_list_init(&pScreen->unattached_list);
+    xorg_list_init(&pScreen->output_slave_list);
+    xorg_list_init(&pScreen->offload_slave_list);
+
     /*
      * This loop gets run once for every Screen that gets added,
      * but thats ok.  If the ddx layer initializes the formats
@@ -3783,7 +3790,33 @@ AddScreen(Bool (*pfnInit) (int /*index */ ,
             PixmapWidthPaddingInfo[depth].notPower2 = 0;
         }
     }
+    return 0;
+}
 
+int
+AddScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ ,
+                           int /*argc */ ,
+                           char **      /*argv */
+          ), int argc, char **argv)
+{
+
+    int i;
+    ScreenPtr pScreen;
+    Bool ret;
+
+    i = screenInfo.numScreens;
+    if (i == MAXSCREENS)
+        return -1;
+
+    pScreen = (ScreenPtr) calloc(1, sizeof(ScreenRec));
+    if (!pScreen)
+        return -1;
+
+    ret = init_screen(pScreen, i, FALSE);
+    if (ret != 0) {
+        free(pScreen);
+        return ret;
+    }
     /* This is where screen specific stuff gets initialized.  Load the
        screen structure, call the hardware, whatever.
        This is also where the default colormap should be allocated and
@@ -3794,7 +3827,8 @@ AddScreen(Bool (*pfnInit) (int /*index */ ,
      */
     screenInfo.screens[i] = pScreen;
     screenInfo.numScreens++;
-    if (!(*pfnInit) (i, pScreen, argc, argv)) {
+    if (!(*pfnInit) (pScreen, argc, argv)) {
+        dixFreeScreenSpecificPrivates(pScreen);
         dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN);
         free(pScreen);
         screenInfo.numScreens--;
@@ -3808,3 +3842,120 @@ AddScreen(Bool (*pfnInit) (int /*index */ ,
 
     return i;
 }
+
+int
+AddGPUScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ ,
+                              int /*argc */ ,
+                              char **      /*argv */
+                              ),
+             int argc, char **argv)
+{
+    int i;
+    ScreenPtr pScreen;
+    Bool ret;
+
+    i = screenInfo.numGPUScreens;
+    if (i == MAXGPUSCREENS)
+        return -1;
+
+    pScreen = (ScreenPtr) calloc(1, sizeof(ScreenRec));
+    if (!pScreen)
+        return -1;
+
+    ret = init_screen(pScreen, i, TRUE);
+    if (ret != 0) {
+        free(pScreen);
+        return ret;
+    }
+
+    /* This is where screen specific stuff gets initialized.  Load the
+       screen structure, call the hardware, whatever.
+       This is also where the default colormap should be allocated and
+       also pixel values for blackPixel, whitePixel, and the cursor
+       Note that InitScreen is NOT allowed to modify argc, argv, or
+       any of the strings pointed to by argv.  They may be passed to
+       multiple screens.
+     */
+    screenInfo.gpuscreens[i] = pScreen;
+    screenInfo.numGPUScreens++;
+    if (!(*pfnInit) (pScreen, argc, argv)) {
+        dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN);
+        free(pScreen);
+        screenInfo.numGPUScreens--;
+        return -1;
+    }
+
+    update_desktop_dimensions();
+
+    return i;
+}
+
+void
+RemoveGPUScreen(ScreenPtr pScreen)
+{
+    int idx, j;
+    if (!pScreen->isGPU)
+        return;
+
+    idx = pScreen->myNum - GPU_SCREEN_OFFSET;
+    for (j = idx; j < screenInfo.numGPUScreens - 1; j++) {
+        screenInfo.gpuscreens[j] = screenInfo.gpuscreens[j + 1];
+        screenInfo.gpuscreens[j]->myNum = j + GPU_SCREEN_OFFSET;
+    }
+    screenInfo.numGPUScreens--;
+
+    free(pScreen);
+
+}
+
+void
+AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new)
+{
+    assert(new->isGPU);
+    assert(!new->current_master);
+    xorg_list_add(&new->unattached_head, &pScreen->unattached_list);
+    new->current_master = pScreen;
+}
+
+void
+DetachUnboundGPU(ScreenPtr slave)
+{
+    assert(slave->isGPU);
+    xorg_list_del(&slave->unattached_head);
+    slave->current_master = NULL;
+}
+
+void
+AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new)
+{
+    assert(new->isGPU);
+    assert(!new->current_master);
+    xorg_list_add(&new->output_head, &pScreen->output_slave_list);
+    new->current_master = pScreen;
+}
+
+void
+DetachOutputGPU(ScreenPtr slave)
+{
+    assert(slave->isGPU);
+    xorg_list_del(&slave->output_head);
+    slave->current_master = NULL;
+}
+
+void
+AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new)
+{
+    assert(new->isGPU);
+    assert(!new->current_master);
+    xorg_list_add(&new->offload_head, &pScreen->offload_slave_list);
+    new->current_master = pScreen;
+}
+
+void
+DetachOffloadGPU(ScreenPtr slave)
+{
+    assert(slave->isGPU);
+    xorg_list_del(&slave->offload_head);
+    slave->current_master = NULL;
+}
+
index 19fd31e..ad21860 100644 (file)
@@ -115,6 +115,15 @@ LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size,
         return Successful;
 }
 
+void
+dixGetGlyphs(FontPtr font, unsigned long count, unsigned char *chars,
+             FontEncoding fontEncoding,
+             unsigned long *glyphcount,    /* RETURN */
+             CharInfoPtr *glyphs)          /* RETURN */
+{
+    (*font->get_glyphs) (font, count, chars, fontEncoding, glyphcount, glyphs);
+}
+
 /*
  * adding RT_FONT prevents conflict with default cursor font
  */
@@ -744,11 +753,12 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
     for (i = 0; i < nnames; i++)
         stringLens += (names->length[i] <= 255) ? names->length[i] : 0;
 
-    memset(&reply, 0, sizeof(xListFontsReply));
-    reply.type = X_Reply;
-    reply.length = bytes_to_int32(stringLens + nnames);
-    reply.nFonts = nnames;
-    reply.sequenceNumber = client->sequence;
+    reply = (xListFontsReply) {
+        .type = X_Reply,
+        .length = bytes_to_int32(stringLens + nnames),
+        .nFonts = nnames,
+        .sequenceNumber = client->sequence
+    };
 
     bufptr = bufferStart = malloc(reply.length << 2);
 
@@ -773,7 +783,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
     reply.length = bytes_to_int32(stringLens + nnames);
     client->pSwapReplyFunc = ReplySwapVector[X_ListFonts];
     WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply);
-    (void) WriteToClient(client, stringLens + nnames, bufferStart);
+    WriteToClient(client, stringLens + nnames, bufferStart);
     free(bufferStart);
 
  bail:
@@ -1011,7 +1021,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
                 pFP++;
             }
             WriteSwappedDataToClient(client, length, reply);
-            (void) WriteToClient(client, namelen, name);
+            WriteToClient(client, namelen, name);
             if (pFontInfo == &fontInfo) {
                 free(fontInfo.props);
                 free(fontInfo.isStringProp);
@@ -1021,11 +1031,12 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
     }
  finish:
     length = sizeof(xListFontsWithInfoReply);
-    memset((char *) &finalReply, 0, sizeof(xListFontsWithInfoReply));
-    finalReply.type = X_Reply;
-    finalReply.sequenceNumber = client->sequence;
-    finalReply.length = bytes_to_int32(sizeof(xListFontsWithInfoReply)
-                                       - sizeof(xGenericReply));
+    finalReply = (xListFontsWithInfoReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(sizeof(xListFontsWithInfoReply)
+                                 - sizeof(xGenericReply))
+    };
     WriteSwappedDataToClient(client, length, &finalReply);
  bail:
     ClientWakeup(client);
index 9eb5489..3f24629 100644 (file)
@@ -384,9 +384,11 @@ BlockHandler(pointer pTimeout, pointer pReadmask)
 
     ++inHandler;
     for (i = 0; i < screenInfo.numScreens; i++)
-        (*screenInfo.screens[i]->BlockHandler) (i,
-                                                screenInfo.screens[i]->
-                                                blockData, pTimeout, pReadmask);
+        (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i],
+                                                pTimeout, pReadmask);
+    for (i = 0; i < screenInfo.numGPUScreens; i++)
+        (*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i],
+                                                   pTimeout, pReadmask);
     for (i = 0; i < numHandlers; i++)
         if (!handlers[i].deleted)
             (*handlers[i].BlockHandler) (handlers[i].blockData,
@@ -421,9 +423,11 @@ WakeupHandler(int result, pointer pReadmask)
             (*handlers[i].WakeupHandler) (handlers[i].blockData,
                                           result, pReadmask);
     for (i = 0; i < screenInfo.numScreens; i++)
-        (*screenInfo.screens[i]->WakeupHandler) (i,
-                                                 screenInfo.screens[i]->
-                                                 wakeupData, result, pReadmask);
+        (*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i],
+                                                 result, pReadmask);
+    for (i = 0; i < screenInfo.numGPUScreens; i++)
+        (*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i],
+                                                    result, pReadmask);
     if (handlerDeleted) {
         for (i = 0; i < numHandlers;)
             if (handlers[i].deleted) {
index 725080a..431566f 100644 (file)
 
 #include <X11/X.h>
 #include <X11/extensions/XI2.h>
+#include <X11/extensions/XIproto.h>
+#include <X11/extensions/XI2proto.h>
 #include "inputstr.h"
 #include "windowstr.h"
 #include "scrnintstr.h"
 #include "exglobals.h"
 #include "enterleave.h"
+#include "eventconvert.h"
+#include "xkbsrv.h"
 
 /**
  * @file
@@ -602,6 +606,243 @@ DoEnterLeaveEvents(DeviceIntPtr pDev,
     DeviceEnterLeaveEvents(pDev, sourceid, fromWin, toWin, mode);
 }
 
+static void
+FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v,
+                  int first)
+{
+    int nval = v->numAxes - first;
+
+    ev->type = DeviceValuator;
+    ev->deviceid = dev->id;
+    ev->num_valuators = nval < 3 ? nval : 3;
+    ev->first_valuator = first;
+    switch (ev->num_valuators) {
+    case 3:
+        ev->valuator2 = v->axisVal[first + 2];
+    case 2:
+        ev->valuator1 = v->axisVal[first + 1];
+    case 1:
+        ev->valuator0 = v->axisVal[first];
+        break;
+    }
+    first += ev->num_valuators;
+}
+
+static void
+FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k,
+                     ButtonClassPtr b, ValuatorClassPtr v, int first)
+{
+    ev->type = DeviceStateNotify;
+    ev->deviceid = dev->id;
+    ev->time = currentTime.milliseconds;
+    ev->classes_reported = 0;
+    ev->num_keys = 0;
+    ev->num_buttons = 0;
+    ev->num_valuators = 0;
+
+    if (b) {
+        ev->classes_reported |= (1 << ButtonClass);
+        ev->num_buttons = b->numButtons;
+        memcpy((char *) ev->buttons, (char *) b->down, 4);
+    }
+    else if (k) {
+        ev->classes_reported |= (1 << KeyClass);
+        ev->num_keys = k->xkbInfo->desc->max_key_code -
+            k->xkbInfo->desc->min_key_code;
+        memmove((char *) &ev->keys[0], (char *) k->down, 4);
+    }
+    if (v) {
+        int nval = v->numAxes - first;
+
+        ev->classes_reported |= (1 << ValuatorClass);
+        ev->classes_reported |= valuator_get_mode(dev, 0) << ModeBitsShift;
+        ev->num_valuators = nval < 3 ? nval : 3;
+        switch (ev->num_valuators) {
+        case 3:
+            ev->valuator2 = v->axisVal[first + 2];
+        case 2:
+            ev->valuator1 = v->axisVal[first + 1];
+        case 1:
+            ev->valuator0 = v->axisVal[first];
+            break;
+        }
+    }
+}
+
+
+static void
+DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win)
+{
+    int evcount = 1;
+    deviceStateNotify *ev, *sev;
+    deviceKeyStateNotify *kev;
+    deviceButtonStateNotify *bev;
+
+    KeyClassPtr k;
+    ButtonClassPtr b;
+    ValuatorClassPtr v;
+    int nval = 0, nkeys = 0, nbuttons = 0, first = 0;
+
+    if (!(wOtherInputMasks(win)) ||
+        !(wOtherInputMasks(win)->inputEvents[dev->id] & DeviceStateNotifyMask))
+        return;
+
+    if ((b = dev->button) != NULL) {
+        nbuttons = b->numButtons;
+        if (nbuttons > 32)
+            evcount++;
+    }
+    if ((k = dev->key) != NULL) {
+        nkeys = k->xkbInfo->desc->max_key_code - k->xkbInfo->desc->min_key_code;
+        if (nkeys > 32)
+            evcount++;
+        if (nbuttons > 0) {
+            evcount++;
+        }
+    }
+    if ((v = dev->valuator) != NULL) {
+        nval = v->numAxes;
+
+        if (nval > 3)
+            evcount++;
+        if (nval > 6) {
+            if (!(k && b))
+                evcount++;
+            if (nval > 9)
+                evcount += ((nval - 7) / 3);
+        }
+    }
+
+    sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent));
+    FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first);
+
+    if (b != NULL) {
+        FixDeviceStateNotify(dev, ev++, NULL, b, v, first);
+        first += 3;
+        nval -= 3;
+        if (nbuttons > 32) {
+            (ev - 1)->deviceid |= MORE_EVENTS;
+            bev = (deviceButtonStateNotify *) ev++;
+            bev->type = DeviceButtonStateNotify;
+            bev->deviceid = dev->id;
+            memcpy((char *) &bev->buttons[4], (char *) &b->down[4],
+                   DOWN_LENGTH - 4);
+        }
+        if (nval > 0) {
+            (ev - 1)->deviceid |= MORE_EVENTS;
+            FixDeviceValuator(dev, (deviceValuator *) ev++, v, first);
+            first += 3;
+            nval -= 3;
+        }
+    }
+
+    if (k != NULL) {
+        FixDeviceStateNotify(dev, ev++, k, NULL, v, first);
+        first += 3;
+        nval -= 3;
+        if (nkeys > 32) {
+            (ev - 1)->deviceid |= MORE_EVENTS;
+            kev = (deviceKeyStateNotify *) ev++;
+            kev->type = DeviceKeyStateNotify;
+            kev->deviceid = dev->id;
+            memmove((char *) &kev->keys[0], (char *) &k->down[4], 28);
+        }
+        if (nval > 0) {
+            (ev - 1)->deviceid |= MORE_EVENTS;
+            FixDeviceValuator(dev, (deviceValuator *) ev++, v, first);
+            first += 3;
+            nval -= 3;
+        }
+    }
+
+    while (nval > 0) {
+        FixDeviceStateNotify(dev, ev++, NULL, NULL, v, first);
+        first += 3;
+        nval -= 3;
+        if (nval > 0) {
+            (ev - 1)->deviceid |= MORE_EVENTS;
+            FixDeviceValuator(dev, (deviceValuator *) ev++, v, first);
+            first += 3;
+            nval -= 3;
+        }
+    }
+
+    DeliverEventsToWindow(dev, win, (xEvent *) sev, evcount,
+                          DeviceStateNotifyMask, NullGrab);
+    free(sev);
+}
+
+void
+DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
+                 WindowPtr pWin)
+{
+    deviceFocus event;
+    xXIFocusInEvent *xi2event;
+    DeviceIntPtr mouse;
+    int btlen, len, i;
+
+    mouse = IsFloating(dev) ? dev : GetMaster(dev, MASTER_POINTER);
+
+    /* XI 2 event */
+    btlen = (mouse->button) ? bits_to_bytes(mouse->button->numButtons) : 0;
+    btlen = bytes_to_int32(btlen);
+    len = sizeof(xXIFocusInEvent) + btlen * 4;
+
+    xi2event = calloc(1, len);
+    xi2event->type = GenericEvent;
+    xi2event->extension = IReqCode;
+    xi2event->evtype = type;
+    xi2event->length = bytes_to_int32(len - sizeof(xEvent));
+    xi2event->buttons_len = btlen;
+    xi2event->detail = detail;
+    xi2event->time = currentTime.milliseconds;
+    xi2event->deviceid = dev->id;
+    xi2event->sourceid = dev->id;       /* a device doesn't change focus by itself */
+    xi2event->mode = mode;
+    xi2event->root_x = FP1616(mouse->spriteInfo->sprite->hot.x, 0);
+    xi2event->root_y = FP1616(mouse->spriteInfo->sprite->hot.y, 0);
+
+    for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++)
+        if (BitIsOn(mouse->button->down, i))
+            SetBit(&xi2event[1], mouse->button->map[i]);
+
+    if (dev->key) {
+        xi2event->mods.base_mods = dev->key->xkbInfo->state.base_mods;
+        xi2event->mods.latched_mods = dev->key->xkbInfo->state.latched_mods;
+        xi2event->mods.locked_mods = dev->key->xkbInfo->state.locked_mods;
+        xi2event->mods.effective_mods = dev->key->xkbInfo->state.mods;
+
+        xi2event->group.base_group = dev->key->xkbInfo->state.base_group;
+        xi2event->group.latched_group = dev->key->xkbInfo->state.latched_group;
+        xi2event->group.locked_group = dev->key->xkbInfo->state.locked_group;
+        xi2event->group.effective_group = dev->key->xkbInfo->state.group;
+    }
+
+    FixUpEventFromWindow(dev->spriteInfo->sprite, (xEvent *) xi2event, pWin,
+                         None, FALSE);
+
+    DeliverEventsToWindow(dev, pWin, (xEvent *) xi2event, 1,
+                          GetEventFilter(dev, (xEvent *) xi2event), NullGrab);
+
+    free(xi2event);
+
+    /* XI 1.x event */
+    event = (deviceFocus) {
+        .deviceid = dev->id,
+        .mode = mode,
+        .type = (type == XI_FocusIn) ? DeviceFocusIn : DeviceFocusOut,
+        .detail = detail,
+        .window = pWin->drawable.id,
+        .time = currentTime.milliseconds
+    };
+
+    DeliverEventsToWindow(dev, pWin, (xEvent *) &event, 1,
+                          DeviceFocusChangeMask, NullGrab);
+
+    if (event.type == DeviceFocusIn)
+        DeliverStateNotifyEvent(dev, pWin);
+}
+
 /**
  * Send focus out events to all windows between 'child' and 'ancestor'.
  * Events are sent running up the hierarchy.
@@ -1007,7 +1248,8 @@ HasOtherPointer(WindowPtr win, DeviceIntPtr exclude)
  * Assumption: Neither A nor B are valid windows.
  */
 static void
-CoreFocusPointerRootNoneSwitch(DeviceIntPtr dev, WindowPtr A,   /* PointerRootWin or NoneWin */
+CoreFocusPointerRootNoneSwitch(DeviceIntPtr dev,
+                               WindowPtr A,     /* PointerRootWin or NoneWin */
                                WindowPtr B,     /* NoneWin or PointerRootWin */
                                int mode)
 {
@@ -1051,7 +1293,8 @@ CoreFocusPointerRootNoneSwitch(DeviceIntPtr dev, WindowPtr A,   /* PointerRootWi
  * Assumption: A is a valid window and not PointerRoot or None.
  */
 static void
-CoreFocusToPointerRootOrNone(DeviceIntPtr dev, WindowPtr A, WindowPtr B,        /* PointerRootWin or NoneWin */
+CoreFocusToPointerRootOrNone(DeviceIntPtr dev, WindowPtr A,
+                             WindowPtr B,        /* PointerRootWin or NoneWin */
                              int mode)
 {
     WindowPtr root;
@@ -1097,7 +1340,8 @@ CoreFocusToPointerRootOrNone(DeviceIntPtr dev, WindowPtr A, WindowPtr B,
  * Assumption: B is a valid window and not PointerRoot or None.
  */
 static void
-CoreFocusFromPointerRootOrNone(DeviceIntPtr dev, WindowPtr A,   /* PointerRootWin or NoneWin */
+CoreFocusFromPointerRootOrNone(DeviceIntPtr dev,
+                               WindowPtr A,   /* PointerRootWin or NoneWin */
                                WindowPtr B, int mode)
 {
     WindowPtr root;
index c1729f8..a59d057 100644 (file)
 #ifndef ENTERLEAVE_H
 #define ENTERLEAVE_H
 
+#include <dix.h> /* DoFocusEvents() */
+
 extern void DoEnterLeaveEvents(DeviceIntPtr pDev,
                                int sourceid,
                                WindowPtr fromWin, WindowPtr toWin, int mode);
 
-extern void DoFocusEvents(DeviceIntPtr pDev,
-                          WindowPtr fromWin, WindowPtr toWin, int mode);
-
 extern void EnterLeaveEvent(DeviceIntPtr mouse,
                             int type,
                             int mode, int detail, WindowPtr pWin, Window child);
@@ -53,6 +52,11 @@ extern void DeviceEnterLeaveEvent(DeviceIntPtr mouse,
                                   int type,
                                   int mode,
                                   int detail, WindowPtr pWin, Window child);
+extern void DeviceFocusEvent(DeviceIntPtr dev,
+                             int type,
+                             int mode,
+                             int detail ,
+                             WindowPtr pWin);
 
 extern void EnterWindow(DeviceIntPtr dev, WindowPtr win, int mode);
 
@@ -61,9 +65,6 @@ extern void LeaveWindow(DeviceIntPtr dev);
 extern void CoreFocusEvent(DeviceIntPtr kbd,
                            int type, int mode, int detail, WindowPtr pWin);
 
-extern void DeviceFocusEvent(DeviceIntPtr kbd,
-                             int type, int mode, int detail, WindowPtr pWin);
-
 extern void SetFocusIn(DeviceIntPtr kbd, WindowPtr win);
 
 extern void SetFocusOut(DeviceIntPtr dev);
index 8dfae81..db1e03f 100644 (file)
@@ -349,8 +349,6 @@ IsFloating(DeviceIntPtr dev)
  */
 extern int lastEvent;
 
-extern int DeviceMotionNotify;
-
 #define CantBeFiltered NoEventMask
 /**
  * Event masks for each event type.
@@ -700,9 +698,10 @@ ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py)
 }
 
 static void
-CheckPhysLimits(DeviceIntPtr pDev, CursorPtr cursor, Bool generateEvents, Bool confineToScreen, /* unused if PanoramiX on */
-                ScreenPtr pScreen)
-{                               /* unused if PanoramiX on */
+CheckPhysLimits(DeviceIntPtr pDev, CursorPtr cursor, Bool generateEvents,
+                Bool confineToScreen, /* unused if PanoramiX on */
+                ScreenPtr pScreen)    /* unused if PanoramiX on */
+{
     HotSpot new;
     SpritePtr pSprite = pDev->spriteInfo->sprite;
 
@@ -1055,19 +1054,20 @@ MonthChangedOrBadTime(InternalEvent *ev)
 }
 
 static void
-NoticeTime(InternalEvent *ev)
+NoticeTime(InternalEvent *ev, DeviceIntPtr dev)
 {
     if (ev->any.time < currentTime.milliseconds)
         MonthChangedOrBadTime(ev);
     currentTime.milliseconds = ev->any.time;
-    lastDeviceEventTime = currentTime;
+    lastDeviceEventTime[XIAllDevices] = currentTime;
+    lastDeviceEventTime[dev->id] = currentTime;
 }
 
 void
-NoticeEventTime(InternalEvent *ev)
+NoticeEventTime(InternalEvent *ev, DeviceIntPtr dev)
 {
     if (!syncEvents.playingEvents)
-        NoticeTime(ev);
+        NoticeTime(ev, dev);
 }
 
 /**************************************************************************
@@ -1091,7 +1091,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
     if (!xorg_list_is_empty(&syncEvents.pending))
         tail = xorg_list_last_entry(&syncEvents.pending, QdEventRec, next);
 
-    NoticeTime((InternalEvent *) event);
+    NoticeTime((InternalEvent *)event, device);
 
     /* Fix for key repeating bug. */
     if (device->key != NULL && device->key->xkbInfo != NULL &&
@@ -2836,14 +2836,15 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
     if (win == NoneWin || win == PointerRootWin)
         return FALSE;
 
-    memset(&event, 0, sizeof(DeviceEvent));
-    event.header = ET_Internal;
-    event.type = ET_FocusIn;
-    event.length = sizeof(DeviceEvent);
-    event.time = GetTimeInMillis();
-    event.deviceid = dev->id;
-    event.sourceid = dev->id;
-    event.detail.button = 0;
+    event = (DeviceEvent) {
+        .header = ET_Internal,
+        .type = ET_FocusIn,
+        .length = sizeof(DeviceEvent),
+        .time = GetTimeInMillis(),
+        .deviceid = dev->id,
+        .sourceid = dev->id,
+        .detail.button = 0
+    };
     rc = (CheckPassiveGrabsOnWindow(win, dev, (InternalEvent *) &event, FALSE,
                                     TRUE) != NULL);
     if (rc)
@@ -2873,14 +2874,15 @@ ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
         (*dev->deviceGrab.DeactivateGrab) (dev);
     }
 
-    memset(&event, 0, sizeof(DeviceEvent));
-    event.header = ET_Internal;
-    event.type = ET_Enter;
-    event.length = sizeof(DeviceEvent);
-    event.time = GetTimeInMillis();
-    event.deviceid = dev->id;
-    event.sourceid = dev->id;
-    event.detail.button = 0;
+    event = (DeviceEvent) {
+        .header = ET_Internal,
+        .type = ET_Enter,
+        .length = sizeof(DeviceEvent),
+        .time = GetTimeInMillis(),
+        .deviceid = dev->id,
+        .sourceid = dev->id,
+        .detail.button = 0
+    };
     rc = (CheckPassiveGrabsOnWindow(win, dev, (InternalEvent *) &event, FALSE,
                                     TRUE) != NULL);
     if (rc)
@@ -3195,6 +3197,18 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
 #endif
 }
 
+void FreeSprite(DeviceIntPtr dev)
+{
+    if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
+        if (dev->spriteInfo->sprite->current)
+            FreeCursor(dev->spriteInfo->sprite->current, None);
+        free(dev->spriteInfo->sprite->spriteTrace);
+        free(dev->spriteInfo->sprite);
+    }
+    dev->spriteInfo->sprite = NULL;
+}
+
+
 /**
  * Update the mouse sprite info when the server switches from a pScreen to another.
  * Otherwise, the pScreen of the mouse sprite is never updated when we switch
@@ -4316,7 +4330,6 @@ OtherClientGone(pointer value, XID id)
         prev = other;
     }
     FatalError("client not on event list");
-     /*NOTREACHED*/ return -1;  /* make compiler happy */
 }
 
 int
@@ -4339,12 +4352,10 @@ EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask)
             return rc;
     }
     check = (mask & AtMostOneClient);
-    if (check & (pWin->eventMask | wOtherEventMasks(pWin))) {   /* It is illegal for two different
-                                                                   clients to select on any of the
-                                                                   events for AtMostOneClient. However,
-                                                                   it is OK, for some client to
-                                                                   continue selecting on one of those
-                                                                   events.  */
+    if (check & (pWin->eventMask | wOtherEventMasks(pWin))) {
+        /* It is illegal for two different clients to select on any of the
+           events for AtMostOneClient. However, it is OK, for some client to
+           continue selecting on one of those events.  */
         if ((wClient(pWin) != client) && (check & pWin->eventMask))
             return BadAccess;
         for (others = wOtherClients(pWin); others; others = others->next) {
@@ -4450,7 +4461,10 @@ CoreEnterLeaveEvent(DeviceIntPtr mouse,
                     int type,
                     int mode, int detail, WindowPtr pWin, Window child)
 {
-    xEvent event;
+    xEvent event = {
+        .u.u.type = type,
+        .u.u.detail = detail
+    };
     WindowPtr focus;
     DeviceIntPtr keybd;
     GrabPtr grab = mouse->deviceGrab.grab;
@@ -4470,9 +4484,6 @@ CoreEnterLeaveEvent(DeviceIntPtr mouse,
         mask = pWin->eventMask | wOtherEventMasks(pWin);
     }
 
-    memset(&event, 0, sizeof(xEvent));
-    event.u.u.type = type;
-    event.u.u.detail = detail;
     event.u.enterLeave.time = currentTime.milliseconds;
     event.u.enterLeave.rootX = mouse->spriteInfo->sprite->hot.x;
     event.u.enterLeave.rootY = mouse->spriteInfo->sprite->hot.y;
@@ -4503,15 +4514,16 @@ CoreEnterLeaveEvent(DeviceIntPtr mouse,
     }
 
     if ((type == EnterNotify) && (mask & KeymapStateMask)) {
-        xKeymapEvent ke;
+        xKeymapEvent ke = {
+            .type = KeymapNotify
+        };
         ClientPtr client = grab ? rClient(grab) : wClient(pWin);
+        int rc;
 
-        if (XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess))
-            memset((char *) &ke.map[0], 0, 31);
-        else
-            memmove((char *) &ke.map[0], (char *) &keybd->key->down[1], 31);
+        rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess);
+        if (rc == Success)
+            memcpy((char *) &ke.map[0], (char *) &keybd->key->down[1], 31);
 
-        ke.type = KeymapNotify;
         if (grab)
             TryClientEvents(rClient(grab), keybd, (xEvent *) &ke, 1,
                             mask, KeymapStateMask, grab);
@@ -4596,27 +4608,27 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
 void
 CoreFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin)
 {
-    xEvent event;
-
-    memset(&event, 0, sizeof(xEvent));
+    xEvent event = {
+        .u.u.type = type,
+        .u.u.detail = detail
+    };
     event.u.focus.mode = mode;
-    event.u.u.type = type;
-    event.u.u.detail = detail;
     event.u.focus.window = pWin->drawable.id;
 
     DeliverEventsToWindow(dev, pWin, &event, 1,
                           GetEventFilter(dev, &event), NullGrab);
     if ((type == FocusIn) &&
         ((pWin->eventMask | wOtherEventMasks(pWin)) & KeymapStateMask)) {
-        xKeymapEvent ke;
+        xKeymapEvent ke = {
+            .type = KeymapNotify
+        };
         ClientPtr client = wClient(pWin);
+        int rc;
 
-        if (XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess))
-            memset((char *) &ke.map[0], 0, 31);
-        else
-            memmove((char *) &ke.map[0], (char *) &dev->key->down[1], 31);
+        rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess);
+        if (rc == Success)
+            memcpy((char *) &ke.map[0], (char *) &dev->key->down[1], 31);
 
-        ke.type = KeymapNotify;
         DeliverEventsToWindow(dev, pWin, (xEvent *) &ke, 1,
                               KeymapStateMask, NullGrab);
     }
@@ -4758,17 +4770,20 @@ ProcGetInputFocus(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    memset(&rep, 0, sizeof(xGetInputFocusReply));
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xGetInputFocusReply) {
+        .type = X_Reply,
+        .length = 0,
+        .sequenceNumber = client->sequence,
+        .revertTo = focus->revert
+    };
+
     if (focus->win == NoneWin)
         rep.focus = None;
     else if (focus->win == PointerRootWin)
         rep.focus = PointerRoot;
     else
         rep.focus = focus->win->drawable.id;
-    rep.revertTo = focus->revert;
+
     WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep);
     return Success;
 }
@@ -4788,6 +4803,7 @@ ProcGrabPointer(ClientPtr client)
     GrabMask mask;
     WindowPtr confineTo;
     CursorPtr oldCursor;
+    BYTE status;
 
     REQUEST(xGrabPointerReq);
     int rc;
@@ -4809,7 +4825,6 @@ ProcGrabPointer(ClientPtr client)
             return rc;
     }
 
-    memset(&rep, 0, sizeof(xGrabPointerReply));
     oldCursor = NullCursor;
     grab = device->deviceGrab.grab;
 
@@ -4824,16 +4839,19 @@ ProcGrabPointer(ClientPtr client)
 
     rc = GrabDevice(client, device, stuff->pointerMode, stuff->keyboardMode,
                     stuff->grabWindow, stuff->ownerEvents, stuff->time,
-                    &mask, CORE, stuff->cursor, stuff->confineTo, &rep.status);
+                    &mask, CORE, stuff->cursor, stuff->confineTo, &status);
     if (rc != Success)
         return rc;
 
-    if (oldCursor && rep.status == GrabSuccess)
+    if (oldCursor && status == GrabSuccess)
         FreeCursor(oldCursor, (Cursor) 0);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
+    rep = (xGrabPointerReply) {
+        .type = X_Reply,
+        .status = status,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep);
     return Success;
 }
@@ -5050,6 +5068,7 @@ int
 ProcGrabKeyboard(ClientPtr client)
 {
     xGrabKeyboardReply rep;
+    BYTE status;
 
     REQUEST(xGrabKeyboardReq);
     int result;
@@ -5058,19 +5077,22 @@ ProcGrabKeyboard(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xGrabKeyboardReq);
 
-    memset(&rep, 0, sizeof(xGrabKeyboardReply));
     mask.core = KeyPressMask | KeyReleaseMask;
 
     result = GrabDevice(client, keyboard, stuff->pointerMode,
                         stuff->keyboardMode, stuff->grabWindow,
                         stuff->ownerEvents, stuff->time, &mask, CORE, None,
-                        None, &rep.status);
+                        None, &status);
 
     if (result != Success)
         return result;
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
+
+    rep = (xGrabKeyboardReply) {
+        .type = X_Reply,
+        .status = status,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep);
     return Success;
 }
@@ -5133,15 +5155,16 @@ ProcQueryPointer(ClientPtr client)
     pSprite = mouse->spriteInfo->sprite;
     if (mouse->valuator->motionHintWindow)
         MaybeStopHint(mouse, client);
-    memset(&rep, 0, sizeof(xQueryPointerReply));
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.mask = event_get_corestate(mouse, keyboard);
-    rep.length = 0;
-    rep.root = (GetCurrentRootWindow(mouse))->drawable.id;
-    rep.rootX = pSprite->hot.x;
-    rep.rootY = pSprite->hot.y;
-    rep.child = None;
+    rep = (xQueryPointerReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .mask = event_get_corestate(mouse, keyboard),
+        .root = (GetCurrentRootWindow(mouse))->drawable.id,
+        .rootX = pSprite->hot.x,
+        .rootY = pSprite->hot.y,
+        .child = None
+    };
     if (pSprite->hot.pScreen == pWin->drawable.pScreen) {
         rep.sameScreen = xTrue;
         rep.winX = pSprite->hot.x - pWin->drawable.x;
@@ -5201,6 +5224,7 @@ InitEvents(void)
 
     for (i = 0; i < MAXDEVICES; i++) {
         memcpy(&event_filters[i], default_filter, sizeof(default_filter));
+        lastDeviceEventTime[i] = currentTime;
     }
 
     syncEvents.replayDev = (DeviceIntPtr) NULL;
@@ -5214,7 +5238,6 @@ InitEvents(void)
     syncEvents.time.milliseconds = 0;   /* hardly matters */
     currentTime.months = 0;
     currentTime.milliseconds = GetTimeInMillis();
-    lastDeviceEventTime = currentTime;
     for (i = 0; i < DNPMCOUNT; i++) {
         DontPropagateMasks[i] = 0;
         DontPropagateRefCnts[i] = 0;
@@ -5409,12 +5432,13 @@ ProcGrabKey(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xGrabKeyReq);
 
-    memset(&param, 0, sizeof(param));
-    param.grabtype = CORE;
-    param.ownerEvents = stuff->ownerEvents;
-    param.this_device_mode = stuff->keyboardMode;
-    param.other_devices_mode = stuff->pointerMode;
-    param.modifiers = stuff->modifiers;
+    param = (GrabParameters) {
+        .grabtype = CORE,
+        .ownerEvents = stuff->ownerEvents,
+        .this_device_mode = stuff->keyboardMode,
+        .other_devices_mode = stuff->pointerMode,
+        .modifiers = stuff->modifiers
+    };
 
     rc = CheckGrabValues(client, &param);
     if (rc != Success)
@@ -5515,12 +5539,13 @@ ProcGrabButton(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    memset(&param, 0, sizeof(param));
-    param.grabtype = CORE;
-    param.ownerEvents = stuff->ownerEvents;
-    param.this_device_mode = stuff->keyboardMode;
-    param.other_devices_mode = stuff->pointerMode;
-    param.modifiers = stuff->modifiers;
+    param = (GrabParameters) {
+        .grabtype = CORE,
+        .ownerEvents = stuff->ownerEvents,
+        .this_device_mode = stuff->keyboardMode,
+        .other_devices_mode = stuff->pointerMode,
+        .modifiers = stuff->modifiers
+    };
 
     mask.core = stuff->eventMask;
 
@@ -5624,8 +5649,8 @@ DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources)
         if (IsKeyboardDevice(keybd)) {
             focus = keybd->focus;
 
-            /* If the focus window is a root window (ie. has no parent) then don't
-               delete the focus from it. */
+            /* If the focus window is a root window (ie. has no parent)
+               then don't delete the focus from it. */
 
             if ((pWin == focus->win) && (pWin->parent != NullWindow)) {
                 int focusEventMode = NotifyNormal;
@@ -5647,12 +5672,12 @@ DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources)
                         parent = parent->parent;
                         focus->traceGood--;
                     } while (!parent->realized
-                             /* This would be a good protocol change -- windows being reparented
-                                during SaveSet processing would cause the focus to revert to the
-                                nearest enclosing window which will survive the death of the exiting
-                                client, instead of ending up reverting to a dying window and thence
-                                to None
-                              */
+                    /* This would be a good protocol change -- windows being
+                       reparented during SaveSet processing would cause the
+                       focus to revert to the nearest enclosing window which
+                       will survive the death of the exiting client, instead
+                       of ending up reverting to a dying window and thence
+                       to None */
 #ifdef NOTDEF
                              || wClient(parent)->clientGone
 #endif
@@ -5892,14 +5917,14 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
             (*EventSwapVector[eventFrom->u.u.type & 0177])
                 (eventFrom, eventTo);
 
-            WriteToClient(pClient, eventlength, (char *) eventTo);
+            WriteToClient(pClient, eventlength, eventTo);
         }
     }
     else {
         /* only one GenericEvent, remember? that means either count is 1 and
          * eventlength is arbitrary or eventlength is 32 and count doesn't
          * matter. And we're all set. Woohoo. */
-        WriteToClient(pClient, count * eventlength, (char *) events);
+        WriteToClient(pClient, count * eventlength, events);
     }
 }
 
index 3cdfb51..6380db3 100644 (file)
@@ -252,11 +252,12 @@ ProcQueryExtension(ClientPtr client)
 
     REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes);
 
-    memset(&reply, 0, sizeof(xQueryExtensionReply));
-    reply.type = X_Reply;
-    reply.length = 0;
-    reply.major_opcode = 0;
-    reply.sequenceNumber = client->sequence;
+    reply = (xQueryExtensionReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .major_opcode = 0
+    };
 
     if (!NumExtensions)
         reply.present = xFalse;
@@ -284,11 +285,12 @@ ProcListExtensions(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xReq);
 
-    memset(&reply, 0, sizeof(xListExtensionsReply));
-    reply.type = X_Reply;
-    reply.nExtensions = 0;
-    reply.length = 0;
-    reply.sequenceNumber = client->sequence;
+    reply = (xListExtensionsReply) {
+        .type = X_Reply,
+        .nExtensions = 0,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     buffer = NULL;
 
     if (NumExtensions) {
index 7be0502..f46e0dd 100644 (file)
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -419,11 +419,11 @@ static const struct {
     RESTYPE type;
     Mask access_mode;
 } xidfields[] = {
-    {
-    GCTile, RT_PIXMAP, DixReadAccess}, {
-    GCStipple, RT_PIXMAP, DixReadAccess}, {
-    GCFont, RT_FONT, DixUseAccess}, {
-GCClipMask, RT_PIXMAP, DixReadAccess},};
+    {GCTile, RT_PIXMAP, DixReadAccess},
+    {GCStipple, RT_PIXMAP, DixReadAccess},
+    {GCFont, RT_FONT, DixUseAccess},
+    {GCClipMask, RT_PIXMAP, DixReadAccess},
+};
 
 int
 ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32)
@@ -458,32 +458,21 @@ ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32)
     return ChangeGC(client, pGC, mask, vals);
 }
 
-/* CreateGC(pDrawable, mask, pval, pStatus)
-   creates a default GC for the given drawable, using mask to fill
-   in any non-default values.
-   Returns a pointer to the new GC on success, NULL otherwise.
-   returns status of non-default fields in pStatus
-BUG:
-   should check for failure to create default tile
-
-*/
-GCPtr
-CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
-         XID gcid, ClientPtr client)
+static GCPtr
+NewGCObject(ScreenPtr pScreen, int depth)
 {
     GCPtr pGC;
 
-    pGC = dixAllocateObjectWithPrivates(GC, PRIVATE_GC);
+    pGC = dixAllocateScreenObjectWithPrivates(pScreen, GC, PRIVATE_GC);
     if (!pGC) {
-        *pStatus = BadAlloc;
         return (GCPtr) NULL;
     }
 
-    pGC->pScreen = pDrawable->pScreen;
-    pGC->depth = pDrawable->depth;
+    pGC->pScreen = pScreen;
+    pGC->depth = depth;
     pGC->alu = GXcopy;          /* dst <- src */
     pGC->planemask = ~0;
-    pGC->serialNumber = GC_CHANGE_SERIAL_BIT;
+    pGC->serialNumber = 0;
     pGC->funcs = 0;
     pGC->fgPixel = 0;
     pGC->bgPixel = 1;
@@ -496,17 +485,8 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
     pGC->arcMode = ArcPieSlice;
     pGC->tile.pixel = 0;
     pGC->tile.pixmap = NullPixmap;
-    if (mask & GCForeground) {
-        /*
-         * magic special case -- ChangeGC checks for this condition
-         * and snags the Foreground value to create a pseudo default-tile
-         */
-        pGC->tileIsPixel = FALSE;
-    }
-    else {
-        pGC->tileIsPixel = TRUE;
-    }
 
+    pGC->tileIsPixel = TRUE;
     pGC->patOrg.x = 0;
     pGC->patOrg.y = 0;
     pGC->subWindowMode = ClipByChildren;
@@ -521,12 +501,49 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
 
     /* use the default font and stipple */
     pGC->font = defaultFont;
-    defaultFont->refcnt++;
+    if (pGC->font)              /* necessary, because open of default font could fail */
+        pGC->font->refcnt++;
     pGC->stipple = pGC->pScreen->PixmapPerDepth[0];
-    pGC->stipple->refcnt++;
+    if (pGC->stipple)
+        pGC->stipple->refcnt++;
 
     /* this is not a scratch GC */
     pGC->scratch_inuse = FALSE;
+    return pGC;
+}
+
+/* CreateGC(pDrawable, mask, pval, pStatus)
+   creates a default GC for the given drawable, using mask to fill
+   in any non-default values.
+   Returns a pointer to the new GC on success, NULL otherwise.
+   returns status of non-default fields in pStatus
+BUG:
+   should check for failure to create default tile
+
+*/
+GCPtr
+CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
+         XID gcid, ClientPtr client)
+{
+    GCPtr pGC;
+
+    pGC = NewGCObject(pDrawable->pScreen, pDrawable->depth);
+    if (!pGC) {
+        *pStatus = BadAlloc;
+        return (GCPtr) NULL;
+    }
+
+    pGC->serialNumber = GC_CHANGE_SERIAL_BIT;
+    if (mask & GCForeground) {
+        /*
+         * magic special case -- ChangeGC checks for this condition
+         * and snags the Foreground value to create a pseudo default-tile
+         */
+        pGC->tileIsPixel = FALSE;
+    }
+    else {
+        pGC->tileIsPixel = TRUE;
+    }
 
     /* security creation/labeling check */
     *pStatus = XaceHook(XACE_RESOURCE_ACCESS, client, gcid, RT_GC, pGC,
@@ -784,45 +801,10 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
 {
     GCPtr pGC;
 
-    pGC = dixAllocateObjectWithPrivates(GC, PRIVATE_GC);
+    pGC = NewGCObject(pScreen, depth);
     if (!pGC)
         return (GCPtr) NULL;
 
-    pGC->pScreen = pScreen;
-    pGC->depth = depth;
-    pGC->alu = GXcopy;          /* dst <- src */
-    pGC->planemask = ~0;
-    pGC->serialNumber = 0;
-    pGC->fgPixel = 0;
-    pGC->bgPixel = 1;
-    pGC->lineWidth = 0;
-    pGC->lineStyle = LineSolid;
-    pGC->capStyle = CapButt;
-    pGC->joinStyle = JoinMiter;
-    pGC->fillStyle = FillSolid;
-    pGC->fillRule = EvenOddRule;
-    pGC->arcMode = ArcPieSlice;
-    pGC->font = defaultFont;
-    if (pGC->font)              /* necessary, because open of default font could fail */
-        pGC->font->refcnt++;
-    pGC->tileIsPixel = TRUE;
-    pGC->tile.pixel = 0;
-    pGC->tile.pixmap = NullPixmap;
-    pGC->stipple = NullPixmap;
-    pGC->patOrg.x = 0;
-    pGC->patOrg.y = 0;
-    pGC->subWindowMode = ClipByChildren;
-    pGC->graphicsExposures = TRUE;
-    pGC->clipOrg.x = 0;
-    pGC->clipOrg.y = 0;
-    pGC->clientClipType = CT_NONE;
-    pGC->dashOffset = 0;
-    pGC->numInDashList = 2;
-    pGC->dash = DefaultDash;
-
-    /* scratch GCs in the GCperDepth pool start off unused */
-    pGC->scratch_inuse = FALSE;
-
     pGC->stateChanges = GCAllBits;
     if (!(*pScreen->CreateGC) (pGC)) {
         FreeGC(pGC, (XID) 0);
old mode 100755 (executable)
new mode 100644 (file)
index 0db2bf0..db00ec2
@@ -35,6 +35,7 @@
 #include <X11/keysym.h>
 #include <X11/Xproto.h>
 #include <math.h>
+#include <limits.h>
 
 #include "misc.h"
 #include "resource.h"
 #include "extnsionst.h"
 #include "listdev.h"            /* for sizing up DeviceClassesChangedEvent */
 
+#if XSERVER_DTRACE
+#include <sys/types.h>
+typedef const char *string;
+#include <Xserver-dtrace.h>
+#endif
+
 /* Number of motion history events to store. */
 #define MOTION_HISTORY_SIZE 256
 
@@ -750,6 +757,29 @@ clipAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
     }
 }
 
+static void
+add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, double value)
+{
+    double v;
+
+    if (!valuator_mask_fetch_double(mask, valuator, &v))
+        return;
+
+    /* protect against scrolling overflow. INT_MAX for double, because
+     * we'll eventually write this as 32.32 fixed point */
+    if ((value > 0 && v > INT_MAX - value) || (value < 0 && v < INT_MIN - value)) {
+        v = 0;
+
+        /* reset last.scroll to avoid a button storm */
+        valuator_mask_set_double(dev->last.scroll, valuator, 0);
+    }
+    else
+        v += value;
+
+    valuator_mask_set_double(mask, valuator, v);
+}
+
+
 /**
  * Move the device's pointer by the values given in @valuators.
  *
@@ -768,13 +798,17 @@ moveRelative(DeviceIntPtr dev, ValuatorMask *mask)
 
         if (!valuator_mask_isset(mask, i))
             continue;
-        val += valuator_mask_get_double(mask, i);
+
+        add_to_scroll_valuator(dev, mask, i, val);
+
         /* x & y need to go over the limits to cross screens if the SD
          * isn't currently attached; otherwise, clip to screen bounds. */
         if (valuator_get_mode(dev, i) == Absolute &&
-            ((i != 0 && i != 1) || clip_xy))
+            ((i != 0 && i != 1) || clip_xy)) {
+            val = valuator_mask_get_double(mask, i);
             clipAxis(dev, i, &val);
-        valuator_mask_set_double(mask, i, val);
+            valuator_mask_set_double(mask, i, val);
+        }
     }
 }
 
@@ -1031,6 +1065,15 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
     RawDeviceEvent *raw;
     ValuatorMask mask;
 
+#if XSERVER_DTRACE
+    if (XSERVER_INPUT_EVENT_ENABLED()) {
+        XSERVER_INPUT_EVENT(pDev->id, type, key_code, 0,
+                            mask_in ? mask_in->last_bit + 1 : 0,
+                            mask_in ? mask_in->mask : NULL,
+                            mask_in ? mask_in->valuators : NULL);
+    }
+#endif
+
     /* refuse events from disabled devices */
     if (!pDev->enabled)
         return 0;
@@ -1156,16 +1199,33 @@ static void
 transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
 {
     double x, y, ox, oy;
+    int has_x, has_y;
+
+    has_x = valuator_mask_fetch_double(mask, 0, &ox);
+    has_y = valuator_mask_fetch_double(mask, 1, &oy);
+
+    if (!has_x && !has_y)
+        return;
+
+    if (!has_x || !has_y) {
+        struct pixman_f_transform invert;
+
+        /* undo transformation from last event */
+        ox = dev->last.valuators[0];
+        oy = dev->last.valuators[1];
+
+        pixman_f_transform_invert(&invert, &dev->transform);
+        transform(&invert, &ox, &oy);
+
+        x = ox;
+        y = oy;
+    }
 
     if (valuator_mask_isset(mask, 0))
         ox = x = valuator_mask_get_double(mask, 0);
-    else
-        ox = x = dev->last.valuators[0];
 
     if (valuator_mask_isset(mask, 1))
         oy = y = valuator_mask_get_double(mask, 1);
-    else
-        oy = y = dev->last.valuators[1];
 
     transform(&dev->transform, &x, &y);
 
@@ -1272,6 +1332,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
     RawDeviceEvent *raw;
     double screenx = 0.0, screeny = 0.0;        /* desktop coordinate system */
     double devx = 0.0, devy = 0.0;      /* desktop-wide in device coords */
+    int sx, sy;                         /* for POINTER_SCREEN */
     ValuatorMask mask;
     ScreenPtr scr;
 
@@ -1314,8 +1375,11 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
     /* valuators are in driver-native format (rel or abs) */
 
     if (flags & POINTER_ABSOLUTE) {
-        if (flags & POINTER_SCREEN)     /* valuators are in screen coords */
+        if (flags & POINTER_SCREEN) {    /* valuators are in screen coords */
+            sx = valuator_mask_get(&mask, 0);
+            sy = valuator_mask_get(&mask, 1);
             scale_from_screen(pDev, &mask);
+        }
 
         transformAbsolute(pDev, &mask);
         clipAbsolute(pDev, &mask);
@@ -1333,6 +1397,18 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
 
     /* valuators are in device coordinate system in absolute coordinates */
     scale_to_desktop(pDev, &mask, &devx, &devy, &screenx, &screeny);
+
+    /* #53037 XWarpPointer's scaling back and forth between screen and
+       device may leave us with rounding errors. End result is that the
+       pointer doesn't end up on the pixel it should.
+       Avoid this by forcing screenx/screeny back to what the input
+       coordinates were.
+     */
+    if (flags & POINTER_SCREEN) {
+        screenx = sx;
+        screeny = sy;
+    }
+
     scr = positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
                          &mask, &devx, &devy, &screenx, &screeny);
 
@@ -1479,6 +1555,7 @@ emulate_scroll_button_events(InternalEvent *events,
     return num_events;
 }
 
+
 /**
  * Generate a complete series of InternalEvents (filled into the EventList)
  * representing pointer motion, or button presses.  If the device is a slave
@@ -1508,6 +1585,15 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
     int i;
     int realtype = type;
 
+#if XSERVER_DTRACE
+    if (XSERVER_INPUT_EVENT_ENABLED()) {
+        XSERVER_INPUT_EVENT(pDev->id, type, buttons, flags,
+                            mask_in ? mask_in->last_bit + 1 : 0,
+                            mask_in ? mask_in->mask : NULL,
+                            mask_in ? mask_in->valuators : NULL);
+    }
+#endif
+
     /* refuse events from disabled devices */
     if (!pDev->enabled)
         return 0;
@@ -1524,7 +1610,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
      * necessary. This only needs to cater for the XIScrollFlagPreferred
      * axis (if more than one scrolling axis is present) */
     if (type == ButtonPress) {
-        double val, adj;
+        double adj;
         int axis;
         int h_scroll_axis = -1;
         int v_scroll_axis = -1;
@@ -1560,8 +1646,9 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
 
         if (adj != 0.0 && axis != -1) {
             adj *= pDev->valuator->axes[axis].scroll.increment;
-            val = valuator_mask_get_double(&mask, axis) + adj;
-            valuator_mask_set_double(&mask, axis, val);
+            if (!valuator_mask_isset(&mask, axis))
+                valuator_mask_set(&mask, axis, 0);
+            add_to_scroll_valuator(pDev, &mask, axis, adj);
             type = MotionNotify;
             buttons = 0;
             flags |= POINTER_EMULATED;
@@ -1579,7 +1666,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
     /* Now turn the smooth-scrolling axes back into emulated button presses
      * for legacy clients, based on the integer delta between before and now */
     for (i = 0; i < valuator_mask_size(&mask); i++) {
-        if (i >= pDev->valuator->numAxes)
+        if ( !pDev->valuator || (i >= pDev->valuator->numAxes))
             break;
 
         if (!valuator_mask_isset(&mask, i))
@@ -1636,6 +1723,15 @@ GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
     DeviceEvent *event;
     ValuatorMask mask;
 
+#if XSERVER_DTRACE
+    if (XSERVER_INPUT_EVENT_ENABLED()) {
+        XSERVER_INPUT_EVENT(pDev->id, type, 0, 0,
+                            mask_in ? mask_in->last_bit + 1 : 0,
+                            mask_in ? mask_in->mask : NULL,
+                            mask_in ? mask_in->valuators : NULL);
+    }
+#endif
+
     /* refuse events from disabled devices */
     if (!pDev->enabled)
         return 0;
@@ -1760,6 +1856,15 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
     Bool emulate_pointer = FALSE;
     int client_id = 0;
 
+#if XSERVER_DTRACE
+    if (XSERVER_INPUT_EVENT_ENABLED()) {
+        XSERVER_INPUT_EVENT(dev->id, type, ddx_touchid, flags,
+                            mask_in ? mask_in->last_bit + 1 : 0,
+                            mask_in ? mask_in->mask : NULL,
+                            mask_in ? mask_in->valuators : NULL);
+    }
+#endif
+
     if (!dev->enabled || !t || !v)
         return 0;
 
@@ -1767,10 +1872,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
 
     if (flags & TOUCH_CLIENT_ID) {      /* A DIX-submitted TouchEnd */
         touchpoint.dix_ti = TouchFindByClientID(dev, ddx_touchid);
-        BUG_WARN(!touchpoint.dix_ti);
-
-        if (!touchpoint.dix_ti)
-            return 0;
+        BUG_RETURN_VAL(!touchpoint.dix_ti, 0);
 
         if (!mask_in ||
             !valuator_mask_isset(mask_in, 0) ||
@@ -1788,8 +1890,8 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
         touchpoint.ti =
             TouchFindByDDXID(dev, ddx_touchid, (type == XI_TouchBegin));
         if (!touchpoint.ti) {
-            ErrorF("[dix] %s: unable to %s touch point %x\n", dev->name,
-                   type == XI_TouchBegin ? "begin" : "find", ddx_touchid);
+            ErrorFSigSafe("[dix] %s: unable to %s touch point %u\n", dev->name,
+                          type == XI_TouchBegin ? "begin" : "find", ddx_touchid);
             return 0;
         }
         client_id = touchpoint.ti->client_id;
index c0cae15..332b91f 100644 (file)
@@ -122,12 +122,13 @@ Bool party_like_its_1989 = FALSE;
 Bool whiteRoot = FALSE;
 
 TimeStamp currentTime;
-TimeStamp lastDeviceEventTime;
+TimeStamp lastDeviceEventTime[MAXDEVICES];
 
 int defaultColorVisualClass = -1;
 int monitorResolution = 0;
 
 char *display;
+int displayfd;
 char *ConnectionInfo;
 
 CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND;
index 2f05f57..55bf64f 100644 (file)
@@ -205,7 +205,10 @@ AllocGrab(void)
 }
 
 GrabPtr
-CreateGrab(int client, DeviceIntPtr device, DeviceIntPtr modDevice, WindowPtr window, enum InputLevel grabtype, GrabMask *mask, GrabParameters *param, int type, KeyCode keybut,        /* key or button */
+CreateGrab(int client, DeviceIntPtr device, DeviceIntPtr modDevice,
+           WindowPtr window, enum InputLevel grabtype, GrabMask *mask,
+           GrabParameters *param, int type,
+           KeyCode keybut,        /* key or button */
            WindowPtr confineTo, CursorPtr cursor)
 {
     GrabPtr grab;
index 223d547..f01e9a7 100644 (file)
@@ -71,14 +71,13 @@ static void
 do_butmap_change(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client)
 {
     int i;
-    xEvent core_mn;
+    xEvent core_mn = { .u.u.type = MappingNotify };
     deviceMappingNotify xi_mn;
 
     /* The map in ButtonClassRec refers to button numbers, whereas the
      * protocol is zero-indexed.  Sigh. */
     memcpy(&(dev->button->map[1]), map, len);
 
-    core_mn.u.u.type = MappingNotify;
     core_mn.u.mappingNotify.request = MappingPointer;
 
     /* 0 is the server client. */
@@ -93,10 +92,12 @@ do_butmap_change(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client)
         WriteEventsToClient(clients[i], 1, &core_mn);
     }
 
-    xi_mn.type = DeviceMappingNotify;
-    xi_mn.request = MappingPointer;
-    xi_mn.deviceid = dev->id;
-    xi_mn.time = GetTimeInMillis();
+    xi_mn = (deviceMappingNotify) {
+        .type = DeviceMappingNotify,
+        .request = MappingPointer,
+        .deviceid = dev->id,
+        .time = GetTimeInMillis()
+    };
 
     SendEventToAllWindows(dev, DeviceMappingNotifyMask, (xEvent *) &xi_mn, 1);
 }
index 70dcc94..fb935c9 100644 (file)
@@ -104,6 +104,7 @@ Equipment Corporation.
 #include "privates.h"
 #include "registry.h"
 #include "client.h"
+#include "exevents.h"
 #ifdef PANORAMIX
 #include "panoramiXsrv.h"
 #else
@@ -206,10 +207,16 @@ main(int argc, char *argv[], char *envp[])
             FatalError("no screens found");
         InitExtensions(argc, argv);
 
+        for (i = 0; i < screenInfo.numGPUScreens; i++) {
+            ScreenPtr pScreen = screenInfo.gpuscreens[i];
+            if (!CreateScratchPixmapsForScreen(pScreen))
+                FatalError("failed to create scratch pixmaps");
+        }
+
         for (i = 0; i < screenInfo.numScreens; i++) {
             ScreenPtr pScreen = screenInfo.screens[i];
 
-            if (!CreateScratchPixmapsForScreen(i))
+            if (!CreateScratchPixmapsForScreen(pScreen))
                 FatalError("failed to create scratch pixmaps");
             if (pScreen->CreateScreenResources &&
                 !(*pScreen->CreateScreenResources) (pScreen))
@@ -295,6 +302,7 @@ main(int argc, char *argv[], char *envp[])
 #endif
 
         UndisplayDevices();
+        DisableAllDevices();
 
         /* Now free up whatever must be freed */
         if (screenIsSaved == SCREEN_SAVER_ON)
@@ -318,14 +326,26 @@ main(int argc, char *argv[], char *envp[])
 
         for (i = 0; i < screenInfo.numScreens; i++)
             screenInfo.screens[i]->root = NullWindow;
+
         CloseDownDevices();
+
         CloseDownEvents();
 
+        for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) {
+            ScreenPtr pScreen = screenInfo.gpuscreens[i];
+            FreeScratchPixmapsForScreen(pScreen);
+            (*pScreen->CloseScreen) (pScreen);
+            dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN);
+            free(pScreen);
+            screenInfo.numGPUScreens = i;
+        }
+
         for (i = screenInfo.numScreens - 1; i >= 0; i--) {
-            FreeScratchPixmapsForScreen(i);
+            FreeScratchPixmapsForScreen(screenInfo.screens[i]);
             FreeGCperDepth(i);
             FreeDefaultStipple(i);
-            (*screenInfo.screens[i]->CloseScreen) (i, screenInfo.screens[i]);
+            dixFreeScreenSpecificPrivates(screenInfo.screens[i]);
+            (*screenInfo.screens[i]->CloseScreen) (screenInfo.screens[i]);
             dixFreePrivates(screenInfo.screens[i]->devPrivates, PRIVATE_SCREEN);
             free(screenInfo.screens[i]);
             screenInfo.numScreens = i;
index 47b220b..2418812 100644 (file)
@@ -84,23 +84,23 @@ FreeScratchPixmapHeader(PixmapPtr pPixmap)
 }
 
 Bool
-CreateScratchPixmapsForScreen(int scrnum)
+CreateScratchPixmapsForScreen(ScreenPtr pScreen)
 {
     unsigned int pixmap_size;
 
-    pixmap_size = sizeof(PixmapRec) + dixPrivatesSize(PRIVATE_PIXMAP);
-    screenInfo.screens[scrnum]->totalPixmapSize =
+    pixmap_size = sizeof(PixmapRec) + dixScreenSpecificPrivatesSize(pScreen, PRIVATE_PIXMAP);
+    pScreen->totalPixmapSize =
         BitmapBytePad(pixmap_size * 8);
 
     /* let it be created on first use */
-    screenInfo.screens[scrnum]->pScratchPixmap = NULL;
+    pScreen->pScratchPixmap = NULL;
     return TRUE;
 }
 
 void
-FreeScratchPixmapsForScreen(int scrnum)
+FreeScratchPixmapsForScreen(ScreenPtr pScreen)
 {
-    FreeScratchPixmapHeader(screenInfo.screens[scrnum]->pScratchPixmap);
+    FreeScratchPixmapHeader(pScreen->pScratchPixmap);
 }
 
 /* callable by ddx */
@@ -118,7 +118,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
     if (!pPixmap)
         return NullPixmap;
 
-    dixInitPrivates(pPixmap, pPixmap + 1, PRIVATE_PIXMAP);
+    dixInitScreenPrivates(pScreen, pPixmap, pPixmap + 1, PRIVATE_PIXMAP);
     return pPixmap;
 }
 
@@ -129,3 +129,142 @@ FreePixmap(PixmapPtr pPixmap)
     dixFiniPrivates(pPixmap, PRIVATE_PIXMAP);
     free(pPixmap);
 }
+
+PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave)
+{
+    PixmapPtr spix;
+    int ret;
+    void *handle;
+    ScreenPtr master = pixmap->drawable.pScreen;
+    int depth = pixmap->drawable.depth;
+
+    ret = master->SharePixmapBacking(pixmap, slave, &handle);
+    if (ret == FALSE)
+        return NULL;
+
+    spix = slave->CreatePixmap(slave, 0, 0, depth,
+                               CREATE_PIXMAP_USAGE_SHARED);
+    slave->ModifyPixmapHeader(spix, pixmap->drawable.width,
+                              pixmap->drawable.height, depth, 0,
+                              pixmap->devKind, NULL);
+
+    /* have the slave pixmap take a reference on the master pixmap
+       later we destroy them both at the same time */
+    pixmap->refcnt++;
+
+    spix->master_pixmap = pixmap;
+
+    ret = slave->SetSharedPixmapBacking(spix, handle);
+    if (ret == FALSE) {
+        slave->DestroyPixmap(spix);
+        return NULL;
+    }
+
+    return spix;
+}
+
+Bool
+PixmapStartDirtyTracking(PixmapPtr src,
+                         PixmapPtr slave_dst,
+                         int x, int y)
+{
+    ScreenPtr screen = src->drawable.pScreen;
+    PixmapDirtyUpdatePtr dirty_update;
+
+    dirty_update = calloc(1, sizeof(PixmapDirtyUpdateRec));
+    if (!dirty_update)
+        return FALSE;
+
+    dirty_update->src = src;
+    dirty_update->slave_dst = slave_dst;
+    dirty_update->x = x;
+    dirty_update->y = y;
+
+    dirty_update->damage = DamageCreate(NULL, NULL,
+                                        DamageReportNone,
+                                        TRUE, src->drawable.pScreen,
+                                        src->drawable.pScreen);
+    if (!dirty_update->damage) {
+        free(dirty_update);
+        return FALSE;
+    }
+
+    DamageRegister(&src->drawable, dirty_update->damage);
+    xorg_list_add(&dirty_update->ent, &screen->pixmap_dirty_list);
+    return TRUE;
+}
+
+Bool
+PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst)
+{
+    ScreenPtr screen = src->drawable.pScreen;
+    PixmapDirtyUpdatePtr ent, safe;
+
+    xorg_list_for_each_entry_safe(ent, safe, &screen->pixmap_dirty_list, ent) {
+        if (ent->src == src && ent->slave_dst == slave_dst) {
+            DamageUnregister(&src->drawable, ent->damage);
+            DamageDestroy(ent->damage);
+            xorg_list_del(&ent->ent);
+            free(ent);
+        }
+    }
+    return TRUE;
+}
+
+/*
+ * this function can possibly be improved and optimised, by clipping
+ * instead of iterating
+ */
+Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region)
+{
+    ScreenPtr pScreen = dirty->src->drawable.pScreen;
+    int n;
+    BoxPtr b;
+    RegionPtr region = DamageRegion(dirty->damage);
+    GCPtr pGC;
+    PixmapPtr dst;
+    SourceValidateProcPtr SourceValidate;
+
+    /*
+     * SourceValidate is used by the software cursor code
+     * to pull the cursor off of the screen when reading
+     * bits from the frame buffer. Bypassing this function
+     * leaves the software cursor in place
+     */
+    SourceValidate = pScreen->SourceValidate;
+    pScreen->SourceValidate = NULL;
+
+    RegionTranslate(dirty_region, dirty->x, dirty->y);
+    RegionIntersect(dirty_region, dirty_region, region);
+
+    if (RegionNil(dirty_region)) {
+        RegionUninit(dirty_region);
+        return FALSE;
+    }
+
+    dst = dirty->slave_dst->master_pixmap;
+
+    RegionTranslate(dirty_region, -dirty->x, -dirty->y);
+    n = RegionNumRects(dirty_region);
+    b = RegionRects(dirty_region);
+
+    pGC = GetScratchGC(dirty->src->drawable.depth, pScreen);
+    ValidateGC(&dst->drawable, pGC);
+
+    while (n--) {
+        BoxRec dst_box;
+        int w, h;
+
+        dst_box = *b;
+        w = dst_box.x2 - dst_box.x1;
+        h = dst_box.y2 - dst_box.y1;
+
+        pGC->ops->CopyArea(&dirty->src->drawable, &dst->drawable, pGC,
+                           dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h, dst_box.x1, dst_box.y1);
+        b++;
+    }
+    FreeScratchGC(pGC);
+
+    pScreen->SourceValidate = SourceValidate;
+    return TRUE;
+}
index 15fbf75..55b9345 100644 (file)
@@ -62,13 +62,9 @@ from The Open Group.
 #include "inputstr.h"
 #include "scrnintstr.h"
 #include "extnsionst.h"
+#include "inputstr.h"
 
-static struct {
-    DevPrivateKey key;
-    unsigned offset;
-    int created;
-    int allocated;
-} keys[PRIVATE_LAST];
+static DevPrivateSetRec global_keys[PRIVATE_LAST];
 
 static const Bool xselinux_private[PRIVATE_LAST] = {
     [PRIVATE_SCREEN] = TRUE,
@@ -86,8 +82,57 @@ static const Bool xselinux_private[PRIVATE_LAST] = {
     [PRIVATE_GLYPHSET] = TRUE,
 };
 
+static const char *key_names[PRIVATE_LAST] = {
+    /* XSELinux uses the same private keys for numerous objects */
+    [PRIVATE_XSELINUX] = "XSELINUX",
+
+    /* Otherwise, you get a private in just the requested structure
+     */
+    /* These can have objects created before all of the keys are registered */
+    [PRIVATE_SCREEN] = "SCREEN",
+    [PRIVATE_EXTENSION] = "EXTENSION",
+    [PRIVATE_COLORMAP] = "COLORMAP",
+    [PRIVATE_DEVICE] = "DEVICE",
+
+    /* These cannot have any objects before all relevant keys are registered */
+    [PRIVATE_CLIENT] = "CLIENT",
+    [PRIVATE_PROPERTY] = "PROPERTY",
+    [PRIVATE_SELECTION] = "SELECTION",
+    [PRIVATE_WINDOW] = "WINDOW",
+    [PRIVATE_PIXMAP] = "PIXMAP",
+    [PRIVATE_GC] = "GC",
+    [PRIVATE_CURSOR] = "CURSOR",
+    [PRIVATE_CURSOR_BITS] = "CURSOR_BITS",
+
+    /* extension privates */
+    [PRIVATE_DBE_WINDOW] = "DBE_WINDOW",
+    [PRIVATE_DAMAGE] = "DAMAGE",
+    [PRIVATE_GLYPH] = "GLYPH",
+    [PRIVATE_GLYPHSET] = "GLYPHSET",
+    [PRIVATE_PICTURE] = "PICTURE",
+    [PRIVATE_SYNC_FENCE] = "SYNC_FENCE",
+};
+
+static const Bool screen_specific_private[PRIVATE_LAST] = {
+    [PRIVATE_SCREEN] = FALSE,
+    [PRIVATE_CLIENT] = FALSE,
+    [PRIVATE_WINDOW] = TRUE,
+    [PRIVATE_PIXMAP] = TRUE,
+    [PRIVATE_GC] = TRUE,
+    [PRIVATE_CURSOR] = FALSE,
+    [PRIVATE_COLORMAP] = FALSE,
+    [PRIVATE_DEVICE] = FALSE,
+    [PRIVATE_EXTENSION] = FALSE,
+    [PRIVATE_SELECTION] = FALSE,
+    [PRIVATE_PROPERTY] = FALSE,
+    [PRIVATE_PICTURE] = TRUE,
+    [PRIVATE_GLYPHSET] = FALSE,
+};
+
 typedef Bool (*FixupFunc) (PrivatePtr *privates, int offset, unsigned bytes);
 
+typedef enum { FixupMove, FixupRealloc } FixupType;
+
 static Bool
 dixReallocPrivates(PrivatePtr *privates, int old_offset, unsigned bytes)
 {
@@ -110,14 +155,76 @@ dixMovePrivates(PrivatePtr *privates, int new_offset, unsigned bytes)
 }
 
 static Bool
+fixupOneScreen(ScreenPtr pScreen, FixupFunc fixup, unsigned bytes)
+{
+    intptr_t        dist;
+    char            *old;
+    char            *new;
+    DevPrivateKey   *keyp, key;
+    DevPrivateType  type;
+    int             size;
+
+    old = (char *) pScreen->devPrivates;
+    size = global_keys[PRIVATE_SCREEN].offset;
+    if (!fixup (&pScreen->devPrivates, size, bytes))
+        return FALSE;
+
+    /* Screen privates can contain screen-specific private keys
+     * for other types. When they move, the linked list we use to
+     * track them gets scrambled. Fix that by computing the change
+     * in the location of each private adjusting our linked list
+     * pointers to match
+     */
+
+    new = (char *) pScreen->devPrivates;
+
+    /* Moving means everyone shifts up in the privates by 'bytes' amount,
+     * realloc means the base pointer moves
+     */
+    if (fixup == dixMovePrivates)
+        new += bytes;
+
+    dist = new - old;
+
+    if (dist) {
+        for (type = PRIVATE_XSELINUX; type < PRIVATE_LAST; type++)
+
+            /* Walk the privates list, being careful as the
+             * pointers are scrambled before we patch them.
+             */
+            for (keyp = &pScreen->screenSpecificPrivates[type].key;
+                 (key = *keyp) != NULL;
+                 keyp = &key->next)
+            {
+
+                /* Only mangle things if the private structure
+                 * is contained within the allocation. Privates
+                 * stored elsewhere will be left alone
+                 */
+                if (old <= (char *) key && (char *) key < old + size)
+                {
+                    /* Compute new location of key */
+                    key = (DevPrivateKey) ((char *) key + dist);
+
+                    /* Patch the list */
+                    *keyp = key;
+                }
+            }
+    }
+    return TRUE;
+}
+
+static Bool
 fixupScreens(FixupFunc fixup, unsigned bytes)
 {
     int s;
 
     for (s = 0; s < screenInfo.numScreens; s++)
-        if (!fixup
-            (&screenInfo.screens[s]->devPrivates, keys[PRIVATE_SCREEN].offset,
-             bytes))
+        if (!fixupOneScreen (screenInfo.screens[s], fixup, bytes))
+            return FALSE;
+
+    for (s = 0; s < screenInfo.numGPUScreens; s++)
+        if (!fixupOneScreen (screenInfo.gpuscreens[s], fixup, bytes))
             return FALSE;
     return TRUE;
 }
@@ -126,7 +233,7 @@ static Bool
 fixupServerClient(FixupFunc fixup, unsigned bytes)
 {
     if (serverClient)
-        return fixup(&serverClient->devPrivates, keys[PRIVATE_CLIENT].offset,
+        return fixup(&serverClient->devPrivates, global_keys[PRIVATE_CLIENT].offset,
                      bytes);
     return TRUE;
 }
@@ -140,7 +247,7 @@ fixupExtensions(FixupFunc fixup, unsigned bytes)
     for (major = EXTENSION_BASE; (extension = GetExtensionEntry(major));
          major++)
         if (!fixup
-            (&extension->devPrivates, keys[PRIVATE_EXTENSION].offset, bytes))
+            (&extension->devPrivates, global_keys[PRIVATE_EXTENSION].offset, bytes))
             return FALSE;
     return TRUE;
 }
@@ -157,17 +264,65 @@ fixupDefaultColormaps(FixupFunc fixup, unsigned bytes)
                                 screenInfo.screens[s]->defColormap, RT_COLORMAP,
                                 serverClient, DixCreateAccess);
         if (cmap &&
-            !fixup(&cmap->devPrivates, keys[PRIVATE_COLORMAP].offset, bytes))
+            !fixup(&cmap->devPrivates, screenInfo.screens[s]->screenSpecificPrivates[PRIVATE_COLORMAP].offset, bytes))
+            return FALSE;
+    }
+    return TRUE;
+}
+
+static Bool
+fixupDeviceList(DeviceIntPtr device, FixupFunc fixup, unsigned bytes)
+{
+    while (device) {
+        if (!fixup(&device->devPrivates, global_keys[PRIVATE_DEVICE].offset, bytes))
             return FALSE;
+        device = device->next;
     }
     return TRUE;
 }
 
+static Bool
+fixupDevices(FixupFunc fixup, unsigned bytes)
+{
+    return (fixupDeviceList(inputInfo.devices, fixup, bytes) &&
+            fixupDeviceList(inputInfo.off_devices, fixup, bytes));
+}
+
 static Bool (*const allocated_early[PRIVATE_LAST]) (FixupFunc, unsigned) = {
-[PRIVATE_SCREEN] = fixupScreens,
-        [PRIVATE_CLIENT] = fixupServerClient,
-        [PRIVATE_EXTENSION] = fixupExtensions,
-        [PRIVATE_COLORMAP] = fixupDefaultColormaps,};
+    [PRIVATE_SCREEN] = fixupScreens,
+    [PRIVATE_CLIENT] = fixupServerClient,
+    [PRIVATE_EXTENSION] = fixupExtensions,
+    [PRIVATE_COLORMAP] = fixupDefaultColormaps,
+    [PRIVATE_DEVICE] = fixupDevices,
+};
+
+static void
+grow_private_set(DevPrivateSetPtr set, unsigned bytes)
+{
+    DevPrivateKey       k;
+
+    for (k = set->key; k; k = k->next)
+        k->offset += bytes;
+    set->offset += bytes;
+}
+
+static void
+grow_screen_specific_set(DevPrivateType type, unsigned bytes)
+{
+    int s;
+
+    /* Update offsets for all screen-specific keys */
+    for (s = 0; s < screenInfo.numScreens; s++) {
+        ScreenPtr       pScreen = screenInfo.screens[s];
+
+        grow_private_set(&pScreen->screenSpecificPrivates[type], bytes);
+    }
+    for (s = 0; s < screenInfo.numGPUScreens; s++) {
+        ScreenPtr       pScreen = screenInfo.gpuscreens[s];
+
+        grow_private_set(&pScreen->screenSpecificPrivates[type], bytes);
+    }
+}
 
 /*
  * Register a private key. This takes the type of object the key will
@@ -199,14 +354,13 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size)
 
     /* Update offsets for all affected keys */
     if (type == PRIVATE_XSELINUX) {
-        DevPrivateKey k;
 
         /* Resize if we can, or make sure nothing's allocated if we can't
          */
         for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++)
             if (xselinux_private[t]) {
                 if (!allocated_early[t])
-                    assert(!keys[t].created);
+                    assert(!global_keys[t].created);
                 else if (!allocated_early[t] (dixReallocPrivates, bytes))
                     return FALSE;
             }
@@ -216,12 +370,12 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size)
          */
         for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++) {
             if (xselinux_private[t]) {
-                for (k = keys[t].key; k; k = k->next)
-                    k->offset += bytes;
-                keys[t].offset += bytes;
+                grow_private_set(&global_keys[t], bytes);
+                grow_screen_specific_set(t, bytes);
                 if (allocated_early[t])
                     allocated_early[t] (dixMovePrivates, bytes);
             }
+
         }
 
         offset = 0;
@@ -229,11 +383,12 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size)
     else {
         /* Resize if we can, or make sure nothing's allocated if we can't */
         if (!allocated_early[type])
-            assert(!keys[type].created);
+            assert(!global_keys[type].created);
         else if (!allocated_early[type] (dixReallocPrivates, bytes))
             return FALSE;
-        offset = keys[type].offset;
-        keys[type].offset += bytes;
+        offset = global_keys[type].offset;
+        global_keys[type].offset += bytes;
+        grow_screen_specific_set(type, bytes);
     }
 
     /* Setup this key */
@@ -242,8 +397,8 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size)
     key->initialized = TRUE;
     key->type = type;
     key->allocated = FALSE;
-    key->next = keys[type].key;
-    keys[type].key = key;
+    key->next = global_keys[type].key;
+    global_keys[type].key = key;
 
     return TRUE;
 }
@@ -286,13 +441,15 @@ _dixGetScreenPrivateKey(const DevScreenPrivateKey key, ScreenPtr pScreen)
 void
 _dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type)
 {
-    keys[type].created++;
+    assert (!screen_specific_private[type]);
+
+    global_keys[type].created++;
     if (xselinux_private[type])
-        keys[PRIVATE_XSELINUX].created++;
-    if (keys[type].offset == 0)
+        global_keys[PRIVATE_XSELINUX].created++;
+    if (global_keys[type].offset == 0)
         addr = 0;
     *privates = addr;
-    memset(addr, '\0', keys[type].offset);
+    memset(addr, '\0', global_keys[type].offset);
 }
 
 /*
@@ -301,9 +458,9 @@ _dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type)
 void
 _dixFiniPrivates(PrivatePtr privates, DevPrivateType type)
 {
-    keys[type].created--;
+    global_keys[type].created--;
     if (xselinux_private[type])
-        keys[PRIVATE_XSELINUX].created--;
+        global_keys[PRIVATE_XSELINUX].created--;
 }
 
 /*
@@ -322,10 +479,11 @@ _dixAllocateObjectWithPrivates(unsigned baseSize, unsigned clear,
     PrivatePtr *devPrivates;
 
     assert(type > PRIVATE_SCREEN && type < PRIVATE_LAST);
+    assert(!screen_specific_private[type]);
 
     /* round up so that void * is aligned */
     baseSize = (baseSize + sizeof(void *) - 1) & ~(sizeof(void *) - 1);
-    totalSize = baseSize + keys[type].offset;
+    totalSize = baseSize + global_keys[type].offset;
     object = malloc(totalSize);
     if (!object)
         return NULL;
@@ -350,8 +508,9 @@ dixAllocatePrivates(PrivatePtr *privates, DevPrivateType type)
     PrivatePtr p;
 
     assert(type > PRIVATE_XSELINUX && type < PRIVATE_LAST);
+    assert(!screen_specific_private[type]);
 
-    size = keys[type].offset;
+    size = global_keys[type].offset;
     if (!size) {
         p = NULL;
     }
@@ -361,7 +520,7 @@ dixAllocatePrivates(PrivatePtr *privates, DevPrivateType type)
     }
 
     _dixInitPrivates(privates, p, type);
-    ++keys[type].allocated;
+    ++global_keys[type].allocated;
 
     return TRUE;
 }
@@ -387,7 +546,7 @@ void
 dixFreePrivates(PrivatePtr privates, DevPrivateType type)
 {
     _dixFiniPrivates(privates, type);
-    --keys[type].allocated;
+    --global_keys[type].allocated;
     free(privates);
 }
 
@@ -398,8 +557,9 @@ extern _X_EXPORT int
 dixPrivatesSize(DevPrivateType type)
 {
     assert(type >= PRIVATE_SCREEN && type < PRIVATE_LAST);
+    assert (!screen_specific_private[type]);
 
-    return keys[type].offset;
+    return global_keys[type].offset;
 }
 
 /* Table of devPrivates offsets */
@@ -434,36 +594,136 @@ dixLookupPrivateOffset(RESTYPE type)
     return -1;
 }
 
-static const char *key_names[PRIVATE_LAST] = {
-    /* XSELinux uses the same private keys for numerous objects */
-    [PRIVATE_XSELINUX] = "XSELINUX",
+/*
+ * Screen-specific privates
+ */
 
-    /* Otherwise, you get a private in just the requested structure
-     */
-    /* These can have objects created before all of the keys are registered */
-    [PRIVATE_SCREEN] = "SCREEN",
-    [PRIVATE_EXTENSION] = "EXTENSION",
-    [PRIVATE_COLORMAP] = "COLORMAP",
+extern _X_EXPORT Bool
+dixRegisterScreenSpecificPrivateKey(ScreenPtr pScreen, DevPrivateKey key,
+                                    DevPrivateType type, unsigned size)
+{
+    int offset;
+    unsigned bytes;
 
-    /* These cannot have any objects before all relevant keys are registered */
-    [PRIVATE_DEVICE] = "DEVICE",
-    [PRIVATE_CLIENT] = "CLIENT",
-    [PRIVATE_PROPERTY] = "PROPERTY",
-    [PRIVATE_SELECTION] = "SELECTION",
-    [PRIVATE_WINDOW] = "WINDOW",
-    [PRIVATE_PIXMAP] = "PIXMAP",
-    [PRIVATE_GC] = "GC",
-    [PRIVATE_CURSOR] = "CURSOR",
-    [PRIVATE_CURSOR_BITS] = "CURSOR_BITS",
+    if (!screen_specific_private[type])
+        FatalError("Attempt to allocate screen-specific private storage for type %s\n",
+                   key_names[type]);
 
-    /* extension privates */
-    [PRIVATE_DBE_WINDOW] = "DBE_WINDOW",
-    [PRIVATE_DAMAGE] = "DAMAGE",
-    [PRIVATE_GLYPH] = "GLYPH",
-    [PRIVATE_GLYPHSET] = "GLYPHSET",
-    [PRIVATE_PICTURE] = "PICTURE",
-    [PRIVATE_SYNC_FENCE] = "SYNC_FENCE",
-};
+    if (key->initialized) {
+        assert(size == key->size);
+        return TRUE;
+    }
+
+    /* Compute required space */
+    bytes = size;
+    if (size == 0)
+        bytes = sizeof(void *);
+
+    /* align to void * size */
+    bytes = (bytes + sizeof(void *) - 1) & ~(sizeof(void *) - 1);
+
+    assert (!allocated_early[type]);
+    assert (!pScreen->screenSpecificPrivates[type].created);
+    offset = pScreen->screenSpecificPrivates[type].offset;
+    pScreen->screenSpecificPrivates[type].offset += bytes;
+
+    /* Setup this key */
+    key->offset = offset;
+    key->size = size;
+    key->initialized = TRUE;
+    key->type = type;
+    key->allocated = FALSE;
+    key->next = pScreen->screenSpecificPrivates[type].key;
+    pScreen->screenSpecificPrivates[type].key = key;
+
+    return TRUE;
+}
+
+/* Clean up screen-specific privates before CloseScreen */
+void
+dixFreeScreenSpecificPrivates(ScreenPtr pScreen)
+{
+}
+
+/* Initialize screen-specific privates in AddScreen */
+void
+dixInitScreenSpecificPrivates(ScreenPtr pScreen)
+{
+    DevPrivateType      t;
+
+    for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++)
+        pScreen->screenSpecificPrivates[t].offset = global_keys[t].offset;
+}
+
+/* Initialize screen-specific privates in AddScreen */
+void
+_dixInitScreenPrivates(ScreenPtr pScreen, PrivatePtr *privates, void *addr, DevPrivateType type)
+{
+    int privates_size;
+    assert (screen_specific_private[type]);
+
+    if (pScreen) {
+        privates_size = pScreen->screenSpecificPrivates[type].offset;
+        pScreen->screenSpecificPrivates[type].created++;
+    }
+    else
+        privates_size = global_keys[type].offset;
+
+    global_keys[type].created++;
+    if (xselinux_private[type])
+        global_keys[PRIVATE_XSELINUX].created++;
+    if (privates_size == 0)
+        addr = 0;
+    *privates = addr;
+    memset(addr, '\0', privates_size);
+}
+
+void *
+_dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen,
+                                     unsigned baseSize,
+                                     unsigned clear,
+                                     unsigned offset,
+                                     DevPrivateType type)
+{
+    unsigned totalSize;
+    void *object;
+    PrivatePtr privates;
+    PrivatePtr *devPrivates;
+    int privates_size;
+
+    assert(type > PRIVATE_SCREEN && type < PRIVATE_LAST);
+    assert (screen_specific_private[type]);
+
+    if (pScreen)
+        privates_size = pScreen->screenSpecificPrivates[type].offset;
+    else
+        privates_size = global_keys[type].offset;
+    /* round up so that void * is aligned */
+    baseSize = (baseSize + sizeof(void *) - 1) & ~(sizeof(void *) - 1);
+    totalSize = baseSize + privates_size;
+    object = malloc(totalSize);
+    if (!object)
+        return NULL;
+
+    memset(object, '\0', clear);
+    privates = (PrivatePtr) (((char *) object) + baseSize);
+    devPrivates = (PrivatePtr *) ((char *) object + offset);
+
+    _dixInitScreenPrivates(pScreen, devPrivates, privates, type);
+
+    return object;
+}
+
+int
+dixScreenSpecificPrivatesSize(ScreenPtr pScreen, DevPrivateType type)
+{
+    assert(type >= PRIVATE_SCREEN && type < PRIVATE_LAST);
+
+    if (screen_specific_private[type])
+        return pScreen->screenSpecificPrivates[type].offset;
+    else
+        return global_keys[type].offset;
+}
 
 void
 dixPrivateUsage(void)
@@ -474,14 +734,14 @@ dixPrivateUsage(void)
     DevPrivateType t;
 
     for (t = PRIVATE_XSELINUX + 1; t < PRIVATE_LAST; t++) {
-        if (keys[t].offset) {
+        if (global_keys[t].offset) {
             ErrorF
                 ("%s: %d objects of %d bytes = %d total bytes %d private allocs\n",
-                 key_names[t], keys[t].created, keys[t].offset,
-                 keys[t].created * keys[t].offset, keys[t].allocated);
-            bytes += keys[t].created * keys[t].offset;
-            objects += keys[t].created;
-            alloc += keys[t].allocated;
+                 key_names[t], global_keys[t].created, global_keys[t].offset,
+                 global_keys[t].created * global_keys[t].offset, global_keys[t].allocated);
+            bytes += global_keys[t].created * global_keys[t].offset;
+            objects += global_keys[t].created;
+            alloc += global_keys[t].allocated;
         }
     }
     ErrorF("TOTAL: %d objects, %d bytes, %d allocs\n", objects, bytes, alloc);
@@ -495,7 +755,7 @@ dixResetPrivates(void)
     for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++) {
         DevPrivateKey key, next;
 
-        for (key = keys[t].key; key; key = next) {
+        for (key = global_keys[t].key; key; key = next) {
             next = key->next;
             key->offset = 0;
             key->initialized = FALSE;
@@ -504,14 +764,14 @@ dixResetPrivates(void)
             if (key->allocated)
                 free(key);
         }
-        if (keys[t].created) {
+        if (global_keys[t].created) {
             ErrorF("%d %ss still allocated at reset\n",
-                   keys[t].created, key_names[t]);
+                   global_keys[t].created, key_names[t]);
             dixPrivateUsage();
         }
-        keys[t].key = NULL;
-        keys[t].offset = 0;
-        keys[t].created = 0;
-        keys[t].allocated = 0;
+        global_keys[t].key = NULL;
+        global_keys[t].offset = 0;
+        global_keys[t].created = 0;
+        global_keys[t].allocated = 0;
     }
 }
index b1b8312..dec4090 100644 (file)
@@ -108,14 +108,13 @@ dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName,
 static void
 deliverPropertyNotifyEvent(WindowPtr pWin, int state, Atom atom)
 {
-    xEvent event;
-
-    memset(&event, 0, sizeof(xEvent));
+    xEvent event = {
+        .u.property.window = pWin->drawable.id,
+        .u.property.state = state,
+        .u.property.atom = atom,
+        .u.property.time = currentTime.milliseconds
+    };
     event.u.u.type = PropertyNotify;
-    event.u.property.window = pWin->drawable.id;
-    event.u.property.state = state;
-    event.u.property.atom = atom;
-    event.u.property.time = currentTime.milliseconds;
     DeliverEvents(pWin, &event, 1, (WindowPtr) NULL);
 }
 
@@ -413,15 +412,18 @@ DeleteAllWindowProperties(WindowPtr pWin)
 }
 
 static int
-NullPropertyReply(ClientPtr client,
-                  ATOM propertyType, int format, xGetPropertyReply * reply)
+NullPropertyReply(ClientPtr client, ATOM propertyType, int format)
 {
-    reply->nItems = 0;
-    reply->length = 0;
-    reply->bytesAfter = 0;
-    reply->propertyType = propertyType;
-    reply->format = format;
-    WriteReplyToClient(client, sizeof(xGenericReply), reply);
+    xGetPropertyReply reply = {
+        .type = X_Reply,
+        .format = format,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .propertyType = propertyType,
+        .bytesAfter = 0,
+        .nItems = 0
+    };
+    WriteReplyToClient(client, sizeof(xGenericReply), &reply);
     return Success;
 }
 
@@ -470,13 +472,9 @@ ProcGetProperty(ClientPtr client)
         return BadAtom;
     }
 
-    memset(&reply, 0, sizeof(xGetPropertyReply));
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-
     rc = dixLookupProperty(&pProp, pWin, stuff->property, client, prop_mode);
     if (rc == BadMatch)
-        return NullPropertyReply(client, None, 0, &reply);
+        return NullPropertyReply(client, None, 0);
     else if (rc != Success)
         return rc;
 
@@ -485,11 +483,15 @@ ProcGetProperty(ClientPtr client)
 
     if (((stuff->type != pProp->type) && (stuff->type != AnyPropertyType))
         ) {
-        reply.bytesAfter = pProp->size;
-        reply.format = pProp->format;
-        reply.length = 0;
-        reply.nItems = 0;
-        reply.propertyType = pProp->type;
+        reply = (xGetPropertyReply) {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .bytesAfter = pProp->size,
+            .format = pProp->format,
+            .length = 0,
+            .nItems = 0,
+            .propertyType = pProp->type
+        };
         WriteReplyToClient(client, sizeof(xGenericReply), &reply);
         return Success;
     }
@@ -510,11 +512,15 @@ ProcGetProperty(ClientPtr client)
 
     len = min(n - ind, 4 * stuff->longLength);
 
-    reply.bytesAfter = n - (ind + len);
-    reply.format = pProp->format;
-    reply.length = bytes_to_int32(len);
-    reply.nItems = len / (pProp->format / 8);
-    reply.propertyType = pProp->type;
+    reply = (xGetPropertyReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .bytesAfter = n - (ind + len),
+        .format = pProp->format,
+        .length = bytes_to_int32(len),
+        .nItems = len / (pProp->format / 8),
+        .propertyType = pProp->type
+    };
 
     if (stuff->delete && (reply.bytesAfter == 0))
         deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName);
@@ -589,10 +595,12 @@ ProcListProperties(ClientPtr client)
         }
     }
 
-    xlpr.type = X_Reply;
-    xlpr.nProperties = numProps;
-    xlpr.length = bytes_to_int32(numProps * sizeof(Atom));
-    xlpr.sequenceNumber = client->sequence;
+    xlpr = (xListPropertiesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(numProps * sizeof(Atom)),
+        .nProperties = numProps
+    };
     WriteReplyToClient(client, sizeof(xGenericReply), &xlpr);
     if (numProps) {
         client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
index acbb479..338f415 100644 (file)
  ****************************************************************************/
 
 /* fwds */
-int
- SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
 static double
-
 SimpleSmoothProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity,
                     double threshold, double acc);
 static PointerAccelerationProfileFunc
@@ -791,7 +788,8 @@ ComputeAcceleration(DeviceIntPtr dev,
         result +=
             4.0f * BasicComputeAcceleration(dev, vel,
                                             (vel->last_velocity +
-                                             vel->velocity) / 2, threshold,
+                                             vel->velocity) / 2,
+                                            threshold,
                                             acc);
         result /= 6.0f;
         DebugAccelF("(dix ptracc) profile average [%.2f ... %.2f] is %.3f\n",
index e9c19b0..5bad0fd 100644 (file)
@@ -286,7 +286,7 @@ LookupResourceName(RESTYPE resource)
 void
 dixResetRegistry(void)
 {
-    ExtensionEntry extEntry;
+    ExtensionEntry extEntry = { .name = CORE };
 
     /* Free all memory */
     while (nmajor--) {
@@ -336,8 +336,6 @@ dixResetRegistry(void)
     RegisterResourceName(RT_PASSIVEGRAB, "PASSIVE GRAB");
 
     /* Add the core protocol */
-    memset(&extEntry, 0, sizeof(extEntry));
-    extEntry.name = CORE;
     RegisterExtensionNames(&extEntry);
 }
 
index 89d0776..2aafa34 100644 (file)
@@ -141,6 +141,7 @@ Equipment Corporation.
 #include "xace.h"
 #include <assert.h>
 #include "registry.h"
+#include "gcstruct.h"
 
 #ifdef XSERVER_DTRACE
 #include <sys/types.h>
@@ -182,50 +183,313 @@ RESTYPE TypeMask;
 
 struct ResourceType {
     DeleteType deleteFunc;
+    SizeType sizeFunc;
+    FindTypeSubResources findSubResFunc;
     int errorValue;
 };
 
+/**
+ * Used by all resources that don't specify a function to calculate
+ * resource size. Currently this is used for all resources with
+ * insignificant memory usage.
+ *
+ * @see GetResourceTypeSizeFunc, SetResourceTypeSizeFunc
+ *
+ * @param[in] value Pointer to resource object.
+ *
+ * @param[in] id Resource ID for the object.
+ *
+ * @param[out] size Fill all fields to zero to indicate that size of
+ *                  resource can't be determined.
+ */
+static void
+GetDefaultBytes(pointer value, XID id, ResourceSizePtr size)
+{
+    size->resourceSize = 0;
+    size->pixmapRefSize = 0;
+    size->refCnt = 1;
+}
+
+/**
+ * Used by all resources that don't specify a function to iterate
+ * through subresources. Currently this is used for all resources with
+ * insignificant memory usage.
+ *
+ * @see FindSubResources, SetResourceTypeFindSubResFunc
+ *
+ * @param[in] value Pointer to resource object.
+ *
+ * @param[in] func Function to call for each subresource.
+
+ * @param[out] cdata Pointer to opaque data.
+ */
+static void
+DefaultFindSubRes(pointer value, FindAllRes func, pointer cdata)
+{
+    /* do nothing */
+}
+
+/**
+ * Calculate drawable size in bytes. Reference counting is not taken
+ * into account.
+ *
+ * @param[in] drawable Pointer to a drawable.
+ *
+ * @return Estimate of total memory usage for the drawable.
+ */
+static unsigned long
+GetDrawableBytes(DrawablePtr drawable)
+{
+    int bytes = 0;
+
+    if (drawable)
+    {
+        int bytesPerPixel = drawable->bitsPerPixel >> 3;
+        int numberOfPixels = drawable->width * drawable->height;
+        bytes = numberOfPixels * bytesPerPixel;
+    }
+
+    return bytes;
+}
+
+/**
+ * Calculate pixmap size in bytes. Reference counting is taken into
+ * account. Any extra data attached by extensions and drivers is not
+ * taken into account. The purpose of this function is to estimate
+ * memory usage that can be attributed to single reference of the
+ * pixmap.
+ *
+ * @param[in] value Pointer to a pixmap.
+ *
+ * @param[in] id Resource ID of pixmap. If the pixmap hasn't been
+ *               added as resource, just pass value->drawable.id.
+ *
+ * @param[out] size Estimate of memory usage attributed to a single
+ *                  pixmap reference.
+ */
+static void
+GetPixmapBytes(pointer value, XID id, ResourceSizePtr size)
+{
+    PixmapPtr pixmap = value;
+
+    size->resourceSize = 0;
+    size->pixmapRefSize = 0;
+    size->refCnt = pixmap->refcnt;
+
+    if (pixmap && pixmap->refcnt)
+    {
+        DrawablePtr drawable = &pixmap->drawable;
+        size->resourceSize = GetDrawableBytes(drawable);
+        size->pixmapRefSize = size->resourceSize / pixmap->refcnt;
+    }
+}
+
+/**
+ * Calculate window size in bytes. The purpose of this function is to
+ * estimate memory usage that can be attributed to all pixmap
+ * references of the window.
+ *
+ * @param[in] value Pointer to a window.
+ *
+ * @param[in] id Resource ID of window.
+ *
+ * @param[out] size Estimate of memory usage attributed to a all
+ *                  pixmap references of a window.
+ */
+static void
+GetWindowBytes(pointer value, XID id, ResourceSizePtr size)
+{
+    SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP);
+    ResourceSizeRec pixmapSize = { 0, 0, 0 };
+    WindowPtr window = value;
+
+    /* Currently only pixmap bytes are reported to clients. */
+    size->resourceSize = 0;
+
+    /* Calculate pixmap reference sizes. */
+    size->pixmapRefSize = 0;
+
+    size->refCnt = 1;
+
+    if (window->backgroundState == BackgroundPixmap)
+    {
+        PixmapPtr pixmap = window->background.pixmap;
+        pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize);
+        size->pixmapRefSize += pixmapSize.pixmapRefSize;
+    }
+    if (window->border.pixmap && !window->borderIsPixel)
+    {
+        PixmapPtr pixmap = window->border.pixmap;
+        pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize);
+        size->pixmapRefSize += pixmapSize.pixmapRefSize;
+    }
+}
+
+/**
+ * Iterate through subresources of a window. The purpose of this
+ * function is to gather accurate information on what resources
+ * a resource uses.
+ *
+ * @note Currently only sub-pixmaps are iterated
+ *
+ * @param[in] value  Pointer to a window
+ *
+ * @param[in] func   Function to call with each subresource
+ *
+ * @param[out] cdata Pointer to opaque data
+ */
+static void
+FindWindowSubRes(pointer value, FindAllRes func, pointer cdata)
+{
+    WindowPtr window = value;
+
+    /* Currently only pixmap subresources are reported to clients. */
+
+    if (window->backgroundState == BackgroundPixmap)
+    {
+        PixmapPtr pixmap = window->background.pixmap;
+        func(window->background.pixmap, pixmap->drawable.id, RT_PIXMAP, cdata);
+    }
+    if (window->border.pixmap && !window->borderIsPixel)
+    {
+        PixmapPtr pixmap = window->border.pixmap;
+        func(window->background.pixmap, pixmap->drawable.id, RT_PIXMAP, cdata);
+    }
+}
+
+/**
+ * Calculate graphics context size in bytes. The purpose of this
+ * function is to estimate memory usage that can be attributed to all
+ * pixmap references of the graphics context.
+ *
+ * @param[in] value Pointer to a graphics context.
+ *
+ * @param[in] id    Resource ID of graphics context.
+ *
+ * @param[out] size Estimate of memory usage attributed to a all
+ *                  pixmap references of a graphics context.
+ */
+static void
+GetGcBytes(pointer value, XID id, ResourceSizePtr size)
+{
+    SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP);
+    ResourceSizeRec pixmapSize = { 0, 0, 0 };
+    GCPtr gc = value;
+
+    /* Currently only pixmap bytes are reported to clients. */
+    size->resourceSize = 0;
+
+    /* Calculate pixmap reference sizes. */
+    size->pixmapRefSize = 0;
+
+    size->refCnt = 1;
+    if (gc->stipple)
+    {
+        PixmapPtr pixmap = gc->stipple;
+        pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize);
+        size->pixmapRefSize += pixmapSize.pixmapRefSize;
+    }
+    if (gc->tile.pixmap && !gc->tileIsPixel)
+    {
+        PixmapPtr pixmap = gc->tile.pixmap;
+        pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize);
+        size->pixmapRefSize += pixmapSize.pixmapRefSize;
+    }
+}
+
+/**
+ * Iterate through subresources of a graphics context. The purpose of
+ * this function is to gather accurate information on what resources a
+ * resource uses.
+ *
+ * @note Currently only sub-pixmaps are iterated
+ *
+ * @param[in] value  Pointer to a window
+ *
+ * @param[in] func   Function to call with each subresource
+ *
+ * @param[out] cdata Pointer to opaque data
+ */
+static void
+FindGCSubRes(pointer value, FindAllRes func, pointer cdata)
+{
+    GCPtr gc = value;
+
+    /* Currently only pixmap subresources are reported to clients. */
+
+    if (gc->stipple)
+    {
+        PixmapPtr pixmap = gc->stipple;
+        func(pixmap, pixmap->drawable.id, RT_PIXMAP, cdata);
+    }
+    if (gc->tile.pixmap && !gc->tileIsPixel)
+    {
+        PixmapPtr pixmap = gc->tile.pixmap;
+        func(pixmap, pixmap->drawable.id, RT_PIXMAP, cdata);
+    }
+}
+
 static struct ResourceType *resourceTypes;
 
 static const struct ResourceType predefTypes[] = {
     [RT_NONE & (RC_LASTPREDEF - 1)] = {
                                        .deleteFunc = (DeleteType) NoopDDA,
+                                       .sizeFunc = GetDefaultBytes,
+                                       .findSubResFunc = DefaultFindSubRes,
                                        .errorValue = BadValue,
                                        },
     [RT_WINDOW & (RC_LASTPREDEF - 1)] = {
                                          .deleteFunc = DeleteWindow,
+                                         .sizeFunc = GetWindowBytes,
+                                         .findSubResFunc = FindWindowSubRes,
                                          .errorValue = BadWindow,
                                          },
     [RT_PIXMAP & (RC_LASTPREDEF - 1)] = {
                                          .deleteFunc = dixDestroyPixmap,
+                                         .sizeFunc = GetPixmapBytes,
+                                         .findSubResFunc = DefaultFindSubRes,
                                          .errorValue = BadPixmap,
                                          },
     [RT_GC & (RC_LASTPREDEF - 1)] = {
                                      .deleteFunc = FreeGC,
+                                     .sizeFunc = GetGcBytes,
+                                     .findSubResFunc = FindGCSubRes,
                                      .errorValue = BadGC,
                                      },
     [RT_FONT & (RC_LASTPREDEF - 1)] = {
                                        .deleteFunc = CloseFont,
+                                       .sizeFunc = GetDefaultBytes,
+                                       .findSubResFunc = DefaultFindSubRes,
                                        .errorValue = BadFont,
                                        },
     [RT_CURSOR & (RC_LASTPREDEF - 1)] = {
                                          .deleteFunc = FreeCursor,
+                                         .sizeFunc = GetDefaultBytes,
+                                         .findSubResFunc = DefaultFindSubRes,
                                          .errorValue = BadCursor,
                                          },
     [RT_COLORMAP & (RC_LASTPREDEF - 1)] = {
                                            .deleteFunc = FreeColormap,
+                                           .sizeFunc = GetDefaultBytes,
+                                           .findSubResFunc = DefaultFindSubRes,
                                            .errorValue = BadColor,
                                            },
     [RT_CMAPENTRY & (RC_LASTPREDEF - 1)] = {
                                             .deleteFunc = FreeClientPixels,
+                                            .sizeFunc = GetDefaultBytes,
+                                            .findSubResFunc = DefaultFindSubRes,
                                             .errorValue = BadColor,
                                             },
     [RT_OTHERCLIENT & (RC_LASTPREDEF - 1)] = {
                                               .deleteFunc = OtherClientGone,
+                                              .sizeFunc = GetDefaultBytes,
+                                              .findSubResFunc = DefaultFindSubRes,
                                               .errorValue = BadValue,
                                               },
     [RT_PASSIVEGRAB & (RC_LASTPREDEF - 1)] = {
                                               .deleteFunc = DeletePassiveGrab,
+                                              .sizeFunc = GetDefaultBytes,
+                                              .findSubResFunc = DefaultFindSubRes,
                                               .errorValue = BadValue,
                                               },
 };
@@ -256,6 +520,8 @@ CreateNewResourceType(DeleteType deleteFunc, const char *name)
     lastResourceType = next;
     resourceTypes = types;
     resourceTypes[next].deleteFunc = deleteFunc;
+    resourceTypes[next].sizeFunc = GetDefaultBytes;
+    resourceTypes[next].findSubResFunc = DefaultFindSubRes;
     resourceTypes[next].errorValue = BadValue;
 
     /* Called even if name is NULL, to remove any previous entry */
@@ -264,6 +530,57 @@ CreateNewResourceType(DeleteType deleteFunc, const char *name)
     return next;
 }
 
+/**
+ * Get the function used to calculate resource size. Extensions and
+ * drivers need to be able to determine the current size calculation
+ * function if they want to wrap or override it.
+ *
+ * @param[in] type     Resource type used in size calculations.
+ *
+ * @return Function to calculate the size of a single
+ *                     resource.
+ */
+SizeType
+GetResourceTypeSizeFunc(RESTYPE type)
+{
+    return resourceTypes[type & TypeMask].sizeFunc;
+}
+
+/**
+ * Override the default function that calculates resource size. For
+ * example, video driver knows better how to calculate pixmap memory
+ * usage and can therefore wrap or override size calculation for
+ * RT_PIXMAP.
+ *
+ * @param[in] type     Resource type used in size calculations.
+ *
+ * @param[in] sizeFunc Function to calculate the size of a single
+ *                     resource.
+ */
+void
+SetResourceTypeSizeFunc(RESTYPE type, SizeType sizeFunc)
+{
+    resourceTypes[type & TypeMask].sizeFunc = sizeFunc;
+}
+
+/**
+ * Provide a function for iterating the subresources of a resource.
+ * This allows for example more accurate accounting of the (memory)
+ * resources consumed by a resource.
+ *
+ * @see FindSubResources
+ *
+ * @param[in] type     Resource type used in size calculations.
+ *
+ * @param[in] sizeFunc Function to calculate the size of a single
+ *                     resource.
+ */
+void
+SetResourceTypeFindSubResFunc(RESTYPE type, FindTypeSubResources findFunc)
+{
+    resourceTypes[type & TypeMask].findSubResFunc = findFunc;
+}
+
 void
 SetResourceTypeErrorValue(RESTYPE type, int errorValue)
 {
@@ -326,25 +643,32 @@ InitClientResources(ClientPtr client)
     return TRUE;
 }
 
-static int
-Hash(int client, XID id)
+int
+HashResourceID(XID id, int numBits)
 {
     id &= RESOURCE_ID_MASK;
-    switch (clientTable[client].hashsize) {
-    case 6:
-        return ((int) (0x03F & (id ^ (id >> 6) ^ (id >> 12))));
-    case 7:
-        return ((int) (0x07F & (id ^ (id >> 7) ^ (id >> 13))));
-    case 8:
-        return ((int) (0x0FF & (id ^ (id >> 8) ^ (id >> 16))));
-    case 9:
-        return ((int) (0x1FF & (id ^ (id >> 9))));
-    case 10:
-        return ((int) (0x3FF & (id ^ (id >> 10))));
-    case 11:
-        return ((int) (0x7FF & (id ^ (id >> 11))));
-    }
-    return -1;
+    switch (numBits)
+    {
+        case 6:
+            return ((int)(0x03F & (id ^ (id>>6) ^ (id>>12))));
+        case 7:
+            return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13))));
+        case 8:
+            return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16))));
+        case 9:
+            return ((int)(0x1FF & (id ^ (id>>9))));
+        case 10:
+            return ((int)(0x3FF & (id ^ (id>>10))));
+        case 11:
+            return ((int)(0x7FF & (id ^ (id>>11))));
+    }
+    if (numBits >= 11)
+        return ((int)(0x7FF & (id ^ (id>>11))));
+    else
+    {
+        assert(numBits >= 0);
+        return id & ~((~0) << numBits);
+    }
 }
 
 static XID
@@ -355,7 +679,7 @@ AvailableID(int client, XID id, XID maxid, XID goodid)
     if ((goodid >= id) && (goodid <= maxid))
         return goodid;
     for (; id <= maxid; id++) {
-        res = clientTable[client].resources[Hash(client, id)];
+        res = clientTable[client].resources[HashResourceID(id, clientTable[client].hashsize)];
         while (res && (res->id != id))
             res = res->next;
         if (!res)
@@ -481,7 +805,7 @@ AddResource(XID id, RESTYPE type, pointer value)
     }
     if ((rrec->elements >= 4 * rrec->buckets) && (rrec->hashsize < MAXHASHSIZE))
         RebuildTable(client);
-    head = &rrec->resources[Hash(client, id)];
+    head = &rrec->resources[HashResourceID(id, clientTable[client].hashsize)];
     res = malloc(sizeof(ResourceRec));
     if (!res) {
         (*resourceTypes[type & TypeMask].deleteFunc) (value, id);
@@ -529,7 +853,7 @@ RebuildTable(int client)
         for (res = *rptr; res; res = next) {
             next = res->next;
             res->next = NULL;
-            tptr = &tails[Hash(client, res->id)];
+            tptr = &tails[HashResourceID(res->id, clientTable[client].hashsize)];
             **tptr = res;
             *tptr = &res->next;
         }
@@ -561,7 +885,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
     int elements;
 
     if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) {
-        head = &clientTable[cid].resources[Hash(cid, id)];
+        head = &clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)];
         eltptr = &clientTable[cid].elements;
 
         prev = head;
@@ -595,7 +919,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
     ResourcePtr *prev, *head;
 
     if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) {
-        head = &clientTable[cid].resources[Hash(cid, id)];
+        head = &clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)];
 
         prev = head;
         while ((res = *prev)) {
@@ -630,7 +954,7 @@ ChangeResourceValue(XID id, RESTYPE rtype, pointer value)
     ResourcePtr res;
 
     if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) {
-        res = clientTable[cid].resources[Hash(cid, id)];
+        res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)];
 
         for (; res; res = res->next)
             if ((res->id == id) && (res->type == rtype)) {
@@ -674,6 +998,15 @@ FindClientResourcesByType(ClientPtr client,
     }
 }
 
+void FindSubResources(pointer    resource,
+                      RESTYPE    type,
+                      FindAllRes func,
+                      pointer    cdata)
+{
+    struct ResourceType rtype = resourceTypes[type & TypeMask];
+    rtype.findSubResFunc(resource, func, cdata);
+}
+
 void
 FindAllClientResources(ClientPtr client, FindAllRes func, pointer cdata)
 {
@@ -859,7 +1192,7 @@ dixLookupResourceByType(pointer *result, XID id, RESTYPE rtype,
         return BadImplementation;
 
     if ((cid < MAXCLIENTS) && clientTable[cid].buckets) {
-        res = clientTable[cid].resources[Hash(cid, id)];
+        res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)];
 
         for (; res; res = res->next)
             if (res->id == id && res->type == rtype)
@@ -892,7 +1225,7 @@ dixLookupResourceByClass(pointer *result, XID id, RESTYPE rclass,
     *result = NULL;
 
     if ((cid < MAXCLIENTS) && clientTable[cid].buckets) {
-        res = clientTable[cid].resources[Hash(cid, id)];
+        res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)];
 
         for (; res; res = res->next)
             if (res->id == id && (res->type & rclass))
index dfdcfdc..e905b1e 100644 (file)
@@ -174,8 +174,6 @@ ProcSetSelectionOwner(ClientPtr client)
     rc = dixLookupSelection(&pSel, stuff->selection, client, DixSetAttrAccess);
 
     if (rc == Success) {
-        xEvent event;
-
         /* If the timestamp in client's request is in the past relative
            to the time stamp indicating the last time the owner of the
            selection was set, do not set the selection, just return 
@@ -183,10 +181,12 @@ ProcSetSelectionOwner(ClientPtr client)
         if (CompareTimeStamps(time, pSel->lastTimeChanged) == EARLIER)
             return Success;
         if (pSel->client && (!pWin || (pSel->client != client))) {
+            xEvent event = {
+                .u.selectionClear.time = time.milliseconds,
+                .u.selectionClear.window = pSel->window,
+                .u.selectionClear.atom = pSel->selection
+            };
             event.u.u.type = SelectionClear;
-            event.u.selectionClear.time = time.milliseconds;
-            event.u.selectionClear.window = pSel->window;
-            event.u.selectionClear.atom = pSel->selection;
             WriteEventsToClient(pSel->client, 1, &event);
         }
     }
@@ -238,10 +238,11 @@ ProcGetSelectionOwner(ClientPtr client)
         return BadAtom;
     }
 
-    memset(&reply, 0, sizeof(xGetSelectionOwnerReply));
-    reply.type = X_Reply;
-    reply.length = 0;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGetSelectionOwnerReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+    };
 
     rc = dixLookupSelection(&pSel, stuff->id, client, DixGetAttrAccess);
     if (rc == Success)
index 9440c4e..559fe27 100644 (file)
@@ -80,7 +80,7 @@ Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
     {
         swapl(&pbuf[i]);
     }
-    (void) WriteToClient(pClient, size << 2, (char *) pbuf);
+    WriteToClient(pClient, size << 2, pbuf);
 }
 
 /**
@@ -123,7 +123,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
             from++;
             to++;
         }
-        (void) WriteToClient(pClient, nbytes, (char *) pbufT);
+        WriteToClient(pClient, nbytes, pbufT);
     }
 
     if (pbufT != tmpbuf)
@@ -170,7 +170,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
             from++;
             to++;
         }
-        (void) WriteToClient(pClient, nbytes, (char *) pbufT);
+        WriteToClient(pClient, nbytes, pbufT);
     }
 
     if (pbufT != tmpbuf)
@@ -182,7 +182,7 @@ void
 SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep)
 {
     swaps(&pRep->sequenceNumber);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 /* Extra-large reply */
@@ -200,7 +200,7 @@ SGetWindowAttributesReply(ClientPtr pClient, int size,
     swapl(&pRep->allEventMasks);
     swapl(&pRep->yourEventMask);
     swaps(&pRep->doNotPropagateMask);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -213,7 +213,7 @@ SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply * pRep)
     swaps(&pRep->width);
     swaps(&pRep->height);
     swaps(&pRep->borderWidth);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -224,7 +224,7 @@ SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply * pRep)
     swapl(&pRep->root);
     swapl(&pRep->parent);
     swaps(&pRep->nChildren);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -232,7 +232,7 @@ SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply * pRep)
 {
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->atom);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -241,7 +241,7 @@ SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep)
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
     swaps(&pRep->nameLength);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -252,7 +252,7 @@ SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply * pRep)
     swapl(&pRep->propertyType);
     swapl(&pRep->bytesAfter);
     swapl(&pRep->nItems);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -261,7 +261,7 @@ SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply * pRep)
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
     swaps(&pRep->nProperties);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -270,7 +270,7 @@ SGetSelectionOwnerReply(ClientPtr pClient, int size,
 {
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->owner);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -284,7 +284,7 @@ SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply * pRep)
     swaps(&pRep->winX);
     swaps(&pRep->winY);
     swaps(&pRep->mask);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 static void
@@ -307,7 +307,7 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord * pRep)
         SwapTimecoord(pRepT);
         pRepT++;
     }
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 
 }
 
@@ -317,7 +317,7 @@ SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply * pRep)
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
     swapl(&pRep->nEvents);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -327,7 +327,7 @@ STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply * pRep)
     swapl(&pRep->child);
     swaps(&pRep->dstX);
     swaps(&pRep->dstY);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -335,7 +335,7 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply * pRep)
 {
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->focus);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 /* extra long reply */
@@ -344,7 +344,7 @@ SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply * pRep)
 {
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 static void
@@ -405,7 +405,7 @@ void
 SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply * pRep)
 {
     SwapFont(pRep, TRUE);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -420,7 +420,7 @@ SQueryTextExtentsReply(ClientPtr pClient, int size,
     swapl(&pRep->overallWidth);
     swapl(&pRep->overallLeft);
     swapl(&pRep->overallRight);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -429,7 +429,7 @@ SListFontsReply(ClientPtr pClient, int size, xListFontsReply * pRep)
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
     swaps(&pRep->nFonts);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -437,7 +437,7 @@ SListFontsWithInfoReply(ClientPtr pClient, int size,
                         xListFontsWithInfoReply * pRep)
 {
     SwapFont((xQueryFontReply *) pRep, FALSE);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -446,7 +446,7 @@ SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep)
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
     swaps(&pRep->nPaths);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -455,7 +455,7 @@ SGetImageReply(ClientPtr pClient, int size, xGetImageReply * pRep)
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
     swapl(&pRep->visual);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
     /* Fortunately, image doesn't need swapping */
 }
 
@@ -466,7 +466,7 @@ SListInstalledColormapsReply(ClientPtr pClient, int size,
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
     swaps(&pRep->nColormaps);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -477,7 +477,7 @@ SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply * pRep)
     swaps(&pRep->green);
     swaps(&pRep->blue);
     swapl(&pRep->pixel);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -491,7 +491,7 @@ SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply * pRep)
     swaps(&pRep->screenRed);
     swaps(&pRep->screenGreen);
     swaps(&pRep->screenBlue);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -501,7 +501,7 @@ SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply * pRep)
     swapl(&pRep->length);
     swaps(&pRep->nPixels);
     swaps(&pRep->nMasks);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -514,7 +514,7 @@ SAllocColorPlanesReply(ClientPtr pClient, int size,
     swapl(&pRep->redMask);
     swapl(&pRep->greenMask);
     swapl(&pRep->blueMask);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 static void
@@ -537,7 +537,7 @@ SQColorsExtend(ClientPtr pClient, int size, xrgb * prgb)
         SwapRGB(prgbT);
         prgbT++;
     }
-    (void) WriteToClient(pClient, size, (char *) prgb);
+    WriteToClient(pClient, size, prgb);
 }
 
 void
@@ -546,7 +546,7 @@ SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply * pRep)
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
     swaps(&pRep->nColors);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -559,7 +559,7 @@ SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply * pRep)
     swaps(&pRep->screenRed);
     swaps(&pRep->screenGreen);
     swaps(&pRep->screenBlue);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -568,7 +568,7 @@ SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply * pRep)
     swaps(&pRep->sequenceNumber);
     swaps(&pRep->width);
     swaps(&pRep->height);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -576,7 +576,7 @@ SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep)
 {
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -585,7 +585,7 @@ SGetKeyboardMappingReply(ClientPtr pClient, int size,
 {
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -594,7 +594,7 @@ SGetPointerMappingReply(ClientPtr pClient, int size,
 {
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -603,7 +603,7 @@ SGetModifierMappingReply(ClientPtr pClient, int size,
 {
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -615,7 +615,7 @@ SGetKeyboardControlReply(ClientPtr pClient, int size,
     swapl(&pRep->ledMask);
     swaps(&pRep->bellPitch);
     swaps(&pRep->bellDuration);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -626,7 +626,7 @@ SGetPointerControlReply(ClientPtr pClient, int size,
     swaps(&pRep->accelNumerator);
     swaps(&pRep->accelDenominator);
     swaps(&pRep->threshold);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -635,7 +635,7 @@ SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply * pRep)
     swaps(&pRep->sequenceNumber);
     swaps(&pRep->timeout);
     swaps(&pRep->interval);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -651,7 +651,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf)
         swaps(&host->length);
         bufT += sizeof(xHostEntry) + pad_to_int32(len);
     }
-    (void) WriteToClient(pClient, size, buf);
+    WriteToClient(pClient, size, buf);
 }
 
 void
@@ -660,7 +660,7 @@ SListHostsReply(ClientPtr pClient, int size, xListHostsReply * pRep)
     swaps(&pRep->sequenceNumber);
     swapl(&pRep->length);
     swaps(&pRep->nHosts);
-    (void) WriteToClient(pClient, size, (char *) pRep);
+    WriteToClient(pClient, size, pRep);
 }
 
 void
@@ -1140,7 +1140,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
         return;
     }
     SwapConnSetupInfo(pInfo, pInfoTBase);
-    (void) WriteToClient(pClient, (int) size, (char *) pInfoTBase);
+    WriteToClient(pClient, (int) size, pInfoTBase);
     free(pInfoTBase);
 }
 
@@ -1160,7 +1160,7 @@ WriteSConnSetupPrefix(ClientPtr pClient, xConnSetupPrefix * pcsp)
     xConnSetupPrefix cspT;
 
     SwapConnSetupPrefix(pcsp, &cspT);
-    (void) WriteToClient(pClient, sizeof(cspT), (char *) &cspT);
+    WriteToClient(pClient, sizeof(cspT), &cspT);
 }
 
 /*
index a896b4b..0f6d49e 100644 (file)
@@ -283,7 +283,7 @@ SProcConvertSelection(ClientPtr client)
 int
 SProcSendEvent(ClientPtr client)
 {
-    xEvent eventT;
+    xEvent eventT = { .u.u.type = 0 };
     EventSwapPtr proc;
 
     REQUEST(xSendEventReq);
index 705ef0d..686cddd 100644 (file)
@@ -58,364 +58,529 @@ SOFTWARE.
 #include "swaprep.h"
 #include "swapreq.h"
 
-int (*InitialVector[3]) (ClientPtr      /* client */
-    ) = {
-0, ProcInitialConnection, ProcEstablishConnection};
+int (*InitialVector[3]) (ClientPtr /* client */) = {
+    0,
+    ProcInitialConnection,
+    ProcEstablishConnection
+};
 
-int (*ProcVector[256]) (ClientPtr       /* client */
-    ) = {
-    ProcBadRequest, ProcCreateWindow, ProcChangeWindowAttributes, ProcGetWindowAttributes, ProcDestroyWindow, ProcDestroySubwindows,    /* 5 */
-        ProcChangeSaveSet, ProcReparentWindow, ProcMapWindow, ProcMapSubwindows, ProcUnmapWindow,       /* 10 */
-        ProcUnmapSubwindows, ProcConfigureWindow, ProcCirculateWindow, ProcGetGeometry, ProcQueryTree,  /* 15 */
-        ProcInternAtom, ProcGetAtomName, ProcChangeProperty, ProcDeleteProperty, ProcGetProperty,       /* 20 */
-        ProcListProperties, ProcSetSelectionOwner, ProcGetSelectionOwner, ProcConvertSelection, ProcSendEvent,  /* 25 */
-        ProcGrabPointer, ProcUngrabPointer, ProcGrabButton, ProcUngrabButton, ProcChangeActivePointerGrab,      /* 30 */
-        ProcGrabKeyboard, ProcUngrabKeyboard, ProcGrabKey, ProcUngrabKey, ProcAllowEvents,      /* 35 */
-        ProcGrabServer, ProcUngrabServer, ProcQueryPointer, ProcGetMotionEvents, ProcTranslateCoords,   /* 40 */
-        ProcWarpPointer, ProcSetInputFocus, ProcGetInputFocus, ProcQueryKeymap, ProcOpenFont,   /* 45 */
-        ProcCloseFont, ProcQueryFont, ProcQueryTextExtents, ProcListFonts, ProcListFontsWithInfo,       /* 50 */
-        ProcSetFontPath, ProcGetFontPath, ProcCreatePixmap, ProcFreePixmap, ProcCreateGC,       /* 55 */
-        ProcChangeGC, ProcCopyGC, ProcSetDashes, ProcSetClipRectangles, ProcFreeGC,     /* 60 */
-        ProcClearToBackground, ProcCopyArea, ProcCopyPlane, ProcPolyPoint, ProcPolyLine,        /* 65 */
-        ProcPolySegment, ProcPolyRectangle, ProcPolyArc, ProcFillPoly, ProcPolyFillRectangle,   /* 70 */
-        ProcPolyFillArc, ProcPutImage, ProcGetImage, ProcPolyText, ProcPolyText,        /* 75 */
-        ProcImageText8, ProcImageText16, ProcCreateColormap, ProcFreeColormap, ProcCopyColormapAndFree, /* 80 */
-        ProcInstallColormap, ProcUninstallColormap, ProcListInstalledColormaps, ProcAllocColor, ProcAllocNamedColor,    /* 85 */
-        ProcAllocColorCells, ProcAllocColorPlanes, ProcFreeColors, ProcStoreColors, ProcStoreNamedColor,        /* 90 */
-        ProcQueryColors, ProcLookupColor, ProcCreateCursor, ProcCreateGlyphCursor, ProcFreeCursor,      /* 95 */
-        ProcRecolorCursor, ProcQueryBestSize, ProcQueryExtension, ProcListExtensions, ProcChangeKeyboardMapping,        /* 100 */
-        ProcGetKeyboardMapping, ProcChangeKeyboardControl, ProcGetKeyboardControl, ProcBell, ProcChangePointerControl,  /* 105 */
-        ProcGetPointerControl, ProcSetScreenSaver, ProcGetScreenSaver, ProcChangeHosts, ProcListHosts,  /* 110 */
-        ProcChangeAccessControl, ProcChangeCloseDownMode, ProcKillClient, ProcRotateProperties, ProcForceScreenSaver,   /* 115 */
-        ProcSetPointerMapping, ProcGetPointerMapping, ProcSetModifierMapping, ProcGetModifierMapping, ProcBadRequest,   /* 120 */
-        ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, /* 125 */
-ProcBadRequest,
-        ProcNoOperation,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest};
+int (*ProcVector[256]) (ClientPtr /* client */) = {
+    ProcBadRequest,
+    ProcCreateWindow,
+    ProcChangeWindowAttributes,
+    ProcGetWindowAttributes,
+    ProcDestroyWindow,
+    ProcDestroySubwindows,              /* 5 */
+    ProcChangeSaveSet,
+    ProcReparentWindow,
+    ProcMapWindow,
+    ProcMapSubwindows,
+    ProcUnmapWindow,                    /* 10 */
+    ProcUnmapSubwindows,
+    ProcConfigureWindow,
+    ProcCirculateWindow,
+    ProcGetGeometry,
+    ProcQueryTree,                      /* 15 */
+    ProcInternAtom,
+    ProcGetAtomName,
+    ProcChangeProperty,
+    ProcDeleteProperty,
+    ProcGetProperty,                    /* 20 */
+    ProcListProperties,
+    ProcSetSelectionOwner,
+    ProcGetSelectionOwner,
+    ProcConvertSelection,
+    ProcSendEvent,                      /* 25 */
+    ProcGrabPointer,
+    ProcUngrabPointer,
+    ProcGrabButton,
+    ProcUngrabButton,
+    ProcChangeActivePointerGrab,        /* 30 */
+    ProcGrabKeyboard,
+    ProcUngrabKeyboard,
+    ProcGrabKey,
+    ProcUngrabKey,
+    ProcAllowEvents,                    /* 35 */
+    ProcGrabServer,
+    ProcUngrabServer,
+    ProcQueryPointer,
+    ProcGetMotionEvents,
+    ProcTranslateCoords,                /* 40 */
+    ProcWarpPointer,
+    ProcSetInputFocus,
+    ProcGetInputFocus,
+    ProcQueryKeymap,
+    ProcOpenFont,                       /* 45 */
+    ProcCloseFont,
+    ProcQueryFont,
+    ProcQueryTextExtents,
+    ProcListFonts,
+    ProcListFontsWithInfo,              /* 50 */
+    ProcSetFontPath,
+    ProcGetFontPath,
+    ProcCreatePixmap,
+    ProcFreePixmap,
+    ProcCreateGC,                       /* 55 */
+    ProcChangeGC,
+    ProcCopyGC,
+    ProcSetDashes,
+    ProcSetClipRectangles,
+    ProcFreeGC,                         /* 60 */
+    ProcClearToBackground,
+    ProcCopyArea,
+    ProcCopyPlane,
+    ProcPolyPoint,
+    ProcPolyLine,                       /* 65 */
+    ProcPolySegment,
+    ProcPolyRectangle,
+    ProcPolyArc,
+    ProcFillPoly,
+    ProcPolyFillRectangle,              /* 70 */
+    ProcPolyFillArc,
+    ProcPutImage,
+    ProcGetImage,
+    ProcPolyText,
+    ProcPolyText,                       /* 75 */
+    ProcImageText8,
+    ProcImageText16,
+    ProcCreateColormap,
+    ProcFreeColormap,
+    ProcCopyColormapAndFree,            /* 80 */
+    ProcInstallColormap,
+    ProcUninstallColormap,
+    ProcListInstalledColormaps,
+    ProcAllocColor,
+    ProcAllocNamedColor,                /* 85 */
+    ProcAllocColorCells,
+    ProcAllocColorPlanes,
+    ProcFreeColors,
+    ProcStoreColors,
+    ProcStoreNamedColor,                /* 90 */
+    ProcQueryColors,
+    ProcLookupColor,
+    ProcCreateCursor,
+    ProcCreateGlyphCursor,
+    ProcFreeCursor,                     /* 95 */
+    ProcRecolorCursor,
+    ProcQueryBestSize,
+    ProcQueryExtension,
+    ProcListExtensions,
+    ProcChangeKeyboardMapping,          /* 100 */
+    ProcGetKeyboardMapping,
+    ProcChangeKeyboardControl,
+    ProcGetKeyboardControl,
+    ProcBell,
+    ProcChangePointerControl,           /* 105 */
+    ProcGetPointerControl,
+    ProcSetScreenSaver,
+    ProcGetScreenSaver,
+    ProcChangeHosts,
+    ProcListHosts,                      /* 110 */
+    ProcChangeAccessControl,
+    ProcChangeCloseDownMode,
+    ProcKillClient,
+    ProcRotateProperties,
+    ProcForceScreenSaver,               /* 115 */
+    ProcSetPointerMapping,
+    ProcGetPointerMapping,
+    ProcSetModifierMapping,
+    ProcGetModifierMapping,
+    ProcBadRequest,                     /* 120 */
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,                     /* 125 */
+    ProcBadRequest,
+    ProcNoOperation,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest
+};
 
-int (*SwappedProcVector[256]) (ClientPtr        /* client */
-    ) = {
-    ProcBadRequest, SProcCreateWindow, SProcChangeWindowAttributes, SProcResourceReq,   /* GetWindowAttributes */
-        SProcResourceReq,       /* DestroyWindow */
-        SProcResourceReq,       /* 5 DestroySubwindows */
-        SProcResourceReq,       /* SProcChangeSaveSet, */
-        SProcReparentWindow, SProcResourceReq,  /* MapWindow */
-        SProcResourceReq,       /* MapSubwindows */
-        SProcResourceReq,       /* 10 UnmapWindow */
-        SProcResourceReq,       /* UnmapSubwindows */
-        SProcConfigureWindow, SProcResourceReq, /* SProcCirculateWindow, */
-        SProcResourceReq,       /* GetGeometry */
-        SProcResourceReq,       /* 15 QueryTree */
-        SProcInternAtom, SProcResourceReq,      /* SProcGetAtomName, */
-        SProcChangeProperty, SProcDeleteProperty, SProcGetProperty,     /* 20 */
-        SProcResourceReq,       /* SProcListProperties, */
-        SProcSetSelectionOwner, SProcResourceReq,       /* SProcGetSelectionOwner, */
-        SProcConvertSelection, SProcSendEvent,  /* 25 */
-        SProcGrabPointer, SProcResourceReq,     /* SProcUngrabPointer, */
-        SProcGrabButton, SProcUngrabButton, SProcChangeActivePointerGrab,       /* 30 */
-        SProcGrabKeyboard, SProcResourceReq,    /* SProcUngrabKeyboard, */
-        SProcGrabKey, SProcUngrabKey, SProcResourceReq, /* 35 SProcAllowEvents, */
-        SProcSimpleReq,         /* SProcGrabServer, */
-        SProcSimpleReq,         /* SProcUngrabServer, */
-        SProcResourceReq,       /* SProcQueryPointer, */
-        SProcGetMotionEvents, SProcTranslateCoords,     /*40 */
-        SProcWarpPointer, SProcSetInputFocus, SProcSimpleReq,   /* SProcGetInputFocus, */
-        SProcSimpleReq,         /* QueryKeymap, */
-        SProcOpenFont,          /* 45 */
-        SProcResourceReq,       /* SProcCloseFont, */
-        SProcResourceReq,       /* SProcQueryFont, */
-        SProcResourceReq,       /* SProcQueryTextExtents,  */
-        SProcListFonts, SProcListFontsWithInfo, /* 50 */
-        SProcSetFontPath, SProcSimpleReq,       /* GetFontPath, */
-        SProcCreatePixmap, SProcResourceReq,    /* SProcFreePixmap, */
-        SProcCreateGC,          /* 55 */
-        SProcChangeGC, SProcCopyGC, SProcSetDashes, SProcSetClipRectangles, SProcResourceReq,   /* 60 SProcFreeGC, */
-        SProcClearToBackground, SProcCopyArea, SProcCopyPlane, SProcPoly,       /* PolyPoint, */
-        SProcPoly,              /* 65 PolyLine */
-        SProcPoly,              /* PolySegment, */
-        SProcPoly,              /* PolyRectangle, */
-        SProcPoly,              /* PolyArc, */
-        SProcFillPoly, SProcPoly,       /* 70 PolyFillRectangle */
-        SProcPoly,              /* PolyFillArc, */
-        SProcPutImage, SProcGetImage, SProcPolyText, SProcPolyText,     /* 75 */
-        SProcImageText, SProcImageText, SProcCreateColormap, SProcResourceReq,  /* SProcFreeColormap, */
-        SProcCopyColormapAndFree,       /* 80 */
-        SProcResourceReq,       /* SProcInstallColormap, */
-        SProcResourceReq,       /* SProcUninstallColormap, */
-        SProcResourceReq,       /* SProcListInstalledColormaps, */
-        SProcAllocColor, SProcAllocNamedColor,  /* 85 */
-        SProcAllocColorCells, SProcAllocColorPlanes, SProcFreeColors, SProcStoreColors, SProcStoreNamedColor,   /* 90 */
-        SProcQueryColors, SProcLookupColor, SProcCreateCursor, SProcCreateGlyphCursor, SProcResourceReq,        /* 95 SProcFreeCursor, */
-        SProcRecolorCursor, SProcQueryBestSize, SProcQueryExtension, SProcSimpleReq,    /* ListExtensions, */
-        SProcChangeKeyboardMapping,     /* 100 */
-        SProcSimpleReq,         /* GetKeyboardMapping, */
-        SProcChangeKeyboardControl, SProcSimpleReq,     /* GetKeyboardControl, */
-        SProcSimpleReq,         /* Bell, */
-        SProcChangePointerControl,      /* 105 */
-        SProcSimpleReq,         /* GetPointerControl, */
-        SProcSetScreenSaver, SProcSimpleReq,    /* GetScreenSaver, */
-        SProcChangeHosts, SProcSimpleReq,       /* 110 ListHosts, */
-        SProcSimpleReq,         /* SProcChangeAccessControl, */
-        SProcSimpleReq,         /* SProcChangeCloseDownMode, */
-        SProcResourceReq,       /* SProcKillClient, */
-        SProcRotateProperties, SProcSimpleReq,  /* 115 ForceScreenSaver */
-        SProcSimpleReq,         /* SetPointerMapping, */
-        SProcSimpleReq,         /* GetPointerMapping, */
-        SProcSimpleReq,         /* SetModifierMapping, */
-        SProcSimpleReq,         /* GetModifierMapping, */
-        ProcBadRequest,         /* 120 */
-        ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, /* 125 */
-ProcBadRequest,
-        SProcNoOperation,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest,
-        ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest};
+int (*SwappedProcVector[256]) (ClientPtr /* client */) = {
+    ProcBadRequest,
+    SProcCreateWindow,
+    SProcChangeWindowAttributes,
+    SProcResourceReq,                   /* GetWindowAttributes */
+    SProcResourceReq,                   /* DestroyWindow */
+    SProcResourceReq,                   /* 5 DestroySubwindows */
+    SProcResourceReq,                   /* SProcChangeSaveSet, */
+    SProcReparentWindow,
+    SProcResourceReq,                   /* MapWindow */
+    SProcResourceReq,                   /* MapSubwindows */
+    SProcResourceReq,                   /* 10 UnmapWindow */
+    SProcResourceReq,                   /* UnmapSubwindows */
+    SProcConfigureWindow,
+    SProcResourceReq,                   /* SProcCirculateWindow, */
+    SProcResourceReq,                   /* GetGeometry */
+    SProcResourceReq,                   /* 15 QueryTree */
+    SProcInternAtom,
+    SProcResourceReq,                   /* SProcGetAtomName, */
+    SProcChangeProperty,
+    SProcDeleteProperty,
+    SProcGetProperty,                   /* 20 */
+    SProcResourceReq,                   /* SProcListProperties, */
+    SProcSetSelectionOwner,
+    SProcResourceReq,                   /* SProcGetSelectionOwner, */
+    SProcConvertSelection,
+    SProcSendEvent,                     /* 25 */
+    SProcGrabPointer,
+    SProcResourceReq,                   /* SProcUngrabPointer, */
+    SProcGrabButton,
+    SProcUngrabButton,
+    SProcChangeActivePointerGrab,       /* 30 */
+    SProcGrabKeyboard,
+    SProcResourceReq,                   /* SProcUngrabKeyboard, */
+    SProcGrabKey,
+    SProcUngrabKey,
+    SProcResourceReq,                   /* 35 SProcAllowEvents, */
+    SProcSimpleReq,                     /* SProcGrabServer, */
+    SProcSimpleReq,                     /* SProcUngrabServer, */
+    SProcResourceReq,                   /* SProcQueryPointer, */
+    SProcGetMotionEvents,
+    SProcTranslateCoords,               /*40 */
+    SProcWarpPointer,
+    SProcSetInputFocus,
+    SProcSimpleReq,                     /* SProcGetInputFocus, */
+    SProcSimpleReq,                     /* QueryKeymap, */
+    SProcOpenFont,                      /* 45 */
+    SProcResourceReq,                   /* SProcCloseFont, */
+    SProcResourceReq,                   /* SProcQueryFont, */
+    SProcResourceReq,                   /* SProcQueryTextExtents,  */
+    SProcListFonts,
+    SProcListFontsWithInfo,             /* 50 */
+    SProcSetFontPath,
+    SProcSimpleReq,                     /* GetFontPath, */
+    SProcCreatePixmap,
+    SProcResourceReq,                   /* SProcFreePixmap, */
+    SProcCreateGC,                      /* 55 */
+    SProcChangeGC,
+    SProcCopyGC,
+    SProcSetDashes,
+    SProcSetClipRectangles,
+    SProcResourceReq,                   /* 60 SProcFreeGC, */
+    SProcClearToBackground,
+    SProcCopyArea,
+    SProcCopyPlane,
+    SProcPoly,                          /* PolyPoint, */
+    SProcPoly,                          /* 65 PolyLine */
+    SProcPoly,                          /* PolySegment, */
+    SProcPoly,                          /* PolyRectangle, */
+    SProcPoly,                          /* PolyArc, */
+    SProcFillPoly,
+    SProcPoly,                          /* 70 PolyFillRectangle */
+    SProcPoly,                          /* PolyFillArc, */
+    SProcPutImage,
+    SProcGetImage,
+    SProcPolyText,
+    SProcPolyText,                      /* 75 */
+    SProcImageText,
+    SProcImageText,
+    SProcCreateColormap,
+    SProcResourceReq,                   /* SProcFreeColormap, */
+    SProcCopyColormapAndFree,           /* 80 */
+    SProcResourceReq,                   /* SProcInstallColormap, */
+    SProcResourceReq,                   /* SProcUninstallColormap, */
+    SProcResourceReq,                   /* SProcListInstalledColormaps, */
+    SProcAllocColor,
+    SProcAllocNamedColor,               /* 85 */
+    SProcAllocColorCells,
+    SProcAllocColorPlanes,
+    SProcFreeColors,
+    SProcStoreColors,
+    SProcStoreNamedColor,               /* 90 */
+    SProcQueryColors,
+    SProcLookupColor,
+    SProcCreateCursor,
+    SProcCreateGlyphCursor,
+    SProcResourceReq,                   /* 95 SProcFreeCursor, */
+    SProcRecolorCursor,
+    SProcQueryBestSize,
+    SProcQueryExtension,
+    SProcSimpleReq,                     /* ListExtensions, */
+    SProcChangeKeyboardMapping,         /* 100 */
+    SProcSimpleReq,                     /* GetKeyboardMapping, */
+    SProcChangeKeyboardControl,
+    SProcSimpleReq,                     /* GetKeyboardControl, */
+    SProcSimpleReq,                     /* Bell, */
+    SProcChangePointerControl,          /* 105 */
+    SProcSimpleReq,                     /* GetPointerControl, */
+    SProcSetScreenSaver,
+    SProcSimpleReq,                     /* GetScreenSaver, */
+    SProcChangeHosts,
+    SProcSimpleReq,                     /* 110 ListHosts, */
+    SProcSimpleReq,                     /* SProcChangeAccessControl, */
+    SProcSimpleReq,                     /* SProcChangeCloseDownMode, */
+    SProcResourceReq,                   /* SProcKillClient, */
+    SProcRotateProperties,
+    SProcSimpleReq,                     /* 115 ForceScreenSaver */
+    SProcSimpleReq,                     /* SetPointerMapping, */
+    SProcSimpleReq,                     /* GetPointerMapping, */
+    SProcSimpleReq,                     /* SetModifierMapping, */
+    SProcSimpleReq,                     /* GetModifierMapping, */
+    ProcBadRequest,                     /* 120 */
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,                     /* 125 */
+    ProcBadRequest,
+    SProcNoOperation,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest,
+    ProcBadRequest
+};
 
 EventSwapPtr EventSwapVector[MAXEVENTS] = {
     (EventSwapPtr) SErrorEvent,
@@ -423,32 +588,32 @@ EventSwapPtr EventSwapVector[MAXEVENTS] = {
     SKeyButtonPtrEvent,
     SKeyButtonPtrEvent,
     SKeyButtonPtrEvent,
-    SKeyButtonPtrEvent,         /* 5 */
+    SKeyButtonPtrEvent,                         /* 5 */
     SKeyButtonPtrEvent,
     SEnterLeaveEvent,
     SEnterLeaveEvent,
     SFocusEvent,
-    SFocusEvent,                /* 10 */
+    SFocusEvent,                                /* 10 */
     SKeymapNotifyEvent,
     SExposeEvent,
     SGraphicsExposureEvent,
     SNoExposureEvent,
-    SVisibilityEvent,           /* 15 */
+    SVisibilityEvent,                           /* 15 */
     SCreateNotifyEvent,
     SDestroyNotifyEvent,
     SUnmapNotifyEvent,
     SMapNotifyEvent,
-    SMapRequestEvent,           /* 20 */
+    SMapRequestEvent,                           /* 20 */
     SReparentEvent,
     SConfigureNotifyEvent,
     SConfigureRequestEvent,
     SGravityEvent,
-    SResizeRequestEvent,        /* 25 */
+    SResizeRequestEvent,                        /* 25 */
     SCirculateEvent,
     SCirculateEvent,
     SPropertyEvent,
     SSelectionClearEvent,
-    SSelectionRequestEvent,     /* 30 */
+    SSelectionRequestEvent,                     /* 30 */
     SSelectionNotifyEvent,
     SColormapEvent,
     SClientMessageEvent,
@@ -554,37 +719,37 @@ ReplySwapPtr ReplySwapVector[256] = {
     ReplyNotSwappd,
     (ReplySwapPtr) SGetWindowAttributesReply,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 5 */
+    ReplyNotSwappd,                             /* 5 */
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 10 */
+    ReplyNotSwappd,                             /* 10 */
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
     (ReplySwapPtr) SGetGeometryReply,
-    (ReplySwapPtr) SQueryTreeReply,     /* 15 */
+    (ReplySwapPtr) SQueryTreeReply,             /* 15 */
     (ReplySwapPtr) SInternAtomReply,
     (ReplySwapPtr) SGetAtomNameReply,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    (ReplySwapPtr) SGetPropertyReply,   /* 20 */
+    (ReplySwapPtr) SGetPropertyReply,           /* 20 */
     (ReplySwapPtr) SListPropertiesReply,
     ReplyNotSwappd,
     (ReplySwapPtr) SGetSelectionOwnerReply,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 25 */
-    (ReplySwapPtr) SGenericReply,       /* SGrabPointerReply, */
+    ReplyNotSwappd,                             /* 25 */
+    (ReplySwapPtr) SGenericReply,               /* SGrabPointerReply, */
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 30 */
-    (ReplySwapPtr) SGenericReply,       /* SGrabKeyboardReply, */
+    ReplyNotSwappd,                             /* 30 */
+    (ReplySwapPtr) SGenericReply,               /* SGrabKeyboardReply, */
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 35 */
+    ReplyNotSwappd,                             /* 35 */
     ReplyNotSwappd,
     ReplyNotSwappd,
     (ReplySwapPtr) SQueryPointerReply,
@@ -594,7 +759,7 @@ ReplySwapPtr ReplySwapVector[256] = {
     ReplyNotSwappd,
     (ReplySwapPtr) SGetInputFocusReply,
     (ReplySwapPtr) SQueryKeymapReply,
-    ReplyNotSwappd,             /* 45 */
+    ReplyNotSwappd,                             /* 45 */
     ReplyNotSwappd,
     (ReplySwapPtr) SQueryFontReply,
     (ReplySwapPtr) SQueryTextExtentsReply,
@@ -604,32 +769,32 @@ ReplySwapPtr ReplySwapVector[256] = {
     (ReplySwapPtr) SGetFontPathReply,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 55 */
+    ReplyNotSwappd,                             /* 55 */
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 60 */
+    ReplyNotSwappd,                             /* 60 */
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 65 */
+    ReplyNotSwappd,                             /* 65 */
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 70 */
+    ReplyNotSwappd,                             /* 70 */
     ReplyNotSwappd,
     ReplyNotSwappd,
     (ReplySwapPtr) SGetImageReply,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 75 */
+    ReplyNotSwappd,                             /* 75 */
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 80 */
+    ReplyNotSwappd,                             /* 80 */
     ReplyNotSwappd,
     ReplyNotSwappd,
     (ReplySwapPtr) SListInstalledColormapsReply,
@@ -639,44 +804,44 @@ ReplySwapPtr ReplySwapVector[256] = {
     (ReplySwapPtr) SAllocColorPlanesReply,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 90 */
+    ReplyNotSwappd,                             /* 90 */
     (ReplySwapPtr) SQueryColorsReply,
     (ReplySwapPtr) SLookupColorReply,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 95 */
+    ReplyNotSwappd,                             /* 95 */
     ReplyNotSwappd,
     (ReplySwapPtr) SQueryBestSizeReply,
-    (ReplySwapPtr) SGenericReply,       /* SQueryExtensionReply, */
+    (ReplySwapPtr) SGenericReply,               /* SQueryExtensionReply, */
     (ReplySwapPtr) SListExtensionsReply,
-    ReplyNotSwappd,             /* 100 */
+    ReplyNotSwappd,                             /* 100 */
     (ReplySwapPtr) SGetKeyboardMappingReply,
     ReplyNotSwappd,
     (ReplySwapPtr) SGetKeyboardControlReply,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 105 */
+    ReplyNotSwappd,                             /* 105 */
     (ReplySwapPtr) SGetPointerControlReply,
     ReplyNotSwappd,
     (ReplySwapPtr) SGetScreenSaverReply,
     ReplyNotSwappd,
-    (ReplySwapPtr) SListHostsReply,     /* 110 */
+    (ReplySwapPtr) SListHostsReply,             /* 110 */
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
-    ReplyNotSwappd,             /* 115 */
-    (ReplySwapPtr) SGenericReply,       /* SetPointerMapping */
+    ReplyNotSwappd,                             /* 115 */
+    (ReplySwapPtr) SGenericReply,               /* SetPointerMapping */
     (ReplySwapPtr) SGetPointerMappingReply,
-    (ReplySwapPtr) SGenericReply,       /* SetModifierMapping */
+    (ReplySwapPtr) SGenericReply,               /* SetModifierMapping */
     (ReplySwapPtr) SGetModifierMappingReply,    /* 119 */
-    ReplyNotSwappd,             /* 120 */
-    ReplyNotSwappd,             /* 121 */
-    ReplyNotSwappd,             /* 122 */
-    ReplyNotSwappd,             /* 123 */
-    ReplyNotSwappd,             /* 124 */
-    ReplyNotSwappd,             /* 125 */
-    ReplyNotSwappd,             /* 126 */
-    ReplyNotSwappd,             /* NoOperation */
+    ReplyNotSwappd,                             /* 120 */
+    ReplyNotSwappd,                             /* 121 */
+    ReplyNotSwappd,                             /* 122 */
+    ReplyNotSwappd,                             /* 123 */
+    ReplyNotSwappd,                             /* 124 */
+    ReplyNotSwappd,                             /* 125 */
+    ReplyNotSwappd,                             /* 126 */
+    ReplyNotSwappd,                             /* NoOperation */
     ReplyNotSwappd,
     ReplyNotSwappd,
     ReplyNotSwappd,
index 401cb98..497ad7d 100644 (file)
@@ -103,11 +103,11 @@ TouchResizeQueue(ClientPtr client, pointer closure)
 
         tmp = realloc(dev->last.touches, size * sizeof(*dev->last.touches));
         if (tmp) {
-            int i;
+            int j;
 
             dev->last.touches = tmp;
-            for (i = dev->last.num_touches; i < size; i++)
-                TouchInitDDXTouchPoint(dev, &dev->last.touches[i]);
+            for (j = dev->last.num_touches; j < size; j++)
+                TouchInitDDXTouchPoint(dev, &dev->last.touches[j]);
             dev->last.num_touches = size;
         }
 
@@ -160,11 +160,13 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id)
     int i;
     TouchClassPtr t = dev->touch;
     DDXTouchPointInfoPtr ti = NULL;
-    Bool emulate_pointer = (t->mode == XIDirectTouch);
+    Bool emulate_pointer;
 
     if (!t)
         return NULL;
 
+    emulate_pointer = (t->mode == XIDirectTouch);
+
     /* Look for another active touchpoint with the same DDX ID. DDX
      * touchpoints must be unique. */
     if (TouchFindByDDXID(dev, ddx_id, FALSE))
@@ -198,8 +200,9 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id)
     /* If we get here, then we've run out of touches and we need to drop the
      * event (we're inside the SIGIO handler here) schedule a WorkProc to
      * grow the queue for us for next time. */
-    ErrorF("%s: not enough space for touch events (max %d touchpoints). "
-           "Dropping this event.\n", dev->name, dev->last.num_touches);
+    ErrorFSigSafe("%s: not enough space for touch events (max %u touchpoints). "
+                  "Dropping this event.\n", dev->name, dev->last.num_touches);
+
     if (!BitIsOn(resize_waiting, dev->id)) {
         SetBit(resize_waiting, dev->id);
         QueueWorkProc(TouchResizeQueue, serverClient, NULL);
@@ -460,14 +463,17 @@ TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev)
 void
 TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource)
 {
-    InternalEvent *tel = InitEventList(GetMaximumEventsNum());
-    ValuatorMask *mask = valuator_mask_new(0);
+    InternalEvent *tel;
+    ValuatorMask *mask;
     int i, nev;
     int flags;
 
     if (!ti->history)
         return;
 
+    tel = InitEventList(GetMaximumEventsNum());
+    mask = valuator_mask_new(0);
+
     valuator_mask_set_double(mask, 0, ti->history[0].valuators.data[0]);
     valuator_mask_set_double(mask, 1, ti->history[0].valuators.data[1]);
 
@@ -598,8 +604,8 @@ TouchConvertToPointerEvent(const InternalEvent *event,
     int ptrtype;
     int nevents = 0;
 
-    BUG_WARN(!event);
-    BUG_WARN(!motion_event);
+    BUG_RETURN_VAL(!event, 0);
+    BUG_RETURN_VAL(!motion_event, 0);
 
     switch (event->any.type) {
     case ET_TouchUpdate:
@@ -627,7 +633,7 @@ TouchConvertToPointerEvent(const InternalEvent *event,
     motion_event->device_event.flags = XIPointerEmulated;
 
     if (nevents > 1) {
-        BUG_WARN(!button_event);
+        BUG_RETURN_VAL(!button_event, 0);
         *button_event = *event;
         button_event->any.type = ptrtype;
         button_event->device_event.flags = XIPointerEmulated;
@@ -966,10 +972,8 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener,
     int nev;
     int i;
 
-    BUG_WARN(listener < 0);
-    BUG_WARN(listener >= ti->num_listeners);
-    if (listener < 0 || listener >= ti->num_listeners)
-        return BadMatch;
+    BUG_RETURN_VAL(listener < 0, BadMatch);
+    BUG_RETURN_VAL(listener >= ti->num_listeners, BadMatch);
 
     if (listener > 0) {
         if (mode == XIRejectTouch)
@@ -981,10 +985,7 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener,
     }
 
     events = InitEventList(GetMaximumEventsNum());
-    if (!events) {
-        BUG_WARN_MSG(TRUE, "Failed to allocate touch ownership events\n");
-        return BadAlloc;
-    }
+    BUG_RETURN_VAL_MSG(!events, BadAlloc, "Failed to allocate touch ownership events\n");
 
     nev = GetTouchOwnershipEvents(events, dev, ti, mode,
                                   ti->listeners[0].listener, 0);
index a31e78f..cdd12dc 100644 (file)
@@ -446,7 +446,7 @@ CreateRootWindow(ScreenPtr pScreen)
     BoxRec box;
     PixmapFormatRec *format;
 
-    pWin = dixAllocateObjectWithPrivates(WindowRec, PRIVATE_WINDOW);
+    pWin = dixAllocateScreenObjectWithPrivates(pScreen, WindowRec, PRIVATE_WINDOW);
     if (!pWin)
         return FALSE;
 
@@ -641,7 +641,6 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
     WindowPtr pWin;
     WindowPtr pHead;
     ScreenPtr pScreen;
-    xEvent event;
     int idepth, ivisual;
     Bool fOK;
     DepthPtr pDepth;
@@ -710,7 +709,7 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
         return NullWindow;
     }
 
-    pWin = dixAllocateObjectWithPrivates(WindowRec, PRIVATE_WINDOW);
+    pWin = dixAllocateScreenObjectWithPrivates(pScreen, WindowRec, PRIVATE_WINDOW);
     if (!pWin) {
         *error = BadAlloc;
         return NullWindow;
@@ -828,16 +827,17 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
     }
 
     if (SubSend(pParent)) {
-        memset(&event, 0, sizeof(xEvent));
+        xEvent event = {
+            .u.createNotify.window = wid,
+            .u.createNotify.parent = pParent->drawable.id,
+            .u.createNotify.x = x,
+            .u.createNotify.y = y,
+            .u.createNotify.width = w,
+            .u.createNotify.height = h,
+            .u.createNotify.borderWidth = bw,
+            .u.createNotify.override = pWin->overrideRedirect
+        };
         event.u.u.type = CreateNotify;
-        event.u.createNotify.window = wid;
-        event.u.createNotify.parent = pParent->drawable.id;
-        event.u.createNotify.x = x;
-        event.u.createNotify.y = y;
-        event.u.createNotify.width = w;
-        event.u.createNotify.height = h;
-        event.u.createNotify.borderWidth = bw;
-        event.u.createNotify.override = pWin->overrideRedirect;
         DeliverEvents(pParent, &event, 1, NullWindow);
     }
     return pWin;
@@ -912,7 +912,6 @@ CrushTree(WindowPtr pWin)
 {
     WindowPtr pChild, pSib, pParent;
     UnrealizeWindowProcPtr UnrealizeWindow;
-    xEvent event;
 
     if (!(pChild = pWin->firstChild))
         return;
@@ -925,8 +924,7 @@ CrushTree(WindowPtr pWin)
         while (1) {
             pParent = pChild->parent;
             if (SubStrSend(pChild, pParent)) {
-                memset(&event, 0, sizeof(xEvent));
-                event.u.u.type = DestroyNotify;
+                xEvent event = { .u.u.type = DestroyNotify };
                 event.u.destroyNotify.window = pChild->drawable.id;
                 DeliverEvents(pChild, &event, 1, NullWindow);
             }
@@ -961,7 +959,6 @@ DeleteWindow(pointer value, XID wid)
 {
     WindowPtr pParent;
     WindowPtr pWin = (WindowPtr) value;
-    xEvent event;
 
     UnmapWindow(pWin, FALSE);
 
@@ -969,8 +966,7 @@ DeleteWindow(pointer value, XID wid)
 
     pParent = pWin->parent;
     if (wid && pParent && SubStrSend(pWin, pParent)) {
-        memset(&event, 0, sizeof(xEvent));
-        event.u.u.type = DestroyNotify;
+        xEvent event = { .u.u.type = DestroyNotify };
         event.u.destroyNotify.window = pWin->drawable.id;
         DeliverEvents(pWin, &event, 1, NullWindow);
     }
@@ -1355,11 +1351,13 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
                         CheckWindowOptionalNeed(pChild);
                 }
 
+                xE = (xEvent) {
+                    .u.colormap.window = pWin->drawable.id,
+                    .u.colormap.colormap = cmap,
+                    .u.colormap.new = xTrue,
+                    .u.colormap.state = IsMapInstalled(cmap, pWin)
+                };
                 xE.u.u.type = ColormapNotify;
-                xE.u.colormap.window = pWin->drawable.id;
-                xE.u.colormap.colormap = cmap;
-                xE.u.colormap.new = xTrue;
-                xE.u.colormap.state = IsMapInstalled(cmap, pWin);
                 DeliverEvents(pWin, &xE, 1, NullWindow);
             }
             break;
@@ -1746,12 +1744,12 @@ ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh)
             GravityTranslate(cwsx, cwsy, cwsx - dx, cwsy - dy, dw, dh,
                              pSib->winGravity, &cwsx, &cwsy);
             if (cwsx != pSib->origin.x || cwsy != pSib->origin.y) {
-                xEvent event;
-
+                xEvent event = {
+                    .u.gravity.window = pSib->drawable.id,
+                    .u.gravity.x = cwsx - wBorderWidth(pSib),
+                    .u.gravity.y = cwsy - wBorderWidth(pSib)
+                };
                 event.u.u.type = GravityNotify;
-                event.u.gravity.window = pSib->drawable.id;
-                event.u.gravity.x = cwsx - wBorderWidth(pSib);
-                event.u.gravity.y = cwsy - wBorderWidth(pSib);
                 DeliverEvents(pSib, &event, 1, NullWindow);
                 pSib->origin.x = cwsx;
                 pSib->origin.y = cwsy;
@@ -2090,7 +2088,6 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
     unsigned short w = pWin->drawable.width,
         h = pWin->drawable.height, bw = pWin->borderWidth;
     int rc, action, smode = Above;
-    xEvent event;
 
     if ((pWin->drawable.class == InputOnly) &&
         (mask & IllegalInputOnlyConfigureMask))
@@ -2179,30 +2176,25 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
 
     if ((!pWin->overrideRedirect) && (RedirectSend(pParent)
         )) {
-        memset(&event, 0, sizeof(xEvent));
+        xEvent event = {
+            .u.configureRequest.window = pWin->drawable.id,
+            .u.configureRequest.sibling = (mask & CWSibling) ? sibwid : None,
+            .u.configureRequest.x = x,
+            .u.configureRequest.y = y,
+            .u.configureRequest.width = w,
+            .u.configureRequest.height = h,
+            .u.configureRequest.borderWidth = bw,
+            .u.configureRequest.valueMask = mask,
+            .u.configureRequest.parent = pParent->drawable.id
+        };
         event.u.u.type = ConfigureRequest;
-        event.u.configureRequest.window = pWin->drawable.id;
-        if (mask & CWSibling)
-            event.u.configureRequest.sibling = sibwid;
-        else
-            event.u.configureRequest.sibling = None;
-        if (mask & CWStackMode)
-            event.u.u.detail = smode;
-        else
-            event.u.u.detail = Above;
-        event.u.configureRequest.x = x;
-        event.u.configureRequest.y = y;
+        event.u.u.detail = (mask & CWStackMode) ? smode : Above;
 #ifdef PANORAMIX
         if (!noPanoramiXExtension && (!pParent || !pParent->parent)) {
             event.u.configureRequest.x += screenInfo.screens[0]->x;
             event.u.configureRequest.y += screenInfo.screens[0]->y;
         }
 #endif
-        event.u.configureRequest.width = w;
-        event.u.configureRequest.height = h;
-        event.u.configureRequest.borderWidth = bw;
-        event.u.configureRequest.valueMask = mask;
-        event.u.configureRequest.parent = pParent->drawable.id;
         if (MaybeDeliverEventsToClient(pParent, &event, 1,
                                        SubstructureRedirectMask, client) == 1)
             return Success;
@@ -2213,13 +2205,12 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
 
         if (size_change &&
             ((pWin->eventMask | wOtherEventMasks(pWin)) & ResizeRedirectMask)) {
-            xEvent eventT;
-
-            memset(&eventT, 0, sizeof(xEvent));
+            xEvent eventT = {
+                .u.resizeRequest.window = pWin->drawable.id,
+                .u.resizeRequest.width = w,
+                .u.resizeRequest.height = h
+            };
             eventT.u.u.type = ResizeRequest;
-            eventT.u.resizeRequest.window = pWin->drawable.id;
-            eventT.u.resizeRequest.width = w;
-            eventT.u.resizeRequest.height = h;
             if (MaybeDeliverEventsToClient(pWin, &eventT, 1,
                                            ResizeRedirectMask, client) == 1) {
                 /* if event is delivered, leave the actual size alone. */
@@ -2270,25 +2261,23 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
     }
 
     if (SubStrSend(pWin, pParent)) {
-        memset(&event, 0, sizeof(xEvent));
+        xEvent event = {
+            .u.configureNotify.window = pWin->drawable.id,
+            .u.configureNotify.aboveSibling = pSib ? pSib->drawable.id : None,
+            .u.configureNotify.x = x,
+            .u.configureNotify.y = y,
+            .u.configureNotify.width = w,
+            .u.configureNotify.height = h,
+            .u.configureNotify.borderWidth = bw,
+            .u.configureNotify.override = pWin->overrideRedirect
+        };
         event.u.u.type = ConfigureNotify;
-        event.u.configureNotify.window = pWin->drawable.id;
-        if (pSib)
-            event.u.configureNotify.aboveSibling = pSib->drawable.id;
-        else
-            event.u.configureNotify.aboveSibling = None;
-        event.u.configureNotify.x = x;
-        event.u.configureNotify.y = y;
 #ifdef PANORAMIX
         if (!noPanoramiXExtension && (!pParent || !pParent->parent)) {
             event.u.configureNotify.x += screenInfo.screens[0]->x;
             event.u.configureNotify.y += screenInfo.screens[0]->y;
         }
 #endif
-        event.u.configureNotify.width = w;
-        event.u.configureNotify.height = h;
-        event.u.configureNotify.borderWidth = bw;
-        event.u.configureNotify.override = pWin->overrideRedirect;
         DeliverEvents(pWin, &event, 1, NullWindow);
     }
     if (mask & CWBorderWidth) {
@@ -2361,13 +2350,13 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client)
             return Success;
     }
 
-    event.u.circulate.window = pWin->drawable.id;
-    event.u.circulate.parent = pParent->drawable.id;
-    event.u.circulate.event = pParent->drawable.id;
-    if (direction == RaiseLowest)
-        event.u.circulate.place = PlaceOnTop;
-    else
-        event.u.circulate.place = PlaceOnBottom;
+    event = (xEvent) {
+        .u.circulate.window = pWin->drawable.id,
+        .u.circulate.parent = pParent->drawable.id,
+        .u.circulate.event = pParent->drawable.id,
+        .u.circulate.place = (direction == RaiseLowest) ?
+                              PlaceOnTop : PlaceOnBottom,
+    };
 
     if (RedirectSend(pParent)) {
         event.u.u.type = CirculateRequest;
@@ -2420,19 +2409,20 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent,
     if (WasMapped)
         UnmapWindow(pWin, FALSE);
 
-    memset(&event, 0, sizeof(xEvent));
+    event = (xEvent) {
+        .u.reparent.window = pWin->drawable.id,
+        .u.reparent.parent = pParent->drawable.id,
+        .u.reparent.x = x,
+        .u.reparent.y = y,
+        .u.reparent.override = pWin->overrideRedirect
+    };
     event.u.u.type = ReparentNotify;
-    event.u.reparent.window = pWin->drawable.id;
-    event.u.reparent.parent = pParent->drawable.id;
-    event.u.reparent.x = x;
-    event.u.reparent.y = y;
 #ifdef PANORAMIX
     if (!noPanoramiXExtension && !pParent->parent) {
         event.u.reparent.x += screenInfo.screens[0]->x;
         event.u.reparent.y += screenInfo.screens[0]->y;
     }
 #endif
-    event.u.reparent.override = pWin->overrideRedirect;
     DeliverEvents(pWin, &event, 1, pParent);
 
     /* take out of sibling chain */
@@ -2568,15 +2558,15 @@ MapWindow(WindowPtr pWin, ClientPtr client)
 
     pScreen = pWin->drawable.pScreen;
     if ((pParent = pWin->parent)) {
-        xEvent event;
         Bool anyMarked;
 
         if ((!pWin->overrideRedirect) && (RedirectSend(pParent)
             )) {
-            memset(&event, 0, sizeof(xEvent));
+            xEvent event = {
+                .u.mapRequest.window = pWin->drawable.id,
+                .u.mapRequest.parent = pParent->drawable.id
+            };
             event.u.u.type = MapRequest;
-            event.u.mapRequest.window = pWin->drawable.id;
-            event.u.mapRequest.parent = pParent->drawable.id;
 
             if (MaybeDeliverEventsToClient(pParent, &event, 1,
                                            SubstructureRedirectMask,
@@ -2586,10 +2576,11 @@ MapWindow(WindowPtr pWin, ClientPtr client)
 
         pWin->mapped = TRUE;
         if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin)) {
-            memset(&event, 0, sizeof(xEvent));
+            xEvent event = {
+                .u.mapNotify.window = pWin->drawable.id,
+                .u.mapNotify.override = pWin->overrideRedirect,
+            };
             event.u.u.type = MapNotify;
-            event.u.mapNotify.window = pWin->drawable.id;
-            event.u.mapNotify.override = pWin->overrideRedirect;
             DeliverEvents(pWin, &event, 1, NullWindow);
         }
 
@@ -2644,7 +2635,6 @@ MapSubwindows(WindowPtr pParent, ClientPtr client)
     ScreenPtr pScreen;
     Mask parentRedirect;
     Mask parentNotify;
-    xEvent event;
     Bool anyMarked;
     WindowPtr pLayerWin;
 
@@ -2655,10 +2645,11 @@ MapSubwindows(WindowPtr pParent, ClientPtr client)
     for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) {
         if (!pWin->mapped) {
             if (parentRedirect && !pWin->overrideRedirect) {
-                memset(&event, 0, sizeof(xEvent));
+                xEvent event = {
+                    .u.mapRequest.window = pWin->drawable.id,
+                    .u.mapRequest.parent = pParent->drawable.id
+                };
                 event.u.u.type = MapRequest;
-                event.u.mapRequest.window = pWin->drawable.id;
-                event.u.mapRequest.parent = pParent->drawable.id;
 
                 if (MaybeDeliverEventsToClient(pParent, &event, 1,
                                                SubstructureRedirectMask,
@@ -2668,10 +2659,11 @@ MapSubwindows(WindowPtr pParent, ClientPtr client)
 
             pWin->mapped = TRUE;
             if (parentNotify || StrSend(pWin)) {
-                memset(&event, 0, sizeof(xEvent));
+                xEvent event = {
+                    .u.mapNotify.window = pWin->drawable.id,
+                    .u.mapNotify.override = pWin->overrideRedirect
+                };
                 event.u.u.type = MapNotify;
-                event.u.mapNotify.window = pWin->drawable.id;
-                event.u.mapNotify.override = pWin->overrideRedirect;
                 DeliverEvents(pWin, &event, 1, NullWindow);
             }
 
@@ -2765,7 +2757,6 @@ int
 UnmapWindow(WindowPtr pWin, Bool fromConfigure)
 {
     WindowPtr pParent;
-    xEvent event;
     Bool wasRealized = (Bool) pWin->realized;
     Bool wasViewable = (Bool) pWin->viewable;
     ScreenPtr pScreen = pWin->drawable.pScreen;
@@ -2774,10 +2765,11 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure)
     if ((!pWin->mapped) || (!(pParent = pWin->parent)))
         return Success;
     if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin)) {
-        memset(&event, 0, sizeof(xEvent));
+        xEvent event = {
+            .u.unmapNotify.window = pWin->drawable.id,
+            .u.unmapNotify.fromConfigure = fromConfigure
+        };
         event.u.u.type = UnmapNotify;
-        event.u.unmapNotify.window = pWin->drawable.id;
-        event.u.unmapNotify.fromConfigure = fromConfigure;
         DeliverEvents(pWin, &event, 1, NullWindow);
     }
     if (wasViewable && !fromConfigure) {
@@ -2813,7 +2805,6 @@ void
 UnmapSubwindows(WindowPtr pWin)
 {
     WindowPtr pChild, pHead;
-    xEvent event;
     Bool wasRealized = (Bool) pWin->realized;
     Bool wasViewable = (Bool) pWin->viewable;
     Bool anyMarked = FALSE;
@@ -2832,9 +2823,11 @@ UnmapSubwindows(WindowPtr pWin)
     for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) {
         if (pChild->mapped) {
             if (parentNotify || StrSend(pChild)) {
+                xEvent event = {
+                    .u.unmapNotify.window = pChild->drawable.id,
+                    .u.unmapNotify.fromConfigure = xFalse
+                };
                 event.u.u.type = UnmapNotify;
-                event.u.unmapNotify.window = pChild->drawable.id;
-                event.u.unmapNotify.fromConfigure = xFalse;
                 DeliverEvents(pChild, &event, 1, NullWindow);
             }
             if (pChild->viewable) {
@@ -3028,10 +3021,11 @@ SendVisibilityNotify(WindowPtr pWin)
     }
 #endif
 
-    memset(&event, 0, sizeof(xEvent));
+    event = (xEvent) {
+        .u.visibility.window = pWin->drawable.id,
+        .u.visibility.state = visibility
+    };
     event.u.u.type = VisibilityNotify;
-    event.u.visibility.window = pWin->drawable.id;
-    event.u.visibility.state = visibility;
     DeliverEvents(pWin, &event, 1, NullWindow);
 }
 
@@ -3134,8 +3128,10 @@ dixSaveScreens(ClientPtr client, int on, int mode)
     screenIsSaved = what;
     if (mode == ScreenSaverReset) {
         if (on == SCREEN_SAVER_FORCER) {
+            DeviceIntPtr dev;
             UpdateCurrentTimeIf();
-            lastDeviceEventTime = currentTime;
+            nt_list_for_each_entry(dev, inputInfo.devices, next)
+                lastDeviceEventTime[dev->id] = currentTime;
         }
         SetScreenSaverTimer();
     }
@@ -3658,3 +3654,16 @@ SetRootClip(ScreenPtr pScreen, Bool enable)
         WindowsRestructured();
     FlushAllOutput();
 }
+
+VisualPtr
+WindowGetVisual(WindowPtr pWin)
+{
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+    VisualID vid = wVisual(pWin);
+    int i;
+
+    for (i = 0; i < pScreen->numVisuals; i++)
+        if (pScreen->visuals[i].vid == vid)
+            return &pScreen->visuals[i];
+    return 0;
+}
index 2b11828..cd1a9d0 100644 (file)
        <revremark>Revised for Xorg 1.9 devPrivates changes
          and 1.8 CreateNewResourceType changes</revremark>
       </revision>
+      <revision>
+       <revnumber>3.6</revnumber>
+       <date>July 2012</date>
+       <authorinitials>kp</authorinitials>
+       <revremark>Revised for X server 1.13 screen-specific devPrivates changes</revremark>
+      </revision>
     </revhistory>
     <abstract>
       <para>The following document explains the structure of the X Window System display server and the interfaces among the larger pieces.  It is intended as a reference for programmers who are implementing an X Display Server on their workstation hardware.  It is included with the X Window System source tape, along with the document "Strategies for Porting the X v11 Sample Server."  The order in which you should read these documents is:
@@ -680,7 +686,7 @@ pReadmask is a pointer to the information describing the descriptors
 that will be waited on.
 </para>
 <para>
-In the sample server,  pTimeout is a struct timeval **,  and pReadmask is
+In the sample server,  pTimeout is a pointer,  and pReadmask is
 the address of the select() mask for reading.
 </para>
 <para>
@@ -688,15 +694,14 @@ The DIX BlockHandler() iterates through the Screens,  for each one calling
 its BlockHandler.  A BlockHandler is declared thus:
 <blockquote>
 <programlisting>
-       void xxxBlockHandler(nscreen, pbdata, pptv, pReadmask)
-               int nscreen;
-               pointer pbdata;
-               struct timeval ** pptv;
+       void xxxBlockHandler(pScreen, pTimeout, pReadmask)
+               ScreenPtr pScreen;
+               pointer pTimeout;
                pointer pReadmask;
 </programlisting>
 </blockquote>
-The arguments are the index of the Screen,  the blockData field
-of the Screen,  and the arguments to the DIX BlockHandler().
+The arguments are a pointer to the Screen, and the arguments to the
+DIX BlockHandler().
 </para>
 <para>
 Immediately after WaitForSomething returns from the
@@ -721,15 +726,14 @@ The DIX WakeupHandler() calls each Screen's
 WakeupHandler.  A WakeupHandler is declared thus:
 <blockquote>
 <programlisting>
-       void xxxWakeupHandler(nscreen, pbdata, err, pReadmask)
-               int nscreen;
-               pointer pbdata;
+       void xxxWakeupHandler(pScreen, result, pReadmask)
+               ScreenPtr pScreen;
                unsigned long result;
                pointer pReadmask;
 </programlisting>
 </blockquote>
-The arguments are the index of the Screen,  the blockData field
-of the Screen,  and the arguments to the DIX WakeupHandler().
+The arguments are the Screen, of the Screen, and the arguments to
+the DIX WakeupHandler().
 </para>
 <para>
 In addition to the per-screen BlockHandlers, any module may register
@@ -1942,18 +1946,15 @@ FALSE.</para>
 The scrInitProc should be of the following form:
 <blockquote><programlisting>
 
-       Bool scrInitProc(iScreen, pScreen, argc, argv)
-               int iScreen;
+       Bool scrInitProc(pScreen, argc, argv)
                ScreenPtr pScreen;
                int argc;
                char **argv;
 </programlisting></blockquote>
-iScreen is the index for this screen; 0 for the first one initialized,
-1 for the second, etc.  pScreen is the pointer to the screen's new
-ScreenRec.  argc and argv are as before.  Your screen initialize
-procedure should return TRUE upon success or FALSE if the screen
-cannot be initialized (for instance, if the screen hardware does not
-exist on this machine).</para>
+pScreen is the pointer to the screen's new ScreenRec. argc and argv
+are as before.  Your screen initialize procedure should return TRUE
+upon success or FALSE if the screen cannot be initialized (for
+ instance, if the screen hardware does not exist on this machine).</para>
 <para>
 This procedure must determine what actual device it is supposed to initialize.
 If you have a different procedure for each screen, then it is no problem.
@@ -4719,7 +4720,8 @@ Two new extensibility concepts have been developed for release 4, Wrappers
 and devPrivates.  These replace the R3 GCInterest queues, which were not a
 general enough mechanism for many extensions and only provided hooks into a
 single data structure.  devPrivates have been revised substantially for
-X.Org X server release 1.5, and updated again for the 1.9 release.</para>
+X.Org X server release 1.5, updated again for the 1.9 release and extended
+again for the 1.13 relealse.</para>
 <section>
   <title>devPrivates</title>
 <para>
@@ -4763,6 +4765,23 @@ the specified type with distinct storage for the given
 that are otherwise equivalent to the following Private functions.</para>
 
 <para>
+  To request private space in objects created for a specific screen, use
+  <blockquote><programlisting>
+    Bool dixRegisterScreenSpecificPrivateKey(ScreenPtr pScreen, DevPrivateKey key, DevPrivateType type, unsigned size);
+  </programlisting></blockquote>
+  The <parameter>type</parameter> and <parameter>size</parameter> arguments are
+  the same as those to <function>dixRegisterPrivateKey</function> but this
+  function ensures only that the given <parameter>key</parameter> exists on objects of
+  the specified type that are allocated with reference to the specified
+  <parameter>pScreen</parameter>. Using the key on objects allocated for
+  other screens will result in incorrect results; there is no check made to
+  ensure that the caller's screen matches the private's screen. The key is
+  usable in any of the following functions. Screen-specific private storage is available
+  only for Windows, GCs, Pixmaps and Pictures. Attempts to allocate screen-specific
+  privates on other objects will result in a call to FatalError.
+</para>
+
+<para>
 To attach a piece of private data to an object, use:
 <blockquote><programlisting>
        void dixSetPrivate(PrivateRec **privates, const DevPrivateKey key, pointer val)
diff --git a/doc/c-extensions b/doc/c-extensions
new file mode 100644 (file)
index 0000000..eb33e27
--- /dev/null
@@ -0,0 +1,61 @@
+First of all: C89 or better.  If you don't have that, port gcc first.
+
+Use of C language extensions throughout the X server tree
+---------------------------------------------------------
+
+Optional extensions:
+The server will still build if your toolchain does not support these
+extensions, although the results may not be optimal.
+
+    * _X_SENTINEL(x): member x of the passed structure must be NULL, e.g.:
+                      void parseOptions(Option *options _X_SENTINEL(0));
+                      parseOptions("foo", "bar", NULL); /* this is OK */
+                      parseOptions("foo", "bar", "baz"); /* this is not */
+                      This definition comes from Xfuncproto.h in the core
+                      protocol headers.
+    * _X_ATTRIBUTE_PRINTF(x, y): This function has printf-like semantics;
+                                 check the format string when built with
+                                 -Wformat (gcc) or similar.
+    * _X_EXPORT: this function should appear in symbol tables.
+    * _X_HIDDEN: this function should not appear in the _dynamic_ symbol
+                 table.
+    * _X_INTERNAL: like _X_HIDDEN, but attempt to ensure that this function
+                   is never called from another module.
+    * _X_INLINE: inline this functon if possible (generally obeyed unless
+                 disabling optimisations).
+    * _X_DEPRECATED: warn on use of this function.
+
+Mandatory extensions:
+The server will not build if your toolchain does not support these extensions.
+
+    * named initialisers: explicitly initialising structure members, e.g.:
+                          struct foo bar = { .baz = quux, .brian = "dog" };
+    * variadic macros: macros with a variable number of arguments, e.g.:
+                       #define DebugF(x, ...) /**/
+    * interleaved code and declarations: { foo = TRUE; int bar; do_stuff(); }
+
+
+Use of OS and library facilities throughout the X server tree
+-------------------------------------------------------------
+
+Non-OS-dependent code can assume facilities at least as good as
+the non-OS-facility parts of POSIX-1.2001.  Ideally this would
+be C99, but even gcc+glibc doesn't implement that yet.
+
+Unix-like systems are assumed to be at least as good as UNIX03.
+
+Linux systems must be at least 2.4 or later.  As a practical matter
+though, 2.4 kernels never receive any testing.  Use 2.6 already.
+
+TODO: Solaris.
+
+TODO: *BSD.
+
+Code that needs to be portable to Windows should be careful to,
+well, be portable.  Note that there are two Windows ports, cygwin and
+mingw.  Cygwin is more or less like Linux, but mingw is a bit more
+restrictive.  TODO: document which versions of Windows we actually care
+about.
+
+OSX support is generally limited to the most recent version.  Currently
+that means 10.5.
index 5ef0629..91ca254 100644 (file)
@@ -52,7 +52,9 @@ DEALINGS IN THE SOFTWARE.
       facility in <productname>Solaris</productname> 10,
       <productname>MacOS X</productname> 10.5, and later releases.  This
       provider instruments various points in the X server, to allow
-      tracing what client applications are up to.
+      tracing what client applications are up to. DTrace probes may be used
+      with <ulink url="http://sourceware.org/systemtap/">SystemTap</ulink>
+      on GNU/Linux systems.
     </para>
 
     <para>
@@ -81,7 +83,7 @@ DEALINGS IN THE SOFTWARE.
 
     <table id="Probes_and_their_arguments">
       <title>Probes and their arguments</title>
-      <tgroup cols='7'>
+      <tgroup cols='9'>
        <colspec colname="probe" colwidth="2*"/>
        <colspec colname="desc" colwidth="3*"/>
        <colspec colname="arg0" colwidth="1*"/>
@@ -89,6 +91,8 @@ DEALINGS IN THE SOFTWARE.
        <colspec colname="arg2" colwidth="1*"/>
        <colspec colname="arg3" colwidth="1*"/>
        <colspec colname="arg4" colwidth="1*"/>
+       <colspec colname="arg5" colwidth="1*"/>
+       <colspec colname="arg6" colwidth="1*"/>
        <spanspec spanname="all" namest="probe" nameend="arg4"/>
        <thead>
          <row>
@@ -99,6 +103,8 @@ DEALINGS IN THE SOFTWARE.
            <entry>arg2</entry>
            <entry>arg3</entry>
            <entry>arg4</entry>
+           <entry>arg5</entry>
+           <entry>arg6</entry>
          </row>
        </thead>
        <tbody>
@@ -113,6 +119,8 @@ DEALINGS IN THE SOFTWARE.
            <entry><parameter>requestLength</parameter></entry>
            <entry><parameter>clientId</parameter></entry>
            <entry><parameter>requestBuffer</parameter></entry>
+           <entry nameend="arg5" class="unused"/>
+           <entry nameend="arg6" class="unused"/>
          </row>
          <row>
            <entry>request-done</entry>
@@ -122,6 +130,8 @@ DEALINGS IN THE SOFTWARE.
            <entry><parameter>sequenceNumber</parameter></entry>
            <entry><parameter>clientId</parameter></entry>
            <entry><parameter>resultCode</parameter></entry>
+           <entry nameend="arg5" class="unused"/>
+           <entry nameend="arg6" class="unused"/>
          </row>
          <row>
            <entry spanname="all" class="grouphead">Event Probes</entry>
@@ -132,7 +142,10 @@ DEALINGS IN THE SOFTWARE.
            <entry><parameter>clientId</parameter></entry>
            <entry><parameter>eventCode</parameter></entry>
            <entry><parameter>eventBuffer</parameter></entry>
+           <entry nameend="arg3" class="unused"/>
            <entry nameend="arg4" class="unused"/>
+           <entry nameend="arg5" class="unused"/>
+           <entry nameend="arg6" class="unused"/>
          </row>
          <row>
            <entry spanname="all" class="grouphead">Client Connection Probes</entry>
@@ -142,7 +155,11 @@ DEALINGS IN THE SOFTWARE.
            <entry>Called when a new connection is opened from a client</entry>
            <entry><parameter>clientId</parameter></entry>
            <entry><parameter>clientFD</parameter></entry>
+           <entry nameend="arg2" class="unused"/>
+           <entry nameend="arg3" class="unused"/>
            <entry nameend="arg4" class="unused"/>
+           <entry nameend="arg5" class="unused"/>
+           <entry nameend="arg6" class="unused"/>
          </row>
          <row>
            <entry>client-auth</entry>
@@ -152,12 +169,19 @@ DEALINGS IN THE SOFTWARE.
            <entry><parameter>clientPid</parameter></entry>
            <entry><parameter>clientZoneId</parameter></entry>
            <entry nameend="arg4" class="unused"/>
+           <entry nameend="arg5" class="unused"/>
+           <entry nameend="arg6" class="unused"/>
          </row>
          <row>
            <entry>client-disconnect</entry>
            <entry>Called when a client connection is closed</entry>
            <entry><parameter>clientId</parameter></entry>
+           <entry nameend="arg1" class="unused"/>
+           <entry nameend="arg2" class="unused"/>
+           <entry nameend="arg3" class="unused"/>
            <entry nameend="arg4" class="unused"/>
+           <entry nameend="arg5" class="unused"/>
+           <entry nameend="arg6" class="unused"/>
          </row>
          <row>
            <entry spanname="all" class="grouphead">Resource Allocation Probes</entry>
@@ -170,6 +194,8 @@ DEALINGS IN THE SOFTWARE.
            <entry><parameter>resourceValue</parameter></entry>
            <entry><parameter>resourceTypeName</parameter></entry>
            <entry nameend="arg4" class="unused"/>
+           <entry nameend="arg5" class="unused"/>
+           <entry nameend="arg6" class="unused"/>
          </row>
          <row>
            <entry>resource-free</entry>
@@ -179,6 +205,24 @@ DEALINGS IN THE SOFTWARE.
            <entry><parameter>resourceValue</parameter></entry>
            <entry><parameter>resourceTypeName</parameter></entry>
            <entry nameend="arg4" class="unused"/>
+           <entry nameend="arg5" class="unused"/>
+           <entry nameend="arg6" class="unused"/>
+         </row>
+         <row>
+           <entry spanname="all" class="grouphead">Input API probes</entry>
+         </row>
+         <row>
+           <entry>input-event</entry>
+           <entry>Called when an input event was submitted for processing</entry>
+           <entry><parameter>deviceid</parameter></entry>
+           <entry><parameter>eventtype</parameter></entry>
+           <entry><parameter>button</parameter> or
+                  <parameter>keycode</parameter> or
+                  <parameter>touchid</parameter></entry>
+           <entry><parameter>flags</parameter></entry>
+           <entry><parameter>nvalues</parameter></entry>
+           <entry><parameter>mask</parameter></entry>
+           <entry><parameter>values</parameter></entry>
          </row>
        </tbody>
       </tgroup>
@@ -304,6 +348,44 @@ DEALINGS IN THE SOFTWARE.
            <entry><type>uint32_t</type></entry>
            <entry>Number of X request in in this connection</entry>
          </row>
+         <row>
+           <entry><parameter>deviceid</parameter></entry>
+           <entry><type>int</type></entry>
+           <entry>The device's numerical ID</entry>
+         </row>
+         <row>
+           <entry><parameter>eventtype</parameter></entry>
+           <entry><type>int</type></entry>
+           <entry>Protocol event type</entry>
+         </row>
+         <row>
+           <entry><parameter>button, keycode, touchid</parameter></entry>
+           <entry><type>uint32_t</type></entry>
+           <entry>The button number, keycode or touch ID</entry>
+         </row>
+         <row>
+           <entry><parameter>flags</parameter></entry>
+           <entry><type>uint32_t</type></entry>
+           <entry>Miscellaneous event-specific server flags</entry>
+         </row>
+         <row>
+           <entry><parameter>nvalues</parameter></entry>
+           <entry><type>int8_t</type></entry>
+           <entry>Number of bits in <parameter>mask</parameter> and number of elements
+                   in <parameter>values</parameter></entry>
+         </row>
+         <row>
+           <entry><parameter>mask</parameter></entry>
+           <entry><type>uint8_t*</type></entry>
+           <entry>Binary mask indicating which indices in <parameter>values</parameter> contain
+                 valid data</entry>
+         </row>
+         <row>
+           <entry><parameter>values</parameter></entry>
+           <entry><type>double*</type></entry>
+           <entry>Valuator values. Values for indices for which the
+                 <parameter>mask</parameter> is not set are undefined</entry>
+         </row>
        </tbody>
       </tgroup>
     </table>
@@ -572,6 +654,73 @@ Xserver$1:::client-disconnect
 
     </example>
 
+    <example id="Input_API_monitoring_with_systemtap">
+      <title>Input API monitoring with SystemTap</title>
+
+      <para>
+       This script can be used to monitor events submitted by drivers to
+       the server for enqueuing. Due to the integration of the input API
+       probes, some server-enqueued events will show up too.
+       <programlisting>
+  # Compile+run with
+  #       stap -g xorg.stp /usr/bin/Xorg
+  #
+
+
+  function print_valuators:string(nvaluators:long, mask_in:long, valuators_in:long) %{
+         int i;
+         unsigned char *mask = (unsigned char*)THIS->mask_in;
+         double *valuators = (double*)THIS->valuators_in;
+         char str[128] = {0};
+         char *s = str;
+
+  #define BitIsSet(ptr, bit) (((unsigned char*)(ptr))[(bit)>>3] &amp; (1 &lt;&lt; ((bit) &amp; 7)))
+
+         s += sprintf(s, "nval: %d ::", (int)THIS->nvaluators);
+         for (i = 0; i &lt; THIS->nvaluators; i++)
+         {
+                 s += sprintf(s, "     %d: ", i);
+                 if (BitIsSet(mask, i))
+                     s += sprintf(s, "%d", (int)valuators[i]);
+         }
+
+         sprintf(THIS->__retvalue, "%s", str);
+  %}
+
+  probe process(@1).mark("input__event")
+  {
+      deviceid = $arg1
+      type = $arg2
+      detail = $arg3
+      flags = $arg4
+      nvaluators = $arg5
+
+      str = print_valuators(nvaluators, $arg6, $arg7)
+      printf("Event: device %d type %d detail %d flags %#x %s\n",
+             deviceid, type, detail, flags, str);
+  }
+       </programlisting>
+
+       Sample output from a run of this script:
+       <screen><computeroutput>
+Event: device 13 type 4 detail 1 flags 0x0 nval: 0 ::
+Event: device 13 type 6 detail 0 flags 0xa nval: 1 ::  0: 1
+Event: device 13 type 6 detail 0 flags 0xa nval: 2 ::  0: 2    1: -1
+Event: device 13 type 6 detail 0 flags 0xa nval: 2 ::  0: 2    1: -1
+Event: device 13 type 6 detail 0 flags 0xa nval: 2 ::  0: 4    1: -3
+Event: device 13 type 6 detail 0 flags 0xa nval: 2 ::  0: 3    1: -3
+Event: device 13 type 6 detail 0 flags 0xa nval: 2 ::  0: 3    1: -2
+Event: device 13 type 6 detail 0 flags 0xa nval: 2 ::  0: 2    1: -2
+Event: device 13 type 6 detail 0 flags 0xa nval: 2 ::  0: 2    1: -2
+Event: device 13 type 6 detail 0 flags 0xa nval: 2 ::  0: 2    1: -2
+Event: device 13 type 6 detail 0 flags 0xa nval: 2 ::  0:      1: -1
+Event: device 13 type 6 detail 0 flags 0xa nval: 2 ::  0:      1: -1
+Event: device 13 type 5 detail 1 flags 0x0 nval: 0 ::
+       </computeroutput></screen>
+
+      </para>
+
+    </example>
 
   </sect1>
 
index 754c830..d12344f 100644 (file)
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -38,8 +38,6 @@
 #include "exa.h"
 
 DevPrivateKeyRec exaScreenPrivateKeyRec;
-DevPrivateKeyRec exaPixmapPrivateKeyRec;
-DevPrivateKeyRec exaGCPrivateKeyRec;
 
 #ifdef MITSHM
 static ShmFuncs exaShmFuncs = { NULL, NULL };
@@ -483,9 +481,6 @@ static void
  exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
 
 static void
- exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
-
-static void
  exaDestroyClip(GCPtr pGC);
 
 const GCFuncs exaGCFuncs = {
@@ -707,11 +702,9 @@ exaCreateScreenResources(ScreenPtr pScreen)
 }
 
 static void
-ExaBlockHandler(int screenNum, pointer blockData, pointer pTimeout,
+ExaBlockHandler(ScreenPtr pScreen, pointer pTimeout,
                 pointer pReadmask)
 {
-    ScreenPtr pScreen = screenInfo.screens[screenNum];
-
     ExaScreenPriv(pScreen);
 
     /* Move any deferred results from a software fallback to the driver pixmap */
@@ -719,7 +712,7 @@ ExaBlockHandler(int screenNum, pointer blockData, pointer pTimeout,
         exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap);
 
     unwrap(pExaScr, pScreen, BlockHandler);
-    (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
+    (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
     wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler);
 
     /* The rest only applies to classic EXA */
@@ -739,15 +732,13 @@ ExaBlockHandler(int screenNum, pointer blockData, pointer pTimeout,
 }
 
 static void
-ExaWakeupHandler(int screenNum, pointer wakeupData, unsigned long result,
+ExaWakeupHandler(ScreenPtr pScreen, unsigned long result,
                  pointer pReadmask)
 {
-    ScreenPtr pScreen = screenInfo.screens[screenNum];
-
     ExaScreenPriv(pScreen);
 
     unwrap(pExaScr, pScreen, WakeupHandler);
-    (*pScreen->WakeupHandler) (screenNum, wakeupData, result, pReadmask);
+    (*pScreen->WakeupHandler) (pScreen, result, pReadmask);
     wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler);
 
     if (result == 0 && pExaScr->numOffscreenAvailable > 1) {
@@ -765,7 +756,7 @@ ExaWakeupHandler(int screenNum, pointer wakeupData, unsigned long result,
  * screen private, before calling down to the next CloseSccreen.
  */
 static Bool
-exaCloseScreen(int i, ScreenPtr pScreen)
+exaCloseScreen(ScreenPtr pScreen)
 {
     ExaScreenPriv(pScreen);
     PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
@@ -791,6 +782,10 @@ exaCloseScreen(int i, ScreenPtr pScreen)
     unwrap(pExaScr, pScreen, ChangeWindowAttributes);
     unwrap(pExaScr, pScreen, BitmapToRegion);
     unwrap(pExaScr, pScreen, CreateScreenResources);
+    if (pExaScr->SavedSharePixmapBacking)
+        unwrap(pExaScr, pScreen, SharePixmapBacking);
+    if (pExaScr->SavedSetSharedPixmapBacking)
+        unwrap(pExaScr, pScreen, SetSharedPixmapBacking);
     unwrap(pExaScr, ps, Composite);
     if (pExaScr->SavedGlyphs)
         unwrap(pExaScr, ps, Glyphs);
@@ -800,7 +795,7 @@ exaCloseScreen(int i, ScreenPtr pScreen)
 
     free(pExaScr);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 /**
@@ -922,8 +917,8 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo)
 
     exaDDXDriverInit(pScreen);
 
-    if (!dixRegisterPrivateKey
-        (&exaGCPrivateKeyRec, PRIVATE_GC, sizeof(ExaGCPrivRec))) {
+    if (!dixRegisterScreenSpecificPrivateKey
+        (pScreen, &pExaScr->gcPrivateKeyRec, PRIVATE_GC, sizeof(ExaGCPrivRec))) {
         LogMessage(X_WARNING, "EXA(%d): Failed to allocate GC private\n",
                    pScreen->myNum);
         return FALSE;
@@ -971,8 +966,8 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo)
      * Hookup offscreen pixmaps
      */
     if (pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) {
-        if (!dixRegisterPrivateKey
-            (&exaPixmapPrivateKeyRec, PRIVATE_PIXMAP,
+        if (!dixRegisterScreenSpecificPrivateKey
+            (pScreen, &pExaScr->pixmapPrivateKeyRec, PRIVATE_PIXMAP,
              sizeof(ExaPixmapPrivRec))) {
             LogMessage(X_WARNING,
                        "EXA(%d): Failed to allocate pixmap private\n",
@@ -985,6 +980,9 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo)
                 wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_mixed);
                 wrap(pExaScr, pScreen, ModifyPixmapHeader,
                      exaModifyPixmapHeader_mixed);
+                wrap(pExaScr, pScreen, SharePixmapBacking, exaSharePixmapBacking_mixed);
+                wrap(pExaScr, pScreen, SetSharedPixmapBacking, exaSetSharedPixmapBacking_mixed);
+
                 pExaScr->do_migration = exaDoMigration_mixed;
                 pExaScr->pixmap_has_gpu_copy = exaPixmapHasGpuCopy_mixed;
                 pExaScr->do_move_in_pixmap = exaMoveInPixmap_mixed;
index 7534002..be022b2 100644 (file)
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -39,7 +39,7 @@
 #include "fb.h"
 
 #define EXA_VERSION_MAJOR   2
-#define EXA_VERSION_MINOR   5
+#define EXA_VERSION_MINOR   6
 #define EXA_VERSION_RELEASE 0
 
 typedef struct _ExaOffscreenArea ExaOffscreenArea;
@@ -694,6 +694,10 @@ typedef struct _ExaDriver {
                             int depth, int usage_hint, int bitsPerPixel,
                             int *new_fb_pitch);
     /** @} */
+    Bool (*SharePixmapBacking)(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p);
+
+    Bool (*SetSharedPixmapBacking)(PixmapPtr pPixmap, void *handle);
+
 } ExaDriverRec, *ExaDriverPtr;
 
 /** @name EXA driver flags
@@ -789,7 +793,7 @@ extern _X_EXPORT void
  ExaOffscreenMarkUsed(PixmapPtr pPixmap);
 
 extern _X_EXPORT void
- exaEnableDisableFBAccess(int index, Bool enable);
+ exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable);
 
 extern _X_EXPORT Bool
  exaDrawableIsOffscreen(DrawablePtr pDrawable);
index 2538bce..71f750f 100644 (file)
@@ -365,7 +365,7 @@ exaGlyphCacheUploadGlyph(ScreenPtr pScreen,
                          ExaGlyphCachePtr cache, int x, int y, GlyphPtr pGlyph)
 {
     ExaScreenPriv(pScreen);
-    PicturePtr pGlyphPicture = GlyphPicture(pGlyph)[pScreen->myNum];
+    PicturePtr pGlyphPicture = GetGlyphPicture(pGlyph, pScreen);
     PixmapPtr pGlyphPixmap = (PixmapPtr) pGlyphPicture->pDrawable;
 
     ExaPixmapPriv(pGlyphPixmap);
@@ -544,7 +544,7 @@ exaBufferGlyph(ScreenPtr pScreen,
                INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst)
 {
     ExaScreenPriv(pScreen);
-    unsigned int format = (GlyphPicture(pGlyph)[pScreen->myNum])->format;
+    unsigned int format = (GetGlyphPicture(pGlyph, pScreen))->format;
     int width = pGlyph->info.width;
     int height = pGlyph->info.height;
     ExaCompositeRectPtr rect;
@@ -586,7 +586,7 @@ exaBufferGlyph(ScreenPtr pScreen,
 
     /* Couldn't find the glyph in the cache, use the glyph picture directly */
 
-    mask = GlyphPicture(pGlyph)[pScreen->myNum];
+    mask = GetGlyphPicture(pGlyph, pScreen);
     if (buffer->mask && buffer->mask != mask)
         return ExaGlyphNeedFlush;
 
index 0681731..0fb4091 100644 (file)
@@ -294,3 +294,36 @@ exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap)
 
     return ret;
 }
+
+Bool
+exaSharePixmapBacking_mixed(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p)
+{
+    ScreenPtr pScreen = pPixmap->drawable.pScreen;
+    ExaScreenPriv(pScreen);
+    Bool ret = FALSE;
+
+    exaMoveInPixmap(pPixmap);
+    /* get the driver to give us a handle */
+    if (pExaScr->info->SharePixmapBacking)
+        ret = pExaScr->info->SharePixmapBacking(pPixmap, slave, handle_p);
+
+    return ret;
+}
+
+Bool
+exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle)
+{
+    ScreenPtr pScreen = pPixmap->drawable.pScreen;
+    ExaScreenPriv(pScreen);
+    Bool ret = FALSE;
+
+    if (pExaScr->info->SetSharedPixmapBacking)
+        ret = pExaScr->info->SetSharedPixmapBacking(pPixmap, handle);
+
+    if (ret == TRUE)
+        exaMoveInPixmap(pPixmap);
+
+    return ret;
+}
+
+
index 5e1d139..1f571cf 100644 (file)
@@ -360,10 +360,8 @@ ExaOffscreenSwapIn(ScreenPtr pScreen)
  * swapped out.
  */
 void
-exaEnableDisableFBAccess(int index, Bool enable)
+exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable)
 {
-    ScreenPtr pScreen = screenInfo.screens[index];
-
     ExaScreenPriv(pScreen);
 
     if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS)
index bde78c3..ea7e7fa 100644 (file)
@@ -147,7 +147,7 @@ typedef struct _ExaMigrationRec {
     RegionPtr pReg;
 } ExaMigrationRec, *ExaMigrationPtr;
 
-typedef void (*EnableDisableFBAccessProcPtr) (int, Bool);
+typedef void (*EnableDisableFBAccessProcPtr) (ScreenPtr, Bool);
 typedef struct {
     ExaDriverPtr info;
     ScreenBlockHandlerProcPtr SavedBlockHandler;
@@ -163,6 +163,8 @@ typedef struct {
     BitmapToRegionProcPtr SavedBitmapToRegion;
     CreateScreenResourcesProcPtr SavedCreateScreenResources;
     ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader;
+    SharePixmapBackingProcPtr SavedSharePixmapBacking;
+    SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking;
     SourceValidateProcPtr SavedSourceValidate;
     CompositeProcPtr SavedComposite;
     TrianglesProcPtr SavedTriangles;
@@ -208,6 +210,8 @@ typedef struct {
     RegionRec maskReg;
     PixmapPtr srcPix;
 
+    DevPrivateKeyRec pixmapPrivateKeyRec;
+    DevPrivateKeyRec gcPrivateKeyRec;
 } ExaScreenPrivRec, *ExaScreenPrivPtr;
 
 /*
@@ -225,17 +229,11 @@ typedef struct {
 extern DevPrivateKeyRec exaScreenPrivateKeyRec;
 
 #define exaScreenPrivateKey (&exaScreenPrivateKeyRec)
-extern DevPrivateKeyRec exaPixmapPrivateKeyRec;
-
-#define exaPixmapPrivateKey (&exaPixmapPrivateKeyRec)
-extern DevPrivateKeyRec exaGCPrivateKeyRec;
-
-#define exaGCPrivateKey (&exaGCPrivateKeyRec)
 
 #define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixGetPrivate(&(s)->devPrivates, exaScreenPrivateKey))
 #define ExaScreenPriv(s)       ExaScreenPrivPtr    pExaScr = ExaGetScreenPriv(s)
 
-#define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, exaGCPrivateKey))
+#define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, &ExaGetScreenPriv(gc->pScreen)->gcPrivateKeyRec))
 #define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc)
 
 /*
@@ -286,7 +284,7 @@ extern DevPrivateKeyRec exaGCPrivateKeyRec;
 #define EXA_PIXMAP_SCORE_PINNED            1000
 #define EXA_PIXMAP_SCORE_INIT      1001
 
-#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, exaPixmapPrivateKey))
+#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &ExaGetScreenPriv((p)->drawable.pScreen)->pixmapPrivateKeyRec))
 #define ExaPixmapPriv(p)       ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p)
 
 #define EXA_RANGE_PITCH (1 << 0)
@@ -662,6 +660,11 @@ void
 void
  exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg);
 
+Bool
+exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle);
+Bool
+exaSharePixmapBacking_mixed(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p);
+
 /* exa_render.c */
 Bool
  exaOpReadsDestination(CARD8 op);
diff --git a/fb/fb.h b/fb/fb.h
index b327ce6..40a7e38 100644 (file)
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -570,12 +570,6 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data);
     }                                                      \
 }
 
-extern _X_EXPORT DevPrivateKey
- fbGetGCPrivateKey(void);
-
-extern _X_EXPORT DevPrivateKey
- fbGetWinPrivateKey(void);
-
 extern _X_EXPORT const GCOps fbGCOps;
 extern _X_EXPORT const GCFuncs fbGCFuncs;
 
@@ -605,7 +599,7 @@ typedef void (*FinishWrapProcPtr) (DrawablePtr pDraw);
 #endif
 
 extern _X_EXPORT DevPrivateKey
- fbGetScreenPrivateKey(void);
+fbGetScreenPrivateKey(void);
 
 /* private field of a screen */
 typedef struct {
@@ -615,6 +609,8 @@ typedef struct {
     SetupWrapProcPtr setupWrap; /* driver hook to set pixmap access wrapping */
     FinishWrapProcPtr finishWrap;       /* driver hook to clean up pixmap access wrapping */
 #endif
+    DevPrivateKeyRec    gcPrivateKeyRec;
+    DevPrivateKeyRec    winPrivateKeyRec;
 } FbScreenPrivRec, *FbScreenPrivPtr;
 
 #define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
@@ -630,8 +626,10 @@ typedef struct {
     unsigned char bpp;          /* current drawable bpp */
 } FbGCPrivRec, *FbGCPrivPtr;
 
+#define fbGetGCPrivateKey(pGC)  (&fbGetScreenPrivate((pGC)->pScreen)->gcPrivateKeyRec)
+
 #define fbGetGCPrivate(pGC)    ((FbGCPrivPtr)\
-                                dixLookupPrivate(&(pGC)->devPrivates, fbGetGCPrivateKey()))
+                                dixLookupPrivate(&(pGC)->devPrivates, fbGetGCPrivateKey(pGC)))
 
 #define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
 #define fbGetExpose(pGC)       ((pGC)->fExpose)
@@ -639,8 +637,11 @@ typedef struct {
 #define fbGetRotatedPixmap(pGC)        ((pGC)->pRotatedPixmap)
 
 #define fbGetScreenPixmap(s)   ((PixmapPtr) (s)->devPrivate)
+
+#define fbGetWinPrivateKey(pWin)        (&fbGetScreenPrivate(((DrawablePtr) (pWin))->pScreen)->winPrivateKeyRec)
+
 #define fbGetWindowPixmap(pWin)        ((PixmapPtr)\
-                                dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey()))
+                                dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey(pWin)))
 
 #ifdef ROOTLESS
 #define __fbPixDrawableX(pPix) ((pPix)->drawable.x)
@@ -782,14 +783,14 @@ fb24_32ModifyPixmapHeader(PixmapPtr pPixmap,
  * fballpriv.c
  */
 extern _X_EXPORT Bool
- fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCIndex);
+fbAllocatePrivates(ScreenPtr pScreen);
 
 /*
  * fbarc.c
  */
 
 extern _X_EXPORT void
- fbPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs);
+fbPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs);
 
 /*
  * fbbits.c
@@ -1419,7 +1420,7 @@ fbPushPixels(GCPtr pGC,
  */
 
 extern _X_EXPORT Bool
- fbCloseScreen(int indx, ScreenPtr pScreen);
+ fbCloseScreen(ScreenPtr pScreen);
 
 extern _X_EXPORT Bool
  fbRealizeFont(ScreenPtr pScreen, FontPtr pFont);
index c6504f9..187d0b0 100644 (file)
@@ -33,33 +33,20 @@ fbGetScreenPrivateKey(void)
     return &fbScreenPrivateKeyRec;
 }
 
-static DevPrivateKeyRec fbGCPrivateKeyRec;
-DevPrivateKey
-fbGetGCPrivateKey(void)
-{
-    return &fbGCPrivateKeyRec;
-}
-
-static DevPrivateKeyRec fbWinPrivateKeyRec;
-DevPrivateKey
-fbGetWinPrivateKey(void)
-{
-    return &fbWinPrivateKeyRec;
-}
-
 Bool
-fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey)
+fbAllocatePrivates(ScreenPtr pScreen)
 {
-    if (pGCKey)
-        *pGCKey = &fbGCPrivateKeyRec;
+    FbScreenPrivPtr     pScrPriv;
 
     if (!dixRegisterPrivateKey
-        (&fbGCPrivateKeyRec, PRIVATE_GC, sizeof(FbGCPrivRec)))
-        return FALSE;
-    if (!dixRegisterPrivateKey
         (&fbScreenPrivateKeyRec, PRIVATE_SCREEN, sizeof(FbScreenPrivRec)))
         return FALSE;
-    if (!dixRegisterPrivateKey(&fbWinPrivateKeyRec, PRIVATE_WINDOW, 0))
+
+    pScrPriv = fbGetScreenPrivate(pScreen);
+
+    if (!dixRegisterScreenSpecificPrivateKey (pScreen, &pScrPriv->gcPrivateKeyRec, PRIVATE_GC, sizeof(FbGCPrivRec)))
+        return FALSE;
+    if (!dixRegisterScreenSpecificPrivateKey (pScreen, &pScrPriv->winPrivateKeyRec, PRIVATE_WINDOW, 0))
         return FALSE;
 
     return TRUE;
index 998be66..c6802e4 100644 (file)
@@ -63,7 +63,7 @@ fbOverlayCreateWindow(WindowPtr pWin)
     for (i = 0; i < pScrPriv->nlayers; i++) {
         pPixmap = pScrPriv->layer[i].u.run.pixmap;
         if (pWin->drawable.depth == pPixmap->drawable.depth) {
-            dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(), pPixmap);
+            dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin), pPixmap);
             /*
              * Make sure layer keys are written correctly by
              * having non-root layers set to full while the
@@ -81,7 +81,7 @@ fbOverlayCreateWindow(WindowPtr pWin)
 }
 
 Bool
-fbOverlayCloseScreen(int iScreen, ScreenPtr pScreen)
+fbOverlayCloseScreen(ScreenPtr pScreen)
 {
     FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen);
     int i;
@@ -103,7 +103,7 @@ fbOverlayWindowLayer(WindowPtr pWin)
     int i;
 
     for (i = 0; i < pScrPriv->nlayers; i++)
-        if (dixLookupPrivate(&pWin->devPrivates, fbGetWinPrivateKey()) ==
+        if (dixLookupPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin)) ==
             (pointer) pScrPriv->layer[i].u.run.pixmap)
             return i;
     return 0;
index 76198cd..9a93457 100644 (file)
@@ -63,7 +63,7 @@ extern _X_EXPORT Bool
  fbOverlayCreateWindow(WindowPtr pWin);
 
 extern _X_EXPORT Bool
- fbOverlayCloseScreen(int iScreen, ScreenPtr pScreen);
+ fbOverlayCloseScreen(ScreenPtr pScreen);
 
 extern _X_EXPORT int
  fbOverlayWindowLayer(WindowPtr pWin);
index c0903ec..7c7d656 100644 (file)
@@ -27,7 +27,7 @@
 #include "fb.h"
 
 Bool
-fbCloseScreen(int index, ScreenPtr pScreen)
+fbCloseScreen(ScreenPtr pScreen)
 {
     int d;
     DepthPtr depths = pScreen->allowedDepths;
@@ -85,7 +85,7 @@ _fbGetWindowPixmap(WindowPtr pWindow)
 void
 _fbSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap)
 {
-    dixSetPrivate(&pWindow->devPrivates, fbGetWinPrivateKey(), pPixmap);
+    dixSetPrivate(&pWindow->devPrivates, fbGetWinPrivateKey(pWindow), pPixmap);
 }
 
 Bool
@@ -95,7 +95,7 @@ fbSetupScreen(ScreenPtr pScreen, pointer pbits, /* pointer to screen bitmap */
               int dpiy, int width,      /* pixel width of frame buffer */
               int bpp)
 {                               /* bits per pixel for screen */
-    if (!fbAllocatePrivates(pScreen, NULL))
+    if (!fbAllocatePrivates(pScreen))
         return FALSE;
     pScreen->defColormap = FakeClientID(0);
     /* let CreateDefColormap do whatever it wants for pixels */
index 0e4e0a9..1848387 100644 (file)
@@ -65,6 +65,12 @@ fbBresSolid(DrawablePtr pDrawable,
     if (axis == X_AXIS) {
         bits = 0;
         while (len--) {
+            if (e >= 0) {
+                WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits));
+                bits = 0;
+                dst += dstStride;
+                e += e3;
+            }
             bits |= mask;
             mask = fbBresShiftMask(mask, signdx, dstBpp);
             if (!mask) {
@@ -74,21 +80,12 @@ fbBresSolid(DrawablePtr pDrawable,
                 mask = mask0;
             }
             e += e1;
-            if (e >= 0) {
-                WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, bits));
-                bits = 0;
-                dst += dstStride;
-                e += e3;
-            }
         }
         if (bits)
             WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, bits));
     }
     else {
         while (len--) {
-            WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask));
-            dst += dstStride;
-            e += e1;
             if (e >= 0) {
                 e += e3;
                 mask = fbBresShiftMask(mask, signdx, dstBpp);
@@ -97,6 +94,9 @@ fbBresSolid(DrawablePtr pDrawable,
                     mask = mask0;
                 }
             }
+            WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask));
+            dst += dstStride;
+            e += e1;
         }
     }
 
index d27ccd4..368c4b8 100644 (file)
@@ -31,7 +31,7 @@
 Bool
 fbCreateWindow(WindowPtr pWin)
 {
-    dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(),
+    dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin),
                   fbGetScreenPixmap(pWin->drawable.pScreen));
     if (pWin->drawable.bitsPerPixel == 32)
         pWin->drawable.bitsPerPixel =
index 8b896eb..588440c 100644 (file)
 #define fbFixCoordModePrevious wfbFixCoordModePrevious
 #define fbGCFuncs wfbGCFuncs
 #define fbGCOps wfbGCOps
-#define fbGCPrivateKeyRec wfbGCPrivateKeyRec
 #define fbGeneration wfbGeneration
-#define fbGetGCPrivateKey wfbGetGCPrivateKey
 #define fbGetImage wfbGetImage
 #define fbGetScreenPrivateKey wfbGetScreenPrivateKey
 #define fbGetSpans wfbGetSpans
 #define _fbGetWindowPixmap _wfbGetWindowPixmap
-#define fbWinPrivateKeyRec wfbWinPrivateKeyRec
-#define fbGetWinPrivateKey wfbGetWinPrivateKey
 #define fbGlyph16 wfbGlyph16
 #define fbGlyph24 wfbGlyph24
 #define fbGlyph32 wfbGlyph32
diff --git a/fix-miregion b/fix-miregion
new file mode 100755 (executable)
index 0000000..fc502bb
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+sed -i \
+-e 's/miRegionCreate\b/RegionCreate/g' \
+-e 's/miRegionInit\b/RegionInit/g' \
+-e 's/miRegionDestroy\b/RegionDestroy/g' \
+-e 's/miRegionUninit\b/RegionUninit/g' \
+-e 's/miRegionCopy\b/RegionCopy/g' \
+-e 's/miIntersect\b/RegionIntersect/g' \
+-e 's/miUnion\b/RegionUnion/g' \
+-e 's/miRegionAppend\b/RegionAppend/g' \
+-e 's/miRegionValidate\b/RegionValidate/g' \
+-e 's/miRectsToRegion\b/RegionFromRects/g' \
+-e 's/miSubtract\b/RegionSubtract/g' \
+-e 's/miInverse\b/RegionInverse/g' \
+-e 's/miRectIn\b/RegionContainsRect/g' \
+-e 's/miTranslateRegion\b/RegionTranslate/g' \
+-e 's/miRegionReset\b/RegionReset/g' \
+-e 's/miRegionBreak\b/RegionBreak/g' \
+-e 's/miPointInRegion\b/RegionContainsPoint/g' \
+-e 's/miRegionEqual\b/RegionEqual/g' \
+-e 's/miRegionNotEmpty\b/RegionNotEmpty/g' \
+-e 's/miRegionEmpty\b/RegionEmpty/g' \
+-e 's/miRegionExtents\b/RegionExtents/g' \
+-e 's/miPrintRegion\b/RegionPrint/g' \
+-e 's/miRectAlloc\b/RegionRectAlloc/g' \
+-e 's/miValidRegion\b/RegionIsValid/g' \
+-e 's/miRegionBroken\b/RegionBroken/g' \
+-e 's/miClipSpans\b/RegionClipSpans/g' \
+"$@"
diff --git a/fix-miregion-private b/fix-miregion-private
new file mode 100755 (executable)
index 0000000..ebc24fa
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+sed -i \
+-e 's/miEmptyBox\b/RegionEmptyBox/g' \
+-e 's/miEmptyData\b/RegionEmptyData/g' \
+-e 's/miBrokenData\b/RegionBrokenData/g' \
+-e 's/miBrokenRegion\b/RegionBrokenRegion/g' \
+-e 's/miCoalesce\b/RegionCoalesce/g' \
+-e 's/miAppendNonO\b/RegionAppendNonO/g' \
+-e 's/miRegionOp\b/RegionOp/g' \
+-e 's/miSetExtents\b/RegionSetExtents/g' \
+-e 's/miIntersectO\b/RegionIntersectO/g' \
+-e 's/miUnionO\b/RegionUnionO/g' \
+-e 's/miSubtractO\b/RegionSubtractO/g' \
+"$@"
diff --git a/fix-patch-whitespace b/fix-patch-whitespace
new file mode 100755 (executable)
index 0000000..2d06d8e
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+git diff --check |
+sed -n 's!^\([^:]*\):\([^:]*\):.*!sed -i "\2 s/[ \t]*$//; \2 s/ *\t/\t/g" \1!p' |
+sh
diff --git a/fix-region b/fix-region
new file mode 100755 (executable)
index 0000000..ef8eb42
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+sed -i \
+    -e 's/REGION_NIL\b/RegionNil/g' \
+    -e 's/REGION_NAR\b/RegionNar/g' \
+    -e 's/REGION_NUM_RECTS\b/RegionNumRects/g' \
+    -e 's/REGION_SIZE\b/RegionSize/g' \
+    -e 's/REGION_RECTS\b/RegionRects/g' \
+    -e 's/REGION_BOXPTR\b/RegionBoxptr/g' \
+    -e 's/REGION_BOX\b/RegionBox/g' \
+    -e 's/REGION_TOP\b/RegionTop/g' \
+    -e 's/REGION_END\b/RegionEnd/g' \
+    -e 's/REGION_SZOF\b/RegionSizeof/g' \
+    -e 's/REGION_CREATE *([^,]*, */RegionCreate(/g' \
+    -e 's/REGION_COPY *([^,]*, */RegionCopy(/g' \
+    -e 's/REGION_DESTROY *([^,]*, */RegionDestroy(/g' \
+    -e 's/REGION_INTERSECT *([^,]*, */RegionIntersect(/g' \
+    -e 's/REGION_UNION *([^,]*, */RegionUnion(/g' \
+    -e 's/REGION_SUBTRACT *([^,]*, */RegionSubtract(/g' \
+    -e 's/REGION_INVERSE *([^,]*, */RegionInverse(/g' \
+    -e 's/REGION_TRANSLATE *([^,]*, */RegionTranslate(/g' \
+    -e 's/RECT_IN_REGION *([^,]*, */RegionContainsRect(/g' \
+    -e 's/POINT_IN_REGION *([^,]*, */RegionContainsPoint(/g' \
+    -e 's/REGION_EQUAL *([^,]*, */RegionEqual(/g' \
+    -e 's/REGION_APPEND *([^,]*, */RegionAppend(/g' \
+    -e 's/REGION_VALIDATE *([^,]*, */RegionValidate(/g' \
+    -e 's/BITMAP_TO_REGION\b/BitmapToRegion/g' \
+    -e 's/RECTS_TO_REGION *([^,]*, */RegionFromRects(/g' \
+    -e 's/REGION_BREAK *([^,]*, */RegionBreak(/g' \
+    -e 's/REGION_INIT *([^,]*, */RegionInit(/g' \
+    -e 's/REGION_UNINIT *([^,]*, */RegionUninit(/g' \
+    -e 's/REGION_RESET *([^,]*, */RegionReset(/g' \
+    -e 's/REGION_NOTEMPTY *([^,]*, */RegionNotEmpty(/g' \
+    -e 's/REGION_BROKEN *([^,]*, */RegionBroken(/g' \
+    -e 's/REGION_EMPTY *([^,]*, */RegionEmpty(/g' \
+    -e 's/REGION_EXTENTS *([^,]*, */RegionExtents(/g' \
+    -e 's/REGION_NULL *([^,]*, */RegionNull(/g' \
+    -e 's/REGION_NULL$/RegionNull/g' \
+    "$@"
index ced78b7..591c4ac 100644 (file)
@@ -7,10 +7,8 @@ noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY)
 AM_CFLAGS = \
        @DIX_CFLAGS@ \
        @GL_CFLAGS@ \
-       @DRI_CFLAGS@ \
        @XLIB_CFLAGS@ \
        @LIBDRM_CFLAGS@ \
-       @DRIPROTO_CFLAGS@ \
        @GLX_DEFINES@ \
        @GLX_ARCH_DEFINES@
 
index 15bbf15..4aaa4c9 100644 (file)
 
 #include "glxserver.h"
 #include "indirect_dispatch.h"
+#include "glxbyteorder.h"
+#include "unpack.h"
+
+static int
+set_client_info(__GLXclientState * cl, xGLXSetClientInfoARBReq * req,
+                unsigned bytes_per_version)
+{
+    char *gl_extensions;
+    char *glx_extensions;
+
+    /* Verify that the size of the packet matches the size inferred from the
+     * sizes specified for the various fields.
+     */
+    const unsigned expected_size = sz_xGLXSetClientInfoARBReq
+        + (req->numVersions * bytes_per_version)
+        + __GLX_PAD(req->numGLExtensionBytes)
+        + __GLX_PAD(req->numGLXExtensionBytes);
+
+    if (req->length != (expected_size / 4))
+        return BadLength;
+
+    /* Verify that the actual length of the GL extension string matches what's
+     * encoded in protocol packet.
+     */
+    gl_extensions = (char *) (req + 1) + (req->numVersions * bytes_per_version);
+    if (req->numGLExtensionBytes != 0
+        && memchr(gl_extensions, 0,
+                  __GLX_PAD(req->numGLExtensionBytes)) == NULL)
+        return BadLength;
+
+    /* Verify that the actual length of the GLX extension string matches
+     * what's encoded in protocol packet.
+     */
+    glx_extensions = gl_extensions + __GLX_PAD(req->numGLExtensionBytes);
+    if (req->numGLXExtensionBytes != 0
+        && memchr(glx_extensions, 0,
+                  __GLX_PAD(req->numGLXExtensionBytes)) == NULL)
+        return BadLength;
+
+    free(cl->GLClientextensions);
+    cl->GLClientextensions = strdup(gl_extensions);
+
+    return 0;
+}
 
 int
 __glXDisp_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
 {
-    return BadRequest;
+    return set_client_info(cl, (xGLXSetClientInfoARBReq *) pc, 8);
 }
 
 int
 __glXDispSwap_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
 {
-    return BadRequest;
+    xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
+
+    req->length = bswap_16(req->length);
+    req->numVersions = bswap_32(req->numVersions);
+    req->numGLExtensionBytes = bswap_32(req->numGLExtensionBytes);
+    req->numGLXExtensionBytes = bswap_32(req->numGLXExtensionBytes);
+
+    return __glXDisp_SetClientInfoARB(cl, pc);
 }
 
 int
 __glXDisp_SetClientInfo2ARB(__GLXclientState * cl, GLbyte * pc)
 {
-    return BadRequest;
+    return set_client_info(cl, (xGLXSetClientInfoARBReq *) pc, 12);
 }
 
 int
 __glXDispSwap_SetClientInfo2ARB(__GLXclientState * cl, GLbyte * pc)
 {
-    return BadRequest;
+    xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
+
+    req->length = bswap_16(req->length);
+    req->numVersions = bswap_32(req->numVersions);
+    req->numGLExtensionBytes = bswap_32(req->numGLExtensionBytes);
+    req->numGLXExtensionBytes = bswap_32(req->numGLXExtensionBytes);
+
+    return __glXDisp_SetClientInfo2ARB(cl, pc);
 }
index 9c1eab3..13d21cc 100644 (file)
 #include <dix-config.h>
 #endif
 
+#include <GL/glxtokens.h>
 #include "glxserver.h"
+#include "glxext.h"
 #include "indirect_dispatch.h"
 
+#define ALL_VALID_FLAGS \
+    (GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB \
+     | GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB)
+
+static Bool
+validate_GL_version(int major_version, int minor_version)
+{
+    if (major_version <= 0 || minor_version < 0)
+        return False;
+
+    switch (major_version) {
+    case 1:
+        if (minor_version > 5)
+            return False;
+        break;
+
+    case 2:
+        if (minor_version > 1)
+            return False;
+        break;
+
+    case 3:
+        if (minor_version > 3)
+            return False;
+        break;
+
+    default:
+        break;
+    }
+
+    return True;
+}
+
+static Bool
+validate_render_type(uint32_t render_type)
+{
+    switch (render_type) {
+    case GLX_RGBA_TYPE:
+    case GLX_COLOR_INDEX_TYPE:
+        return True;
+    default:
+        return False;
+    }
+}
+
 int
 __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
 {
-    return BadRequest;
+    ClientPtr client = cl->client;
+    xGLXCreateContextAttribsARBReq *req = (xGLXCreateContextAttribsARBReq *) pc;
+    int32_t *attribs = (req->numAttribs != 0) ? (int32_t *) (req + 1) : NULL;
+    unsigned i;
+    int major_version = 1;
+    int minor_version = 0;
+    uint32_t flags = 0;
+    uint32_t render_type = GLX_RGBA_TYPE;
+    __GLXcontext *ctx = NULL;
+    __GLXcontext *shareCtx = NULL;
+    __GLXscreen *glxScreen;
+    __GLXconfig *config;
+    int err;
+
+    /* The GLX_ARB_create_context_robustness spec says:
+     *
+     *     "The default value for GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
+     *     is GLX_NO_RESET_NOTIFICATION_ARB."
+     */
+    int reset = GLX_NO_RESET_NOTIFICATION_ARB;
+
+    /* The GLX_ARB_create_context_profile spec says:
+     *
+     *     "The default value for GLX_CONTEXT_PROFILE_MASK_ARB is
+     *     GLX_CONTEXT_CORE_PROFILE_BIT_ARB."
+     *
+     * The core profile only makes sense for OpenGL versions 3.2 and later.
+     * If the version ultimately specified is less than 3.2, the core profile
+     * bit is cleared (see below).
+     */
+    int profile = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
+
+    /* Verify that the size of the packet matches the size inferred from the
+     * sizes specified for the various fields.
+     */
+    const unsigned expected_size = (sz_xGLXCreateContextAttribsARBReq
+                                    + (req->numAttribs * 8)) / 4;
+
+    if (req->length != expected_size)
+        return BadLength;
+
+    LEGAL_NEW_RESOURCE(req->context, client);
+
+    /* The GLX_ARB_create_context spec says:
+     *
+     *     "* If <config> is not a valid GLXFBConfig, GLXBadFBConfig is
+     *        generated."
+     *
+     * On the client, the screen comes from the FBConfig, so GLXBadFBConfig
+     * should be issued if the screen is nonsense.
+     */
+    if (!validGlxScreen(client, req->screen, &glxScreen, &err))
+        return __glXError(GLXBadFBConfig);
+
+    if (!validGlxFBConfig(client, glxScreen, req->fbconfig, &config, &err))
+        return __glXError(GLXBadFBConfig);
+
+    /* Validate the context with which the new context should share resources.
+     */
+    if (req->shareList != None) {
+        if (!validGlxContext(client, req->shareList, DixReadAccess,
+                             &shareCtx, &err))
+            return err;
+
+        /* The crazy condition is because C doesn't have a logical XOR
+         * operator.  Comparing directly for equality may fail if one is 1 and
+         * the other is 2 even though both are logically true.
+         */
+        if (!!req->isDirect != !!shareCtx->isDirect) {
+            client->errorValue = req->shareList;
+            return BadMatch;
+        }
+
+        /* The GLX_ARB_create_context spec says:
+         *
+         *     "* If the server context state for <share_context>...was
+         *        created on a different screen than the one referenced by
+         *        <config>...BadMatch is generated."
+         */
+        if (glxScreen != shareCtx->pGlxScreen) {
+            client->errorValue = shareCtx->pGlxScreen->pScreen->myNum;
+            return BadMatch;
+        }
+    }
+
+    for (i = 0; i < req->numAttribs; i++) {
+        switch (attribs[i * 2]) {
+        case GLX_CONTEXT_MAJOR_VERSION_ARB:
+            major_version = attribs[2 * i + 1];
+            break;
+
+        case GLX_CONTEXT_MINOR_VERSION_ARB:
+            minor_version = attribs[2 * i + 1];
+            break;
+
+        case GLX_CONTEXT_FLAGS_ARB:
+            flags = attribs[2 * i + 1];
+            break;
+
+        case GLX_RENDER_TYPE:
+            render_type = attribs[2 * i + 1];
+            break;
+
+        case GLX_CONTEXT_PROFILE_MASK_ARB:
+            profile = attribs[2 * i + 1];
+            break;
+
+        case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB:
+            reset = attribs[2 * i + 1];
+            if (reset != GLX_NO_RESET_NOTIFICATION_ARB
+                && reset != GLX_LOSE_CONTEXT_ON_RESET_ARB)
+                return BadValue;
+
+            break;
+
+        default:
+            return BadValue;
+        }
+    }
+
+    /* The GLX_ARB_create_context spec says:
+     *
+     *     "If attributes GLX_CONTEXT_MAJOR_VERSION_ARB and
+     *     GLX_CONTEXT_MINOR_VERSION_ARB, when considered together
+     *     with attributes GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB and
+     *     GLX_RENDER_TYPE, specify an OpenGL version and feature set
+     *     that are not defined, BadMatch is generated.
+     *
+     *     ...Feature deprecation was introduced with OpenGL 3.0, so
+     *     forward-compatible contexts may only be requested for
+     *     OpenGL 3.0 and above. Thus, examples of invalid
+     *     combinations of attributes include:
+     *
+     *       - Major version < 1 or > 3
+     *       - Major version == 1 and minor version < 0 or > 5
+     *       - Major version == 2 and minor version < 0 or > 1
+     *       - Major version == 3 and minor version > 2
+     *       - Forward-compatible flag set and major version < 3
+     *       - Color index rendering and major version >= 3"
+     */
+    if (!validate_GL_version(major_version, minor_version))
+        return BadMatch;
+
+    if (major_version < 3
+        && ((flags & GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB) != 0))
+        return BadMatch;
+
+    if (major_version >= 3 && render_type == GLX_COLOR_INDEX_TYPE)
+        return BadMatch;
+
+    if (!validate_render_type(render_type))
+        return BadValue;
+
+    if ((flags & ~ALL_VALID_FLAGS) != 0)
+        return BadValue;
+
+    /* The GLX_ARB_create_context_profile spec says:
+     *
+     *     "* If attribute GLX_CONTEXT_PROFILE_MASK_ARB has no bits set; has
+     *        any bits set other than GLX_CONTEXT_CORE_PROFILE_BIT_ARB and
+     *        GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; has more than one of
+     *        these bits set; or if the implementation does not support the
+     *        requested profile, then GLXBadProfileARB is generated."
+     */
+    switch (profile) {
+    case GLX_CONTEXT_CORE_PROFILE_BIT_ARB:
+    case GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB:
+        break;
+    case GLX_CONTEXT_ES2_PROFILE_BIT_EXT:
+        /* The GLX_EXT_create_context_es2_profile spec says:
+         *
+         *     "... If the version requested is 2.0, and the
+         *     GLX_CONTEXT_ES2_PROFILE_BIT_EXT bit is set in the
+         *     GLX_CONTEXT_PROFILE_MASK_ARB attribute (see below), then the
+         *     context returned will implement OpenGL ES 2.0."
+         *
+         * It also says:
+         *
+         *     "* If attribute GLX_CONTEXT_PROFILE_MASK_ARB has no bits set;
+         *        has any bits set other than
+         *        GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
+         *        GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, or
+         *        GLX_CONTEXT_ES2_PROFILE_BIT_EXT; has more than one of these
+         *        bits set; or if the implementation does not supported the
+         *        requested profile, then GLXBadProfileARB is generated."
+         *
+         * It does not specifically say what is supposed to happen if
+         * GLX_CONTEXT_ES2_PROFILE_BIT_EXT is set but the version requested is
+         * not 2.0.  We choose to generate GLXBadProfileARB as this matches
+         * NVIDIA's behavior.
+         */
+        if (major_version != 2 || minor_version != 0)
+            return __glXError(GLXBadProfileARB);
+        break;
+    default:
+        return __glXError(GLXBadProfileARB);
+    }
+
+    /* The GLX_ARB_create_context_robustness spec says:
+     *
+     *     "* If the reset notification behavior of <share_context> and the
+     *        newly created context are different, BadMatch is generated."
+     */
+    if (shareCtx != NULL && shareCtx->resetNotificationStrategy != reset)
+        return BadMatch;
+
+    /* There is no GLX protocol for desktop OpenGL versions after 1.4.  There
+     * is no GLX protocol for any version of OpenGL ES.  If the application is
+     * requested an indirect rendering context for a version that cannot be
+     * satisfied, reject it.
+     *
+     * The GLX_ARB_create_context spec says:
+     *
+     *     "* If <config> does not support compatible OpenGL contexts
+     *        providing the requested API major and minor version,
+     *        forward-compatible flag, and debug context flag, GLXBadFBConfig
+     *        is generated."
+     */
+    if (!req->isDirect && (major_version > 1 || minor_version > 4
+                           || profile == GLX_CONTEXT_ES2_PROFILE_BIT_EXT)) {
+        return __glXError(GLXBadFBConfig);
+    }
+
+    /* Allocate memory for the new context
+     */
+    if (req->isDirect) {
+        ctx = __glXdirectContextCreate(glxScreen, config, shareCtx);
+        err = BadAlloc;
+    }
+    else {
+        ctx = glxScreen->createContext(glxScreen, config, shareCtx,
+                                       req->numAttribs, (uint32_t *) attribs,
+                                       &err);
+    }
+
+    if (ctx == NULL)
+        return err;
+
+    ctx->pGlxScreen = glxScreen;
+    ctx->config = config;
+    ctx->id = req->context;
+    ctx->share_id = req->shareList;
+    ctx->idExists = True;
+    ctx->isCurrent = False;
+    ctx->isDirect = req->isDirect;
+    ctx->hasUnflushedCommands = False;
+    ctx->renderMode = GL_RENDER;
+    ctx->feedbackBuf = NULL;
+    ctx->feedbackBufSize = 0;
+    ctx->selectBuf = NULL;
+    ctx->selectBufSize = 0;
+    ctx->drawPriv = NULL;
+    ctx->readPriv = NULL;
+    ctx->resetNotificationStrategy = reset;
+
+    /* Add the new context to the various global tables of GLX contexts.
+     */
+    if (!__glXAddContext(ctx)) {
+        (*ctx->destroy) (ctx);
+        client->errorValue = req->context;
+        return BadAlloc;
+    }
+
+    return Success;
 }
 
 int
index 866f8bf..544ca1f 100644 (file)
@@ -67,23 +67,29 @@ struct extension_info {
 
 static const struct extension_info known_glx_extensions[] = {
 /*   GLX_ARB_get_proc_address is implemented on the client. */
-    {GLX(ARB_multisample), VER(1, 4), Y,},
-
-    {GLX(EXT_import_context), VER(0, 0), Y,},
-    {GLX(EXT_texture_from_pixmap), VER(0, 0), Y,},
-    {GLX(EXT_visual_info), VER(0, 0), Y,},
-    {GLX(EXT_visual_rating), VER(0, 0), Y,},
-
-    {GLX(MESA_copy_sub_buffer), VER(0, 0), N,},
-    {GLX(OML_swap_method), VER(0, 0), Y,},
-    {GLX(SGI_make_current_read), VER(1, 3), N,},
-    {GLX(SGI_swap_control), VER(0, 0), N,},
-    {GLX(SGIS_multisample), VER(0, 0), Y,},
-    {GLX(SGIX_fbconfig), VER(1, 3), Y,},
-    {GLX(SGIX_pbuffer), VER(1, 3), Y,},
-    {GLX(SGIX_visual_select_group), VER(0, 0), Y,},
-    {GLX(INTEL_swap_event), VER(1, 4), N,},
-    {NULL}
+    /* *INDENT-OFF* */
+    { GLX(ARB_create_context),          VER(0,0), N, },
+    { GLX(ARB_create_context_profile),  VER(0,0), N, },
+    { GLX(ARB_create_context_robustness), VER(0,0), N, },
+    { GLX(ARB_multisample),             VER(1,4), Y, },
+
+    { GLX(EXT_create_context_es2_profile), VER(0,0), N, },
+    { GLX(EXT_import_context),          VER(0,0), Y, },
+    { GLX(EXT_texture_from_pixmap),     VER(0,0), Y, },
+    { GLX(EXT_visual_info),             VER(0,0), Y, },
+    { GLX(EXT_visual_rating),           VER(0,0), Y, },
+
+    { GLX(MESA_copy_sub_buffer),        VER(0,0), N, },
+    { GLX(OML_swap_method),             VER(0,0), Y, },
+    { GLX(SGI_make_current_read),       VER(1,3), N, },
+    { GLX(SGI_swap_control),            VER(0,0), N, },
+    { GLX(SGIS_multisample),            VER(0,0), Y, },
+    { GLX(SGIX_fbconfig),               VER(1,3), Y, },
+    { GLX(SGIX_pbuffer),                VER(1,3), Y, },
+    { GLX(SGIX_visual_select_group),    VER(0,0), Y, },
+    { GLX(INTEL_swap_event),            VER(0,0), N, },
+    { NULL }
+    /* *INDENT-ON* */
 };
 
 /**
index e02213f..7a4a8b1 100644 (file)
 
 enum {
 /*   GLX_ARB_get_proc_address is implemented on the client. */
-    ARB_multisample_bit = 0,
+    ARB_create_context_bit = 0,
+    ARB_create_context_profile_bit,
+    ARB_create_context_robustness_bit,
+    ARB_multisample_bit,
+    EXT_create_context_es2_profile_bit,
     EXT_import_context_bit,
     EXT_texture_from_pixmap_bit,
     EXT_visual_info_bit,
index 24fed8f..c1f4e22 100644 (file)
@@ -50,7 +50,7 @@
 #include "indirect_table.h"
 #include "indirect_util.h"
 
-static int
+_X_HIDDEN int
 validGlxScreen(ClientPtr client, int screen, __GLXscreen ** pGlxScreen,
                int *err)
 {
@@ -67,7 +67,7 @@ validGlxScreen(ClientPtr client, int screen, __GLXscreen ** pGlxScreen,
     return TRUE;
 }
 
-static int
+_X_HIDDEN int
 validGlxFBConfig(ClientPtr client, __GLXscreen * pGlxScreen, XID id,
                  __GLXconfig ** config, int *err)
 {
@@ -131,7 +131,7 @@ validGlxFBConfigForWindow(ClientPtr client, __GLXconfig * config,
     return TRUE;
 }
 
-static int
+_X_HIDDEN int
 validGlxContext(ClientPtr client, XID id, int access_mode,
                 __GLXcontext ** context, int *err)
 {
@@ -200,7 +200,7 @@ __glXdirectContextDestroy(__GLXcontext * context)
     free(context);
 }
 
-static __GLXcontext *
+_X_HIDDEN __GLXcontext *
 __glXdirectContextCreate(__GLXscreen * screen,
                          __GLXconfig * modes, __GLXcontext * shareContext)
 {
@@ -251,20 +251,20 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
                              &shareglxc, &err))
             return err;
 
-        if (shareglxc->isDirect) {
-            /*
-             ** NOTE: no support for sharing display lists between direct
-             ** contexts, even if they are in the same address space.
-             */
-#if 0
-            /* Disabling this code seems to allow shared display lists
-             * and texture objects to work.  We'll leave it disabled for now.
-             */
+        /* Page 26 (page 32 of the PDF) of the GLX 1.4 spec says:
+         *
+         *     "The server context state for all sharing contexts must exist
+         *     in a single address space or a BadMatch error is generated."
+         *
+         * If the share context is indirect, force the new context to also be
+         * indirect.  If the shard context is direct but the new context
+         * cannot be direct, generate BadMatch.
+         */
+        if (shareglxc->isDirect && !isDirect) {
             client->errorValue = shareList;
             return BadMatch;
-#endif
         }
-        else {
+        else if (!shareglxc->isDirect) {
             /*
              ** Create an indirect context regardless of what the client asked
              ** for; this way we can share display list space with shareList.
@@ -276,42 +276,55 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
     /*
      ** Allocate memory for the new context
      */
-    if (!isDirect)
-        glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc);
+    if (!isDirect) {
+        /* Without any attributes, the only error that the driver should be
+         * able to generate is BadAlloc.  As result, just drop the error
+         * returned from the driver on the floor.
+         */
+        glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc,
+                                         0, NULL, &err);
+    }
     else
         glxc = __glXdirectContextCreate(pGlxScreen, config, shareglxc);
     if (!glxc) {
         return BadAlloc;
     }
 
-    /*
-     ** Initially, setup the part of the context that could be used by
-     ** a GL core that needs windowing information (e.g., Mesa).
+    /* Initialize the GLXcontext structure.
      */
     glxc->pGlxScreen = pGlxScreen;
     glxc->config = config;
-
-    /*
-     ** Register this context as a resource.
-     */
-    if (!AddResource(gcId, __glXContextRes, (pointer) glxc)) {
-        (*glxc->destroy) (glxc);
-        client->errorValue = gcId;
-        return BadAlloc;
-    }
-
-    /*
-     ** Finally, now that everything is working, setup the rest of the
-     ** context.
-     */
     glxc->id = gcId;
     glxc->share_id = shareList;
     glxc->idExists = GL_TRUE;
     glxc->isCurrent = GL_FALSE;
     glxc->isDirect = isDirect;
+    glxc->hasUnflushedCommands = GL_FALSE;
     glxc->renderMode = GL_RENDER;
+    glxc->feedbackBuf = NULL;
+    glxc->feedbackBufSize = 0;
+    glxc->selectBuf = NULL;
+    glxc->selectBufSize = 0;
+    glxc->drawPriv = NULL;
+    glxc->readPriv = NULL;
+
+    /* The GLX_ARB_create_context_robustness spec says:
+     *
+     *     "The default value for GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
+     *     is GLX_NO_RESET_NOTIFICATION_ARB."
+     *
+     * Without using glXCreateContextAttribsARB, there is no way to specify a
+     * non-default reset notification strategy.
+     */
+    glxc->resetNotificationStrategy = GLX_NO_RESET_NOTIFICATION_ARB;
 
-    __glXAddToContextList(glxc);
+    /* Add the new context to the various global tables of GLX contexts.
+     */
+    if (!__glXAddContext(glxc)) {
+        (*glxc->destroy) (glxc);
+        client->errorValue = gcId;
+        return BadAlloc;
+    }
 
     return Success;
 }
@@ -638,23 +651,23 @@ DoMakeCurrent(__GLXclientState * cl,
 
     StopUsingContext(prevglxc);
 
+    reply = (xGLXMakeCurrentReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .contextTag = 0
+    };
+
     if (glxc) {
         StartUsingContext(cl, glxc);
         reply.contextTag = glxc->id;
     }
-    else {
-        reply.contextTag = 0;
-    }
-
-    reply.length = 0;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
 
     if (client->swapped) {
         __glXSwapMakeCurrentReply(client, &reply);
     }
     else {
-        WriteToClient(client, sz_xGLXMakeCurrentReply, (char *) &reply);
+        WriteToClient(client, sz_xGLXMakeCurrentReply, &reply);
     }
     return Success;
 }
@@ -709,16 +722,18 @@ __glXDisp_IsDirect(__GLXclientState * cl, GLbyte * pc)
     if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err))
         return err;
 
-    reply.isDirect = glxc->isDirect;
-    reply.length = 0;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXIsDirectReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .isDirect = glxc->isDirect
+    };
 
     if (client->swapped) {
         __glXSwapIsDirectReply(client, &reply);
     }
     else {
-        WriteToClient(client, sz_xGLXIsDirectReply, (char *) &reply);
+        WriteToClient(client, sz_xGLXIsDirectReply, &reply);
     }
 
     return Success;
@@ -744,17 +759,19 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc)
      ** client if it wants to work with older clients; however, in this
      ** implementation the server just returns its version number.
      */
-    reply.majorVersion = glxMajorVersion;
-    reply.minorVersion = glxMinorVersion;
-    reply.length = 0;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXQueryVersionReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = glxMajorVersion,
+        .minorVersion = glxMinorVersion
+    };
 
     if (client->swapped) {
         __glXSwapQueryVersionReply(client, &reply);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryVersionReply, (char *) &reply);
+        WriteToClient(client, sz_xGLXQueryVersionReply, &reply);
     }
     return Success;
 }
@@ -922,12 +939,14 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
     if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
         return err;
 
-    reply.numVisuals = pGlxScreen->numVisuals;
-    reply.numProps = GLX_VIS_CONFIG_TOTAL;
-    reply.length =
-        (reply.numVisuals * __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXGetVisualConfigsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = (pGlxScreen->numVisuals *
+                   __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2,
+        .numVisuals = pGlxScreen->numVisuals,
+        .numProps = GLX_VIS_CONFIG_TOTAL
+    };
 
     if (client->swapped) {
         __GLX_SWAP_SHORT(&reply.sequenceNumber);
@@ -936,7 +955,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
         __GLX_SWAP_INT(&reply.numProps);
     }
 
-    WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
+    WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply);
 
     for (i = 0; i < pGlxScreen->numVisuals; i++) {
         modes = pGlxScreen->visuals[i];
@@ -993,7 +1012,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
         if (client->swapped) {
             __GLX_SWAP_INT_ARRAY(buf, p);
         }
-        WriteToClient(client, __GLX_SIZE_CARD32 * p, (char *) buf);
+        WriteToClient(client, __GLX_SIZE_CARD32 * p, buf);
     }
     return Success;
 }
@@ -1026,11 +1045,13 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen)
     if (!validGlxScreen(cl->client, screen, &pGlxScreen, &err))
         return err;
 
-    reply.numFBConfigs = pGlxScreen->numFBConfigs;
-    reply.numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS;
-    reply.length = (__GLX_FBCONFIG_ATTRIBS_LENGTH * reply.numFBConfigs);
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXGetFBConfigsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = __GLX_FBCONFIG_ATTRIBS_LENGTH * pGlxScreen->numFBConfigs,
+        .numFBConfigs = pGlxScreen->numFBConfigs,
+        .numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS
+    };
 
     if (client->swapped) {
         __GLX_SWAP_SHORT(&reply.sequenceNumber);
@@ -1039,7 +1060,7 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen)
         __GLX_SWAP_INT(&reply.numAttribs);
     }
 
-    WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *) &reply);
+    WriteToClient(client, sz_xGLXGetFBConfigsReply, &reply);
 
     for (modes = pGlxScreen->fbconfigs; modes != NULL; modes = modes->next) {
         p = 0;
@@ -1650,10 +1671,12 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
         return err;
 
     nProps = 3;
-    reply.length = nProps << 1;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.n = nProps;
+    reply = (xGLXQueryContextInfoEXTReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = nProps << 1,
+        .n = nProps
+    };
 
     nReplyBytes = reply.length << 2;
     sendBuf = (int *) malloc((size_t) nReplyBytes);
@@ -1672,8 +1695,8 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
         __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) &reply);
-        WriteToClient(client, nReplyBytes, (char *) sendBuf);
+        WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply);
+        WriteToClient(client, nReplyBytes, sendBuf);
     }
     free((char *) sendBuf);
 
@@ -1857,10 +1880,12 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
         return error;
 
     numAttribs = 3;
-    reply.length = numAttribs << 1;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.numAttribs = numAttribs;
+    reply = (xGLXGetDrawableAttributesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = numAttribs << 1,
+        .numAttribs = numAttribs
+    };
 
     attributes[0] = GLX_TEXTURE_TARGET_EXT;
     attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT :
@@ -1874,10 +1899,8 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
         __glXSwapGetDrawableAttributesReply(client, &reply, attributes);
     }
     else {
-        WriteToClient(client, sz_xGLXGetDrawableAttributesReply,
-                      (char *) &reply);
-        WriteToClient(client, reply.length * sizeof(CARD32),
-                      (char *) attributes);
+        WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply);
+        WriteToClient(client, reply.length * sizeof(CARD32), attributes);
     }
 
     return Success;
@@ -2298,13 +2321,15 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
 
     n = strlen(pGlxScreen->GLXextensions) + 1;
     length = __GLX_PAD(n) >> 2;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = length;
-    reply.n = n;
+    reply = (xGLXQueryExtensionsStringReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = length,
+        .n = n
+    };
 
     /* Allocate buffer to make sure it's a multiple of 4 bytes big. */
-    buf = (char *) malloc(length << 2);
+    buf = calloc(length, 4);
     if (buf == NULL)
         return BadAlloc;
     memcpy(buf, pGlxScreen->GLXextensions, n);
@@ -2313,9 +2338,8 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
         glxSwapQueryExtensionsStringReply(client, &reply, buf);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryExtensionsStringReply,
-                      (char *) &reply);
-        WriteToClient(client, (int) (length << 2), (char *) buf);
+        WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply);
+        WriteToClient(client, (int) (length << 2), buf);
     }
 
     free(buf);
@@ -2360,12 +2384,14 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
 
     n = strlen(ptr) + 1;
     length = __GLX_PAD(n) >> 2;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = length;
-    reply.n = n;
-
-    buf = (char *) malloc(length << 2);
+    reply = (xGLXQueryServerStringReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = length,
+        .n = n
+    };
+
+    buf = calloc(length, 4);
     if (buf == NULL) {
         return BadAlloc;
     }
@@ -2375,7 +2401,7 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
         glxSwapQueryServerStringReply(client, &reply, buf);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) &reply);
+        WriteToClient(client, sz_xGLXQueryServerStringReply, &reply);
         WriteToClient(client, (int) (length << 2), buf);
     }
 
@@ -2396,8 +2422,6 @@ __glXDisp_ClientInfo(__GLXclientState * cl, GLbyte * pc)
     if (!memchr(buf, 0, (client->req_len << 2) - sizeof(xGLXClientInfoReq)))
         return BadLength;
 
-    cl->GLClientmajorVersion = req->major;
-    cl->GLClientminorVersion = req->minor;
     free(cl->GLClientextensions);
     cl->GLClientextensions = strdup(buf);
 
index e8520d6..43f88d3 100644 (file)
@@ -840,7 +840,7 @@ __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply * reply)
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->contextTag);
-    WriteToClient(client, sz_xGLXMakeCurrentReply, (char *) reply);
+    WriteToClient(client, sz_xGLXMakeCurrentReply, reply);
 }
 
 void
@@ -849,7 +849,7 @@ __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply)
     __GLX_DECLARE_SWAP_VARIABLES;
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
-    WriteToClient(client, sz_xGLXIsDirectReply, (char *) reply);
+    WriteToClient(client, sz_xGLXIsDirectReply, reply);
 }
 
 void
@@ -860,7 +860,7 @@ __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply)
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->majorVersion);
     __GLX_SWAP_INT(&reply->minorVersion);
-    WriteToClient(client, sz_xGLXQueryVersionReply, (char *) reply);
+    WriteToClient(client, sz_xGLXQueryVersionReply, reply);
 }
 
 void
@@ -875,7 +875,7 @@ glxSwapQueryExtensionsStringReply(ClientPtr client,
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->n);
-    WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *) reply);
+    WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply);
     __GLX_SWAP_INT_ARRAY((int *) buf, length);
     WriteToClient(client, length << 2, buf);
 }
@@ -890,7 +890,7 @@ glxSwapQueryServerStringReply(ClientPtr client,
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->n);
-    WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) reply);
+    WriteToClient(client, sz_xGLXQueryServerStringReply, reply);
     /** no swap is needed for an array of chars **/
     /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
     WriteToClient(client, length << 2, buf);
@@ -908,9 +908,9 @@ __glXSwapQueryContextInfoEXTReply(ClientPtr client,
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->n);
-    WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) reply);
+    WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply);
     __GLX_SWAP_INT_ARRAY((int *) buf, length);
-    WriteToClient(client, length << 2, (char *) buf);
+    WriteToClient(client, length << 2, buf);
 }
 
 void
@@ -925,9 +925,9 @@ __glXSwapGetDrawableAttributesReply(ClientPtr client,
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->numAttribs);
-    WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *) reply);
+    WriteToClient(client, sz_xGLXGetDrawableAttributesReply, reply);
     __GLX_SWAP_INT_ARRAY((int *) buf, length);
-    WriteToClient(client, length << 2, (char *) buf);
+    WriteToClient(client, length << 2, buf);
 }
 
 /************************************************************************/
index ef2c4db..4764e56 100644 (file)
@@ -104,6 +104,11 @@ struct __GLXcontext {
      */
     GLenum renderMode;
 
+    /**
+     * Reset notification strategy used when a GPU reset occurs.
+     */
+    GLenum resetNotificationStrategy;
+
     /*
      ** Buffers for feedback and selection.
      */
@@ -121,4 +126,17 @@ struct __GLXcontext {
 
 void __glXContextDestroy(__GLXcontext * context);
 
+extern int validGlxScreen(ClientPtr client, int screen,
+                          __GLXscreen ** pGlxScreen, int *err);
+
+extern int validGlxFBConfig(ClientPtr client, __GLXscreen * pGlxScreen,
+                            XID id, __GLXconfig ** config, int *err);
+
+extern int validGlxContext(ClientPtr client, XID id, int access_mode,
+                           __GLXcontext ** context, int *err);
+
+extern __GLXcontext *__glXdirectContextCreate(__GLXscreen * screen,
+                                              __GLXconfig * modes,
+                                              __GLXcontext * shareContext);
+
 #endif                          /* !__GLX_context_h__ */
index 9b8b66f..a5d87ec 100644 (file)
@@ -599,7 +599,10 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
 static __GLXcontext *
 __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
                             __GLXconfig * glxConfig,
-                            __GLXcontext * baseShareContext)
+                            __GLXcontext * baseShareContext,
+                            unsigned num_attribs,
+                            const uint32_t *attribs,
+                            int *error)
 {
     __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
     __GLXDRIcontext *context, *shareContext;
@@ -611,6 +614,13 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
     drm_context_t hwContext;
     ScreenPtr pScreen = baseScreen->pScreen;
 
+    /* DRI1 cannot support createContextAttribs, so these parameters will
+     * never be used.
+     */
+    (void) num_attribs;
+    (void) attribs;
+    (void) error;
+
     shareContext = (__GLXDRIcontext *) baseShareContext;
     if (shareContext)
         driShare = shareContext->driContext;
@@ -846,18 +856,17 @@ static const __DRIextension *loader_extensions[] = {
 };
 
 static Bool
-glxDRIEnterVT(int index, int flags)
+glxDRIEnterVT(ScrnInfoPtr scrn)
 {
-    ScrnInfoPtr scrn = xf86Screens[index];
     Bool ret;
     __GLXDRIscreen *screen = (__GLXDRIscreen *)
-        glxGetScreen(screenInfo.screens[index]);
+        glxGetScreen(xf86ScrnToScreen(scrn));
 
     LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
 
     scrn->EnterVT = screen->enterVT;
 
-    ret = scrn->EnterVT(index, flags);
+    ret = scrn->EnterVT(scrn);
 
     screen->enterVT = scrn->EnterVT;
     scrn->EnterVT = glxDRIEnterVT;
@@ -871,18 +880,17 @@ glxDRIEnterVT(int index, int flags)
 }
 
 static void
-glxDRILeaveVT(int index, int flags)
+glxDRILeaveVT(ScrnInfoPtr scrn)
 {
-    ScrnInfoPtr scrn = xf86Screens[index];
     __GLXDRIscreen *screen = (__GLXDRIscreen *)
-        glxGetScreen(screenInfo.screens[index]);
+        glxGetScreen(xf86ScrnToScreen(scrn));
 
     LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n");
 
     glxSuspendClients();
 
     scrn->LeaveVT = screen->leaveVT;
-    (*screen->leaveVT) (index, flags);
+    (*screen->leaveVT) (scrn);
     screen->leaveVT = scrn->LeaveVT;
     scrn->LeaveVT = glxDRILeaveVT;
 }
@@ -961,7 +969,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     __GLXDRIscreen *screen;
     Bool isCapable;
     size_t buffer_size;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
     if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
         !DRIQueryDirectRenderingCapable(pScreen, &isCapable) || !isCapable) {
index aa38295..bce1bfa 100644 (file)
@@ -47,6 +47,7 @@
 #include "glxserver.h"
 #include "glxutil.h"
 #include "glxdricommon.h"
+#include <GL/glxtokens.h>
 
 #include "glapitable.h"
 #include "glapi.h"
@@ -58,6 +59,16 @@ typedef struct __GLXDRIscreen __GLXDRIscreen;
 typedef struct __GLXDRIcontext __GLXDRIcontext;
 typedef struct __GLXDRIdrawable __GLXDRIdrawable;
 
+
+#ifdef __DRI2_ROBUSTNESS
+#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG                         \
+                           | __DRI_CTX_FLAG_FORWARD_COMPATIBLE          \
+                           | __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS)
+#else
+#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG                         \
+                           | __DRI_CTX_FLAG_FORWARD_COMPATIBLE)
+#endif
+
 struct __GLXDRIscreen {
     __GLXscreen base;
     __DRIscreen *driScreen;
@@ -95,6 +106,7 @@ struct __GLXDRIdrawable {
     int height;
     __DRIbuffer buffers[MAX_DRAWABLE_BUFFERS];
     int count;
+    XID dri2_id;
 };
 
 static void
@@ -103,6 +115,8 @@ __glXDRIdrawableDestroy(__GLXdrawable * drawable)
     __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
     const __DRIcoreExtension *core = private->screen->core;
 
+    FreeResource(private->dri2_id, FALSE);
+
     (*core->destroyDrawable) (private->driDrawable);
 
     __glXDrawableRelease(drawable);
@@ -167,12 +181,13 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
                   CARD64 msc, CARD32 sbc)
 {
     __GLXdrawable *drawable = data;
-    xGLXBufferSwapComplete2 wire;
+    xGLXBufferSwapComplete2 wire =  {
+        .type = __glXEventBase + GLX_BufferSwapComplete
+    };
 
     if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
         return;
 
-    wire.type = __glXEventBase + GLX_BufferSwapComplete;
     switch (type) {
     case DRI2_EXCHANGE_COMPLETE:
         wire.event_type = GLX_EXCHANGE_COMPLETE_INTEL;
@@ -377,10 +392,213 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
     free(screen);
 }
 
+static Bool
+dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
+                         const uint32_t *attribs,
+                         unsigned *major_ver, unsigned *minor_ver,
+                         uint32_t *flags, int *api, int *reset, unsigned *error)
+{
+    unsigned i;
+
+    if (num_attribs == 0)
+        return True;
+
+    if (attribs == NULL) {
+        *error = BadImplementation;
+        return False;
+    }
+
+    *major_ver = 1;
+    *minor_ver = 0;
+#ifdef __DRI2_ROBUSTNESS
+    *reset = __DRI_CTX_RESET_NO_NOTIFICATION;
+#else
+    (void) reset;
+#endif
+
+    for (i = 0; i < num_attribs; i++) {
+        switch (attribs[i * 2]) {
+        case GLX_CONTEXT_MAJOR_VERSION_ARB:
+            *major_ver = attribs[i * 2 + 1];
+            break;
+        case GLX_CONTEXT_MINOR_VERSION_ARB:
+            *minor_ver = attribs[i * 2 + 1];
+            break;
+        case GLX_CONTEXT_FLAGS_ARB:
+            *flags = attribs[i * 2 + 1];
+            break;
+        case GLX_RENDER_TYPE:
+            break;
+        case GLX_CONTEXT_PROFILE_MASK_ARB:
+            switch (attribs[i * 2 + 1]) {
+            case GLX_CONTEXT_CORE_PROFILE_BIT_ARB:
+                *api = __DRI_API_OPENGL_CORE;
+                break;
+            case GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB:
+                *api = __DRI_API_OPENGL;
+                break;
+            case GLX_CONTEXT_ES2_PROFILE_BIT_EXT:
+                *api = __DRI_API_GLES2;
+                break;
+            default:
+                *error = __glXError(GLXBadProfileARB);
+                return False;
+            }
+            break;
+#ifdef __DRI2_ROBUSTNESS
+        case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB:
+            if (screen->dri2->base.version >= 4) {
+                *error = BadValue;
+                return False;
+            }
+
+            switch (attribs[i * 2 + 1]) {
+            case GLX_NO_RESET_NOTIFICATION_ARB:
+                *reset = __DRI_CTX_RESET_NO_NOTIFICATION;
+                break;
+            case GLX_LOSE_CONTEXT_ON_RESET_ARB:
+                *reset = __DRI_CTX_RESET_LOSE_CONTEXT;
+                break;
+            default:
+                *error = BadValue;
+                return False;
+            }
+            break;
+#endif
+        default:
+            /* If an unknown attribute is received, fail.
+             */
+            *error = BadValue;
+            return False;
+        }
+    }
+
+    /* Unknown flag value.
+     */
+    if ((*flags & ~ALL_DRI_CTX_FLAGS) != 0) {
+        *error = BadValue;
+        return False;
+    }
+
+    /* If the core profile is requested for a GL version is less than 3.2,
+     * request the non-core profile from the DRI driver.  The core profile
+     * only makes sense for GL versions >= 3.2, and many DRI drivers that
+     * don't support OpenGL 3.2 may fail the request for a core profile.
+     */
+    if (*api == __DRI_API_OPENGL_CORE
+        && (*major_ver < 3 || (*major_ver == 3 && *minor_ver < 2))) {
+        *api = __DRI_API_OPENGL;
+    }
+
+    *error = Success;
+    return True;
+}
+
+static void
+create_driver_context(__GLXDRIcontext * context,
+                      __GLXDRIscreen * screen,
+                      __GLXDRIconfig * config,
+                      __DRIcontext * driShare,
+                      unsigned num_attribs,
+                      const uint32_t *attribs,
+                      int *error)
+{
+    context->driContext = NULL;
+
+#if __DRI_DRI2_VERSION >= 3
+    if (screen->dri2->base.version >= 3) {
+        uint32_t ctx_attribs[3 * 2];
+        unsigned num_ctx_attribs = 0;
+        unsigned dri_err = 0;
+        unsigned major_ver;
+        unsigned minor_ver;
+        uint32_t flags;
+        int reset;
+        int api;
+
+        if (num_attribs != 0) {
+            if (!dri2_convert_glx_attribs(screen, num_attribs, attribs,
+                                          &major_ver, &minor_ver,
+                                          &flags, &api, &reset,
+                                          (unsigned *) error))
+                return;
+
+            ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MAJOR_VERSION;
+            ctx_attribs[num_ctx_attribs++] = major_ver;
+            ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MINOR_VERSION;
+            ctx_attribs[num_ctx_attribs++] = minor_ver;
+
+            if (flags != 0) {
+                ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_FLAGS;
+
+                /* The current __DRI_CTX_FLAG_* values are identical to the
+                 * GLX_CONTEXT_*_BIT values.
+                 */
+                ctx_attribs[num_ctx_attribs++] = flags;
+            }
+
+#ifdef __DRI2_ROBUSTNESS
+            if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) {
+                ctx_attribs[num_ctx_attribs++] =
+                    __DRI_CTX_ATTRIB_RESET_STRATEGY;
+                ctx_attribs[num_ctx_attribs++] = reset;
+            }
+#endif
+        }
+
+        context->driContext =
+            (*screen->dri2->createContextAttribs)(screen->driScreen,
+                                                  api,
+                                                  config->driConfig,
+                                                  driShare,
+                                                  num_ctx_attribs / 2,
+                                                  ctx_attribs,
+                                                  &dri_err,
+                                                  context);
+
+        switch (dri_err) {
+        case __DRI_CTX_ERROR_SUCCESS:
+            *error = Success;
+            break;
+        case __DRI_CTX_ERROR_NO_MEMORY:
+            *error = BadAlloc;
+            break;
+        case __DRI_CTX_ERROR_BAD_API:
+            *error = __glXError(GLXBadProfileARB);
+            break;
+        case __DRI_CTX_ERROR_BAD_VERSION:
+        case __DRI_CTX_ERROR_BAD_FLAG:
+            *error = __glXError(GLXBadFBConfig);
+            break;
+        case __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE:
+        case __DRI_CTX_ERROR_UNKNOWN_FLAG:
+        default:
+            *error = BadValue;
+            break;
+        }
+
+        return;
+    }
+#endif
+
+    if (num_attribs != 0) {
+        *error = BadValue;
+        return;
+    }
+
+    context->driContext =
+        (*screen->dri2->createNewContext) (screen->driScreen,
+                                           config->driConfig,
+                                           driShare, context);
+}
+
 static __GLXcontext *
 __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
                             __GLXconfig * glxConfig,
-                            __GLXcontext * baseShareContext)
+                            __GLXcontext * baseShareContext,
+                            unsigned num_attribs,
+                            const uint32_t *attribs,
+                            int *error)
 {
     __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
     __GLXDRIcontext *context, *shareContext;
@@ -394,8 +612,10 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
         driShare = NULL;
 
     context = calloc(1, sizeof *context);
-    if (context == NULL)
+    if (context == NULL) {
+        *error = BadAlloc;
         return NULL;
+    }
 
     context->base.destroy = __glXDRIcontextDestroy;
     context->base.makeCurrent = __glXDRIcontextMakeCurrent;
@@ -404,10 +624,8 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
     context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
     context->base.wait = __glXDRIcontextWait;
 
-    context->driContext =
-        (*screen->dri2->createNewContext) (screen->driScreen,
-                                           config->driConfig,
-                                           driShare, context);
+    create_driver_context(context, screen, config, driShare, num_attribs,
+                          attribs, error);
     if (context->driContext == NULL) {
         free(context);
         return NULL;
@@ -456,8 +674,9 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
     private->base.waitGL = __glXDRIdrawableWaitGL;
     private->base.waitX = __glXDRIdrawableWaitX;
 
-    if (DRI2CreateDrawable(client, pDraw, drawId,
-                           __glXDRIinvalidateBuffers, private)) {
+    if (DRI2CreateDrawable2(client, pDraw, drawId,
+                            __glXDRIinvalidateBuffers, private,
+                            &private->dri2_id)) {
         free(private);
         return NULL;
     }
@@ -587,18 +806,17 @@ static const __DRIextension *loader_extensions[] = {
 };
 
 static Bool
-glxDRIEnterVT(int index, int flags)
+glxDRIEnterVT(ScrnInfoPtr scrn)
 {
-    ScrnInfoPtr scrn = xf86Screens[index];
     Bool ret;
     __GLXDRIscreen *screen = (__GLXDRIscreen *)
-        glxGetScreen(screenInfo.screens[index]);
+        glxGetScreen(xf86ScrnToScreen(scrn));
 
     LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
 
     scrn->EnterVT = screen->enterVT;
 
-    ret = scrn->EnterVT(index, flags);
+    ret = scrn->EnterVT(scrn);
 
     screen->enterVT = scrn->EnterVT;
     scrn->EnterVT = glxDRIEnterVT;
@@ -612,18 +830,17 @@ glxDRIEnterVT(int index, int flags)
 }
 
 static void
-glxDRILeaveVT(int index, int flags)
+glxDRILeaveVT(ScrnInfoPtr scrn)
 {
-    ScrnInfoPtr scrn = xf86Screens[index];
     __GLXDRIscreen *screen = (__GLXDRIscreen *)
-        glxGetScreen(screenInfo.screens[index]);
+        glxGetScreen(xf86ScrnToScreen(scrn));
 
     LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n");
 
     glxSuspendClients();
 
     scrn->LeaveVT = screen->leaveVT;
-    (*screen->leaveVT) (index, flags);
+    (*screen->leaveVT) (scrn);
     screen->leaveVT = scrn->LeaveVT;
     scrn->LeaveVT = glxDRILeaveVT;
 }
@@ -643,6 +860,21 @@ initializeExtensions(__GLXDRIscreen * screen)
     __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
     LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n");
 
+#if __DRI_DRI2_VERSION >= 3
+    if (screen->dri2->base.version >= 3) {
+        __glXEnableExtension(screen->glx_enable_bits,
+                             "GLX_ARB_create_context");
+        __glXEnableExtension(screen->glx_enable_bits,
+                             "GLX_ARB_create_context_profile");
+        __glXEnableExtension(screen->glx_enable_bits,
+                             "GLX_EXT_create_context_es2_profile");
+        LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context\n");
+        LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context_profile\n");
+        LogMessage(X_INFO,
+                   "AIGLX: enabled GLX_EXT_create_context_es2_profile\n");
+    }
+#endif
+
     if (DRI2HasSwapControl(pScreen)) {
         __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_swap_control");
         __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_swap_control");
@@ -676,6 +908,16 @@ initializeExtensions(__GLXDRIscreen * screen)
         }
 #endif
 
+#ifdef __DRI2_ROBUSTNESS
+        if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0 &&
+            screen->dri2->base.version >= 3) {
+            __glXEnableExtension(screen->glx_enable_bits,
+                                 "GLX_ARB_create_context_robustness");
+            LogMessage(X_INFO,
+                       "AIGLX: enabled GLX_ARB_create_context_robustness\n");
+        }
+#endif
+
         /* Ignore unknown extensions */
     }
 }
@@ -686,14 +928,14 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     const char *driverName, *deviceName;
     __GLXDRIscreen *screen;
     size_t buffer_size;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
     screen = calloc(1, sizeof *screen);
     if (screen == NULL)
         return NULL;
 
     if (!xf86LoaderCheckSymbol("DRI2Connect") ||
-        !DRI2Connect(pScreen, DRI2DriverDRI,
+        !DRI2Connect(serverClient, pScreen, DRI2DriverDRI,
                      &screen->fd, &driverName, &deviceName)) {
         LogMessage(X_INFO,
                    "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
index 44d5a3e..c90f380 100644 (file)
@@ -107,8 +107,6 @@ __ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits),
         __ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture),
         __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),};
 
-#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
-
 static void
 setScalar(__GLXconfig * config, unsigned int attrib, unsigned int value)
 {
index c69b4d2..b478398 100644 (file)
@@ -257,7 +257,10 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
 static __GLXcontext *
 __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
                             __GLXconfig * glxConfig,
-                            __GLXcontext * baseShareContext)
+                            __GLXcontext * baseShareContext,
+                            unsigned num_attribs,
+                            const uint32_t *attribs,
+                            int *error)
 {
     __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
     __GLXDRIcontext *context, *shareContext;
@@ -265,6 +268,13 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
     const __DRIcoreExtension *core = screen->core;
     __DRIcontext *driShare;
 
+    /* DRISWRAST won't support createContextAttribs, so these parameters will
+     * never be used.
+     */
+    (void) num_attribs;
+    (void) attribs;
+    (void) error;
+
     shareContext = (__GLXDRIcontext *) baseShareContext;
     if (shareContext)
         driShare = shareContext->driContext;
index acd696e..bc7fe82 100644 (file)
@@ -39,6 +39,8 @@
 #include <registry.h>
 #include "privates.h"
 #include <os.h>
+#include "extinit.h"
+#include "glx_extinit.h"
 #include "unpack.h"
 #include "glxutil.h"
 #include "glxext.h"
@@ -157,11 +159,18 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid)
     return True;
 }
 
-void
-__glXAddToContextList(__GLXcontext * cx)
+Bool
+__glXAddContext(__GLXcontext * cx)
 {
+    /* Register this context as a resource.
+     */
+    if (!AddResource(cx->id, __glXContextRes, (pointer)cx)) {
+       return False;
+    }
+
     cx->next = glxAllContexts;
     glxAllContexts = cx;
+    return True;
 }
 
 static void
@@ -281,8 +290,6 @@ glxClientCallback(CallbackListPtr *list, pointer closure, pointer data)
          ** By default, assume that the client supports
          ** GLX major version 1 minor version 0 protocol.
          */
-        cl->GLClientmajorVersion = 1;
-        cl->GLClientminorVersion = 0;
         cl->client = pClient;
         break;
 
@@ -317,9 +324,15 @@ GlxExtensionInit(void)
     ExtensionEntry *extEntry;
     ScreenPtr pScreen;
     int i;
-    __GLXprovider *p;
+    __GLXprovider *p, **stack;
     Bool glx_provided = False;
 
+    if (serverGeneration == 1) {
+        for (stack = &__glXProviderStack; *stack; stack = &(*stack)->next)
+            ;
+        *stack = &__glXDRISWRastProvider;
+    }
+
     __glXContextRes = CreateNewResourceType((DeleteType) ContextGone,
                                             "GLXContext");
     __glXDrawableRes = CreateNewResourceType((DeleteType) DrawableGone,
index 7cd5cb4..9b0978b 100644 (file)
@@ -38,7 +38,7 @@
 extern GLboolean __glXFreeContext(__GLXcontext * glxc);
 extern void __glXFlushContextCache(void);
 
-extern void __glXAddToContextList(__GLXcontext * cx);
+extern Bool __glXAddContext(__GLXcontext * cx);
 extern void __glXErrorCallBack(GLenum code);
 extern void __glXClearErrorOccured(void);
 extern GLboolean __glXErrorOccured(void);
index 74b4c42..61d590c 100644 (file)
@@ -174,10 +174,10 @@ static char GLXServerExtensions[] =
     "GLX_SGIS_multisample "
 #endif
     "GLX_SGIX_fbconfig "
-    "GLX_SGIX_pbuffer " "GLX_MESA_copy_sub_buffer " "GLX_INTEL_swap_event";
+    "GLX_SGIX_pbuffer " "GLX_MESA_copy_sub_buffer ";
 
 static Bool
-glxCloseScreen(int index, ScreenPtr pScreen)
+glxCloseScreen(ScreenPtr pScreen)
 {
     __GLXscreen *pGlxScreen = glxGetScreen(pScreen);
 
@@ -185,7 +185,7 @@ glxCloseScreen(int index, ScreenPtr pScreen)
 
     pGlxScreen->destroy(pGlxScreen);
 
-    return pScreen->CloseScreen(index, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 __GLXscreen *
@@ -288,6 +288,9 @@ pickFBConfig(__GLXscreen * pGlxScreen, VisualPtr visual)
             continue;
         if (config->visualRating != GLX_NONE)
             continue;
+        /* Ignore multisampled configs */
+        if (config->sampleBuffers)
+            continue;
         if (glxConvertToXVisualType(config->visualType) != visual->class)
             continue;
         /* If it's the 32-bit RGBA visual, demand a 32-bit fbconfig. */
index d5420ee..b29df58 100644 (file)
@@ -117,7 +117,10 @@ struct __GLXscreen {
 
     __GLXcontext *(*createContext) (__GLXscreen * screen,
                                     __GLXconfig * modes,
-                                    __GLXcontext * shareContext);
+                                    __GLXcontext * shareContext,
+                                    unsigned num_attribs,
+                                    const uint32_t *attribs,
+                                    int *error);
 
     __GLXdrawable *(*createDrawable) (ClientPtr client,
                                       __GLXscreen * context,
@@ -153,7 +156,7 @@ struct __GLXscreen {
     unsigned GLXminor;
     /*@} */
 
-    Bool (*CloseScreen) (int index, ScreenPtr pScreen);
+    Bool (*CloseScreen) (ScreenPtr pScreen);
 };
 
 void __glXScreenInit(__GLXscreen * screen, ScreenPtr pScreen);
index 7076848..1021aec 100644 (file)
@@ -46,7 +46,6 @@
 #include <resource.h>
 #include <scrnintstr.h>
 
-#define GL_GLEXT_PROTOTYPES     /* we want prototypes */
 #include <GL/gl.h>
 #include <GL/glxproto.h>
 
@@ -77,8 +76,6 @@ extern __GLXclientState *glxGetClient(ClientPtr pClient);
 
 /************************************************************************/
 
-void GlxExtensionInit(void);
-
 void GlxSetVisualConfigs(int nconfigs, void *configs, void **privates);
 
 void __glXScreenInitVisuals(__GLXscreen * screen);
@@ -100,6 +97,7 @@ struct __GLXprovider {
     const char *name;
     __GLXprovider *next;
 };
+extern __GLXprovider __glXDRISWRastProvider;
 
 void GlxPushProvider(__GLXprovider * provider);
 
@@ -145,8 +143,6 @@ struct __GLXclientStateRec {
     /* Back pointer to X client record */
     ClientPtr client;
 
-    int GLClientmajorVersion;
-    int GLClientminorVersion;
     char *GLClientextensions;
 };
 
index a54f70a..a30b1f8 100644 (file)
@@ -138,10 +138,10 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements,
      */
 
     (void) memcpy(&__glXReply.pad3, data, 8);
-    WriteToClient(client, sz_xGLXSingleReply, (char *) &__glXReply);
+    WriteToClient(client, sz_xGLXSingleReply, &__glXReply);
 
     if (reply_ints != 0) {
-        WriteToClient(client, reply_ints * 4, (char *) data);
+        WriteToClient(client, reply_ints * 4, data);
     }
 }
 
@@ -184,10 +184,10 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements,
      */
 
     (void) memcpy(&__glXReply.pad3, data, 8);
-    WriteToClient(client, sz_xGLXSingleReply, (char *) &__glXReply);
+    WriteToClient(client, sz_xGLXSingleReply, &__glXReply);
 
     if (reply_ints != 0) {
-        WriteToClient(client, reply_ints * 4, (char *) data);
+        WriteToClient(client, reply_ints * 4, data);
     }
 }
 
index 42cccc1..9597d29 100644 (file)
@@ -193,15 +193,17 @@ __glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc)
      */
  noChangeAllowed:;
     client = cl->client;
-    reply.length = nitems;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.retval = retval;
-    reply.size = nitems;
-    reply.newMode = newMode;
-    WriteToClient(client, sz_xGLXRenderModeReply, (char *) &reply);
+    reply = (xGLXRenderModeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = nitems,
+        .retval = retval,
+        .size = nitems,
+        .newMode = newMode
+    };
+    WriteToClient(client, sz_xGLXRenderModeReply, &reply);
     if (retBytes) {
-        WriteToClient(client, retBytes, (char *) retBuffer);
+        WriteToClient(client, retBytes, retBuffer);
     }
     return Success;
 }
@@ -384,7 +386,7 @@ DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap)
     }
 
     __GLX_SEND_HEADER();
-    WriteToClient(client, length, (char *) string);
+    WriteToClient(client, length, string);
     free(buf);
 
     return Success;
index e6bb585..1ca5328 100644 (file)
@@ -205,20 +205,22 @@ __glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc)
      */
  noChangeAllowed:;
     client = cl->client;
-    reply.length = nitems;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.retval = retval;
-    reply.size = nitems;
-    reply.newMode = newMode;
+    reply = (xGLXRenderModeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = nitems,
+        .retval = retval,
+        .size = nitems,
+        .newMode = newMode
+    };
     __GLX_SWAP_SHORT(&reply.sequenceNumber);
     __GLX_SWAP_INT(&reply.length);
     __GLX_SWAP_INT(&reply.retval);
     __GLX_SWAP_INT(&reply.size);
     __GLX_SWAP_INT(&reply.newMode);
-    WriteToClient(client, sz_xGLXRenderModeReply, (char *) &reply);
+    WriteToClient(client, sz_xGLXRenderModeReply, &reply);
     if (retBytes) {
-        WriteToClient(client, retBytes, (char *) retBuffer);
+        WriteToClient(client, retBytes, retBuffer);
     }
     return Success;
 }
index 0a088fc..52fba74 100644 (file)
@@ -63,7 +63,7 @@ extern xGLXSingleReply __glXReply;
        __glXReply.sequenceNumber = client->sequence;
 
 #define __GLX_SEND_HEADER() \
-       WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply);
+       WriteToClient (client, sz_xGLXSingleReply, &__glXReply);
 
 #define __GLX_PUT_RETVAL(a) \
        __glXReply.retval = (a);
@@ -116,19 +116,19 @@ extern xGLXSingleReply __glXReply;
        *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
 
 #define __GLX_SEND_BYTE_ARRAY(len) \
-       WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer)
+       WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer)
 
 #define __GLX_SEND_SHORT_ARRAY(len) \
-       WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer)
+       WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), answer)
 
 #define __GLX_SEND_INT_ARRAY(len) \
-       WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer)
+       WriteToClient(client, (len)*__GLX_SIZE_INT32, answer)
 
 #define __GLX_SEND_FLOAT_ARRAY(len) \
-       WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer)
+       WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, answer)
 
 #define __GLX_SEND_DOUBLE_ARRAY(len) \
-       WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer)
+       WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, answer)
 
 #define __GLX_SEND_VOID_ARRAY(len)  __GLX_SEND_BYTE_ARRAY(len)
 #define __GLX_SEND_UBYTE_ARRAY(len)  __GLX_SEND_BYTE_ARRAY(len)
diff --git a/hw/dmx/config/parser.c b/hw/dmx/config/parser.c
deleted file mode 100644 (file)
index 7e5ce40..0000000
+++ /dev/null
@@ -1,1888 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.3.  */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
-   simplifying the original so-called "semantic" parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Bison version.  */
-#define YYBISON_VERSION "2.3"
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 0
-
-/* Using locations.  */
-#define YYLSP_NEEDED 0
-
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     T_VIRTUAL = 258,
-     T_DISPLAY = 259,
-     T_WALL = 260,
-     T_OPTION = 261,
-     T_PARAM = 262,
-     T_STRING = 263,
-     T_DIMENSION = 264,
-     T_OFFSET = 265,
-     T_ORIGIN = 266,
-     T_COMMENT = 267,
-     T_LINE_COMMENT = 268
-   };
-#endif
-/* Tokens.  */
-#define T_VIRTUAL 258
-#define T_DISPLAY 259
-#define T_WALL 260
-#define T_OPTION 261
-#define T_PARAM 262
-#define T_STRING 263
-#define T_DIMENSION 264
-#define T_OFFSET 265
-#define T_ORIGIN 266
-#define T_COMMENT 267
-#define T_LINE_COMMENT 268
-
-
-
-
-/* Copy the first part of user declarations.  */
-#line 35 "parser.y"
-
-#ifdef HAVE_DMX_CONFIG_H
-#include <dmx-config.h>
-#endif
-
-#include "dmxparse.h"
-#include <string.h>
-#include <stdlib.h>
-#define YYDEBUG 1
-#define YYERROR_VERBOSE
-#define YY_USE_PROTOS
-
-DMXConfigEntryPtr dmxConfigEntry = NULL;
-#define APPEND(type, h, t)                 \
-{                                          \
-    type pt;                               \
-    for (pt = h; pt->next; pt = pt->next); \
-    pt->next = t;                          \
-}
-
-
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table.  */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 56 "parser.y"
-{
-    DMXConfigTokenPtr      token;
-    DMXConfigStringPtr     string;
-    DMXConfigNumberPtr     number;
-    DMXConfigPairPtr       pair;
-    DMXConfigFullDimPtr    fdim;
-    DMXConfigPartDimPtr    pdim;
-    DMXConfigDisplayPtr    display;
-    DMXConfigWallPtr       wall;
-    DMXConfigOptionPtr     option;
-    DMXConfigParamPtr      param;
-    DMXConfigCommentPtr    comment;
-    DMXConfigSubPtr        subentry;
-    DMXConfigVirtualPtr    virtual;
-    DMXConfigEntryPtr      entry;
-}
-/* Line 193 of yacc.c.  */
-#line 160 "parser.c"
-       YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-/* Copy the second part of user declarations.  */
-
-
-/* Line 216 of yacc.c.  */
-#line 173 "parser.c"
-
-#ifdef short
-# undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-#  define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-#  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYSIZE_T size_t
-# else
-#  define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
-#  if ENABLE_NLS
-#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YY_(msgid) dgettext ("bison-runtime", msgid)
-#  endif
-# endif
-# ifndef YY_
-#  define YY_(msgid) msgid
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E.  */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
-#else
-# define YYUSE(e) /* empty */
-#endif
-
-/* Identity function, used to suppress warnings about constant conditions.  */
-#ifndef lint
-# define YYID(n) (n)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int i)
-#else
-static int
-YYID (i)
-    int i;
-#endif
-{
-  return i;
-}
-#endif
-
-#if ! defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols.  */
-
-# ifdef YYSTACK_USE_ALLOCA
-#  if YYSTACK_USE_ALLOCA
-#   ifdef __GNUC__
-#    define YYSTACK_ALLOC __builtin_alloca
-#   elif defined __BUILTIN_VA_ARG_INCR
-#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-#   elif defined _AIX
-#    define YYSTACK_ALLOC __alloca
-#   elif defined _MSC_VER
-#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-#    define alloca _alloca
-#   else
-#    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef _STDLIB_H
-#      define _STDLIB_H 1
-#     endif
-#    endif
-#   endif
-#  endif
-# endif
-
-# ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-    /* The OS might guarantee only one guard page at the bottom of the stack,
-       and a page size can be as small as 4096 bytes.  So we cannot safely
-       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
-       to allow for a few compiler-allocated temporary stack slots.  */
-#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-#  endif
-# else
-#  define YYSTACK_ALLOC YYMALLOC
-#  define YYSTACK_FREE YYFREE
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-#  endif
-#  if (defined __cplusplus && ! defined _STDLIB_H \
-       && ! ((defined YYMALLOC || defined malloc) \
-            && (defined YYFREE || defined free)))
-#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef _STDLIB_H
-#    define _STDLIB_H 1
-#   endif
-#  endif
-#  ifndef YYMALLOC
-#   define YYMALLOC malloc
-#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-#  ifndef YYFREE
-#   define YYFREE free
-#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-
-#if (! defined yyoverflow \
-     && (! defined __cplusplus \
-        || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member.  */
-union yyalloc
-{
-  yytype_int16 yyss;
-  YYSTYPE yyvs;
-  };
-
-/* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
-   N elements.  */
-# define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
-      + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)             \
-      do                                       \
-       {                                       \
-         YYSIZE_T yyi;                         \
-         for (yyi = 0; yyi < (Count); yyi++)   \
-           (To)[yyi] = (From)[yyi];            \
-       }                                       \
-      while (YYID (0))
-#  endif
-# endif
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-# define YYSTACK_RELOCATE(Stack)                                       \
-    do                                                                 \
-      {                                                                        \
-       YYSIZE_T yynewbytes;                                            \
-       YYCOPY (&yyptr->Stack, Stack, yysize);                          \
-       Stack = &yyptr->Stack;                                          \
-       yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-       yyptr += yynewbytes / sizeof (*yyptr);                          \
-      }                                                                        \
-    while (YYID (0))
-
-#endif
-
-/* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  13
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   106
-
-/* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  18
-/* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  25
-/* YYNRULES -- Number of rules.  */
-#define YYNRULES  59
-/* YYNRULES -- Number of states.  */
-#define YYNSTATES  95
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
-#define YYUNDEFTOK  2
-#define YYMAXUTOK   268
-
-#define YYTRANSLATE(YYX)                                               \
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const yytype_uint8 yytranslate[] =
-{
-       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     6,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     5,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     3,     2,     4,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     2,     7,     8,
-       9,    10,    11,    12,    13,    14,    15,    16,    17
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const yytype_uint8 yyprhs[] =
-{
-       0,     0,     3,     5,     7,    10,    12,    14,    19,    25,
-      31,    38,    40,    43,    45,    47,    49,    51,    53,    57,
-      61,    66,    68,    71,    74,    77,    79,    81,    85,    88,
-      90,    96,   101,   106,   111,   115,   119,   122,   128,   133,
-     137,   139,   142,   144,   147,   149,   152,   154,   157,   159,
-     162,   164,   167,   169,   172,   174,   177,   179,   182,   184
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-static const yytype_int8 yyrhs[] =
-{
-      19,     0,    -1,    20,    -1,    21,    -1,    20,    21,    -1,
-      22,    -1,    17,    -1,     7,    39,    23,    40,    -1,     7,
-      35,    39,    23,    40,    -1,     7,    34,    39,    23,    40,
-      -1,     7,    34,    35,    39,    23,    40,    -1,    24,    -1,
-      23,    24,    -1,    17,    -1,    31,    -1,    32,    -1,    25,
-      -1,    26,    -1,    10,    42,    38,    -1,    11,    42,    38,
-      -1,    11,    39,    27,    40,    -1,    28,    -1,    27,    28,
-      -1,    42,    38,    -1,    35,    36,    -1,    35,    -1,    36,
-      -1,    29,     6,    29,    -1,     6,    29,    -1,    29,    -1,
-      33,    34,    30,    37,    38,    -1,    33,    30,    37,    38,
-      -1,    33,    34,    37,    38,    -1,    33,    34,    30,    38,
-      -1,    33,    30,    38,    -1,    33,    34,    38,    -1,    33,
-      38,    -1,    41,    35,    35,    42,    38,    -1,    41,    35,
-      42,    38,    -1,    41,    42,    38,    -1,     8,    -1,     8,
-      16,    -1,    12,    -1,    12,    16,    -1,    13,    -1,    13,
-      16,    -1,    14,    -1,    14,    16,    -1,    15,    -1,    15,
-      16,    -1,     5,    -1,     5,    16,    -1,     3,    -1,     3,
-      16,    -1,     4,    -1,     4,    16,    -1,     9,    -1,     9,
-      16,    -1,    34,    -1,    42,    34,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const yytype_uint8 yyrline[] =
-{
-       0,    95,    95,    98,    99,   102,   103,   106,   108,   110,
-     112,   116,   117,   120,   121,   122,   123,   124,   127,   131,
-     133,   139,   140,   143,   147,   149,   151,   155,   157,   159,
-     163,   165,   167,   170,   172,   174,   176,   180,   182,   184,
-     188,   189,   192,   193,   196,   197,   200,   201,   204,   205,
-     208,   209,   212,   213,   216,   217,   220,   221,   224,   225
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
-static const char *const yytname[] =
-{
-  "$end", "error", "$undefined", "'{'", "'}'", "';'", "'/'", "T_VIRTUAL",
-  "T_DISPLAY", "T_WALL", "T_OPTION", "T_PARAM", "T_STRING", "T_DIMENSION",
-  "T_OFFSET", "T_ORIGIN", "T_COMMENT", "T_LINE_COMMENT", "$accept",
-  "Program", "EntryList", "Entry", "Virtual", "SubList", "Sub",
-  "OptionEntry", "ParamEntry", "ParamList", "Param", "PartialDim",
-  "FullDim", "DisplayEntry", "WallEntry", "Display", "Name", "Dimension",
-  "Offset", "Origin", "Terminal", "Open", "Close", "Wall", "NameList", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
-static const yytype_uint16 yytoknum[] =
-{
-       0,   256,   257,   123,   125,    59,    47,   258,   259,   260,
-     261,   262,   263,   264,   265,   266,   267,   268
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
-{
-       0,    18,    19,    20,    20,    21,    21,    22,    22,    22,
-      22,    23,    23,    24,    24,    24,    24,    24,    25,    26,
-      26,    27,    27,    28,    29,    29,    29,    30,    30,    30,
-      31,    31,    31,    31,    31,    31,    31,    32,    32,    32,
-      33,    33,    34,    34,    35,    35,    36,    36,    37,    37,
-      38,    38,    39,    39,    40,    40,    41,    41,    42,    42
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
-{
-       0,     2,     1,     1,     2,     1,     1,     4,     5,     5,
-       6,     1,     2,     1,     1,     1,     1,     1,     3,     3,
-       4,     1,     2,     2,     2,     1,     1,     3,     2,     1,
-       5,     4,     4,     4,     3,     3,     2,     5,     4,     3,
-       1,     2,     1,     2,     1,     2,     1,     2,     1,     2,
-       1,     2,     1,     2,     1,     2,     1,     2,     1,     2
-};
-
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint8 yydefact[] =
-{
-       0,     0,     6,     0,     2,     3,     5,    52,    42,    44,
-       0,     0,     0,     1,     4,    53,    43,    45,     0,     0,
-       0,    40,    56,     0,     0,    13,     0,    11,    16,    17,
-      14,    15,     0,     0,     0,     0,     0,    41,    57,    58,
-       0,     0,     0,    54,    12,     7,    50,     0,    46,    29,
-       0,     0,    25,    26,    36,     0,     0,     0,     9,     8,
-      59,    18,     0,    21,     0,    19,    55,    51,    28,    47,
-       0,    48,     0,    34,     0,     0,    35,    24,     0,     0,
-      39,    10,    22,    20,    23,    27,    49,    31,     0,    33,
-      32,     0,    38,    30,    37
-};
-
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int8 yydefgoto[] =
-{
-      -1,     3,     4,     5,     6,    26,    27,    28,    29,    62,
-      63,    49,    50,    30,    31,    32,    39,    52,    53,    72,
-      54,    12,    45,    33,    64
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -32
-static const yytype_int8 yypact[] =
-{
-      -3,    41,   -32,    22,    -3,   -32,   -32,    12,    35,    46,
-       5,    62,    75,   -32,   -32,   -32,   -32,   -32,    62,    75,
-      75,    51,    54,    59,    18,   -32,    65,   -32,   -32,   -32,
-     -32,   -32,    88,    37,    75,    65,    65,   -32,   -32,   -32,
-      86,    59,    86,    61,   -32,   -32,    79,    -4,    80,    28,
-      31,    74,    67,   -32,   -32,    37,    86,    65,   -32,   -32,
-     -32,   -32,    56,   -32,    86,   -32,   -32,   -32,   -32,   -32,
-      -4,    81,    94,   -32,    31,    94,   -32,   -32,    59,    86,
-     -32,   -32,   -32,   -32,   -32,   -32,   -32,   -32,    94,   -32,
-     -32,    86,   -32,   -32,   -32
-};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yytype_int8 yypgoto[] =
-{
-     -32,   -32,   -32,    99,   -32,     6,   -19,   -32,   -32,   -32,
-      42,   -28,    55,   -32,   -32,   -32,    -1,     2,    53,   -31,
-     -27,    48,   -30,   -32,   -22
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -1
-static const yytype_uint8 yytable[] =
-{
-      10,    40,    42,    11,     1,    58,    59,    44,     7,     9,
-      48,    56,    18,    61,     2,    65,    44,    44,     9,    68,
-      75,     7,    13,    73,    76,    35,    36,    81,    15,    80,
-       8,    51,    83,    79,    70,    55,    46,    84,    44,    60,
-      57,    60,    85,    88,     7,    87,    71,    89,    90,     8,
-       9,    16,    92,     8,     9,    60,    91,    78,    19,    20,
-      43,    93,    17,    60,    94,     7,    34,    37,     8,    43,
-      38,     8,    41,    21,    22,    23,    24,    66,    60,    46,
-      47,    48,    25,    21,    22,    23,    24,     9,    48,    71,
-      60,    46,    25,    46,    47,    67,    69,    86,     8,    46,
-       8,     9,    48,    14,    82,    77,    74
-};
-
-static const yytype_uint8 yycheck[] =
-{
-       1,    23,    24,     1,     7,    35,    36,    26,     3,    13,
-      14,    33,    10,    40,    17,    42,    35,    36,    13,    47,
-      51,     3,     0,    50,    51,    19,    20,    57,    16,    56,
-      12,    32,    62,    55,     6,    33,     5,    64,    57,    40,
-      34,    42,    70,    74,     3,    72,    15,    74,    75,    12,
-      13,    16,    79,    12,    13,    56,    78,    55,    10,    11,
-       4,    88,    16,    64,    91,     3,    18,    16,    12,     4,
-      16,    12,    24,     8,     9,    10,    11,    16,    79,     5,
-       6,    14,    17,     8,     9,    10,    11,    13,    14,    15,
-      91,     5,    17,     5,     6,    16,    16,    16,    12,     5,
-      12,    13,    14,     4,    62,    52,    51
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
-static const yytype_uint8 yystos[] =
-{
-       0,     7,    17,    19,    20,    21,    22,     3,    12,    13,
-      34,    35,    39,     0,    21,    16,    16,    16,    35,    39,
-      39,     8,     9,    10,    11,    17,    23,    24,    25,    26,
-      31,    32,    33,    41,    39,    23,    23,    16,    16,    34,
-      42,    39,    42,     4,    24,    40,     5,     6,    14,    29,
-      30,    34,    35,    36,    38,    35,    42,    23,    40,    40,
-      34,    38,    27,    28,    42,    38,    16,    16,    29,    16,
-       6,    15,    37,    38,    30,    37,    38,    36,    35,    42,
-      38,    40,    28,    40,    38,    29,    16,    38,    37,    38,
-      38,    42,    38,    38,    38
-};
-
-#define yyerrok                (yyerrstatus = 0)
-#define yyclearin      (yychar = YYEMPTY)
-#define YYEMPTY                (-2)
-#define YYEOF          0
-
-#define YYACCEPT       goto yyacceptlab
-#define YYABORT                goto yyabortlab
-#define YYERROR                goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
-
-#define YYFAIL         goto yyerrlab
-
-#define YYRECOVERING()  (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value)                                 \
-do                                                             \
-  if (yychar == YYEMPTY && yylen == 1)                         \
-    {                                                          \
-      yychar = (Token);                                                \
-      yylval = (Value);                                                \
-      yytoken = YYTRANSLATE (yychar);                          \
-      YYPOPSTACK (1);                                          \
-      goto yybackup;                                           \
-    }                                                          \
-  else                                                         \
-    {                                                          \
-      yyerror (YY_("syntax error: cannot back up")); \
-      YYERROR;                                                 \
-    }                                                          \
-while (YYID (0))
-
-
-#define YYTERROR       1
-#define YYERRCODE      256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
-   If N is 0, then set CURRENT to the empty location which ends
-   the previous symbol: RHS[0] (always defined).  */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)                               \
-    do                                                                 \
-      if (YYID (N))                                                    \
-       {                                                               \
-         (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
-         (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
-         (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
-         (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
-       }                                                               \
-      else                                                             \
-       {                                                               \
-         (Current).first_line   = (Current).last_line   =              \
-           YYRHSLOC (Rhs, 0).last_line;                                \
-         (Current).first_column = (Current).last_column =              \
-           YYRHSLOC (Rhs, 0).last_column;                              \
-       }                                                               \
-    while (YYID (0))
-#endif
-
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
-   This macro was not mandated originally: define only if we know
-   we won't break user code: when these are the locations we know.  */
-
-#ifndef YY_LOCATION_PRINT
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-#  define YY_LOCATION_PRINT(File, Loc)                 \
-     fprintf (File, "%d.%d-%d.%d",                     \
-             (Loc).first_line, (Loc).first_column,     \
-             (Loc).last_line,  (Loc).last_column)
-# else
-#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments.  */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
-#else
-# define YYLEX yylex ()
-#endif
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args)                       \
-do {                                           \
-  if (yydebug)                                 \
-    YYFPRINTF Args;                            \
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                   \
-do {                                                                     \
-  if (yydebug)                                                           \
-    {                                                                    \
-      YYFPRINTF (stderr, "%s ", Title);                                          \
-      yy_symbol_print (stderr,                                           \
-                 Type, Value); \
-      YYFPRINTF (stderr, "\n");                                                  \
-    }                                                                    \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-#endif
-{
-  if (!yyvaluep)
-    return;
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
-  YYUSE (yyoutput);
-# endif
-  switch (yytype)
-    {
-      default:
-       break;
-    }
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-#endif
-{
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
-  YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included).                                                   |
-`------------------------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
-#else
-static void
-yy_stack_print (bottom, top)
-    yytype_int16 *bottom;
-    yytype_int16 *top;
-#endif
-{
-  YYFPRINTF (stderr, "Stack now");
-  for (; bottom <= top; ++bottom)
-    YYFPRINTF (stderr, " %d", *bottom);
-  YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top)                           \
-do {                                                           \
-  if (yydebug)                                                 \
-    yy_stack_print ((Bottom), (Top));                          \
-} while (YYID (0))
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule)
-    YYSTYPE *yyvsp;
-    int yyrule;
-#endif
-{
-  int yynrhs = yyr2[yyrule];
-  int yyi;
-  unsigned long int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-            yyrule - 1, yylno);
-  /* The symbols being reduced.  */
-  for (yyi = 0; yyi < yynrhs; yyi++)
-    {
-      fprintf (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
-                      &(yyvsp[(yyi + 1) - (yynrhs)])
-                                      );
-      fprintf (stderr, "\n");
-    }
-}
-
-# define YY_REDUCE_PRINT(Rule)         \
-do {                                   \
-  if (yydebug)                         \
-    yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
-
-/* Nonzero means print parse trace.  It is left uninitialized so that
-   multiple parsers can coexist.  */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef        YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
-   if the built-in stack extension method is used).
-
-   Do not make this value too large; the results are undefined if
-   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
-   evaluated with infinite-precision integer arithmetic.  */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-\f
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-#  if defined __GLIBC__ && defined _STRING_H
-#   define yystrlen strlen
-#  else
-/* Return the length of YYSTR.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
-    const char *yystr;
-#endif
-{
-  YYSIZE_T yylen;
-  for (yylen = 0; yystr[yylen]; yylen++)
-    continue;
-  return yylen;
-}
-#  endif
-# endif
-
-# ifndef yystpcpy
-#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-#   define yystpcpy stpcpy
-#  else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
-    char *yydest;
-    const char *yysrc;
-#endif
-{
-  char *yyd = yydest;
-  const char *yys = yysrc;
-
-  while ((*yyd++ = *yys++) != '\0')
-    continue;
-
-  return yyd - 1;
-}
-#  endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
-   quotes and backslashes, so that it's suitable for yyerror.  The
-   heuristic is that double-quoting is unnecessary unless the string
-   contains an apostrophe, a comma, or backslash (other than
-   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
-   null, do not copy; instead, return the length of what the result
-   would have been.  */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
-  if (*yystr == '"')
-    {
-      YYSIZE_T yyn = 0;
-      char const *yyp = yystr;
-
-      for (;;)
-       switch (*++yyp)
-         {
-         case '\'':
-         case ',':
-           goto do_not_strip_quotes;
-
-         case '\\':
-           if (*++yyp != '\\')
-             goto do_not_strip_quotes;
-           /* Fall through.  */
-         default:
-           if (yyres)
-             yyres[yyn] = *yyp;
-           yyn++;
-           break;
-
-         case '"':
-           if (yyres)
-             yyres[yyn] = '\0';
-           return yyn;
-         }
-    do_not_strip_quotes: ;
-    }
-
-  if (! yyres)
-    return yystrlen (yystr);
-
-  return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into YYRESULT an error message about the unexpected token
-   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
-   including the terminating null byte.  If YYRESULT is null, do not
-   copy anything; just return the number of bytes that would be
-   copied.  As a special case, return 0 if an ordinary "syntax error"
-   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
-   size calculation.  */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
-  int yyn = yypact[yystate];
-
-  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
-    return 0;
-  else
-    {
-      int yytype = YYTRANSLATE (yychar);
-      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-      YYSIZE_T yysize = yysize0;
-      YYSIZE_T yysize1;
-      int yysize_overflow = 0;
-      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-      int yyx;
-
-# if 0
-      /* This is so xgettext sees the translatable formats that are
-        constructed on the fly.  */
-      YY_("syntax error, unexpected %s");
-      YY_("syntax error, unexpected %s, expecting %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
-      char *yyfmt;
-      char const *yyf;
-      static char const yyunexpected[] = "syntax error, unexpected %s";
-      static char const yyexpecting[] = ", expecting %s";
-      static char const yyor[] = " or %s";
-      char yyformat[sizeof yyunexpected
-                   + sizeof yyexpecting - 1
-                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-                      * (sizeof yyor - 1))];
-      char const *yyprefix = yyexpecting;
-
-      /* Start YYX at -YYN if negative to avoid negative indexes in
-        YYCHECK.  */
-      int yyxbegin = yyn < 0 ? -yyn : 0;
-
-      /* Stay within bounds of both yycheck and yytname.  */
-      int yychecklim = YYLAST - yyn + 1;
-      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-      int yycount = 1;
-
-      yyarg[0] = yytname[yytype];
-      yyfmt = yystpcpy (yyformat, yyunexpected);
-
-      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-       if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-         {
-           if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-             {
-               yycount = 1;
-               yysize = yysize0;
-               yyformat[sizeof yyunexpected - 1] = '\0';
-               break;
-             }
-           yyarg[yycount++] = yytname[yyx];
-           yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-           yysize_overflow |= (yysize1 < yysize);
-           yysize = yysize1;
-           yyfmt = yystpcpy (yyfmt, yyprefix);
-           yyprefix = yyor;
-         }
-
-      yyf = YY_(yyformat);
-      yysize1 = yysize + yystrlen (yyf);
-      yysize_overflow |= (yysize1 < yysize);
-      yysize = yysize1;
-
-      if (yysize_overflow)
-       return YYSIZE_MAXIMUM;
-
-      if (yyresult)
-       {
-         /* Avoid sprintf, as that infringes on the user's name space.
-            Don't have undefined behavior even if the translation
-            produced a string with the wrong number of "%s"s.  */
-         char *yyp = yyresult;
-         int yyi = 0;
-         while ((*yyp = *yyf) != '\0')
-           {
-             if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-               {
-                 yyp += yytnamerr (yyp, yyarg[yyi++]);
-                 yyf += 2;
-               }
-             else
-               {
-                 yyp++;
-                 yyf++;
-               }
-           }
-       }
-      return yysize;
-    }
-}
-#endif /* YYERROR_VERBOSE */
-\f
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep)
-    const char *yymsg;
-    int yytype;
-    YYSTYPE *yyvaluep;
-#endif
-{
-  YYUSE (yyvaluep);
-
-  if (!yymsg)
-    yymsg = "Deleting";
-  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
-  switch (yytype)
-    {
-
-      default:
-       break;
-    }
-}
-\f
-
-/* Prevent warnings from -Wmissing-prototypes.  */
-
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-/* The look-ahead symbol.  */
-int yychar;
-
-/* The semantic value of the look-ahead symbol.  */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far.  */
-int yynerrs;
-
-
-
-/*----------.
-| yyparse.  |
-`----------*/
-
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
-    void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
-{
-  
-  int yystate;
-  int yyn;
-  int yyresult;
-  /* Number of tokens to shift before error messages enabled.  */
-  int yyerrstatus;
-  /* Look-ahead token as an internal (translated) token number.  */
-  int yytoken = 0;
-#if YYERROR_VERBOSE
-  /* Buffer for error messages, and its allocated size.  */
-  char yymsgbuf[128];
-  char *yymsg = yymsgbuf;
-  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-  /* Three stacks and their tools:
-     `yyss': related to states,
-     `yyvs': related to semantic values,
-     `yyls': related to locations.
-
-     Refer to the stacks thru separate pointers, to allow yyoverflow
-     to reallocate them elsewhere.  */
-
-  /* The state stack.  */
-  yytype_int16 yyssa[YYINITDEPTH];
-  yytype_int16 *yyss = yyssa;
-  yytype_int16 *yyssp;
-
-  /* The semantic value stack.  */
-  YYSTYPE yyvsa[YYINITDEPTH];
-  YYSTYPE *yyvs = yyvsa;
-  YYSTYPE *yyvsp;
-
-
-
-#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
-
-  YYSIZE_T yystacksize = YYINITDEPTH;
-
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-
-
-  /* The number of symbols on the RHS of the reduced rule.
-     Keep to zero when no symbol should be popped.  */
-  int yylen = 0;
-
-  YYDPRINTF ((stderr, "Starting parse\n"));
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY;            /* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-
-  yyssp = yyss;
-  yyvsp = yyvs;
-
-  goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
-`------------------------------------------------------------*/
- yynewstate:
-  /* In all cases, when you get here, the value and location stacks
-     have just been pushed.  So pushing a state here evens the stacks.  */
-  yyssp++;
-
- yysetstate:
-  *yyssp = yystate;
-
-  if (yyss + yystacksize - 1 <= yyssp)
-    {
-      /* Get the current used size of the three stacks, in elements.  */
-      YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      {
-       /* Give user a chance to reallocate the stack.  Use copies of
-          these so that the &'s don't force the real ones into
-          memory.  */
-       YYSTYPE *yyvs1 = yyvs;
-       yytype_int16 *yyss1 = yyss;
-
-
-       /* Each stack pointer address is followed by the size of the
-          data in use in that stack, in bytes.  This used to be a
-          conditional around just the two extra args, but that might
-          be undefined if yyoverflow is a macro.  */
-       yyoverflow (YY_("memory exhausted"),
-                   &yyss1, yysize * sizeof (*yyssp),
-                   &yyvs1, yysize * sizeof (*yyvsp),
-
-                   &yystacksize);
-
-       yyss = yyss1;
-       yyvs = yyvs1;
-      }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
-      /* Extend the stack our own way.  */
-      if (YYMAXDEPTH <= yystacksize)
-       goto yyexhaustedlab;
-      yystacksize *= 2;
-      if (YYMAXDEPTH < yystacksize)
-       yystacksize = YYMAXDEPTH;
-
-      {
-       yytype_int16 *yyss1 = yyss;
-       union yyalloc *yyptr =
-         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-       if (! yyptr)
-         goto yyexhaustedlab;
-       YYSTACK_RELOCATE (yyss);
-       YYSTACK_RELOCATE (yyvs);
-
-#  undef YYSTACK_RELOCATE
-       if (yyss1 != yyssa)
-         YYSTACK_FREE (yyss1);
-      }
-# endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + yysize - 1;
-      yyvsp = yyvs + yysize - 1;
-
-
-      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-                 (unsigned long int) yystacksize));
-
-      if (yyss + yystacksize - 1 <= yyssp)
-       YYABORT;
-    }
-
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
-  goto yybackup;
-
-/*-----------.
-| yybackup.  |
-`-----------*/
-yybackup:
-
-  /* Do appropriate processing given the current state.  Read a
-     look-ahead token if we need one and don't already have one.  */
-
-  /* First try to decide what to do without reference to look-ahead token.  */
-  yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
-    goto yydefault;
-
-  /* Not known => get a look-ahead token if don't already have one.  */
-
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
-  if (yychar == YYEMPTY)
-    {
-      YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = YYLEX;
-    }
-
-  if (yychar <= YYEOF)
-    {
-      yychar = yytoken = YYEOF;
-      YYDPRINTF ((stderr, "Now at end of input.\n"));
-    }
-  else
-    {
-      yytoken = YYTRANSLATE (yychar);
-      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
-    }
-
-  /* If the proper action on seeing token YYTOKEN is to reduce or to
-     detect an error, take that action.  */
-  yyn += yytoken;
-  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
-    goto yydefault;
-  yyn = yytable[yyn];
-  if (yyn <= 0)
-    {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
-       goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  /* Shift the look-ahead token.  */
-  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
-  /* Discard the shifted token unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
-
-  yystate = yyn;
-  *++yyvsp = yylval;
-
-  goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state.  |
-`-----------------------------------------------------------*/
-yydefault:
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-  goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction.  |
-`-----------------------------*/
-yyreduce:
-  /* yyn is the number of a rule to reduce with.  */
-  yylen = yyr2[yyn];
-
-  /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
-
-     Otherwise, the following line sets YYVAL to garbage.
-     This behavior is undocumented and Bison
-     users should not rely upon it.  Assigning to YYVAL
-     unconditionally makes the parser a bit smaller, and it avoids a
-     GCC warning that YYVAL may be used uninitialized.  */
-  yyval = yyvsp[1-yylen];
-
-
-  YY_REDUCE_PRINT (yyn);
-  switch (yyn)
-    {
-        case 2:
-#line 95 "parser.y"
-    { dmxConfigEntry = (yyvsp[(1) - (1)].entry); }
-    break;
-
-  case 4:
-#line 99 "parser.y"
-    { APPEND(DMXConfigEntryPtr,(yyvsp[(1) - (2)].entry),(yyvsp[(2) - (2)].entry)); (yyval.entry) = (yyvsp[(1) - (2)].entry); }
-    break;
-
-  case 5:
-#line 102 "parser.y"
-    { (yyval.entry) = dmxConfigEntryVirtual((yyvsp[(1) - (1)].virtual)); }
-    break;
-
-  case 6:
-#line 103 "parser.y"
-    { (yyval.entry) = dmxConfigEntryComment((yyvsp[(1) - (1)].comment)); }
-    break;
-
-  case 7:
-#line 107 "parser.y"
-    { (yyval.virtual) = dmxConfigCreateVirtual((yyvsp[(1) - (4)].token), NULL, NULL, (yyvsp[(2) - (4)].token), (yyvsp[(3) - (4)].subentry), (yyvsp[(4) - (4)].token)); }
-    break;
-
-  case 8:
-#line 109 "parser.y"
-    { (yyval.virtual) = dmxConfigCreateVirtual((yyvsp[(1) - (5)].token), NULL, (yyvsp[(2) - (5)].pair), (yyvsp[(3) - (5)].token), (yyvsp[(4) - (5)].subentry), (yyvsp[(5) - (5)].token)); }
-    break;
-
-  case 9:
-#line 111 "parser.y"
-    { (yyval.virtual) = dmxConfigCreateVirtual((yyvsp[(1) - (5)].token), (yyvsp[(2) - (5)].string), NULL, (yyvsp[(3) - (5)].token), (yyvsp[(4) - (5)].subentry), (yyvsp[(5) - (5)].token)); }
-    break;
-
-  case 10:
-#line 113 "parser.y"
-    { (yyval.virtual) = dmxConfigCreateVirtual((yyvsp[(1) - (6)].token), (yyvsp[(2) - (6)].string), (yyvsp[(3) - (6)].pair), (yyvsp[(4) - (6)].token), (yyvsp[(5) - (6)].subentry), (yyvsp[(6) - (6)].token) ); }
-    break;
-
-  case 12:
-#line 117 "parser.y"
-    { APPEND(DMXConfigSubPtr,(yyvsp[(1) - (2)].subentry),(yyvsp[(2) - (2)].subentry)); (yyval.subentry) = (yyvsp[(1) - (2)].subentry); }
-    break;
-
-  case 13:
-#line 120 "parser.y"
-    { (yyval.subentry) = dmxConfigSubComment((yyvsp[(1) - (1)].comment)); }
-    break;
-
-  case 14:
-#line 121 "parser.y"
-    { (yyval.subentry) = dmxConfigSubDisplay((yyvsp[(1) - (1)].display)); }
-    break;
-
-  case 15:
-#line 122 "parser.y"
-    { (yyval.subentry) = dmxConfigSubWall((yyvsp[(1) - (1)].wall)); }
-    break;
-
-  case 16:
-#line 123 "parser.y"
-    { (yyval.subentry) = dmxConfigSubOption((yyvsp[(1) - (1)].option)); }
-    break;
-
-  case 17:
-#line 124 "parser.y"
-    { (yyval.subentry) = dmxConfigSubParam((yyvsp[(1) - (1)].param)); }
-    break;
-
-  case 18:
-#line 128 "parser.y"
-    { (yyval.option) = dmxConfigCreateOption((yyvsp[(1) - (3)].token), (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].token)); }
-    break;
-
-  case 19:
-#line 132 "parser.y"
-    { (yyval.param) = dmxConfigCreateParam((yyvsp[(1) - (3)].token), NULL, (yyvsp[(2) - (3)].string), NULL, (yyvsp[(3) - (3)].token)); }
-    break;
-
-  case 20:
-#line 134 "parser.y"
-    { (yyval.param) = dmxConfigCreateParam((yyvsp[(1) - (4)].token), (yyvsp[(2) - (4)].token), NULL, (yyvsp[(4) - (4)].token), NULL);
-               (yyval.param)->next = (yyvsp[(3) - (4)].param);
-             }
-    break;
-
-  case 22:
-#line 140 "parser.y"
-    { APPEND(DMXConfigParamPtr,(yyvsp[(1) - (2)].param),(yyvsp[(2) - (2)].param)); (yyval.param) = (yyvsp[(1) - (2)].param); }
-    break;
-
-  case 23:
-#line 144 "parser.y"
-    { (yyval.param) = dmxConfigCreateParam(NULL, NULL, (yyvsp[(1) - (2)].string), NULL, (yyvsp[(2) - (2)].token)); }
-    break;
-
-  case 24:
-#line 148 "parser.y"
-    { (yyval.pdim) = dmxConfigCreatePartDim((yyvsp[(1) - (2)].pair), (yyvsp[(2) - (2)].pair)); }
-    break;
-
-  case 25:
-#line 150 "parser.y"
-    { (yyval.pdim) = dmxConfigCreatePartDim((yyvsp[(1) - (1)].pair), NULL); }
-    break;
-
-  case 26:
-#line 152 "parser.y"
-    { (yyval.pdim) = dmxConfigCreatePartDim(NULL, (yyvsp[(1) - (1)].pair)); }
-    break;
-
-  case 27:
-#line 156 "parser.y"
-    { (yyval.fdim) = dmxConfigCreateFullDim((yyvsp[(1) - (3)].pdim), (yyvsp[(3) - (3)].pdim)); }
-    break;
-
-  case 28:
-#line 158 "parser.y"
-    { (yyval.fdim) = dmxConfigCreateFullDim(NULL, (yyvsp[(2) - (2)].pdim)); }
-    break;
-
-  case 29:
-#line 160 "parser.y"
-    { (yyval.fdim) = dmxConfigCreateFullDim((yyvsp[(1) - (1)].pdim), NULL); }
-    break;
-
-  case 30:
-#line 164 "parser.y"
-    { (yyval.display) = dmxConfigCreateDisplay((yyvsp[(1) - (5)].token), (yyvsp[(2) - (5)].string), (yyvsp[(3) - (5)].fdim), (yyvsp[(4) - (5)].pair), (yyvsp[(5) - (5)].token)); }
-    break;
-
-  case 31:
-#line 166 "parser.y"
-    { (yyval.display) = dmxConfigCreateDisplay((yyvsp[(1) - (4)].token), NULL, (yyvsp[(2) - (4)].fdim), (yyvsp[(3) - (4)].pair), (yyvsp[(4) - (4)].token)); }
-    break;
-
-  case 32:
-#line 168 "parser.y"
-    { (yyval.display) = dmxConfigCreateDisplay((yyvsp[(1) - (4)].token), (yyvsp[(2) - (4)].string), NULL, (yyvsp[(3) - (4)].pair), (yyvsp[(4) - (4)].token)); }
-    break;
-
-  case 33:
-#line 171 "parser.y"
-    { (yyval.display) = dmxConfigCreateDisplay((yyvsp[(1) - (4)].token), (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].fdim), NULL, (yyvsp[(4) - (4)].token)); }
-    break;
-
-  case 34:
-#line 173 "parser.y"
-    { (yyval.display) = dmxConfigCreateDisplay((yyvsp[(1) - (3)].token), NULL, (yyvsp[(2) - (3)].fdim), NULL, (yyvsp[(3) - (3)].token)); }
-    break;
-
-  case 35:
-#line 175 "parser.y"
-    { (yyval.display) = dmxConfigCreateDisplay((yyvsp[(1) - (3)].token), (yyvsp[(2) - (3)].string), NULL, NULL, (yyvsp[(3) - (3)].token)); }
-    break;
-
-  case 36:
-#line 177 "parser.y"
-    { (yyval.display) = dmxConfigCreateDisplay((yyvsp[(1) - (2)].token), NULL, NULL, NULL, (yyvsp[(2) - (2)].token)); }
-    break;
-
-  case 37:
-#line 181 "parser.y"
-    { (yyval.wall) = dmxConfigCreateWall((yyvsp[(1) - (5)].token), (yyvsp[(2) - (5)].pair), (yyvsp[(3) - (5)].pair), (yyvsp[(4) - (5)].string), (yyvsp[(5) - (5)].token)); }
-    break;
-
-  case 38:
-#line 183 "parser.y"
-    { (yyval.wall) = dmxConfigCreateWall((yyvsp[(1) - (4)].token), (yyvsp[(2) - (4)].pair), NULL, (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].token)); }
-    break;
-
-  case 39:
-#line 185 "parser.y"
-    { (yyval.wall) = dmxConfigCreateWall((yyvsp[(1) - (3)].token), NULL, NULL, (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].token)); }
-    break;
-
-  case 41:
-#line 189 "parser.y"
-    { (yyval.token) = (yyvsp[(1) - (2)].token); (yyval.token)->comment = (yyvsp[(2) - (2)].comment)->comment; }
-    break;
-
-  case 43:
-#line 193 "parser.y"
-    { (yyval.string) = (yyvsp[(1) - (2)].string); (yyval.string)->comment = (yyvsp[(2) - (2)].comment)->comment; }
-    break;
-
-  case 45:
-#line 197 "parser.y"
-    { (yyval.pair) = (yyvsp[(1) - (2)].pair); (yyval.pair)->comment = (yyvsp[(2) - (2)].comment)->comment; }
-    break;
-
-  case 47:
-#line 201 "parser.y"
-    { (yyval.pair) = (yyvsp[(1) - (2)].pair); (yyval.pair)->comment = (yyvsp[(2) - (2)].comment)->comment; }
-    break;
-
-  case 49:
-#line 205 "parser.y"
-    { (yyval.pair) = (yyvsp[(1) - (2)].pair); (yyval.pair)->comment = (yyvsp[(2) - (2)].comment)->comment; }
-    break;
-
-  case 51:
-#line 209 "parser.y"
-    { (yyval.token) = (yyvsp[(1) - (2)].token); (yyval.token)->comment = (yyvsp[(2) - (2)].comment)->comment; }
-    break;
-
-  case 53:
-#line 213 "parser.y"
-    { (yyval.token) = (yyvsp[(1) - (2)].token); (yyval.token)->comment = (yyvsp[(2) - (2)].comment)->comment; }
-    break;
-
-  case 55:
-#line 217 "parser.y"
-    { (yyval.token) = (yyvsp[(1) - (2)].token); (yyval.token)->comment = (yyvsp[(2) - (2)].comment)->comment; }
-    break;
-
-  case 57:
-#line 221 "parser.y"
-    { (yyval.token) = (yyvsp[(1) - (2)].token); (yyval.token)->comment = (yyvsp[(2) - (2)].comment)->comment; }
-    break;
-
-  case 59:
-#line 225 "parser.y"
-    { APPEND(DMXConfigStringPtr, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].string)); (yyval.string) = (yyvsp[(1) - (2)].string); }
-    break;
-
-
-/* Line 1267 of yacc.c.  */
-#line 1675 "parser.c"
-      default: break;
-    }
-  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-
-  *++yyvsp = yyval;
-
-
-  /* Now `shift' the result of the reduction.  Determine what state
-     that goes to, based on the state we popped back to and the rule
-     number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTOKENS];
-
-  goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
-  /* If not already recovering from an error, report this error.  */
-  if (!yyerrstatus)
-    {
-      ++yynerrs;
-#if ! YYERROR_VERBOSE
-      yyerror (YY_("syntax error"));
-#else
-      {
-       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
-       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
-         {
-           YYSIZE_T yyalloc = 2 * yysize;
-           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
-             yyalloc = YYSTACK_ALLOC_MAXIMUM;
-           if (yymsg != yymsgbuf)
-             YYSTACK_FREE (yymsg);
-           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
-           if (yymsg)
-             yymsg_alloc = yyalloc;
-           else
-             {
-               yymsg = yymsgbuf;
-               yymsg_alloc = sizeof yymsgbuf;
-             }
-         }
-
-       if (0 < yysize && yysize <= yymsg_alloc)
-         {
-           (void) yysyntax_error (yymsg, yystate, yychar);
-           yyerror (yymsg);
-         }
-       else
-         {
-           yyerror (YY_("syntax error"));
-           if (yysize != 0)
-             goto yyexhaustedlab;
-         }
-      }
-#endif
-    }
-
-
-
-  if (yyerrstatus == 3)
-    {
-      /* If just tried and failed to reuse look-ahead token after an
-        error, discard it.  */
-
-      if (yychar <= YYEOF)
-       {
-         /* Return failure if at end of input.  */
-         if (yychar == YYEOF)
-           YYABORT;
-       }
-      else
-       {
-         yydestruct ("Error: discarding",
-                     yytoken, &yylval);
-         yychar = YYEMPTY;
-       }
-    }
-
-  /* Else will try to reuse look-ahead token after shifting the error
-     token.  */
-  goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR.  |
-`---------------------------------------------------*/
-yyerrorlab:
-
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
-
-  /* Do not reclaim the symbols of the rule which action triggered
-     this YYERROR.  */
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-  yystate = *yyssp;
-  goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR.  |
-`-------------------------------------------------------------*/
-yyerrlab1:
-  yyerrstatus = 3;     /* Each real token shifted decrements this.  */
-
-  for (;;)
-    {
-      yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
-       {
-         yyn += YYTERROR;
-         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-           {
-             yyn = yytable[yyn];
-             if (0 < yyn)
-               break;
-           }
-       }
-
-      /* Pop the current state because it cannot handle the error token.  */
-      if (yyssp == yyss)
-       YYABORT;
-
-
-      yydestruct ("Error: popping",
-                 yystos[yystate], yyvsp);
-      YYPOPSTACK (1);
-      yystate = *yyssp;
-      YY_STACK_PRINT (yyss, yyssp);
-    }
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  *++yyvsp = yylval;
-
-
-  /* Shift the error token.  */
-  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
-  yystate = yyn;
-  goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here.  |
-`-------------------------------------*/
-yyacceptlab:
-  yyresult = 0;
-  goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here.  |
-`-----------------------------------*/
-yyabortlab:
-  yyresult = 1;
-  goto yyreturn;
-
-#ifndef yyoverflow
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
-yyexhaustedlab:
-  yyerror (YY_("memory exhausted"));
-  yyresult = 2;
-  /* Fall through.  */
-#endif
-
-yyreturn:
-  if (yychar != YYEOF && yychar != YYEMPTY)
-     yydestruct ("Cleanup: discarding lookahead",
-                yytoken, &yylval);
-  /* Do not reclaim the symbols of the rule which action triggered
-     this YYABORT or YYACCEPT.  */
-  YYPOPSTACK (yylen);
-  YY_STACK_PRINT (yyss, yyssp);
-  while (yyssp != yyss)
-    {
-      yydestruct ("Cleanup: popping",
-                 yystos[*yyssp], yyvsp);
-      YYPOPSTACK (1);
-    }
-#ifndef yyoverflow
-  if (yyss != yyssa)
-    YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
-  if (yymsg != yymsgbuf)
-    YYSTACK_FREE (yymsg);
-#endif
-  /* Make sure YYID is used.  */
-  return YYID (yyresult);
-}
-
-
-
diff --git a/hw/dmx/config/parser.h b/hw/dmx/config/parser.h
deleted file mode 100644 (file)
index 89dc9a9..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.3.  */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     T_VIRTUAL = 258,
-     T_DISPLAY = 259,
-     T_WALL = 260,
-     T_OPTION = 261,
-     T_PARAM = 262,
-     T_STRING = 263,
-     T_DIMENSION = 264,
-     T_OFFSET = 265,
-     T_ORIGIN = 266,
-     T_COMMENT = 267,
-     T_LINE_COMMENT = 268
-   };
-#endif
-/* Tokens.  */
-#define T_VIRTUAL 258
-#define T_DISPLAY 259
-#define T_WALL 260
-#define T_OPTION 261
-#define T_PARAM 262
-#define T_STRING 263
-#define T_DIMENSION 264
-#define T_OFFSET 265
-#define T_ORIGIN 266
-#define T_COMMENT 267
-#define T_LINE_COMMENT 268
-
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 56 "parser.y"
-{
-    DMXConfigTokenPtr      token;
-    DMXConfigStringPtr     string;
-    DMXConfigNumberPtr     number;
-    DMXConfigPairPtr       pair;
-    DMXConfigFullDimPtr    fdim;
-    DMXConfigPartDimPtr    pdim;
-    DMXConfigDisplayPtr    display;
-    DMXConfigWallPtr       wall;
-    DMXConfigOptionPtr     option;
-    DMXConfigParamPtr      param;
-    DMXConfigCommentPtr    comment;
-    DMXConfigSubPtr        subentry;
-    DMXConfigVirtualPtr    virtual;
-    DMXConfigEntryPtr      entry;
-}
-/* Line 1529 of yacc.c.  */
-#line 92 "parser.h"
-       YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-extern YYSTYPE yylval;
-
diff --git a/hw/dmx/config/scanner.c b/hw/dmx/config/scanner.c
deleted file mode 100644 (file)
index 90712b2..0000000
+++ /dev/null
@@ -1,2029 +0,0 @@
-
-#line 3 "scanner.c"
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else  /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN (yy_start) = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START (((yy_start) - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin  )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-extern yy_size_t yyleng;
-
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-    #define YY_LESS_LINENO(n)
-    
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-               *yy_cp = (yy_hold_char); \
-               YY_RESTORE_YY_MORE_OFFSET \
-               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-               YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-               } \
-       while ( 0 )
-
-#define unput(c) yyunput( c, (yytext_ptr)  )
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-       {
-       FILE *yy_input_file;
-
-       char *yy_ch_buf;                /* input buffer */
-       char *yy_buf_pos;               /* current position in input buffer */
-
-       /* Size of input buffer in bytes, not including room for EOB
-        * characters.
-        */
-       yy_size_t yy_buf_size;
-
-       /* Number of characters read into yy_ch_buf, not including EOB
-        * characters.
-        */
-       yy_size_t yy_n_chars;
-
-       /* Whether we "own" the buffer - i.e., we know we created it,
-        * and can realloc() it to grow it, and should free() it to
-        * delete it.
-        */
-       int yy_is_our_buffer;
-
-       /* Whether this is an "interactive" input source; if so, and
-        * if we're using stdio for input, then we want to use getc()
-        * instead of fread(), to make sure we stop fetching input after
-        * each newline.
-        */
-       int yy_is_interactive;
-
-       /* Whether we're considered to be at the beginning of a line.
-        * If so, '^' rules will be active on the next match, otherwise
-        * not.
-        */
-       int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-    
-       /* Whether to try to fill the input buffer when we reach the
-        * end of it.
-        */
-       int yy_fill_buffer;
-
-       int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-       /* When an EOF's been seen but there's still some text to process
-        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-        * shouldn't try reading from the input source any more.  We might
-        * still have a bunch of tokens to match, though, because of
-        * possible backing-up.
-        *
-        * When we actually see the EOF, we change the status to "new"
-        * (via yyrestart()), so that the user can continue scanning by
-        * just pointing yyin at a new input file.
-        */
-#define YY_BUFFER_EOF_PENDING 2
-
-       };
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* Stack of input buffers. */
-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
-                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
-                          : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-static yy_size_t yy_n_chars;           /* number of characters read into yy_ch_buf */
-yy_size_t yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0;                /* whether we need to initialize */
-static int yy_start = 0;       /* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart (FILE *input_file  );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
-void yy_delete_buffer (YY_BUFFER_STATE b  );
-void yy_flush_buffer (YY_BUFFER_STATE b  );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
-void yypop_buffer_state (void );
-
-static void yyensure_buffer_stack (void );
-static void yy_load_buffer_state (void );
-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
-
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
-
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  );
-
-void *yyalloc (yy_size_t  );
-void *yyrealloc (void *,yy_size_t  );
-void yyfree (void *  );
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-       { \
-       if ( ! YY_CURRENT_BUFFER ){ \
-        yyensure_buffer_stack (); \
-               YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ); \
-       } \
-       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-       }
-
-#define yy_set_bol(at_bol) \
-       { \
-       if ( ! YY_CURRENT_BUFFER ){\
-        yyensure_buffer_stack (); \
-               YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ); \
-       } \
-       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-       }
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-typedef unsigned char YY_CHAR;
-
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-
-typedef int yy_state_type;
-
-extern int yylineno;
-
-int yylineno = 1;
-
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
-static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[]  );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
-       (yytext_ptr) = yy_bp; \
-       yyleng = (yy_size_t) (yy_cp - yy_bp); \
-       (yy_hold_char) = *yy_cp; \
-       *yy_cp = '\0'; \
-       (yy_c_buf_p) = yy_cp;
-
-#define YY_NUM_RULES 20
-#define YY_END_OF_BUFFER 21
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-       {
-       flex_int32_t yy_verify;
-       flex_int32_t yy_nxt;
-       };
-static yyconst flex_int16_t yy_accept[73] =
-    {   0,
-        0,    0,    0,    0,   21,   19,   12,   11,   19,   18,
-       19,   19,   16,   19,   15,   19,   19,   19,   19,   19,
-       19,   13,   14,   17,   12,    0,   10,   18,    9,    9,
-        0,    0,    0,    0,    0,    9,    9,    9,    9,    9,
-       17,    0,    9,    0,    6,    0,    0,    9,    9,    9,
-        9,    9,    0,    0,    7,    8,    9,    9,    9,    9,
-        3,    7,    9,    9,    5,    9,    9,    4,    9,    2,
-        1,    0
-    } ;
-
-static yyconst flex_int32_t yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    1,    4,    5,    1,    1,    1,    1,    1,
-        1,    6,    7,    1,    7,    6,    8,    9,    9,    9,
-        9,    9,    9,    9,    9,    9,    9,    6,   10,    1,
-        1,    1,    1,   11,    6,    6,    6,    6,    6,    6,
-        6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
-        6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
-        1,    1,    1,    1,    6,    1,   12,    6,    6,   13,
-
-        6,    6,    6,    6,   14,    6,    6,   15,   16,   17,
-       18,   19,    6,   20,   21,   22,   23,   24,   25,   26,
-       27,    6,   28,    1,   29,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst flex_int32_t yy_meta[30] =
-    {   0,
-        1,    1,    2,    1,    1,    3,    3,    3,    3,    1,
-        1,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    1,    1
-    } ;
-
-static yyconst flex_int16_t yy_base[77] =
-    {   0,
-        0,  101,    0,  100,  104,  107,  101,  107,   98,    0,
-        0,   92,    0,   28,  107,   29,   86,   80,   86,   83,
-       84,  107,  107,    0,   93,   90,   89,    0,    0,   32,
-       30,   31,   33,   34,   42,   71,   69,   70,   69,   73,
-        0,   43,   44,   46,   78,   45,   77,   66,   70,   71,
-       60,   66,   50,   56,   70,   67,   58,   52,   53,   44,
-        0,   57,   52,   46,    0,   50,   34,    0,   45,    0,
-        0,  107,   71,   74,   46,   77
-    } ;
-
-static yyconst flex_int16_t yy_def[77] =
-    {   0,
-       72,    1,    1,    1,   72,   72,   72,   72,   73,   74,
-       75,   75,   75,   72,   72,   72,   75,   75,   75,   75,
-       75,   72,   72,   76,   72,   73,   72,   74,   75,   75,
-       72,   72,   72,   72,   72,   75,   75,   75,   75,   75,
-       76,   72,   75,   72,   72,   72,   72,   75,   75,   75,
-       75,   75,   72,   72,   75,   72,   75,   75,   75,   75,
-       75,   72,   75,   75,   75,   75,   75,   75,   75,   75,
-       75,    0,   72,   72,   72,   72
-    } ;
-
-static yyconst flex_int16_t yy_nxt[137] =
-    {   0,
-        6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
-       16,   11,   17,   11,   11,   11,   11,   18,   19,   11,
-       11,   11,   11,   20,   21,   11,   11,   22,   23,   31,
-       34,   31,   31,   42,   44,   34,   32,   35,   43,   32,
-       30,   45,   35,   46,   42,   54,   46,   44,   29,   53,
-       35,   54,   55,   33,   45,   33,   33,   54,   62,   71,
-       70,   69,   68,   67,   62,   62,   66,   47,   65,   64,
-       47,   26,   63,   26,   28,   56,   28,   41,   55,   41,
-       61,   60,   59,   58,   57,   56,   45,   52,   51,   50,
-       49,   48,   26,   27,   25,   40,   39,   38,   37,   36,
-
-       30,   27,   25,   72,   24,   24,    5,   72,   72,   72,
-       72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
-       72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
-       72,   72,   72,   72,   72,   72
-    } ;
-
-static yyconst flex_int16_t yy_chk[137] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,   14,
-       16,   31,   32,   30,   33,   34,   14,   16,   30,   32,
-       30,   33,   34,   35,   42,   43,   46,   44,   75,   42,
-       35,   53,   43,   14,   44,   31,   32,   54,   53,   69,
-       67,   66,   64,   63,   54,   62,   60,   35,   59,   58,
-       46,   73,   57,   73,   74,   56,   74,   76,   55,   76,
-       52,   51,   50,   49,   48,   47,   45,   40,   39,   38,
-       37,   36,   27,   26,   25,   21,   20,   19,   18,   17,
-
-       12,    9,    7,    5,    4,    2,   72,   72,   72,   72,
-       72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
-       72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
-       72,   72,   72,   72,   72,   72
-    } ;
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "scanner.l"
-/* $XFree86$ */
-/*
- * Copyright 2002 Red Hat Inc., Durham, North Carolina.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation on the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/*
- * Authors:
- *   Rickard E. (Rik) Faith <faith@redhat.com>
- *
- */
-#line 36 "scanner.l"
-#ifdef HAVE_DMX_CONFIG_H
-#include <dmx-config.h>
-#endif
-
-#include "dmxparse.h"
-#include "parser.h"
-#include "os.h"
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-static int getdimension(int token, const char *text, int leng);
-static int getstring(int token, const char *text, int leng);
-static int gettoken(int token, const char *text, int leng);
-static int getcomment(int token, const char *text, int leng);
-static int lineno = 1;
-
-#line 550 "scanner.c"
-
-#define INITIAL 0
-#define OTHER 1
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-static int yy_init_globals (void );
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int yylex_destroy (void );
-
-int yyget_debug (void );
-
-void yyset_debug (int debug_flag  );
-
-YY_EXTRA_TYPE yyget_extra (void );
-
-void yyset_extra (YY_EXTRA_TYPE user_defined  );
-
-FILE *yyget_in (void );
-
-void yyset_in  (FILE * in_str  );
-
-FILE *yyget_out (void );
-
-void yyset_out  (FILE * out_str  );
-
-yy_size_t yyget_leng (void );
-
-char *yyget_text (void );
-
-int yyget_lineno (void );
-
-void yyset_lineno (int line_number  );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap (void );
-#else
-extern int yywrap (void );
-#endif
-#endif
-
-    static void yyunput (int c,char *buf_ptr  );
-    
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (void );
-#else
-static int input (void );
-#endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-               { \
-               int c = '*'; \
-               yy_size_t n; \
-               for ( n = 0; n < max_size && \
-                            (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-                       buf[n] = (char) c; \
-               if ( c == '\n' ) \
-                       buf[n++] = (char) c; \
-               if ( c == EOF && ferror( yyin ) ) \
-                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
-               result = n; \
-               } \
-       else \
-               { \
-               errno=0; \
-               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-                       { \
-                       if( errno != EINTR) \
-                               { \
-                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
-                               break; \
-                               } \
-                       errno=0; \
-                       clearerr(yyin); \
-                       } \
-               }\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int yylex (void);
-
-#define YY_DECL int yylex (void)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-       if ( yyleng > 0 ) \
-               YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
-                               (yytext[yyleng - 1] == '\n'); \
-       YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-       register yy_state_type yy_current_state;
-       register char *yy_cp, *yy_bp;
-       register int yy_act;
-    
-#line 63 "scanner.l"
-
-#line 738 "scanner.c"
-
-       if ( !(yy_init) )
-               {
-               (yy_init) = 1;
-
-#ifdef YY_USER_INIT
-               YY_USER_INIT;
-#endif
-
-               if ( ! (yy_start) )
-                       (yy_start) = 1; /* first start state */
-
-               if ( ! yyin )
-                       yyin = stdin;
-
-               if ( ! yyout )
-                       yyout = stdout;
-
-               if ( ! YY_CURRENT_BUFFER ) {
-                       yyensure_buffer_stack ();
-                       YY_CURRENT_BUFFER_LVALUE =
-                               yy_create_buffer(yyin,YY_BUF_SIZE );
-               }
-
-               yy_load_buffer_state( );
-               }
-
-       while ( 1 )             /* loops until end-of-file is reached */
-               {
-               yy_cp = (yy_c_buf_p);
-
-               /* Support of yytext. */
-               *yy_cp = (yy_hold_char);
-
-               /* yy_bp points to the position in yy_ch_buf of the start of
-                * the current run.
-                */
-               yy_bp = yy_cp;
-
-               yy_current_state = (yy_start);
-               yy_current_state += YY_AT_BOL();
-yy_match:
-               do
-                       {
-                       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-                       if ( yy_accept[yy_current_state] )
-                               {
-                               (yy_last_accepting_state) = yy_current_state;
-                               (yy_last_accepting_cpos) = yy_cp;
-                               }
-                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-                               {
-                               yy_current_state = (int) yy_def[yy_current_state];
-                               if ( yy_current_state >= 73 )
-                                       yy_c = yy_meta[(unsigned int) yy_c];
-                               }
-                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-                       ++yy_cp;
-                       }
-               while ( yy_base[yy_current_state] != 107 );
-
-yy_find_action:
-               yy_act = yy_accept[yy_current_state];
-               if ( yy_act == 0 )
-                       { /* have to back up */
-                       yy_cp = (yy_last_accepting_cpos);
-                       yy_current_state = (yy_last_accepting_state);
-                       yy_act = yy_accept[yy_current_state];
-                       }
-
-               YY_DO_BEFORE_ACTION;
-
-do_action:     /* This label is used only to access EOF actions. */
-
-               switch ( yy_act )
-       { /* beginning of action switch */
-                       case 0: /* must back up */
-                       /* undo the effects of YY_DO_BEFORE_ACTION */
-                       *yy_cp = (yy_hold_char);
-                       yy_cp = (yy_last_accepting_cpos);
-                       yy_current_state = (yy_last_accepting_state);
-                       goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-#line 64 "scanner.l"
-return gettoken(T_VIRTUAL, yytext, yyleng);
-       YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 65 "scanner.l"
-return gettoken(T_DISPLAY, yytext, yyleng);
-       YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 66 "scanner.l"
-return gettoken(T_WALL, yytext, yyleng);
-       YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 67 "scanner.l"
-return gettoken(T_OPTION, yytext, yyleng);
-       YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 68 "scanner.l"
-return gettoken(T_PARAM, yytext, yyleng);
-       YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 69 "scanner.l"
-return getdimension(T_DIMENSION, yytext, yyleng);
-       YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 70 "scanner.l"
-return getdimension(T_OFFSET, yytext+1, yyleng-1);
-       YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 71 "scanner.l"
-return getdimension(T_ORIGIN, yytext+1, yyleng-1);
-       YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 72 "scanner.l"
-return getstring(T_STRING, yytext, yyleng);
-       YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 73 "scanner.l"
-return getstring(T_STRING, yytext+1, yyleng-2);
-       YY_BREAK
-case 11:
-/* rule 11 can match eol */
-YY_RULE_SETUP
-#line 74 "scanner.l"
-++lineno;
-       YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 75 "scanner.l"
-
-       YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 76 "scanner.l"
-return gettoken(yytext[0], yytext, yyleng);
-       YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 77 "scanner.l"
-return gettoken(yytext[0], yytext, yyleng);
-       YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 78 "scanner.l"
-return gettoken(yytext[0], yytext, yyleng);
-       YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 79 "scanner.l"
-return gettoken(yytext[0], yytext, yyleng);
-       YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 80 "scanner.l"
-return getcomment(T_LINE_COMMENT, yytext, yyleng);
-       YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 81 "scanner.l"
-return getcomment(T_COMMENT, yytext, yyleng);
-       YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 82 "scanner.l"
-return getstring(T_STRING, yytext, yyleng);
-       YY_BREAK
-case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(OTHER):
-#line 83 "scanner.l"
-return 0;
-       YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 84 "scanner.l"
-ECHO;
-       YY_BREAK
-#line 928 "scanner.c"
-
-       case YY_END_OF_BUFFER:
-               {
-               /* Amount of text matched not including the EOB char. */
-               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
-               /* Undo the effects of YY_DO_BEFORE_ACTION. */
-               *yy_cp = (yy_hold_char);
-               YY_RESTORE_YY_MORE_OFFSET
-
-               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-                       {
-                       /* We're scanning a new file or input source.  It's
-                        * possible that this happened because the user
-                        * just pointed yyin at a new source and called
-                        * yylex().  If so, then we have to assure
-                        * consistency between YY_CURRENT_BUFFER and our
-                        * globals.  Here is the right place to do so, because
-                        * this is the first action (other than possibly a
-                        * back-up) that will match for the new input source.
-                        */
-                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-                       }
-
-               /* Note that here we test for yy_c_buf_p "<=" to the position
-                * of the first EOB in the buffer, since yy_c_buf_p will
-                * already have been incremented past the NUL character
-                * (since all states make transitions on EOB to the
-                * end-of-buffer state).  Contrast this with the test
-                * in input().
-                */
-               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-                       { /* This was really a NUL. */
-                       yy_state_type yy_next_state;
-
-                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
-                       yy_current_state = yy_get_previous_state(  );
-
-                       /* Okay, we're now positioned to make the NUL
-                        * transition.  We couldn't have
-                        * yy_get_previous_state() go ahead and do it
-                        * for us because it doesn't know how to deal
-                        * with the possibility of jamming (and we don't
-                        * want to build jamming into it because then it
-                        * will run more slowly).
-                        */
-
-                       yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
-                       if ( yy_next_state )
-                               {
-                               /* Consume the NUL. */
-                               yy_cp = ++(yy_c_buf_p);
-                               yy_current_state = yy_next_state;
-                               goto yy_match;
-                               }
-
-                       else
-                               {
-                               yy_cp = (yy_c_buf_p);
-                               goto yy_find_action;
-                               }
-                       }
-
-               else switch ( yy_get_next_buffer(  ) )
-                       {
-                       case EOB_ACT_END_OF_FILE:
-                               {
-                               (yy_did_buffer_switch_on_eof) = 0;
-
-                               if ( yywrap( ) )
-                                       {
-                                       /* Note: because we've taken care in
-                                        * yy_get_next_buffer() to have set up
-                                        * yytext, we can now set up
-                                        * yy_c_buf_p so that if some total
-                                        * hoser (like flex itself) wants to
-                                        * call the scanner after we return the
-                                        * YY_NULL, it'll still work - another
-                                        * YY_NULL will get returned.
-                                        */
-                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-                                       yy_act = YY_STATE_EOF(YY_START);
-                                       goto do_action;
-                                       }
-
-                               else
-                                       {
-                                       if ( ! (yy_did_buffer_switch_on_eof) )
-                                               YY_NEW_FILE;
-                                       }
-                               break;
-                               }
-
-                       case EOB_ACT_CONTINUE_SCAN:
-                               (yy_c_buf_p) =
-                                       (yytext_ptr) + yy_amount_of_matched_text;
-
-                               yy_current_state = yy_get_previous_state(  );
-
-                               yy_cp = (yy_c_buf_p);
-                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-                               goto yy_match;
-
-                       case EOB_ACT_LAST_MATCH:
-                               (yy_c_buf_p) =
-                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
-                               yy_current_state = yy_get_previous_state(  );
-
-                               yy_cp = (yy_c_buf_p);
-                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-                               goto yy_find_action;
-                       }
-               break;
-               }
-
-       default:
-               YY_FATAL_ERROR(
-                       "fatal flex scanner internal error--no action found" );
-       } /* end of action switch */
-               } /* end of scanning one token */
-} /* end of yylex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *     EOB_ACT_LAST_MATCH -
- *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *     EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (void)
-{
-       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-       register char *source = (yytext_ptr);
-       register int number_to_move, i;
-       int ret_val;
-
-       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
-               YY_FATAL_ERROR(
-               "fatal flex scanner internal error--end of buffer missed" );
-
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-               { /* Don't try to fill the buffer, so this is an EOF. */
-               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
-                       {
-                       /* We matched a single character, the EOB, so
-                        * treat this as a final EOF.
-                        */
-                       return EOB_ACT_END_OF_FILE;
-                       }
-
-               else
-                       {
-                       /* We matched some text prior to the EOB, first
-                        * process it.
-                        */
-                       return EOB_ACT_LAST_MATCH;
-                       }
-               }
-
-       /* Try to read more data. */
-
-       /* First move last chars to start of buffer. */
-       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
-       for ( i = 0; i < number_to_move; ++i )
-               *(dest++) = *(source++);
-
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-               /* don't do the read, it's not guaranteed to return an EOF,
-                * just force an EOF
-                */
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
-       else
-               {
-                       yy_size_t num_to_read =
-                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-               while ( num_to_read <= 0 )
-                       { /* Not enough room in the buffer - grow it. */
-
-                       /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
-                       int yy_c_buf_p_offset =
-                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
-                       if ( b->yy_is_our_buffer )
-                               {
-                               yy_size_t new_size = b->yy_buf_size * 2;
-
-                               if ( new_size <= 0 )
-                                       b->yy_buf_size += b->yy_buf_size / 8;
-                               else
-                                       b->yy_buf_size *= 2;
-
-                               b->yy_ch_buf = (char *)
-                                       /* Include room in for 2 EOB chars. */
-                                       yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
-                               }
-                       else
-                               /* Can't grow it, we don't own it. */
-                               b->yy_ch_buf = 0;
-
-                       if ( ! b->yy_ch_buf )
-                               YY_FATAL_ERROR(
-                               "fatal error - scanner input buffer overflow" );
-
-                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-                                               number_to_move - 1;
-
-                       }
-
-               if ( num_to_read > YY_READ_BUF_SIZE )
-                       num_to_read = YY_READ_BUF_SIZE;
-
-               /* Read in more data. */
-               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-                       (yy_n_chars), num_to_read );
-
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       if ( (yy_n_chars) == 0 )
-               {
-               if ( number_to_move == YY_MORE_ADJ )
-                       {
-                       ret_val = EOB_ACT_END_OF_FILE;
-                       yyrestart(yyin  );
-                       }
-
-               else
-                       {
-                       ret_val = EOB_ACT_LAST_MATCH;
-                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-                               YY_BUFFER_EOF_PENDING;
-                       }
-               }
-
-       else
-               ret_val = EOB_ACT_CONTINUE_SCAN;
-
-       if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-               /* Extend the array by 50%, plus the number we really need. */
-               yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
-               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-       }
-
-       (yy_n_chars) += number_to_move;
-       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
-       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
-       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-       return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-    static yy_state_type yy_get_previous_state (void)
-{
-       register yy_state_type yy_current_state;
-       register char *yy_cp;
-    
-       yy_current_state = (yy_start);
-       yy_current_state += YY_AT_BOL();
-
-       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-               {
-               register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-               if ( yy_accept[yy_current_state] )
-                       {
-                       (yy_last_accepting_state) = yy_current_state;
-                       (yy_last_accepting_cpos) = yy_cp;
-                       }
-               while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-                       {
-                       yy_current_state = (int) yy_def[yy_current_state];
-                       if ( yy_current_state >= 73 )
-                               yy_c = yy_meta[(unsigned int) yy_c];
-                       }
-               yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-               }
-
-       return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *     next_state = yy_try_NUL_trans( current_state );
- */
-    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
-{
-       register int yy_is_jam;
-       register char *yy_cp = (yy_c_buf_p);
-
-       register YY_CHAR yy_c = 1;
-       if ( yy_accept[yy_current_state] )
-               {
-               (yy_last_accepting_state) = yy_current_state;
-               (yy_last_accepting_cpos) = yy_cp;
-               }
-       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-               {
-               yy_current_state = (int) yy_def[yy_current_state];
-               if ( yy_current_state >= 73 )
-                       yy_c = yy_meta[(unsigned int) yy_c];
-               }
-       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-       yy_is_jam = (yy_current_state == 72);
-
-       return yy_is_jam ? 0 : yy_current_state;
-}
-
-    static void yyunput (int c, register char * yy_bp )
-{
-       register char *yy_cp;
-    
-    yy_cp = (yy_c_buf_p);
-
-       /* undo effects of setting up yytext */
-       *yy_cp = (yy_hold_char);
-
-       if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-               { /* need to shift things up to make room */
-               /* +2 for EOB chars. */
-               register yy_size_t number_to_move = (yy_n_chars) + 2;
-               register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-                                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-               register char *source =
-                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
-               while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-                       *--dest = *--source;
-
-               yy_cp += (int) (dest - source);
-               yy_bp += (int) (dest - source);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
-               if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-                       YY_FATAL_ERROR( "flex scanner push-back overflow" );
-               }
-
-       *--yy_cp = (char) c;
-
-       (yytext_ptr) = yy_bp;
-       (yy_hold_char) = *yy_cp;
-       (yy_c_buf_p) = yy_cp;
-}
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-    static int yyinput (void)
-#else
-    static int input  (void)
-#endif
-
-{
-       int c;
-    
-       *(yy_c_buf_p) = (yy_hold_char);
-
-       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-               {
-               /* yy_c_buf_p now points to the character we want to return.
-                * If this occurs *before* the EOB characters, then it's a
-                * valid NUL; if not, then we've hit the end of the buffer.
-                */
-               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-                       /* This was really a NUL. */
-                       *(yy_c_buf_p) = '\0';
-
-               else
-                       { /* need more input */
-                       yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
-                       ++(yy_c_buf_p);
-
-                       switch ( yy_get_next_buffer(  ) )
-                               {
-                               case EOB_ACT_LAST_MATCH:
-                                       /* This happens because yy_g_n_b()
-                                        * sees that we've accumulated a
-                                        * token and flags that we need to
-                                        * try matching the token before
-                                        * proceeding.  But for input(),
-                                        * there's no matching to consider.
-                                        * So convert the EOB_ACT_LAST_MATCH
-                                        * to EOB_ACT_END_OF_FILE.
-                                        */
-
-                                       /* Reset buffer status. */
-                                       yyrestart(yyin );
-
-                                       /*FALLTHROUGH*/
-
-                               case EOB_ACT_END_OF_FILE:
-                                       {
-                                       if ( yywrap( ) )
-                                               return 0;
-
-                                       if ( ! (yy_did_buffer_switch_on_eof) )
-                                               YY_NEW_FILE;
-#ifdef __cplusplus
-                                       return yyinput();
-#else
-                                       return input();
-#endif
-                                       }
-
-                               case EOB_ACT_CONTINUE_SCAN:
-                                       (yy_c_buf_p) = (yytext_ptr) + offset;
-                                       break;
-                               }
-                       }
-               }
-
-       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
-       *(yy_c_buf_p) = '\0';   /* preserve yytext */
-       (yy_hold_char) = *++(yy_c_buf_p);
-
-       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
-
-       return c;
-}
-#endif /* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * 
- * @note This function does not reset the start condition to @c INITIAL .
- */
-    void yyrestart  (FILE * input_file )
-{
-    
-       if ( ! YY_CURRENT_BUFFER ){
-        yyensure_buffer_stack ();
-               YY_CURRENT_BUFFER_LVALUE =
-            yy_create_buffer(yyin,YY_BUF_SIZE );
-       }
-
-       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
-       yy_load_buffer_state( );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * 
- */
-    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
-{
-    
-       /* TODO. We should be able to replace this entire function body
-        * with
-        *              yypop_buffer_state();
-        *              yypush_buffer_state(new_buffer);
-     */
-       yyensure_buffer_stack ();
-       if ( YY_CURRENT_BUFFER == new_buffer )
-               return;
-
-       if ( YY_CURRENT_BUFFER )
-               {
-               /* Flush out information for old buffer. */
-               *(yy_c_buf_p) = (yy_hold_char);
-               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       YY_CURRENT_BUFFER_LVALUE = new_buffer;
-       yy_load_buffer_state( );
-
-       /* We don't actually know whether we did this switch during
-        * EOF (yywrap()) processing, but the only time this flag
-        * is looked at is after yywrap() is called, so it's safe
-        * to go ahead and always set it.
-        */
-       (yy_did_buffer_switch_on_eof) = 1;
-}
-
-static void yy_load_buffer_state  (void)
-{
-       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-       (yy_hold_char) = *(yy_c_buf_p);
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * 
- * @return the allocated buffer state.
- */
-    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
-{
-       YY_BUFFER_STATE b;
-    
-       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
-       if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-       b->yy_buf_size = size;
-
-       /* yy_ch_buf has to be 2 characters longer than the size given because
-        * we need to put in 2 end-of-buffer characters.
-        */
-       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
-       if ( ! b->yy_ch_buf )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-       b->yy_is_our_buffer = 1;
-
-       yy_init_buffer(b,file );
-
-       return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
- * 
- */
-    void yy_delete_buffer (YY_BUFFER_STATE  b )
-{
-    
-       if ( ! b )
-               return;
-
-       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
-       if ( b->yy_is_our_buffer )
-               yyfree((void *) b->yy_ch_buf  );
-
-       yyfree((void *) b  );
-}
-
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a yyrestart() or at EOF.
- */
-    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
-
-{
-       int oerrno = errno;
-    
-       yy_flush_buffer(b );
-
-       b->yy_input_file = file;
-       b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then yy_init_buffer was _probably_
-     * called from yyrestart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER){
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-    
-       errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * 
- */
-    void yy_flush_buffer (YY_BUFFER_STATE  b )
-{
-       if ( ! b )
-               return;
-
-       b->yy_n_chars = 0;
-
-       /* We always need two end-of-buffer characters.  The first causes
-        * a transition to the end-of-buffer state.  The second causes
-        * a jam in that state.
-        */
-       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-       b->yy_buf_pos = &b->yy_ch_buf[0];
-
-       b->yy_at_bol = 1;
-       b->yy_buffer_status = YY_BUFFER_NEW;
-
-       if ( b == YY_CURRENT_BUFFER )
-               yy_load_buffer_state( );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  
- */
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
-{
-       if (new_buffer == NULL)
-               return;
-
-       yyensure_buffer_stack();
-
-       /* This block is copied from yy_switch_to_buffer. */
-       if ( YY_CURRENT_BUFFER )
-               {
-               /* Flush out information for old buffer. */
-               *(yy_c_buf_p) = (yy_hold_char);
-               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       /* Only push if top exists. Otherwise, replace top. */
-       if (YY_CURRENT_BUFFER)
-               (yy_buffer_stack_top)++;
-       YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-       /* copied from yy_switch_to_buffer. */
-       yy_load_buffer_state( );
-       (yy_did_buffer_switch_on_eof) = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  
- */
-void yypop_buffer_state (void)
-{
-       if (!YY_CURRENT_BUFFER)
-               return;
-
-       yy_delete_buffer(YY_CURRENT_BUFFER );
-       YY_CURRENT_BUFFER_LVALUE = NULL;
-       if ((yy_buffer_stack_top) > 0)
-               --(yy_buffer_stack_top);
-
-       if (YY_CURRENT_BUFFER) {
-               yy_load_buffer_state( );
-               (yy_did_buffer_switch_on_eof) = 1;
-       }
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void yyensure_buffer_stack (void)
-{
-       yy_size_t num_to_alloc;
-    
-       if (!(yy_buffer_stack)) {
-
-               /* First allocation is just for 2 elements, since we don't know if this
-                * scanner will even need a stack. We use 2 instead of 1 to avoid an
-                * immediate realloc on the next call.
-         */
-               num_to_alloc = 1;
-               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
-                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
-                                                               );
-               if ( ! (yy_buffer_stack) )
-                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-                                                                 
-               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-                               
-               (yy_buffer_stack_max) = num_to_alloc;
-               (yy_buffer_stack_top) = 0;
-               return;
-       }
-
-       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
-               /* Increase the buffer to prepare for a possible push. */
-               int grow_size = 8 /* arbitrary grow size */;
-
-               num_to_alloc = (yy_buffer_stack_max) + grow_size;
-               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
-                                                               ((yy_buffer_stack),
-                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
-                                                               );
-               if ( ! (yy_buffer_stack) )
-                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
-               /* zero only the new slots.*/
-               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
-               (yy_buffer_stack_max) = num_to_alloc;
-       }
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * 
- * @return the newly allocated buffer state object. 
- */
-YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
-{
-       YY_BUFFER_STATE b;
-    
-       if ( size < 2 ||
-            base[size-2] != YY_END_OF_BUFFER_CHAR ||
-            base[size-1] != YY_END_OF_BUFFER_CHAR )
-               /* They forgot to leave room for the EOB's. */
-               return 0;
-
-       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
-       if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
-       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
-       b->yy_buf_pos = b->yy_ch_buf = base;
-       b->yy_is_our_buffer = 0;
-       b->yy_input_file = 0;
-       b->yy_n_chars = b->yy_buf_size;
-       b->yy_is_interactive = 0;
-       b->yy_at_bol = 1;
-       b->yy_fill_buffer = 0;
-       b->yy_buffer_status = YY_BUFFER_NEW;
-
-       yy_switch_to_buffer(b  );
-
-       return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to yylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * 
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       yy_scan_bytes() instead.
- */
-YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
-{
-    
-       return yy_scan_bytes(yystr,strlen(yystr) );
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
- * 
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
-{
-       YY_BUFFER_STATE b;
-       char *buf;
-       yy_size_t n, i;
-    
-       /* Get memory for full buffer, including space for trailing EOB's. */
-       n = _yybytes_len + 2;
-       buf = (char *) yyalloc(n  );
-       if ( ! buf )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
-       for ( i = 0; i < _yybytes_len; ++i )
-               buf[i] = yybytes[i];
-
-       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-       b = yy_scan_buffer(buf,n );
-       if ( ! b )
-               YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
-       /* It's okay to grow etc. this buffer, and we should throw it
-        * away when we're done.
-        */
-       b->yy_is_our_buffer = 1;
-
-       return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yy_fatal_error (yyconst char* msg )
-{
-       (void) fprintf( stderr, "%s\n", msg );
-       exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-               yytext[yyleng] = (yy_hold_char); \
-               (yy_c_buf_p) = yytext + yyless_macro_arg; \
-               (yy_hold_char) = *(yy_c_buf_p); \
-               *(yy_c_buf_p) = '\0'; \
-               yyleng = yyless_macro_arg; \
-               } \
-       while ( 0 )
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the current line number.
- * 
- */
-int yyget_lineno  (void)
-{
-        
-    return yylineno;
-}
-
-/** Get the input stream.
- * 
- */
-FILE *yyget_in  (void)
-{
-        return yyin;
-}
-
-/** Get the output stream.
- * 
- */
-FILE *yyget_out  (void)
-{
-        return yyout;
-}
-
-/** Get the length of the current token.
- * 
- */
-yy_size_t yyget_leng  (void)
-{
-        return yyleng;
-}
-
-/** Get the current token.
- * 
- */
-
-char *yyget_text  (void)
-{
-        return yytext;
-}
-
-/** Set the current line number.
- * @param line_number
- * 
- */
-void yyset_lineno (int  line_number )
-{
-    
-    yylineno = line_number;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- * 
- * @see yy_switch_to_buffer
- */
-void yyset_in (FILE *  in_str )
-{
-        yyin = in_str ;
-}
-
-void yyset_out (FILE *  out_str )
-{
-        yyout = out_str ;
-}
-
-int yyget_debug  (void)
-{
-        return yy_flex_debug;
-}
-
-void yyset_debug (int  bdebug )
-{
-        yy_flex_debug = bdebug ;
-}
-
-static int yy_init_globals (void)
-{
-        /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from yylex_destroy(), so don't allocate here.
-     */
-
-    (yy_buffer_stack) = 0;
-    (yy_buffer_stack_top) = 0;
-    (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = (char *) 0;
-    (yy_init) = 0;
-    (yy_start) = 0;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
-    yyin = stdin;
-    yyout = stdout;
-#else
-    yyin = (FILE *) 0;
-    yyout = (FILE *) 0;
-#endif
-
-    /* For future reference: Set errno on error, since we are called by
-     * yylex_init()
-     */
-    return 0;
-}
-
-/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-int yylex_destroy  (void)
-{
-    
-    /* Pop the buffer stack, destroying each element. */
-       while(YY_CURRENT_BUFFER){
-               yy_delete_buffer(YY_CURRENT_BUFFER  );
-               YY_CURRENT_BUFFER_LVALUE = NULL;
-               yypop_buffer_state();
-       }
-
-       /* Destroy the stack itself. */
-       yyfree((yy_buffer_stack) );
-       (yy_buffer_stack) = NULL;
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * yylex() is called, initialization will occur. */
-    yy_init_globals( );
-
-    return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
-{
-       register int i;
-       for ( i = 0; i < n; ++i )
-               s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s )
-{
-       register int n;
-       for ( n = 0; s[n]; ++n )
-               ;
-
-       return n;
-}
-#endif
-
-void *yyalloc (yy_size_t  size )
-{
-       return (void *) malloc( size );
-}
-
-void *yyrealloc  (void * ptr, yy_size_t  size )
-{
-       /* The cast to (char *) in the following accommodates both
-        * implementations that use char* generic pointers, and those
-        * that use void* generic pointers.  It works with the latter
-        * because both ANSI C and C++ allow castless assignment from
-        * any pointer type to void*, and deal with argument conversions
-        * as though doing an assignment.
-        */
-       return (void *) realloc( (char *) ptr, size );
-}
-
-void yyfree (void * ptr )
-{
-       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-#line 84 "scanner.l"
-
-
-int yywrap(void)
-{
-    return 1;
-}
-
-void yyerror(const char *message)
-{
-    const char *pt, *end;
-    struct _entry {
-        const char *from;
-        const char *to;
-    } *entry, list[] = {
-        { "T_VIRTUAL",      "\"virtual\"" },
-        { "T_DISPLAY",      "\"display\"" },
-        { "T_WALL",         "\"wall\"" },
-        { "T_OPTION",       "\"option\"" },
-        { "T_PARAM",        "\"param\"" },
-        { "T_DIMENSION",    "dimension (e.g., 2x2 or 1024x768)" },
-        { "T_OFFSET",       "display offset (e.g., +10-10)" },
-        { "T_ORIGIN",       "tile origin (e.g., @1280x1024)" },
-        { "T_STRING",       "string" },
-        { "T_COMMENT",      "comment (e.g., #...)" },
-        { "T_LINE_COMMENT", "comment (e.g., #...)" },
-        { NULL, NULL }
-    };
-    
-    fprintf(stderr, "parse error on line %d at token \"%*.*s\"\n",
-            lineno, yyleng, yyleng, yytext);
-    end = message + strlen(message);
-    for (pt = message; *pt; pt++) {
-        if (pt[0] == 'T' && pt[1] == '_') {
-            const char *next = strchr(pt, ' ');
-            if (!next || !*next) next = strchr(pt, '\0');
-            if (!next) goto bail;
-            --next;
-            if (next-pt == 1 && next[1]
-                && next[2] == '\'' && next[3] == '\'') {
-                fprintf(stderr, "\"%c\"", next[1]);
-                pt += 4;
-                goto cnt;
-            }
-            for (entry = list; entry->from; ++entry) {
-                if (!strncmp(entry->from, pt, strlen(entry->from))) {
-                    fprintf(stderr, "%s", entry->to);
-                    pt = next;
-                    goto cnt;
-                }
-            }
-        } else if (end-pt >= 5 && pt[0] == '\'' && pt[1] == '\'' && pt[3]
-                   && pt[4] == '\'' && pt[5] == '\'') {
-            fprintf(stderr, "\"%c\"", pt[3]);
-            pt += 5;
-        } else if (end-pt >= 3 && pt[0] == '\'' && pt[1] && pt[2] == '\'') {
-            fprintf(stderr, "\"%c\"", pt[1]);
-            pt += 3;
-        }
-      bail:
-        putc(*pt, stderr);
-      cnt:
-        ;
-    }
-    fprintf(stderr, "\n");
-    exit( 1 );
-}
-
-static int getdimension(int token, const char *text, int leng)
-{
-    char *endptr;
-    char *tmp = dmxConfigAlloc(leng+1);
-    int  x, y;
-
-    strlcpy(tmp, text, leng+1);
-    x = strtol(tmp, &endptr, 10);
-    while (*endptr && !isdigit(*endptr)) ++endptr;
-    y = strtol(endptr, NULL, 10);
-    dmxConfigFree(tmp);
-    yylval.pair = dmxConfigCreatePair(token, lineno, NULL, x, y, 1, 1);
-    return token;
-}
-
-static int getstring(int token, const char *text, int leng)
-{
-    yylval.string = dmxConfigCreateString(token, lineno, NULL,
-                                          dmxConfigCopyString(leng ? text : "",
-                                                              leng));
-    return token;
-}
-
-static int gettoken(int token, const char *text, int leng)
-{
-    yylval.token = dmxConfigCreateToken(token, lineno, NULL);
-    return token;
-}
-
-static int getcomment(int token, const char *text, int leng)
-{
-    yylval.comment = dmxConfigCreateComment(token, lineno,
-                                            dmxConfigCopyString(text + 1,
-                                                                leng - 1));
-    return token;
-}
-
index add0e53..0f7cb5c 100644 (file)
@@ -52,6 +52,7 @@
 #include "os.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include "opaque.h"
 
 #include "dmxextension.h"
@@ -65,8 +66,6 @@ extern unsigned long XRT_WINDOW;
 extern int PanoramiXNumScreens;
 #endif
 
-extern void DMXExtensionInit(void);
-
 static unsigned char DMXCode;
 
 static int
@@ -74,8 +73,9 @@ _DMXXineramaActive(void)
 {
 #ifdef PANORAMIX
     return !noPanoramiXExtension;
-#endif
+#else
     return 0;
+#endif
 }
 
 static void
@@ -207,16 +207,17 @@ dmxFetchInputAttributes(unsigned int mask,
 static int
 ProcDMXQueryVersion(ClientPtr client)
 {
-    xDMXQueryVersionReply rep;
+    xDMXQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_DMX_MAJOR_VERSION,
+        .minorVersion = SERVER_DMX_MINOR_VERSION,
+        .patchVersion = SERVER_DMX_PATCH_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.majorVersion = SERVER_DMX_MAJOR_VERSION;
-    rep.minorVersion = SERVER_DMX_MINOR_VERSION;
-    rep.patchVersion = SERVER_DMX_PATCH_VERSION;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -224,7 +225,7 @@ ProcDMXQueryVersion(ClientPtr client)
         swapl(&rep.minorVersion);
         swapl(&rep.patchVersion);
     }
-    WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXQueryVersionReply), &rep);
     return Success;
 }
 
@@ -237,16 +238,18 @@ ProcDMXSync(ClientPtr client)
 
     dmxFlushPendingSyncs();
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.status = 0;
+    rep = (xDMXSyncReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = 0
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.status);
     }
-    WriteToClient(client, sizeof(xDMXSyncReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXSyncReply), &rep);
     return Success;
 }
 
@@ -287,16 +290,18 @@ ProcDMXForceWindowCreation(ClientPtr client)
     dmxForceWindowCreation(pWin);
  doreply:
     dmxFlushPendingSyncs();
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.status = 0;
+    rep = (xDMXForceWindowCreationReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = 0
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.status);
     }
-    WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXForceWindowCreationReply), &rep);
     return Success;
 }
 
@@ -307,16 +312,18 @@ ProcDMXGetScreenCount(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.screenCount = dmxGetNumScreens();
+    rep = (xDMXGetScreenCountReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .screenCount = dmxGetNumScreens()
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.screenCount);
     }
-    WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXGetScreenCountReply), &rep);
     return Success;
 }
 
@@ -338,27 +345,29 @@ ProcDMXGetScreenAttributes(ClientPtr client)
     if (!dmxGetScreenAttributes(stuff->physicalScreen, &attr))
         return BadValue;
 
-    rep.logicalScreen = attr.logicalScreen;
-    rep.screenWindowWidth = attr.screenWindowWidth;
-    rep.screenWindowHeight = attr.screenWindowHeight;
-    rep.screenWindowXoffset = attr.screenWindowXoffset;
-    rep.screenWindowYoffset = attr.screenWindowYoffset;
-    rep.rootWindowWidth = attr.rootWindowWidth;
-    rep.rootWindowHeight = attr.rootWindowHeight;
-    rep.rootWindowXoffset = attr.rootWindowXoffset;
-    rep.rootWindowYoffset = attr.rootWindowYoffset;
-    rep.rootWindowXorigin = attr.rootWindowXorigin;
-    rep.rootWindowYorigin = attr.rootWindowYorigin;
-
     length = attr.displayName ? strlen(attr.displayName) : 0;
     paddedLength = pad_to_int32(length);
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length =
-        bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) -
-                        sizeof(xGenericReply))
-                       + paddedLength);
-    rep.displayNameLength = length;
+
+    rep = (xDMXGetScreenAttributesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length =
+            bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) -
+                            sizeof(xGenericReply))
+                           + paddedLength),
+        .displayNameLength = length,
+        .logicalScreen = attr.logicalScreen,
+        .screenWindowWidth = attr.screenWindowWidth,
+        .screenWindowHeight = attr.screenWindowHeight,
+        .screenWindowXoffset = attr.screenWindowXoffset,
+        .screenWindowYoffset = attr.screenWindowYoffset,
+        .rootWindowWidth = attr.rootWindowWidth,
+        .rootWindowHeight = attr.rootWindowHeight,
+        .rootWindowXoffset = attr.rootWindowXoffset,
+        .rootWindowYoffset = attr.rootWindowYoffset,
+        .rootWindowXorigin = attr.rootWindowXorigin,
+        .rootWindowYorigin = attr.rootWindowYorigin
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
@@ -376,9 +385,9 @@ ProcDMXGetScreenAttributes(ClientPtr client)
         swaps(&rep.rootWindowXorigin);
         swaps(&rep.rootWindowYorigin);
     }
-    WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), &rep);
     if (length)
-        WriteToClient(client, length, (char *) attr.displayName);
+        WriteToClient(client, length, attr.displayName);
     return Success;
 }
 
@@ -441,19 +450,20 @@ ProcDMXChangeScreensAttributes(ClientPtr client)
         return status;
 
  noxinerama:
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.status = status;
-    rep.errorScreen = errorScreen;
+    rep = (xDMXChangeScreensAttributesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = status,
+        .errorScreen = errorScreen
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.status);
         swapl(&rep.errorScreen);
     }
-    WriteToClient(client,
-                  sizeof(xDMXChangeScreensAttributesReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXChangeScreensAttributesReply), &rep);
     return Success;
 }
 
@@ -491,18 +501,20 @@ ProcDMXAddScreen(ClientPtr client)
 
     free(name);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.status = status;
-    rep.physicalScreen = stuff->physicalScreen;
+    rep = (xDMXAddScreenReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = status,
+        .physicalScreen = stuff->physicalScreen
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.status);
         swapl(&rep.physicalScreen);
     }
-    WriteToClient(client, sizeof(xDMXAddScreenReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXAddScreenReply), &rep);
     return Success;
 }
 
@@ -517,16 +529,18 @@ ProcDMXRemoveScreen(ClientPtr client)
 
     status = dmxDetachScreen(stuff->physicalScreen);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.status = status;
+    rep = (xDMXRemoveScreenReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = status
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.status);
     }
-    WriteToClient(client, sizeof(xDMXRemoveScreenReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXRemoveScreenReply), &rep);
     return Success;
 }
 
@@ -636,10 +650,12 @@ ProcDMXGetWindowAttributes(ClientPtr client)
         return BadWindow;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = count * 6;
-    rep.screenCount = count;
+    rep = (xDMXGetWindowAttributesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = count * 6,
+        .screenCount = count
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -662,12 +678,12 @@ ProcDMXGetWindowAttributes(ClientPtr client)
 
     dmxFlushPendingSyncs();
 
-    WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), &rep);
     if (count) {
-        WriteToClient(client, count * sizeof(*screens), (char *) screens);
-        WriteToClient(client, count * sizeof(*windows), (char *) windows);
-        WriteToClient(client, count * sizeof(*pos), (char *) pos);
-        WriteToClient(client, count * sizeof(*vis), (char *) vis);
+        WriteToClient(client, count * sizeof(*screens), screens);
+        WriteToClient(client, count * sizeof(*windows), windows);
+        WriteToClient(client, count * sizeof(*pos), pos);
+        WriteToClient(client, count * sizeof(*vis), vis);
     }
 
     free(vis);
@@ -688,14 +704,15 @@ ProcDMXGetDesktopAttributes(ClientPtr client)
 
     dmxGetDesktopAttributes(&attr);
 
-    rep.width = attr.width;
-    rep.height = attr.height;
-    rep.shiftX = attr.shiftX;
-    rep.shiftY = attr.shiftY;
-
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
+    rep = (xDMXGetDesktopAttributesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .width = attr.width,
+        .height = attr.height,
+        .shiftX = attr.shiftX,
+        .shiftY = attr.shiftY
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
@@ -705,7 +722,7 @@ ProcDMXGetDesktopAttributes(ClientPtr client)
         swaps(&rep.shiftX);
         swaps(&rep.shiftY);
     }
-    WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), &rep);
     return Success;
 }
 
@@ -739,17 +756,18 @@ ProcDMXChangeDesktopAttributes(ClientPtr client)
         return status;
 
  noxinerama:
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.status = status;
+    rep = (xDMXChangeDesktopAttributesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = status
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.status);
     }
-    WriteToClient(client,
-                  sizeof(xDMXChangeDesktopAttributesReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXChangeDesktopAttributesReply), &rep);
     return Success;
 }
 
@@ -760,16 +778,18 @@ ProcDMXGetInputCount(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.inputCount = dmxGetInputCount();
+    rep = (xDMXGetInputCountReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .inputCount = dmxGetInputCount()
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.inputCount);
     }
-    WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXGetInputCountReply), &rep);
     return Success;
 }
 
@@ -786,19 +806,24 @@ ProcDMXGetInputAttributes(ClientPtr client)
 
     if (dmxGetInputAttributes(stuff->deviceId, &attr))
         return BadValue;
-    rep.inputType = attr.inputType;
-    rep.physicalScreen = attr.physicalScreen;
-    rep.physicalId = attr.physicalId;
-    rep.isCore = attr.isCore;
-    rep.sendsCore = attr.sendsCore;
-    rep.detached = attr.detached;
 
     length = attr.name ? strlen(attr.name) : 0;
     paddedLength = pad_to_int32(length);
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = bytes_to_int32(paddedLength);
-    rep.nameLength = length;
+
+    rep = (xDMXGetInputAttributesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(paddedLength),
+
+        .inputType = attr.inputType,
+        .physicalScreen = attr.physicalScreen,
+        .physicalId = attr.physicalId,
+        .nameLength = length,
+        .isCore = attr.isCore,
+        .sendsCore = attr.sendsCore,
+        .detached = attr.detached
+    };
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -807,9 +832,9 @@ ProcDMXGetInputAttributes(ClientPtr client)
         swapl(&rep.physicalId);
         swapl(&rep.nameLength);
     }
-    WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXGetInputAttributesReply), &rep);
     if (length)
-        WriteToClient(client, length, (char *) attr.name);
+        WriteToClient(client, length, attr.name);
     return Success;
 }
 
@@ -850,18 +875,20 @@ ProcDMXAddInput(ClientPtr client)
     if (status)
         return status;
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.status = status;
-    rep.physicalId = id;
+    rep = (xDMXAddInputReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = status,
+        .physicalId = id
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.status);
         swapl(&rep.physicalId);
     }
-    WriteToClient(client, sizeof(xDMXAddInputReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXAddInputReply), &rep);
     return Success;
 }
 
@@ -879,16 +906,18 @@ ProcDMXRemoveInput(ClientPtr client)
     if (status)
         return status;
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.status = status;
+    rep = (xDMXRemoveInputReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .status = status
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.status);
     }
-    WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *) &rep);
+    WriteToClient(client, sizeof(xDMXRemoveInputReply), &rep);
     return Success;
 }
 
index faa28a5..d7296ae 100644 (file)
@@ -1318,7 +1318,7 @@ dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
     }
 
     /* Initialize the BE screen resources */
-    dmxBEScreenInit(idx, screenInfo.screens[idx]);
+    dmxBEScreenInit(screenInfo.screens[idx]);
 
     /* TODO: Handle GLX visual initialization.  GLXProxy needs to be
      * updated to handle dynamic addition/removal of screens. */
index 09e3d74..5804353 100644 (file)
@@ -905,7 +905,7 @@ OsVendorInit(void)
  * two routines mentioned here, as well as by others) to use the
  * referenced routine instead of \a vfprintf().) */
 void
-OsVendorFatalError(void)
+OsVendorFatalError(const char *f, va_list args)
 {
 }
 
index 151f672..3249c48 100644 (file)
@@ -114,9 +114,6 @@ VFatalError(const char *format, va_list args)
 {
     VErrorF(format, args);
     ErrorF("\n");
-#ifdef DDXOSFATALERROR
-    OsVendorFatalError();
-#endif
     AbortServer();
  /*NOTREACHED*/}
 #endif
index 37b3f3b..849ef16 100644 (file)
@@ -59,7 +59,7 @@
 #include "mipointer.h"
 #include "micmap.h"
 
-extern Bool dmxCloseScreen(int idx, ScreenPtr pScreen);
+extern Bool dmxCloseScreen(ScreenPtr pScreen);
 static Bool dmxSaveScreen(ScreenPtr pScreen, int what);
 
 static unsigned long dmxGeneration;
@@ -77,9 +77,9 @@ DevPrivateKeyRec dmxGlyphSetPrivateKeyRec;
 /** Initialize the parts of screen \a idx that require access to the
  *  back-end server. */
 void
-dmxBEScreenInit(int idx, ScreenPtr pScreen)
+dmxBEScreenInit(ScreenPtr pScreen)
 {
-    DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+    DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
     XSetWindowAttributes attribs;
     XGCValues gcvals;
     unsigned long mask;
@@ -192,11 +192,11 @@ dmxBEScreenInit(int idx, ScreenPtr pScreen)
     }
 }
 
-/** Initialize screen number \a idx. */
+/** Initialize screen number \a pScreen->myNum. */
 Bool
-dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[])
+dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
 {
-    DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+    DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
     int i, j;
 
     if (!dixRegisterPrivateKey(&dmxScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
@@ -286,20 +286,20 @@ dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[])
     }
     else {
         MAXSCREENSALLOC(dmxCursorGeneration);
-        if (dmxCursorGeneration[idx] != serverGeneration) {
+        if (dmxCursorGeneration[pScreen->myNum] != serverGeneration) {
             if (!(miPointerInitialize(pScreen,
                                       &dmxPointerSpriteFuncs,
                                       &dmxPointerCursorFuncs, FALSE)))
                 return FALSE;
 
-            dmxCursorGeneration[idx] = serverGeneration;
+            dmxCursorGeneration[pScreen->myNum] = serverGeneration;
         }
     }
 
     DMX_WRAP(CloseScreen, dmxCloseScreen, dmxScreen, pScreen);
     DMX_WRAP(SaveScreen, dmxSaveScreen, dmxScreen, pScreen);
 
-    dmxBEScreenInit(idx, pScreen);
+    dmxBEScreenInit(pScreen);
 
     if (!dmxShadowFB) {
         /* Wrap GC functions */
@@ -422,12 +422,12 @@ dmxBECloseScreen(ScreenPtr pScreen)
 
 /** Close screen number \a idx. */
 Bool
-dmxCloseScreen(int idx, ScreenPtr pScreen)
+dmxCloseScreen(ScreenPtr pScreen)
 {
-    DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+    DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
 
     /* Reset the proc vectors */
-    if (idx == 0) {
+    if (pScreen->myNum == 0) {
         dmxResetRender();
         dmxResetFonts();
     }
@@ -498,7 +498,7 @@ dmxCloseScreen(int idx, ScreenPtr pScreen)
     }
 
     DMX_UNWRAP(CloseScreen, dmxScreen, pScreen);
-    return pScreen->CloseScreen(idx, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 static Bool
index 5c0bfac..9fe9c98 100644 (file)
@@ -40,9 +40,9 @@
 
 #include "scrnintstr.h"
 
-extern Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]);
+extern Bool dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[]);
 
-extern void dmxBEScreenInit(int idx, ScreenPtr pScreen);
+extern void dmxBEScreenInit(ScreenPtr pScreen);
 extern void dmxBECloseScreen(ScreenPtr pScreen);
 
 #endif                          /* DMXSCRINIT_H */
index 49c6ef1..91011d1 100644 (file)
@@ -454,19 +454,18 @@ __glXQueryMaxSwapBarriersSGIX(__GLXclientState * cl, GLbyte * pc)
     ClientPtr client = cl->client;
     xGLXQueryMaxSwapBarriersSGIXReq *req =
         (xGLXQueryMaxSwapBarriersSGIXReq *) pc;
-    xGLXQueryMaxSwapBarriersSGIXReply reply;
-
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = 0;
-    reply.max = QueryMaxSwapBarriersSGIX(req->screen);
+    xGLXQueryMaxSwapBarriersSGIXReply reply = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .max = QueryMaxSwapBarriersSGIX(req->screen)
+    };
 
     if (client->swapped) {
         __glXSwapQueryMaxSwapBarriersSGIXReply(client, &reply);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply,
-                      (char *) &reply);
+        WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, &reply);
     }
 
     return Success;
@@ -794,7 +793,11 @@ MakeCurrent(__GLXclientState * cl,
     ClientPtr client = cl->client;
     DrawablePtr pDraw = NULL;
     DrawablePtr pReadDraw = NULL;
-    xGLXMakeCurrentReadSGIReply new_reply;
+    xGLXMakeCurrentReadSGIReply new_reply = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     xGLXMakeCurrentReq *be_req;
     xGLXMakeCurrentReply be_reply;
     xGLXMakeContextCurrentReq *be_new_req;
@@ -1198,9 +1201,6 @@ MakeCurrent(__GLXclientState * cl,
     else {
         new_reply.contextTag = 0;
     }
-    new_reply.length = 0;
-    new_reply.type = X_Reply;
-    new_reply.sequenceNumber = client->sequence;
 
 #ifdef PANORAMIX
     if (!noPanoramiXExtension) {
@@ -1388,8 +1388,7 @@ MakeCurrent(__GLXclientState * cl,
         __glXSwapMakeCurrentReply(client, &new_reply);
     }
     else {
-        WriteToClient(client, sz_xGLXMakeContextCurrentReply,
-                      (char *) &new_reply);
+        WriteToClient(client, sz_xGLXMakeContextCurrentReply, &new_reply);
     }
 
     return Success;
@@ -1440,16 +1439,18 @@ __glXIsDirect(__GLXclientState * cl, GLbyte * pc)
         return __glXBadContext;
     }
 
-    reply.isDirect = 0;
-    reply.length = 0;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXIsDirectReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .isDirect = 0
+    };
 
     if (client->swapped) {
         __glXSwapIsDirectReply(client, &reply);
     }
     else {
-        WriteToClient(client, sz_xGLXIsDirectReply, (char *) &reply);
+        WriteToClient(client, sz_xGLXIsDirectReply, &reply);
     }
 
     return Success;
@@ -1461,24 +1462,25 @@ __glXQueryVersion(__GLXclientState * cl, GLbyte * pc)
     ClientPtr client = cl->client;
 
 /*    xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; */
-    xGLXQueryVersionReply reply;
 
+    xGLXQueryVersionReply reply = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
     /*
      ** Server should take into consideration the version numbers sent by the
      ** client if it wants to work with older clients; however, in this
      ** implementation the server just returns its version number.
      */
-    reply.majorVersion = __glXVersionMajor;
-    reply.minorVersion = __glXVersionMinor;
-    reply.length = 0;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+        .majorVersion = __glXVersionMajor,
+        .minorVersion = __glXVersionMinor
+    };
 
     if (client->swapped) {
         __glXSwapQueryVersionReply(client, &reply);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryVersionReply, (char *) &reply);
+        WriteToClient(client, sz_xGLXQueryVersionReply, &reply);
     }
     return Success;
 }
@@ -1682,14 +1684,16 @@ __glXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
     }
     pGlxScreen = &__glXActiveScreens[screen];
 
-    reply.numVisuals = pGlxScreen->numGLXVisuals;
-    reply.numProps = __GLX_TOTAL_CONFIG;
-    reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
-                    __GLX_TOTAL_CONFIG) >> 2;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXGetVisualConfigsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .numVisuals = pGlxScreen->numGLXVisuals,
+        .numProps = __GLX_TOTAL_CONFIG,
+        .length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
+                    __GLX_TOTAL_CONFIG) >> 2
+    };
 
-    WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
+    WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply);
 
     for (i = 0; i < pGlxScreen->numVisuals; i++) {
         pGlxVisual = &pGlxScreen->pGlxVisual[i];
@@ -1743,8 +1747,7 @@ __glXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
         buf[p++] = GLX_VISUAL_SELECT_GROUP_SGIX;
         buf[p++] = pGlxVisual->visualSelectGroup;
 
-        WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
-                      (char *) buf);
+        WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, buf);
     }
     return Success;
 }
@@ -2628,18 +2631,19 @@ __glXQueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
 #endif
 
     length = len;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = len;
-    reply.n = numbytes;
+    reply = (xGLXQueryExtensionsStringReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = len,
+        .n = numbytes
+    };
 
     if (client->swapped) {
         glxSwapQueryExtensionsStringReply(client, &reply, be_buf);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryExtensionsStringReply,
-                      (char *) &reply);
-        WriteToClient(client, (int) (length << 2), (char *) be_buf);
+        WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply);
+        WriteToClient(client, (int) (length << 2), be_buf);
     }
 
     return Success;
@@ -2710,16 +2714,18 @@ __glXQueryServerString(__GLXclientState * cl, GLbyte * pc)
 #endif
 
     length = len;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = length;
-    reply.n = numbytes;
+    reply = (xGLXQueryServerStringReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = length,
+        .n = numbytes
+    };
 
     if (client->swapped) {
         glxSwapQueryServerStringReply(client, &reply, be_buf);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) &reply);
+        WriteToClient(client, sz_xGLXQueryServerStringReply, &reply);
         WriteToClient(client, (int) (length << 2), be_buf);
     }
 
@@ -2867,11 +2873,13 @@ __glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc)
     pGlxScreen = &__glXActiveScreens[screen];
     numFBConfigs = __glXNumFBConfigs;
 
-    reply.numFBConfigs = numFBConfigs;
-    reply.numAttribs = numAttribs;
-    reply.length = (numFBConfigs * 2 * numAttribs * __GLX_SIZE_CARD32) >> 2;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXGetFBConfigsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = (numFBConfigs * 2 * numAttribs * __GLX_SIZE_CARD32) >> 2,
+        .numFBConfigs = numFBConfigs,
+        .numAttribs = numAttribs
+    };
 
     if (client->swapped) {
         __GLX_DECLARE_SWAP_VARIABLES;
@@ -2880,7 +2888,7 @@ __glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc)
         __GLX_SWAP_INT(&reply.numFBConfigs);
         __GLX_SWAP_INT(&reply.numAttribs);
     }
-    WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *) &reply);
+    WriteToClient(client, sz_xGLXGetFBConfigsReply, &reply);
 
     for (i = 0; i < numFBConfigs; i++) {
         int associatedVisualId = 0;
@@ -3021,7 +3029,7 @@ __glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc)
             __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
             __GLX_SWAP_INT_ARRAY((int *) buf, 2 * numAttribs);
         }
-        WriteToClient(client, 2 * numAttribs * __GLX_SIZE_CARD32, (char *) buf);
+        WriteToClient(client, 2 * numAttribs * __GLX_SIZE_CARD32, buf);
     }
     return Success;
 }
@@ -3199,10 +3207,12 @@ __glXQueryContext(__GLXclientState * cl, GLbyte * pc)
 
     nProps = 3;
 
-    reply.length = nProps << 1;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.n = nProps;
+    reply = (xGLXQueryContextReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = nProps << 1,
+        .n = nProps
+    };
 
     nReplyBytes = reply.length << 2;
     sendBuf = (int *) malloc(nReplyBytes);
@@ -3218,8 +3228,8 @@ __glXQueryContext(__GLXclientState * cl, GLbyte * pc)
         __glXSwapQueryContextReply(client, &reply, sendBuf);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryContextReply, (char *) &reply);
-        WriteToClient(client, nReplyBytes, (char *) sendBuf);
+        WriteToClient(client, sz_xGLXQueryContextReply, &reply);
+        WriteToClient(client, nReplyBytes, sendBuf);
     }
     free((char *) sendBuf);
 
@@ -3249,10 +3259,12 @@ __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
 
     nProps = 4;
 
-    reply.length = nProps << 1;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.n = nProps;
+    reply = (xGLXQueryContextInfoEXTReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = nProps << 1,
+        .n = nProps
+    };
 
     nReplyBytes = reply.length << 2;
     sendBuf = (int *) malloc(nReplyBytes);
@@ -3270,8 +3282,8 @@ __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
         __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) &reply);
-        WriteToClient(client, nReplyBytes, (char *) sendBuf);
+        WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply);
+        WriteToClient(client, nReplyBytes, sendBuf);
     }
     free((char *) sendBuf);
 
@@ -3606,9 +3618,8 @@ __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc)
         __glXSwapGetDrawableAttributesReply(client, &reply, (int *) attribs);
     }
     else {
-        WriteToClient(client, sz_xGLXGetDrawableAttributesReply,
-                      (char *) &reply);
-        WriteToClient(client, attribs_size, (char *) attribs);
+        WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply);
+        WriteToClient(client, attribs_size, attribs);
     }
 
     free(attribs);
index ec0e83d..ac79cda 100644 (file)
@@ -293,18 +293,20 @@ __glXSwapGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
     }
     pGlxScreen = &__glXActiveScreens[screen];
 
-    reply.numVisuals = pGlxScreen->numGLXVisuals;
-    reply.numProps = __GLX_TOTAL_CONFIG;
-    reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
-                    __GLX_TOTAL_CONFIG) >> 2;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXGetVisualConfigsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
+                   __GLX_TOTAL_CONFIG) >> 2,
+        .numVisuals = pGlxScreen->numGLXVisuals,
+        .numProps = __GLX_TOTAL_CONFIG
+    };
 
     __GLX_SWAP_SHORT(&reply.sequenceNumber);
     __GLX_SWAP_INT(&reply.length);
     __GLX_SWAP_INT(&reply.numVisuals);
     __GLX_SWAP_INT(&reply.numProps);
-    WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
+    WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply);
 
     for (i = 0; i < pGlxScreen->numVisuals; i++) {
         pGlxVisual = &pGlxScreen->pGlxVisual[i];
@@ -353,8 +355,7 @@ __glXSwapGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
         buf[p++] = pGlxVisual->transparentIndex;
 
         __GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
-        WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
-                      (char *) buf);
+        WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, buf);
     }
     return Success;
 }
@@ -508,7 +509,7 @@ __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReadSGIReply * reply)
     __GLX_SWAP_INT(&reply->writeType);
     __GLX_SWAP_INT(&reply->readVid);
     __GLX_SWAP_INT(&reply->readType);
-    WriteToClient(client, sz_xGLXMakeCurrentReadSGIReply, (char *) reply);
+    WriteToClient(client, sz_xGLXMakeCurrentReadSGIReply, reply);
 }
 
 void
@@ -517,7 +518,7 @@ __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply)
     __GLX_DECLARE_SWAP_VARIABLES;
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
-    WriteToClient(client, sz_xGLXIsDirectReply, (char *) reply);
+    WriteToClient(client, sz_xGLXIsDirectReply, reply);
 }
 
 void
@@ -528,7 +529,7 @@ __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply)
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->majorVersion);
     __GLX_SWAP_INT(&reply->minorVersion);
-    WriteToClient(client, sz_xGLXQueryVersionReply, (char *) reply);
+    WriteToClient(client, sz_xGLXQueryVersionReply, reply);
 }
 
 void
@@ -543,7 +544,7 @@ glxSwapQueryExtensionsStringReply(ClientPtr client,
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->n);
-    WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *) reply);
+    WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply);
     __GLX_SWAP_INT_ARRAY((int *) buf, length);
     WriteToClient(client, length << 2, buf);
 }
@@ -558,7 +559,7 @@ glxSwapQueryServerStringReply(ClientPtr client,
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->n);
-    WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) reply);
+    WriteToClient(client, sz_xGLXQueryServerStringReply, reply);
     /** no swap is needed for an array of chars **/
     /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
     WriteToClient(client, length << 2, buf);
@@ -576,9 +577,9 @@ __glXSwapQueryContextInfoEXTReply(ClientPtr client,
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->n);
-    WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) reply);
+    WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply);
     __GLX_SWAP_INT_ARRAY((int *) buf, length);
-    WriteToClient(client, length << 2, (char *) buf);
+    WriteToClient(client, length << 2, buf);
 }
 
 void
@@ -592,9 +593,9 @@ __glXSwapQueryContextReply(ClientPtr client,
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->n);
-    WriteToClient(client, sz_xGLXQueryContextReply, (char *) reply);
+    WriteToClient(client, sz_xGLXQueryContextReply, reply);
     __GLX_SWAP_INT_ARRAY((int *) buf, length);
-    WriteToClient(client, length << 2, (char *) buf);
+    WriteToClient(client, length << 2, buf);
 }
 
 void
@@ -608,8 +609,8 @@ __glXSwapGetDrawableAttributesReply(ClientPtr client,
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->numAttribs);
     __GLX_SWAP_INT_ARRAY(buf, reply->length);
-    WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *) reply);
-    WriteToClient(client, reply->length << 2, (char *) buf);
+    WriteToClient(client, sz_xGLXGetDrawableAttributesReply, reply);
+    WriteToClient(client, reply->length << 2, buf);
 }
 
 void
@@ -621,7 +622,7 @@ __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
     __GLX_SWAP_SHORT(&reply->sequenceNumber);
     __GLX_SWAP_INT(&reply->length);
     __GLX_SWAP_INT(&reply->max);
-    WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, (char *) reply);
+    WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, reply);
 }
 
 /************************************************************************/
index b0710cc..e72a040 100644 (file)
 #include "glxvisuals.h"
 #include "micmap.h"
 #include "glxswap.h"
-
-/*
-** Stubs to satisfy miinitext.c references.
-*/
-typedef int __GLXprovider;
-__GLXprovider __glXDRISWRastProvider;
-void
-GlxPushProvider(__GLXprovider * provider)
-{
-}
+#include "extinit.h"
+#include "glx_extinit.h"
 
 /*
 ** Forward declarations.
index 881152d..47cec15 100644 (file)
@@ -64,8 +64,6 @@ extern void __glXResetLargeCommandStatus(__GLXclientState *);
 extern int __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc);
 extern int __glXSwapQueryContextInfoEXT(__GLXclientState * cl, char *pc);
 
-extern void GlxExtensionInit(void);
-
 extern Bool __glXCoreType(void);
 
 #endif                          /* _glxext_h_ */
index 63786cf..8784200 100644 (file)
@@ -147,9 +147,9 @@ SendSwappedReply(ClientPtr client,
 
     }
 
-    WriteToClient(client, sizeof(xGLXSingleReply), (char *) reply);
+    WriteToClient(client, sizeof(xGLXSingleReply), reply);
     if (buf_size > 0)
-        WriteToClient(client, buf_size, (char *) buf);
+        WriteToClient(client, buf_size, buf);
 
 }
 
@@ -269,21 +269,23 @@ __glXForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc)
     /*
      * send the reply to the client
      */
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = be_reply.length;
-    reply.retval = be_reply.retval;
-    reply.size = be_reply.size;
-    reply.pad3 = be_reply.pad3;
-    reply.pad4 = be_reply.pad4;
+    reply = (xGLXSingleReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = be_reply.length,
+        .retval = be_reply.retval,
+        .size = be_reply.size,
+        .pad3 = be_reply.pad3,
+        .pad4 = be_reply.pad4
+    };
 
     if (client->swapped) {
         SendSwappedReply(client, &reply, be_buf, be_buf_size);
     }
     else {
-        WriteToClient(client, sizeof(xGLXSingleReply), (char *) &reply);
+        WriteToClient(client, sizeof(xGLXSingleReply), &reply);
         if (be_buf_size > 0)
-            WriteToClient(client, be_buf_size, (char *) be_buf);
+            WriteToClient(client, be_buf_size, be_buf);
     }
 
     if (be_buf_size > 0)
@@ -371,21 +373,23 @@ __glXForwardAllWithReply(__GLXclientState * cl, GLbyte * pc)
     /*
      * send the reply to the client
      */
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = be_reply.length;
-    reply.retval = be_reply.retval;
-    reply.size = be_reply.size;
-    reply.pad3 = be_reply.pad3;
-    reply.pad4 = be_reply.pad4;
+    reply = (xGLXSingleReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = be_reply.length,
+        .retval = be_reply.retval,
+        .size = be_reply.size,
+        .pad3 = be_reply.pad3,
+        .pad4 = be_reply.pad4
+    };
 
     if (client->swapped) {
         SendSwappedReply(client, &reply, be_buf, be_buf_size);
     }
     else {
-        WriteToClient(client, sizeof(xGLXSingleReply), (char *) &reply);
+        WriteToClient(client, sizeof(xGLXSingleReply), &reply);
         if (be_buf_size > 0)
-            WriteToClient(client, be_buf_size, (char *) be_buf);
+            WriteToClient(client, be_buf_size, be_buf);
     }
 
     if (be_buf_size > 0)
@@ -1004,18 +1008,20 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
 
     }                           /* of if buf_size > 0 */
 
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = buf_size >> 2;
+    reply = (xGLXReadPixelsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = buf_size >> 2
+    };
 
     if (client->swapped) {
         __GLX_SWAP_SHORT(&reply.sequenceNumber);
         __GLX_SWAP_INT(&reply.length);
     }
 
-    WriteToClient(client, sizeof(xGLXReadPixelsReply), (char *) &reply);
+    WriteToClient(client, sizeof(xGLXReadPixelsReply), &reply);
     if (buf_size > 0) {
-        WriteToClient(client, buf_size, (char *) buf);
+        WriteToClient(client, buf_size, buf);
         free(buf);
     }
 
index 963c92e..e5c8da1 100644 (file)
@@ -138,9 +138,9 @@ SendSwappedReply(ClientPtr client,
 
     }
 
-    WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) reply);
+    WriteToClient(client, sizeof(xGLXVendorPrivReply), reply);
     if (buf_size > 0)
-        WriteToClient(client, buf_size, (char *) buf);
+        WriteToClient(client, buf_size, buf);
 
 }
 
@@ -265,9 +265,9 @@ __glXVForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc)
         SendSwappedReply(client, &reply, be_buf, be_buf_size);
     }
     else {
-        WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) &reply);
+        WriteToClient(client, sizeof(xGLXVendorPrivReply), &reply);
         if (be_buf_size > 0)
-            WriteToClient(client, be_buf_size, (char *) be_buf);
+            WriteToClient(client, be_buf_size, be_buf);
     }
 
     if (be_buf_size > 0)
@@ -364,9 +364,9 @@ __glXVForwardAllWithReply(__GLXclientState * cl, GLbyte * pc)
         SendSwappedReply(client, &reply, be_buf, be_buf_size);
     }
     else {
-        WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) &reply);
+        WriteToClient(client, sizeof(xGLXVendorPrivReply), &reply);
         if (be_buf_size > 0)
-            WriteToClient(client, be_buf_size, (char *) be_buf);
+            WriteToClient(client, be_buf_size, be_buf);
     }
 
     if (be_buf_size > 0)
index b4b7358..45c27c6 100644 (file)
@@ -59,7 +59,7 @@ extern xGLXSingleReply __glXReply;
        __glXReply.sequenceNumber = client->sequence;
 
 #define __GLX_SEND_HEADER() \
-       WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply);
+       WriteToClient (client, sz_xGLXSingleReply, &__glXReply);
 
 #define __GLX_PUT_RETVAL(a) \
        __glXReply.retval = (a);
@@ -112,19 +112,19 @@ extern xGLXSingleReply __glXReply;
        *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
 
 #define __GLX_SEND_BYTE_ARRAY(len) \
-       WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer)
+       WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer)
 
 #define __GLX_SEND_SHORT_ARRAY(len) \
-       WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer)
+       WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), answer)
 
 #define __GLX_SEND_INT_ARRAY(len) \
-       WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer)
+       WriteToClient(client, (len)*__GLX_SIZE_INT32, answer)
 
 #define __GLX_SEND_FLOAT_ARRAY(len) \
-       WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer)
+       WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, answer)
 
 #define __GLX_SEND_DOUBLE_ARRAY(len) \
-       WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer)
+       WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, answer)
 
 #define __GLX_SEND_VOID_ARRAY(len)  __GLX_SEND_BYTE_ARRAY(len)
 #define __GLX_SEND_UBYTE_ARRAY(len)  __GLX_SEND_BYTE_ARRAY(len)
index f63772b..600a705 100644 (file)
@@ -640,7 +640,7 @@ dmxCloseConsole(myPrivate * priv)
 }
 
 static Bool
-dmxCloseConsoleScreen(int idx, ScreenPtr pScreen)
+dmxCloseConsoleScreen(ScreenPtr pScreen)
 {
     myPrivate *priv, *last;
 
@@ -650,7 +650,7 @@ dmxCloseConsoleScreen(int idx, ScreenPtr pScreen)
         dmxCloseConsole(last = priv);
 
     DMX_UNWRAP(CloseScreen, last, pScreen);
-    return pScreen->CloseScreen(idx, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 static Cursor
index f734808..2875620 100644 (file)
@@ -227,25 +227,25 @@ dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
             && pScreen->myNum == dmxScreen->index) {
             /* Screen is old screen */
             if (block)
-                dmxSigioBlock();
+                OsBlockSIGIO();
             if (pDev)
                 enqueueMotion(pDev, localX, localY);
             if (block)
-                dmxSigioUnblock();
+                OsReleaseSIGIO();
         }
         else {
             /* Screen is new */
             DMXDBG4("   New screen: old=%d new=%d localX=%d localY=%d\n",
                     pScreen->myNum, dmxScreen->index, localX, localY);
             if (block)
-                dmxSigioBlock();
+                OsBlockSIGIO();
             mieqProcessInputEvents();
             miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
                                localX, localY);
             if (pDev)
                 enqueueMotion(pDev, localX, localY);
             if (block)
-                dmxSigioUnblock();
+                OsReleaseSIGIO();
         }
 #if 00
         miPointerGetPosition(inputInfo.pointer, &localX, &localY);
@@ -387,12 +387,12 @@ dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
     }
 
     if (block)
-        dmxSigioBlock();
+        OsBlockSIGIO();
     valuator_mask_set_range(&mask, firstAxis, axesCount, v);
     QueuePointerEvents(pDevice, MotionNotify, 0, POINTER_ABSOLUTE, &mask);
 
     if (block)
-        dmxSigioUnblock();
+        OsReleaseSIGIO();
 }
 
 static int
@@ -492,10 +492,10 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
         valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
                                 valuators);
         if (block)
-            dmxSigioBlock();
+            OsBlockSIGIO();
         QueueKeyboardEvents(pDevice, event, ke->keycode, &mask);
         if (block)
-            dmxSigioUnblock();
+            OsReleaseSIGIO();
         break;
     case XI_DeviceButtonPress:
     case XI_DeviceButtonRelease:
@@ -503,11 +503,11 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
         valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
                                 valuators);
         if (block)
-            dmxSigioBlock();
+            OsBlockSIGIO();
         QueuePointerEvents(pDevice, event, ke->keycode,
                            POINTER_ABSOLUTE, &mask);
         if (block)
-            dmxSigioUnblock();
+            OsReleaseSIGIO();
         break;
     case XI_ProximityIn:
     case XI_ProximityOut:
@@ -515,10 +515,10 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
         valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
                                 valuators);
         if (block)
-            dmxSigioBlock();
+            OsBlockSIGIO();
         QueueProximityEvents(pDevice, event, &mask);
         if (block)
-            dmxSigioUnblock();
+            OsReleaseSIGIO();
         break;
 
         break;
index 9b1b493..6ef543c 100644 (file)
@@ -84,28 +84,6 @@ dmxSigioHandler(int sig)
     }
 }
 
-/** Block SIGIO handling. */
-void
-dmxSigioBlock(void)
-{
-    sigset_t s;
-
-    sigemptyset(&s);
-    sigaddset(&s, SIGIO);
-    sigprocmask(SIG_BLOCK, &s, 0);
-}
-
-/** Unblock SIGIO handling. */
-void
-dmxSigioUnblock(void)
-{
-    sigset_t s;
-
-    sigemptyset(&s);
-    sigaddset(&s, SIGIO);
-    sigprocmask(SIG_UNBLOCK, &s, 0);
-}
-
 static void
 dmxSigioHook(void)
 {
index 4e48749..9f30662 100644 (file)
@@ -36,8 +36,6 @@
 
 #ifndef _DMXSIGIO_H_
 #define _DMXSIGIO_H_
-extern void dmxSigioBlock(void);
-extern void dmxSigioUnblock(void);
 extern void dmxSigioEnableInput(void);
 extern void dmxSigioDisableInput(void);
 extern void dmxSigioRegister(DMXInputInfo * dmxInput, int fd);
diff --git a/hw/kdrive/Xkdrive.man b/hw/kdrive/Xkdrive.man
new file mode 100644 (file)
index 0000000..b37f9f1
--- /dev/null
@@ -0,0 +1,57 @@
+.\" $RCSId: xc/programs/Xserver/hw/kdrive/Xkdrive.man,v 1.3 2001/01/24 00:06:10 dawes Exp $
+.\"
+.TH Xkdrive 1 __vendorversion__
+.SH NAME
+Xkdrive \- tiny X server
+.SH SYNOPSIS
+.B Xvesa
+.RI [ :display ]
+.RI [ option ...]
+
+.B Xfbdev
+.RI [ :display ]
+.RI [ option ...]
+.SH DESCRIPTION
+.B Xkdrive
+is a family of X servers designed to be particularly small.  This
+manual page describes the common functionality of the 
+.B Xkdrive
+servers; for information on a specific X server, please refer to the
+relevant manual page.
+.SH OPTIONS
+In addition to the standard options accepted by all X servers (see
+Xserver(1)), all the 
+.B Xkdrive
+servers accept the following options:
+.TP 8
+.B -card \fIpcmcia\fP
+use pcmcia card as additional screen.
+.TP 8
+.B -dumb
+disable hardware acceleration.
+.TP 8
+.B -origin \fIX\fP,\fIY\fP
+Locates the next screen in the Xinerama virtual screen.
+.TP 8
+.B -screen \fIwidth\fBx\fIheight\fR[\fBx\fIdepth\fR[\fBx\fIfreq\fR]]\fR[\fB@\fIrotation\fR]\fB
+use a screen of the specified \fIwidth\fP, \fIheight\fP, screen \fIdepth\fP, \fIfrequency\fP, and \fIrotation\fP (0, 90, 180 and 270 are legal values).
+.TP 8
+.B -softCursor
+disable the hardware cursor.
+.TP 8
+.B -videoTest
+start the server, pause momentarily, and exit.
+.TP 8
+.B -zaphod
+disable switching screens by moving the pointer across a screen boundary.
+.TP 8
+.B -2button
+enable emulation of a middle mouse button by chording.
+.TP 8
+.B -3button
+disable emulation of a middle mouse button by chording.
+.SH SEE ALSO
+X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), Xvesa(1), Xfbdev(1).
+.SH AUTHORS
+The Xkdrive common core was written by Keith Packard,
+and is based on the Sample Implementation of X.
index 9d9b64e..2e0613a 100644 (file)
@@ -5,7 +5,6 @@ INCLUDES =                      \
        @KDRIVE_CFLAGS@         \
        @XEPHYR_INCS@           \
        @XEPHYR_CFLAGS@         \
-       @DRIPROTO_CFLAGS@       \
        -I$(top_srcdir)         \
        -I$(top_srcdir)/exa
 
index 8eda539..e6520d0 100644 (file)
 
 extern int KdTsPhyScreen;
 
-#ifdef GLXEXT
-extern Bool noGlxVisualInit;
-#endif
-
 KdKeyboardInfo *ephyrKbd;
 KdPointerInfo *ephyrMouse;
 EphyrKeySyms ephyrKeySyms;
@@ -419,23 +415,22 @@ ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations)
     struct {
         int width, height;
     } sizes[] = {
-        {
-        1600, 1200}, {
-        1400, 1050}, {
-        1280, 960}, {
-        1280, 1024}, {
-        1152, 864}, {
-        1024, 768}, {
-        832, 624}, {
-        800, 600}, {
-        720, 400}, {
-        480, 640}, {
-        640, 480}, {
-        640, 400}, {
-        320, 240}, {
-        240, 320}, {
-        160, 160}, {
-        0, 0}
+        {1600, 1200},
+        {1400, 1050},
+        {1280, 960},
+        {1280, 1024},
+        {1152, 864},
+        {1024, 768},
+        {832, 624},
+        {800, 600},
+        {720, 400},
+        {480, 640},
+        {640, 480},
+        {640, 400},
+        {320, 240},
+        {240, 320},
+        {160, 160},
+        {0, 0}
     };
 
     EPHYR_LOG("mark");
@@ -562,6 +557,8 @@ ephyrRandRSetConfig(ScreenPtr pScreen,
     if (wasEnabled)
         KdEnableScreen(pScreen);
 
+    RRScreenSizeNotify(pScreen);
+
     return TRUE;
 
  bail4:
@@ -594,6 +591,43 @@ ephyrRandRInit(ScreenPtr pScreen)
     pScrPriv->rrSetConfig = ephyrRandRSetConfig;
     return TRUE;
 }
+
+static Bool
+ephyrResizeScreen (ScreenPtr           pScreen,
+                  int                  newwidth,
+                  int                  newheight)
+{
+    KdScreenPriv(pScreen);
+    KdScreenInfo *screen = pScreenPriv->screen;
+    RRScreenSize size = {0};
+    Bool ret;
+    int t;
+
+    if (screen->randr & (RR_Rotate_90|RR_Rotate_270)) {
+        t = newwidth;
+        newwidth = newheight;
+        newheight = t;
+    }
+
+    if (newwidth == screen->width && newheight == screen->height) {
+        return FALSE;
+    }
+
+    size.width = newwidth;
+    size.height = newheight;
+
+    ret = ephyrRandRSetConfig (pScreen, screen->randr, 0, &size);
+    if (ret) {
+        RROutputPtr output;
+
+        output = RRFirstOutput(pScreen);
+        if (!output)
+            return FALSE;
+        RROutputSetModes(output, NULL, 0, 0);
+    }
+
+    return ret;
+}
 #endif
 
 Bool
@@ -624,12 +658,9 @@ ephyrInitScreen(ScreenPtr pScreen)
     }
 #endif /*XV*/
 #ifdef XF86DRI
-        if (!ephyrNoDRI && !hostx_has_dri()) {
+    if (!ephyrNoDRI && !hostx_has_dri()) {
         EPHYR_LOG("host x does not support DRI. Disabling DRI forwarding\n");
         ephyrNoDRI = TRUE;
-#ifdef GLXEXT
-        noGlxVisualInit = FALSE;
-#endif
     }
     if (!ephyrNoDRI) {
         ephyrDRIExtensionInit(pScreen);
@@ -637,12 +668,6 @@ ephyrInitScreen(ScreenPtr pScreen)
     }
 #endif
 
-#ifdef GLXEXT
-    if (ephyrNoDRI) {
-        noGlxVisualInit = FALSE;
-    }
-#endif
-
     return TRUE;
 }
 
@@ -772,26 +797,6 @@ ephyrUpdateModifierState(unsigned int state)
     }
 }
 
-static void
-ephyrBlockSigio(void)
-{
-    sigset_t set;
-
-    sigemptyset(&set);
-    sigaddset(&set, SIGIO);
-    sigprocmask(SIG_BLOCK, &set, 0);
-}
-
-static void
-ephyrUnblockSigio(void)
-{
-    sigset_t set;
-
-    sigemptyset(&set);
-    sigaddset(&set, SIGIO);
-    sigprocmask(SIG_UNBLOCK, &set, 0);
-}
-
 static Bool
 ephyrCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
 {
@@ -808,11 +813,11 @@ int ephyrCurScreen;             /*current event screen */
 static void
 ephyrWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
-    ephyrBlockSigio();
+    OsBlockSIGIO();
     ephyrCurScreen = pScreen->myNum;
     miPointerWarpCursor(inputInfo.pointer, pScreen, x, y);
 
-    ephyrUnblockSigio();
+    OsReleaseSIGIO();
 }
 
 miPointerScreenFuncRec ephyrPointerScreenFuncs = {
@@ -963,6 +968,14 @@ ephyrPoll(void)
             break;
 #endif                          /* XF86DRI */
 
+#ifdef RANDR
+        case EPHYR_EV_CONFIGURE:
+            ephyrResizeScreen(screenInfo.screens[ev.data.configure.screen],
+                              ev.data.configure.width,
+                              ev.data.configure.height);
+            break;
+#endif /* RANDR */
+
         default:
             break;
         }
index 28486f5..a42be07 100644 (file)
@@ -517,18 +517,19 @@ EphyrMirrorHostVisuals(ScreenPtr a_screen)
 static int
 ProcXF86DRIQueryVersion(register ClientPtr client)
 {
-    xXF86DRIQueryVersionReply rep;
+    xXF86DRIQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_XF86DRI_MAJOR_VERSION,
+        .minorVersion = SERVER_XF86DRI_MINOR_VERSION,
+        .patchVersion = SERVER_XF86DRI_PATCH_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
 
     EPHYR_LOG("enter\n");
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SERVER_XF86DRI_MAJOR_VERSION;
-    rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION;
-    rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -536,7 +537,7 @@ ProcXF86DRIQueryVersion(register ClientPtr client)
         swaps(&rep.minorVersion);
         swapl(&rep.patchVersion);
     }
-    WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), &rep);
     EPHYR_LOG("leave\n");
     return Success;
 }
@@ -556,17 +557,19 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     if (!ephyrDRIQueryDirectRenderingCapable(stuff->screen, &isCapable)) {
         return BadValue;
     }
-    rep.isCapable = isCapable;
 
     if (!LocalClient(client) || client->swapped)
-        rep.isCapable = 0;
+        isCapable = 0;
+
+    rep = (xXF86DRIQueryDirectRenderingCapableReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .isCapable = isCapable
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
@@ -574,7 +577,7 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client)
     }
 
     WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply),
-                  (char *) &rep);
+                  &rep);
     EPHYR_LOG("leave\n");
 
     return Success;
@@ -586,6 +589,7 @@ ProcXF86DRIOpenConnection(register ClientPtr client)
     xXF86DRIOpenConnectionReply rep;
     drm_handle_t hSAREA;
     char *busIdString = NULL;
+    CARD32 busIdStringLength = 0;
 
     REQUEST(xXF86DRIOpenConnectionReq);
     REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq);
@@ -600,26 +604,27 @@ ProcXF86DRIOpenConnection(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.busIdStringLength = 0;
     if (busIdString)
-        rep.busIdStringLength = strlen(busIdString);
-    rep.length =
-        bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) -
-                       SIZEOF(xGenericReply) +
-                       pad_to_int32(rep.busIdStringLength));
-
-    rep.hSAREALow = (CARD32) (hSAREA & 0xffffffff);
+        busIdStringLength = strlen(busIdString);
+
+    rep = (xXF86DRIOpenConnectionReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) -
+                                 SIZEOF(xGenericReply) +
+                                 pad_to_int32(busIdStringLength)),
+        .hSAREALow = (CARD32) (hSAREA & 0xffffffff),
 #if defined(LONG64) && !defined(__linux__)
-    rep.hSAREAHigh = (CARD32) (hSAREA >> 32);
+        .hSAREAHigh = (CARD32) (hSAREA >> 32),
 #else
-    rep.hSAREAHigh = 0;
+        .hSAREAHigh = 0,
 #endif
+        .busIdStringLength = busIdStringLength
+    };
 
-    WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *) &rep);
-    if (rep.busIdStringLength)
-        WriteToClient(client, rep.busIdStringLength, busIdString);
+    WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), &rep);
+    if (busIdStringLength)
+        WriteToClient(client, busIdStringLength, busIdString);
     free(busIdString);
     EPHYR_LOG("leave\n");
     return Success;
@@ -639,16 +644,18 @@ ProcXF86DRIAuthConnection(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.authenticated = 1;
+    rep = (xXF86DRIAuthConnectionReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .authenticated = 1
+    };
 
     if (!ephyrDRIAuthConnection(stuff->screen, stuff->magic)) {
         ErrorF("Failed to authenticate %lu\n", (unsigned long) stuff->magic);
         rep.authenticated = 0;
     }
-    WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), &rep);
     EPHYR_LOG("leave\n");
     return Success;
 }
@@ -675,7 +682,11 @@ ProcXF86DRICloseConnection(register ClientPtr client)
 static int
 ProcXF86DRIGetClientDriverName(register ClientPtr client)
 {
-    xXF86DRIGetClientDriverNameReply rep;
+    xXF86DRIGetClientDriverNameReply rep =  {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .clientDriverNameLength = 0
+    };
     char *clientDriverName;
 
     REQUEST(xXF86DRIGetClientDriverNameReq);
@@ -692,18 +703,13 @@ ProcXF86DRIGetClientDriverName(register ClientPtr client)
                                 (int *) &rep.ddxDriverMinorVersion,
                                 (int *) &rep.ddxDriverPatchVersion,
                                 &clientDriverName);
-
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.clientDriverNameLength = 0;
     if (clientDriverName)
         rep.clientDriverNameLength = strlen(clientDriverName);
     rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetClientDriverNameReply) -
                                 SIZEOF(xGenericReply) +
                                 pad_to_int32(rep.clientDriverNameLength));
 
-    WriteToClient(client,
-                  sizeof(xXF86DRIGetClientDriverNameReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), &rep);
     if (rep.clientDriverNameLength)
         WriteToClient(client, rep.clientDriverNameLength, clientDriverName);
     EPHYR_LOG("leave\n");
@@ -713,7 +719,11 @@ ProcXF86DRIGetClientDriverName(register ClientPtr client)
 static int
 ProcXF86DRICreateContext(register ClientPtr client)
 {
-    xXF86DRICreateContextReply rep;
+    xXF86DRICreateContextReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     ScreenPtr pScreen;
     VisualPtr visual;
     int i = 0;
@@ -728,10 +738,6 @@ ProcXF86DRICreateContext(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     pScreen = screenInfo.screens[stuff->screen];
     visual = pScreen->visuals;
 
@@ -752,7 +758,7 @@ ProcXF86DRICreateContext(register ClientPtr client)
         return BadValue;
     }
 
-    WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRICreateContextReply), &rep);
     EPHYR_LOG("leave\n");
     return Success;
 }
@@ -916,7 +922,11 @@ destroyHostPeerWindow(const WindowPtr a_win)
 static int
 ProcXF86DRICreateDrawable(ClientPtr client)
 {
-    xXF86DRICreateDrawableReply rep;
+    xXF86DRICreateDrawableReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     DrawablePtr drawable = NULL;
     WindowPtr window = NULL;
     EphyrWindowPair *pair = NULL;
@@ -932,10 +942,6 @@ ProcXF86DRICreateDrawable(ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0,
                            DixReadAccess);
     if (rc != Success)
@@ -974,7 +980,7 @@ ProcXF86DRICreateDrawable(ClientPtr client)
         EPHYR_LOG("paired window '%p' with remote '%d'\n", window, remote_win);
     }
 
-    WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), &rep);
     EPHYR_LOG("leave\n");
     return Success;
 }
@@ -1024,7 +1030,11 @@ ProcXF86DRIDestroyDrawable(register ClientPtr client)
 static int
 ProcXF86DRIGetDrawableInfo(register ClientPtr client)
 {
-    xXF86DRIGetDrawableInfoReply rep;
+    xXF86DRIGetDrawableInfoReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     DrawablePtr drawable;
     WindowPtr window = NULL;
     EphyrWindowPair *pair = NULL;
@@ -1036,16 +1046,11 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client)
     REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq);
 
     EPHYR_LOG("enter\n");
-    memset(&rep, 0, sizeof(rep));
     if (stuff->screen >= screenInfo.numScreens) {
         client->errorValue = stuff->screen;
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0,
                            DixReadAccess);
     if (rc != Success || !drawable) {
@@ -1136,18 +1141,18 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client)
 
     rep.length = bytes_to_int32(rep.length);
 
-    WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), &rep);
 
     if (rep.numClipRects) {
         WriteToClient(client,
                       sizeof(drm_clip_rect_t) * rep.numClipRects,
-                      (char *) clipRects);
+                      clipRects);
     }
 
     if (rep.numBackClipRects) {
         WriteToClient(client,
                       sizeof(drm_clip_rect_t) * rep.numBackClipRects,
-                      (char *) backClipRects);
+                      backClipRects);
     }
     free(clipRects);
     clipRects = NULL;
@@ -1160,7 +1165,11 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client)
 static int
 ProcXF86DRIGetDeviceInfo(register ClientPtr client)
 {
-    xXF86DRIGetDeviceInfoReply rep;
+    xXF86DRIGetDeviceInfoReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     drm_handle_t hFrameBuffer;
     void *pDevPrivate;
 
@@ -1173,10 +1182,6 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     if (!ephyrDRIGetDeviceInfo(stuff->screen,
                                &hFrameBuffer,
                                (int *) &rep.framebufferOrigin,
@@ -1193,16 +1198,15 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client)
     rep.hFrameBufferHigh = 0;
 #endif
 
-    rep.length = 0;
     if (rep.devPrivateSize) {
         rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetDeviceInfoReply) -
                                     SIZEOF(xGenericReply) +
                                     pad_to_int32(rep.devPrivateSize));
     }
 
-    WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), &rep);
     if (rep.length) {
-        WriteToClient(client, rep.devPrivateSize, (char *) pDevPrivate);
+        WriteToClient(client, rep.devPrivateSize, pDevPrivate);
     }
     EPHYR_LOG("leave\n");
     return Success;
index dab028b..df285cf 100644 (file)
@@ -159,17 +159,19 @@ ephyrGLXQueryVersion(__GLXclientState * a_cl, GLbyte * a_pc)
         goto out;
     }
     EPHYR_LOG("major:%d, minor:%d\n", major, minor);
-    reply.majorVersion = major;
-    reply.minorVersion = minor;
-    reply.length = 0;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXQueryVersionReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = major,
+        .minorVersion = minor
+    };
 
     if (client->swapped) {
         __glXSwapQueryVersionReply(client, &reply);
     }
     else {
-        WriteToClient(client, sz_xGLXQueryVersionReply, (char *) &reply);
+        WriteToClient(client, sz_xGLXQueryVersionReply, &reply);
     }
 
     res = Success;
@@ -215,11 +217,13 @@ ephyrGLXGetVisualConfigsReal(__GLXclientState * a_cl,
     }
     EPHYR_LOG("num_visuals:%d, num_props:%d\n", num_visuals, num_props);
 
-    reply.numVisuals = num_visuals;
-    reply.numProps = num_props;
-    reply.length = (num_visuals * __GLX_SIZE_CARD32 * num_props) >> 2;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXGetVisualConfigsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = (num_visuals * __GLX_SIZE_CARD32 * num_props) >> 2,
+        .numVisuals = num_visuals,
+        .numProps = num_props
+    };
 
     if (a_do_swap) {
         __GLX_SWAP_SHORT(&reply.sequenceNumber);
@@ -228,7 +232,7 @@ ephyrGLXGetVisualConfigsReal(__GLXclientState * a_cl,
         __GLX_SWAP_INT(&reply.numProps);
         __GLX_SWAP_INT_ARRAY(props_buf, num_props);
     }
-    WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
+    WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply);
     props_per_visual_size = props_buf_size / num_visuals;
     for (i = 0; i < num_visuals; i++) {
         WriteToClient(client,
@@ -269,11 +273,13 @@ ephyrGLXGetFBConfigsSGIXReal(__GLXclientState * a_cl,
     }
     EPHYR_LOG("num_visuals:%d, num_props:%d\n", num_visuals, num_props);
 
-    reply.numVisuals = num_visuals;
-    reply.numProps = num_props;
-    reply.length = props_buf_size >> 2;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xGLXGetVisualConfigsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = props_buf_size >> 2,
+        .numVisuals = num_visuals,
+        .numProps = num_props
+    };
 
     if (a_do_swap) {
         __GLX_SWAP_SHORT(&reply.sequenceNumber);
@@ -282,7 +288,7 @@ ephyrGLXGetFBConfigsSGIXReal(__GLXclientState * a_cl,
         __GLX_SWAP_INT(&reply.numProps);
         __GLX_SWAP_INT_ARRAY(props_buf, num_props);
     }
-    WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
+    WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply);
     props_per_visual_size = props_buf_size / num_visuals;
     for (i = 0; i < num_visuals; i++) {
         WriteToClient(client,
@@ -351,7 +357,7 @@ ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc)
     ClientPtr client = a_cl->client;
     xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) a_pc;
     xGLXQueryServerStringReply reply;
-    char *server_string = NULL, *buf = NULL;
+    char *server_string = NULL;
     int length = 0;
 
     EPHYR_LOG("enter\n");
@@ -364,18 +370,14 @@ ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc)
     }
     EPHYR_LOG("string: %s\n", server_string);
     length = strlen(server_string) + 1;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = __GLX_PAD(length) >> 2;
-    reply.n = length;
-    buf = calloc(reply.length << 2, 1);
-    if (!buf) {
-        EPHYR_LOG_ERROR("failed to allocate string\n;");
-        return BadAlloc;
-    }
-    memcpy(buf, server_string, length);
-
-    WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) &reply);
+    reply = (xGLXQueryServerStringReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = __GLX_PAD(length) >> 2,
+        .n = length
+    };
+
+    WriteToClient(client, sz_xGLXQueryServerStringReply, &reply);
     WriteToClient(client, (int) (reply.length << 2), server_string);
 
     res = Success;
@@ -385,9 +387,6 @@ ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc)
     free(server_string);
     server_string = NULL;
 
-    free(buf);
-    buf = NULL;
-
     return res;
 }
 
@@ -512,6 +511,7 @@ ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap)
     xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc;
     xGLXMakeCurrentReply reply;
     DrawablePtr drawable = NULL;
+    GLXContextTag contextTag = 0;
     int rc = 0;
 
     EPHYR_LOG("enter\n");
@@ -521,24 +521,26 @@ ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap)
     EPHYR_RETURN_VAL_IF_FAIL(drawable->pScreen, BadValue);
     EPHYR_LOG("screen nummber requested:%d\n", drawable->pScreen->myNum);
 
-    memset(&reply, 0, sizeof(reply));
     if (!ephyrHostGLXMakeCurrent(hostx_get_window(drawable->pScreen->myNum),
                                  req->context,
                                  req->oldContextTag,
-                                 (int *) &reply.contextTag)) {
+                                 (int *) &contextTag)) {
         EPHYR_LOG_ERROR("ephyrHostGLXMakeCurrent() failed\n");
         goto out;
     }
-    reply.length = 0;
-    reply.type = X_Reply;
-    reply.sequenceNumber = a_cl->client->sequence;
+    reply = (xGLXMakeCurrentReply) {
+        .type = X_Reply,
+        .sequenceNumber = a_cl->client->sequence,
+        .length = 0,
+        .contextTag = contextTag
+    };
     if (a_do_swap) {
         __GLX_DECLARE_SWAP_VARIABLES;
         __GLX_SWAP_SHORT(&reply.sequenceNumber);
         __GLX_SWAP_INT(&reply.length);
         __GLX_SWAP_INT(&reply.contextTag);
     }
-    WriteToClient(a_cl->client, sz_xGLXMakeCurrentReply, (char *) &reply);
+    WriteToClient(a_cl->client, sz_xGLXMakeCurrentReply, &reply);
 
     res = Success;
  out:
@@ -601,7 +603,7 @@ ephyrGLXGetStringReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap)
         __GLX_SWAP_REPLY_SIZE();
         __GLX_SWAP_REPLY_HEADER();
     }
-    WriteToClient(client, length, (char *) string);
+    WriteToClient(client, length, string);
 
     res = Success;
  out:
@@ -681,16 +683,18 @@ ephyrGLXIsDirectReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap)
 
     EPHYR_LOG("enter\n");
 
-    memset(&reply, 0, sizeof(reply));
     if (!ephyrHostIsContextDirect(req->context, (int *) &is_direct)) {
         EPHYR_LOG_ERROR("ephyrHostIsContextDirect() failed\n");
         goto out;
     }
-    reply.isDirect = is_direct;
-    reply.length = 0;
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    WriteToClient(client, sz_xGLXIsDirectReply, (char *) &reply);
+    reply = (xGLXIsDirectReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .isDirect = is_direct
+    };
+
+    WriteToClient(client, sz_xGLXIsDirectReply, &reply);
     res = Success;
 
  out:
diff --git a/hw/kdrive/ephyr/ephyrhostproxy.c b/hw/kdrive/ephyr/ephyrhostproxy.c
new file mode 100644 (file)
index 0000000..410e6b6
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Xephyr - A kdrive X server thats runs in a host X window.
+ *          Authored by Matthew Allum <mallum@openedhand.com>
+ * 
+ * Copyright © 2007 OpenedHand Ltd 
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of OpenedHand Ltd not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. OpenedHand Ltd makes no
+ * representations about the suitability of this software for any purpose.  It
+ * is provided "as is" without express or implied warranty.
+ *
+ * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors:
+ *    Dodji Seketeli <dodji@openedhand.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <kdrive-config.h>
+#endif
+
+#include <X11/Xlibint.h>
+#define _HAVE_XALLOC_DECLS
+#include "ephyrlog.h"
+#include "ephyrhostproxy.h"
+#include "hostx.h"
+
+/* byte swap a short */
+#define swaps(x, n) { \
+    n = ((char *) (x))[0];\
+    ((char *) (x))[0] = ((char *) (x))[1];\
+    ((char *) (x))[1] = n; }
+
+#define GetXReq(req) \
+    WORD64ALIGN ;\
+    if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\
+            _XFlush(dpy);\
+    req = (xReq *)(dpy->last_req = dpy->bufptr);\
+    dpy->bufptr += SIZEOF(xReq);\
+    dpy->request++
+
+Bool
+ephyrHostProxyDoForward(pointer a_request_buffer,
+                        struct XReply *a_reply, Bool a_do_swap)
+{
+    Bool is_ok = FALSE;
+    int n = 0;
+    Display *dpy = hostx_get_display();
+    xReq *in_req = (xReq *) a_request_buffer;
+    xReq *forward_req = NULL;
+    struct XReply reply;
+
+    EPHYR_RETURN_VAL_IF_FAIL(in_req && dpy, FALSE);
+
+    EPHYR_LOG("enter\n");
+
+    if (a_do_swap) {
+        swaps(&in_req->length);
+    }
+    EPHYR_LOG("Req {type:%d, data:%d, length:%d}\n",
+              in_req->reqType, in_req->data, in_req->length);
+    GetXReq(forward_req);
+    memmove(forward_req, in_req, 4);
+
+    if (!_XReply(dpy, (xReply *) & reply, 0, FALSE)) {
+        EPHYR_LOG_ERROR("failed to get reply\n");
+        goto out;
+    }
+    EPHYR_LOG("XReply{type:%d, foo:%d, seqnum:%d, length:%d}\n",
+              reply.type, reply.foo, reply.sequence_number, reply.length);
+
+    if (a_reply) {
+        memmove(a_reply, &reply, sizeof(reply));
+    }
+    is_ok = TRUE;
+
+ out:
+    EPHYR_LOG("leave\n");
+    return is_ok;
+}
diff --git a/hw/kdrive/ephyr/ephyrhostproxy.h b/hw/kdrive/ephyr/ephyrhostproxy.h
new file mode 100644 (file)
index 0000000..1372160
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Xephyr - A kdrive X server thats runs in a host X window.
+ *          Authored by Matthew Allum <mallum@openedhand.com>
+ * 
+ * Copyright © 2007 OpenedHand Ltd 
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of OpenedHand Ltd not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. OpenedHand Ltd makes no
+ * representations about the suitability of this software for any purpose.  It
+ * is provided "as is" without express or implied warranty.
+ *
+ * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors:
+ *    Dodji Seketeli <dodji@openedhand.com>
+ */
+
+#ifndef __EPHYRHOSTPROXY_H__
+#define __EPHYRHOSTPROXY_H__
+
+struct XReply {
+    int8_t type;                /*X_Reply */
+    int8_t foo;
+    int16_t sequence_number;
+    int32_t length;
+    /*following is some data up to 32 bytes lenght */
+    int32_t pad0;
+    int32_t pad1;
+    int32_t pad2;
+    int32_t pad3;
+    int32_t pad4;
+    int32_t pad5;
+};
+
+Bool
+
+ephyrHostProxyDoForward(pointer a_request_buffer,
+                        struct XReply *a_reply, Bool a_do_swap);
+
+#endif /*__EPHYRHOSTPROXY_H__*/
index a62b49d..5e2eb67 100644 (file)
@@ -36,7 +36,6 @@ extern Bool kdHasKbd;
 
 #ifdef GLXEXT
 extern Bool ephyrNoDRI;
-extern Bool noGlxVisualInit;
 #endif
 extern Bool ephyrNoXV;
 
@@ -233,7 +232,6 @@ ddxProcessArgument(int argc, char **argv, int i)
     }
 #ifdef GLXEXT
     else if (!strcmp(argv[i], "-nodri")) {
-        noGlxVisualInit = FALSE;
         ephyrNoDRI = TRUE;
         EPHYR_LOG("no direct rendering enabled\n");
         return 1;
diff --git a/hw/kdrive/ephyr/ephyrproxyext.c b/hw/kdrive/ephyr/ephyrproxyext.c
new file mode 100644 (file)
index 0000000..c24238c
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Xephyr - A kdrive X server thats runs in a host X window.
+ *          Authored by Matthew Allum <mallum@openedhand.com>
+ * 
+ * Copyright © 2007 OpenedHand Ltd 
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of OpenedHand Ltd not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. OpenedHand Ltd makes no
+ * representations about the suitability of this software for any purpose.  It
+ * is provided "as is" without express or implied warranty.
+ *
+ * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors:
+ *    Dodji Seketeli <dodji@openedhand.com>
+ */
+
+/*
+ * \file
+ * This file defines a proxy extension that forwards requests.
+ * When a request to extension FOO is sent to Xephyr, that request is forwared
+ * to the host X, without even trying to know what the request means.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <kdrive-config.h>
+#endif
+
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "ephyrproxyext.h"
+#define _HAVE_XALLOC_DECLS
+#include "ephyrlog.h"
+#include "ephyrhostproxy.h"
+#include "hostx.h"
+
+static Bool ephyrProxyGetHostExtensionInfo(const char *a_ext_name,
+                                           int *a_major_opcode,
+                                           int *a_first_event,
+                                           int *a_first_error);
+
+static int ephyrProxyProcDispatch(ClientPtr client);
+
+static Bool
+ephyrProxyGetHostExtensionInfo(const char *a_ext_name,
+                               int *a_major_opcode,
+                               int *a_first_event, int *a_first_error)
+{
+    return hostx_get_extension_info(a_ext_name, a_major_opcode,
+                                    a_first_event, a_first_error);
+}
+
+static int
+ephyrProxyProcDispatch(ClientPtr a_client)
+{
+    int res = BadImplementation;
+    struct XReply reply;
+
+    if (!ephyrHostProxyDoForward(a_client->requestBuffer, &reply, FALSE)) {
+        EPHYR_LOG_ERROR("forwarding failed\n");
+        goto out;
+    }
+    reply.sequence_number = a_client->sequence;
+    res = Success;
+
+    WriteToClient(a_client, 32, &reply);
+
+ out:
+    return res;
+}
+
+static void
+ephyrProxyProcReset(ExtensionEntry * a_entry)
+{
+}
+
+Bool
+ephyrProxyExtensionInit(const char *a_extension_name)
+{
+    Bool is_ok = FALSE;
+    int major_opcode = 0, first_event = 0, first_error = 0;
+    ExtensionEntry *ext = NULL;
+
+    if (!ephyrProxyGetHostExtensionInfo(a_extension_name,
+                                        &major_opcode,
+                                        &first_event, &first_error)) {
+        EPHYR_LOG("failed to query extension %s from host\n", a_extension_name);
+        goto out;
+    }
+    ext = AddExtension((char *) a_extension_name, 0, 0,
+                       ephyrProxyProcDispatch,
+                       ephyrProxyProcDispatch,
+                       ephyrProxyProcReset, StandardMinorOpcode);
+    if (!ext) {
+        EPHYR_LOG_ERROR("failed to add the extension\n");
+        goto out;
+    }
+    is_ok = TRUE;
+
+ out:
+    EPHYR_LOG("leave\n");
+    return is_ok;
+}
diff --git a/hw/kdrive/ephyr/ephyrproxyext.h b/hw/kdrive/ephyr/ephyrproxyext.h
new file mode 100644 (file)
index 0000000..018b69b
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Xephyr - A kdrive X server thats runs in a host X window.
+ *          Authored by Matthew Allum <mallum@openedhand.com>
+ * 
+ * Copyright © 2007 OpenedHand Ltd 
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of OpenedHand Ltd not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. OpenedHand Ltd makes no
+ * representations about the suitability of this software for any purpose.  It
+ * is provided "as is" without express or implied warranty.
+ *
+ * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors:
+ *    Dodji Seketeli <dodji@openedhand.com>
+ */
+#ifndef __EPHYRPROXYEXT_H__
+#define __EPHYRPROXYEXT_H__
+
+Bool ephyrProxyExtensionInit(const char *a_extension_name);
+
+#endif /*__EPHYRPROXYEXT_H__*/
index 6988f16..02729d6 100644 (file)
@@ -345,7 +345,11 @@ hostx_init(void)
     attr.event_mask =
         ButtonPressMask
         | ButtonReleaseMask
-        | PointerMotionMask | KeyPressMask | KeyReleaseMask | ExposureMask;
+        | PointerMotionMask
+        | KeyPressMask
+        | KeyReleaseMask
+        | ExposureMask
+        | StructureNotifyMask;
 
     EPHYR_DBG("mark");
 
@@ -693,12 +697,14 @@ hostx_screen_init(EphyrScreenInfo screen,
     XResizeWindow(HostX.dpy, host_screen->win, width, height);
 
     /* Ask the WM to keep our size static */
-    size_hints = XAllocSizeHints();
-    size_hints->max_width = size_hints->min_width = width;
-    size_hints->max_height = size_hints->min_height = height;
-    size_hints->flags = PMinSize | PMaxSize;
-    XSetWMNormalHints(HostX.dpy, host_screen->win, size_hints);
-    XFree(size_hints);
+    if (host_screen->win_pre_existing == None) {
+        size_hints = XAllocSizeHints();
+        size_hints->max_width = size_hints->min_width = width;
+        size_hints->max_height = size_hints->min_height = height;
+        size_hints->flags = PMinSize | PMaxSize;
+        XSetWMNormalHints(HostX.dpy, host_screen->win, size_hints);
+        XFree(size_hints);
+    }
 
     XMapWindow(HostX.dpy, host_screen->win);
 
@@ -1001,6 +1007,22 @@ hostx_get_event(EphyrHostXEvent * ev)
             ev->data.key_up.scancode = xev.xkey.keycode;
             return 1;
 
+        case ConfigureNotify:
+        {
+            struct EphyrHostScreen *host_screen =
+                host_screen_from_window(xev.xconfigure.window);
+
+            if (host_screen && host_screen->win_pre_existing != None) {
+                ev->type = EPHYR_EV_CONFIGURE;
+                ev->data.configure.width = xev.xconfigure.width;
+                ev->data.configure.height = xev.xconfigure.height;
+                ev->data.configure.window = xev.xconfigure.window;
+                ev->data.configure.screen = host_screen->mynum;
+                return 1;
+            }
+
+            return 0;
+        }
         default:
             break;
 
index d621711..31c4053 100644 (file)
@@ -47,7 +47,8 @@ typedef enum EphyrHostXEventType {
     EPHYR_EV_MOUSE_RELEASE,
     EPHYR_EV_KEY_PRESS,
     EPHYR_EV_KEY_RELEASE,
-    EPHYR_EV_EXPOSE
+    EPHYR_EV_EXPOSE,
+    EPHYR_EV_CONFIGURE,
 } EphyrHostXEventType;
 
 /* I can't believe it's not a KeySymsRec. */
@@ -89,6 +90,13 @@ struct EphyrHostXEvent {
             int window;
         } expose;
 
+        struct configure {
+            int width;
+            int height;
+            int screen;
+            int window;
+        } configure;
+
     } data;
 
     int key_state;
diff --git a/hw/kdrive/fbdev/Xfbdev.man b/hw/kdrive/fbdev/Xfbdev.man
new file mode 100644 (file)
index 0000000..bfdae16
--- /dev/null
@@ -0,0 +1,28 @@
+.\" $RCSId: xc/programs/Xserver/hw/kdrive/fbdev/Xfbdev.man,v 1.4 2001/01/27 18:20:40 dawes Exp $
+.\"
+.TH Xfbdev 1 __vendorversion__
+.SH NAME
+Xfbdev \- Linux framebuffer device tiny X server
+.SH SYNOPSIS
+.B Xfbdev
+.RI [ :display ] 
+.RI [ option ...]
+.SH DESCRIPTION
+.B Xfbdev
+is a generic X server for Linux.
+.B Xfbdev
+doesn't know about any particular hardware, and uses the framebuffer
+provided by the Linux framebuffer device.
+.SH OPTIONS
+.B Xfbdev
+accepts the common options of the Xkdrive family of servers.  Please
+see Xkdrive(1).
+.SH KEYBOARD
+To be written.
+.SH SEE ALSO
+X(__miscmansuffix__), Xserver(1), Xkdrive(1), xdm(1), xinit(1).
+.SH AUTHORS
+The
+.B Xfbdev
+server was written by Keith Packard.
+
index f65ab96..7d9bf9d 100644 (file)
@@ -606,7 +606,7 @@ KdCreateScreenResources(ScreenPtr pScreen)
 }
 
 Bool
-KdCloseScreen(int index, ScreenPtr pScreen)
+KdCloseScreen(ScreenPtr pScreen)
 {
     KdScreenPriv(pScreen);
     KdScreenInfo *screen = pScreenPriv->screen;
@@ -616,7 +616,7 @@ KdCloseScreen(int index, ScreenPtr pScreen)
     pScreenPriv->closed = TRUE;
     pScreen->CloseScreen = pScreenPriv->CloseScreen;
     if (pScreen->CloseScreen)
-        ret = (*pScreen->CloseScreen) (index, pScreen);
+        ret = (*pScreen->CloseScreen) (pScreen);
     else
         ret = TRUE;
 
@@ -730,22 +730,22 @@ KdSetSubpixelOrder(ScreenPtr pScreen, Rotation randr)
         int subpixel_order;
         Rotation direction;
     } orders[] = {
-        {
-        SubPixelHorizontalRGB, RR_Rotate_0}, {
-        SubPixelHorizontalBGR, RR_Rotate_180}, {
-        SubPixelVerticalRGB, RR_Rotate_270}, {
-    SubPixelVerticalBGR, RR_Rotate_90},};
+        {SubPixelHorizontalRGB, RR_Rotate_0},
+        {SubPixelHorizontalBGR, RR_Rotate_180},
+        {SubPixelVerticalRGB, RR_Rotate_270},
+        {SubPixelVerticalBGR, RR_Rotate_90},
+    };
 
     static struct {
         int bit;
         int normal;
         int reflect;
     } reflects[] = {
-        {
-        RR_Reflect_X, SubPixelHorizontalRGB, SubPixelHorizontalBGR}, {
-        RR_Reflect_X, SubPixelHorizontalBGR, SubPixelHorizontalRGB}, {
-        RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalBGR}, {
-    RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalRGB},};
+        {RR_Reflect_X, SubPixelHorizontalRGB, SubPixelHorizontalBGR},
+        {RR_Reflect_X, SubPixelHorizontalBGR, SubPixelHorizontalRGB},
+        {RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalBGR},
+        {RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalRGB},
+    };
 
     /* map subpixel to direction */
     for (i = 0; i < 4; i++)
@@ -776,7 +776,7 @@ KdSetSubpixelOrder(ScreenPtr pScreen, Rotation randr)
 static KdScreenInfo *kdCurrentScreen;
 
 Bool
-KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
+KdScreenInit(ScreenPtr pScreen, int argc, char **argv)
 {
     KdScreenInfo *screen = kdCurrentScreen;
     KdCardInfo *card = screen->card;
@@ -1104,7 +1104,7 @@ KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
 }
 
 void
-OsVendorFatalError(void)
+OsVendorFatalError(const char *f, va_list args)
 {
 }
 
index 6c2f293..b37041f 100644 (file)
@@ -442,13 +442,13 @@ Bool
  KdCreateScreenResources(ScreenPtr pScreen);
 
 Bool
- KdCloseScreen(int index, ScreenPtr pScreen);
+ KdCloseScreen(ScreenPtr pScreen);
 
 Bool
  KdSaveScreen(ScreenPtr pScreen, int on);
 
 Bool
- KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv);
+ KdScreenInit(ScreenPtr pScreen, int argc, char **argv);
 
 void
 
@@ -537,13 +537,11 @@ void
 
 void
 
-KdBlockHandler(int screen,
-               pointer blockData, pointer timeout, pointer readmask);
+KdBlockHandler(ScreenPtr pScreen, pointer timeout, pointer readmask);
 
 void
 
-KdWakeupHandler(int screen,
-                pointer data, unsigned long result, pointer readmask);
+KdWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer readmask);
 
 void
  KdDisableInput(void);
@@ -552,9 +550,6 @@ void
  KdEnableInput(void);
 
 void
- ProcessInputEvents(void);
-
-void
  KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration);
 
 /* kmode.c */
index 692e511..d35dcf8 100644 (file)
@@ -102,26 +102,6 @@ KdSigio(int sig)
         (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure);
 }
 
-static void
-KdBlockSigio(void)
-{
-    sigset_t set;
-
-    sigemptyset(&set);
-    sigaddset(&set, SIGIO);
-    sigprocmask(SIG_BLOCK, &set, 0);
-}
-
-static void
-KdUnblockSigio(void)
-{
-    sigset_t set;
-
-    sigemptyset(&set);
-    sigaddset(&set, SIGIO);
-    sigprocmask(SIG_UNBLOCK, &set, 0);
-}
-
 #ifdef DEBUG_SIGIO
 
 void
@@ -261,7 +241,7 @@ KdDisableInput(void)
     KdPointerInfo *pi;
     int found = 0, i = 0;
 
-    KdBlockSigio();
+    OsBlockSIGIO();
 
     for (ki = kdKeyboards; ki; ki = ki->next) {
         if (ki->driver && ki->driver->Disable)
@@ -340,9 +320,10 @@ KdEnableInput(void)
 
     /* reset screen saver */
     ev.any.time = GetTimeInMillis();
-    NoticeEventTime(&ev);
+    NoticeEventTime(&ev, pi->dixdev);
+    NoticeEventTime(&ev, ki->dixdev);
 
-    KdUnblockSigio();
+    OsReleaseSIGIO();
 }
 
 static KdKeyboardDriver *
@@ -701,8 +682,6 @@ KdKbdCtrl(DeviceIntPtr pDevice, KeybdCtrl * ctrl)
     ki->bellDuration = ctrl->bell_duration;
 }
 
-extern KeybdCtrl defaultKeyboardControl;
-
 static int
 KdKeyboardProc(DeviceIntPtr pDevice, int onoff)
 {
@@ -1055,7 +1034,7 @@ KdGetOptions(InputOption **options, char *string)
 
     if (strchr(string, '=')) {
         tam_key = (strchr(string, '=') - string);
-        key = strndup(string, tam_key);
+        key = strndup(string, tam_key + 1);
         if (!key)
             goto out;
 
@@ -1802,7 +1781,7 @@ KdReleaseAllKeys(void)
     int key;
     KdKeyboardInfo *ki;
 
-    KdBlockSigio();
+    OsBlockSIGIO();
 
     for (ki = kdKeyboards; ki; ki = ki->next) {
         for (key = ki->keySyms.minKeyCode; key < ki->keySyms.maxKeyCode; key++) {
@@ -1813,7 +1792,7 @@ KdReleaseAllKeys(void)
         }
     }
 
-    KdUnblockSigio();
+    OsReleaseSIGIO();
 #endif
 }
 
@@ -1973,7 +1952,7 @@ _KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z,
 }
 
 void
-KdBlockHandler(int screen, pointer blockData, pointer timeout, pointer readmask)
+KdBlockHandler(ScreenPtr pScreen, pointer timeout, pointer readmask)
 {
     KdPointerInfo *pi;
     int myTimeout = 0;
@@ -1999,8 +1978,7 @@ KdBlockHandler(int screen, pointer blockData, pointer timeout, pointer readmask)
 }
 
 void
-KdWakeupHandler(int screen,
-                pointer data, unsigned long lresult, pointer readmask)
+KdWakeupHandler(ScreenPtr pScreen, unsigned long lresult, pointer readmask)
 {
     int result = (int) lresult;
     fd_set *pReadmask = (fd_set *) readmask;
@@ -2010,18 +1988,18 @@ KdWakeupHandler(int screen,
     if (kdInputEnabled && result > 0) {
         for (i = 0; i < kdNumInputFds; i++)
             if (FD_ISSET(kdInputFds[i].fd, pReadmask)) {
-                KdBlockSigio();
+                OsBlockSIGIO();
                 (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure);
-                KdUnblockSigio();
+                OsReleaseSIGIO();
             }
     }
     for (pi = kdPointers; pi; pi = pi->next) {
         if (pi->timeoutPending) {
             if ((long) (GetTimeInMillis() - pi->emulationTimeout) >= 0) {
                 pi->timeoutPending = FALSE;
-                KdBlockSigio();
+                OsBlockSIGIO();
                 KdReceiveTimeout(pi);
-                KdUnblockSigio();
+                OsReleaseSIGIO();
             }
         }
     }
@@ -2118,10 +2096,10 @@ int KdCurScreen;                /* current event screen */
 static void
 KdWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
-    KdBlockSigio();
+    OsBlockSIGIO();
     KdCurScreen = pScreen->myNum;
     miPointerWarpCursor(pDev, pScreen, x, y);
-    KdUnblockSigio();
+    OsReleaseSIGIO();
 }
 
 miPointerScreenFuncRec kdPointerScreenFuncs = {
index 7097aee..cf65636 100644 (file)
@@ -58,7 +58,7 @@ of the copyright holder.
 
 /* XvScreenRec fields */
 
-static Bool KdXVCloseScreen(int, ScreenPtr);
+static Bool KdXVCloseScreen(ScreenPtr);
 static int KdXVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *);
 
 /* XvAdaptorRec fields */
@@ -107,10 +107,6 @@ static DevPrivateKey KdXvScreenKey;
 static unsigned long KdXVGeneration = 0;
 static unsigned long PortResource = 0;
 
-DevPrivateKey (*XvGetScreenKeyProc) (void) = XvGetScreenKey;
-unsigned long (*XvGetRTPortProc) (void) = XvGetRTPort;
-int (*XvScreenInitProc) (ScreenPtr) = XvScreenInit;
-
 #define GET_XV_SCREEN(pScreen) ((XvScreenPtr) \
     dixLookupPrivate(&(pScreen)->devPrivates, KdXvScreenKey))
 
@@ -186,17 +182,17 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr * adaptors, int num)
     if (KdXVGeneration != serverGeneration)
         KdXVGeneration = serverGeneration;
 
-    if (!XvGetScreenKeyProc || !XvGetRTPortProc || !XvScreenInitProc)
+    if (noXvExtension)
         return FALSE;
 
     if (!dixRegisterPrivateKey(&KdXVWindowKeyRec, PRIVATE_WINDOW, 0))
         return FALSE;
 
-    if (Success != (*XvScreenInitProc) (pScreen))
+    if (Success != XvScreenInit(pScreen))
         return FALSE;
 
-    KdXvScreenKey = (*XvGetScreenKeyProc) ();
-    PortResource = (*XvGetRTPortProc) ();
+    KdXvScreenKey = XvGetScreenKey();
+    PortResource = XvGetRTPort();
 
     pxvs = GET_XV_SCREEN(pScreen);
 
@@ -1118,7 +1114,7 @@ KdXVClipNotify(WindowPtr pWin, int dx, int dy)
 /**** Required XvScreenRec fields ****/
 
 static Bool
-KdXVCloseScreen(int i, ScreenPtr pScreen)
+KdXVCloseScreen(ScreenPtr pScreen)
 {
     XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
     KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen);
index 2d679a5..955624f 100644 (file)
@@ -219,7 +219,7 @@ OsVendorInit(void)
 }
 
 void
-OsVendorFatalError(void)
+OsVendorFatalError(const char *f, va_list args)
 {
 }
 
@@ -760,9 +760,9 @@ static miPointerScreenFuncRec vfbPointerCursorFuncs = {
 };
 
 static Bool
-vfbCloseScreen(int index, ScreenPtr pScreen)
+vfbCloseScreen(ScreenPtr pScreen)
 {
-    vfbScreenInfoPtr pvfb = &vfbScreens[index];
+    vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
     int i;
 
     pScreen->CloseScreen = pvfb->closeScreen;
@@ -774,13 +774,20 @@ vfbCloseScreen(int index, ScreenPtr pScreen)
     for (i = 0; i < screenInfo.numScreens; i++)
         SetInstalledColormap(screenInfo.screens[i], NULL);
 
-    return pScreen->CloseScreen(index, pScreen);
+    /*
+     * fb overwrites miCloseScreen, so do this here
+     */
+    if (pScreen->devPrivate)
+        (*pScreen->DestroyPixmap) (pScreen->devPrivate);
+    pScreen->devPrivate = NULL;
+
+    return pScreen->CloseScreen(pScreen);
 }
 
 static Bool
-vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
+vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
 {
-    vfbScreenInfoPtr pvfb = &vfbScreens[index];
+    vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
     int dpix = monitorResolution, dpiy = monitorResolution;
     int ret;
     char *pbits;
index ed46dbb..9f4992c 100644 (file)
@@ -4,8 +4,6 @@ bin_PROGRAMS = Xvfb
 noinst_LIBRARIES = libfbcmap.a
 
 AM_CFLAGS = -DHAVE_DIX_CONFIG_H \
-            -DNO_HW_ONLY_EXTS \
-            -DNO_MODULE_EXTS \
             $(XVFBMODULES_CFLAGS) \
            $(DIX_CFLAGS)
 
index 72be889..c3899b5 100644 (file)
@@ -1,18 +1,18 @@
 
 if DRI
 DRI_SUBDIR = dri
+DRI_LIB = dri/libdri.la
 endif
 
 if DRI2
 DRI2_SUBDIR = dri2
+DRI2_LIB = dri2/libdri2.la
 endif
 
 if XF86UTILS
 XF86UTILS_SUBDIR = utils
 endif
 
-XAA_SUBDIR = xaa
-
 if VGAHW
 VGAHW_SUBDIR = vgahw
 endif
@@ -25,13 +25,13 @@ if INT10MODULE
 INT10_SUBDIR = int10
 endif
 
-SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \
-         ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \
-         loader dixmods exa modes \
-         $(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) doc man
+SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \
+         ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \
+         $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods \
+         fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man
 
 DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
-               parser ramdac shadowfb vbe vgahw xaa \
+               parser ramdac shadowfb vbe vgahw \
                loader dixmods dri dri2 exa modes \
               utils doc man
 
@@ -40,7 +40,8 @@ nodist_Xorg_SOURCES = sdksyms.c
 
 AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
 INCLUDES = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
-       -I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac
+       -I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \
+       -I$(srcdir)/dri -I$(srcdir)/dri2
 
 LOCAL_LIBS = \
             $(MAIN_LIB) \
@@ -54,8 +55,10 @@ LOCAL_LIBS = \
             ramdac/libramdac.la \
             ddc/libddc.la \
             i2c/libi2c.la \
-            dixmods/libxorgxkb.la \
             $(XORG_LIBS) \
+            dixmods/libxorgxkb.la \
+            $(DRI_LIB) \
+            $(DRI2_LIB) \
             $(top_builddir)/mi/libmi.la \
             $(top_builddir)/os/libos.la
 Xorg_LDADD = \
@@ -92,6 +95,9 @@ if INSTALL_SETUID
        chown root $(DESTDIR)$(bindir)/Xorg
        chmod u+s $(DESTDIR)$(bindir)/Xorg
 endif
+if CYGWIN
+       $(INSTALL_DATA) libXorg.exe.a $(DESTDIR)$(libdir)/libXorg.exe.a
+endif
 
 # Use variables from XORG_MANPAGE_SECTIONS and X Server configuration
 # Do not include manpages.am as values are not appropriate for rc files
@@ -103,13 +109,22 @@ xorg.conf.example: xorgconf.cpp
        $(AM_V_GEN)$(SED) $(CONF_SUBSTS) < $(srcdir)/xorgconf.cpp > $@
 
 relink:
-       $(AM_V_at)rm -f Xorg && $(MAKE) Xorg
+       $(AM_V_at)rm -f Xorg$(EXEEXT) && $(MAKE) Xorg$(EXEEXT)
 
 CLEANFILES = sdksyms.c sdksyms.dep
 EXTRA_DIST += sdksyms.sh
 
 sdksyms.dep sdksyms.c: sdksyms.sh
-       CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES)
+       $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES)
 
 SDKSYMS_DEP = sdksyms.dep
 include $(SDKSYMS_DEP)
+
+i2c/libi2c.la:
+       $(AM_V_at)cd i2c && $(MAKE) libi2c.la
+
+dixmods/libdixmods.la:
+       $(AM_V_at)cd dixmods && $(MAKE) libdixmods.la
+
+dixmods/libxorgxkb.la:
+       $(AM_V_at)cd dixmods && $(MAKE) libxorgxkb.la
index 2792177..f8fcde9 100644 (file)
@@ -20,11 +20,16 @@ endif
 
 if DGA
 DGASOURCES = xf86DGA.c
+DGA_SDK = dgaproc.h
+endif
+
+if XORG_BUS_PLATFORM
+PLATSOURCES = xf86platformBus.c
 endif
 
 RANDRSOURCES = xf86RandR.c
 
-BUSSOURCES = xf86fbBus.c xf86noBus.c $(PCI_SOURCES) $(SBUS_SOURCES)
+BUSSOURCES = xf86fbBus.c xf86noBus.c $(PCI_SOURCES) $(SBUS_SOURCES) $(PLATSOURCES)
 
 MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes
 
@@ -41,7 +46,8 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
                       xf86Option.c xf86Init.c \
                       xf86VidMode.c xf86fbman.c xf86cmap.c \
                       xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \
-                      xf86Mode.c xorgHelper.c \
+                      xf86Mode.c xorgHelper.c xf86Extensions.h \
+                     xf86Extensions.c xf86vmode.c \
                       $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES)
 nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h
 libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la
@@ -50,13 +56,14 @@ INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
           -I$(srcdir)/../loader -I$(srcdir)/../parser \
            -I$(srcdir)/../vbe -I$(srcdir)/../int10 \
           -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \
-          -I$(srcdir)/../modes -I$(srcdir)/../ramdac
+          -I$(srcdir)/../modes -I$(srcdir)/../ramdac -I$(srcdir)/../dri2
 
 sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \
               xf86PciInfo.h xf86Priv.h xf86Privstr.h \
               xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \
-              $(XVSDKINCS) $(XF86VMODE_SDK) xorgVersion.h \
-              xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h
+              $(XVSDKINCS) $(XF86VMODE_SDK) $(DGA_SDK) xorgVersion.h \
+              xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h \
+             xaarop.h
 
 DISTCLEANFILES = xf86Build.h
 CLEANFILES = $(BUILT_SOURCES)
@@ -88,7 +95,8 @@ EXTRA_DIST = \
        modeline2c.awk \
        xf86VGAarbiter.h \
        xf86VGAarbiterPriv.h \
-        $(DISTKBDSOURCES)
+        $(DISTKBDSOURCES) \
+       xaarop.h
 
 if LNXACPI
 XORG_CFLAGS += -DHAVE_ACPI
index 0abdfb6..c980bee 100644 (file)
@@ -119,6 +119,23 @@ extern _X_EXPORT unsigned int inb(unsigned long);
 extern _X_EXPORT unsigned int inw(unsigned long);
 extern _X_EXPORT unsigned int inl(unsigned long);
 
+#ifdef __SUNPRO_C
+extern _X_EXPORT unsigned char  xf86ReadMmio8    (void *, unsigned long);
+extern _X_EXPORT unsigned short xf86ReadMmio16Be (void *, unsigned long);
+extern _X_EXPORT unsigned short xf86ReadMmio16Le (void *, unsigned long);
+extern _X_EXPORT unsigned int   xf86ReadMmio32Be (void *, unsigned long);
+extern _X_EXPORT unsigned int   xf86ReadMmio32Le (void *, unsigned long);
+extern _X_EXPORT void xf86WriteMmio8    (void *, unsigned long, unsigned int);
+extern _X_EXPORT void xf86WriteMmio16Be (void *, unsigned long, unsigned int);
+extern _X_EXPORT void xf86WriteMmio16Le (void *, unsigned long, unsigned int);
+extern _X_EXPORT void xf86WriteMmio32Be (void *, unsigned long, unsigned int);
+extern _X_EXPORT void xf86WriteMmio32Le (void *, unsigned long, unsigned int);
+extern _X_EXPORT void xf86WriteMmio8NB    (void *, unsigned long, unsigned int);
+extern _X_EXPORT void xf86WriteMmio16BeNB (void *, unsigned long, unsigned int);
+extern _X_EXPORT void xf86WriteMmio16LeNB (void *, unsigned long, unsigned int);
+extern _X_EXPORT void xf86WriteMmio32BeNB (void *, unsigned long, unsigned int);
+extern _X_EXPORT void xf86WriteMmio32LeNB (void *, unsigned long, unsigned int);
+#endif                          /* _SUNPRO_C */
 #endif                          /* __sparc__,  __arm32__, __alpha__, __nds32__ */
 #endif                          /* __arm__ */
 
similarity index 96%
rename from hw/xfree86/dixmods/extmod/dgaproc.h
rename to hw/xfree86/common/dgaproc.h
index b4e0ddf..e824d30 100644 (file)
@@ -64,6 +64,7 @@ extern _X_EXPORT void
  DGASelectInput(int Index, ClientPtr client, long mask);
 
 extern _X_EXPORT Bool DGAAvailable(int Index);
+extern _X_EXPORT Bool DGAScreenAvailable(ScreenPtr pScreen);
 extern _X_EXPORT Bool DGAActive(int Index);
 extern _X_EXPORT void DGAShutdown(void);
 extern _X_EXPORT void DGAInstallCmap(ColormapPtr cmap);
@@ -106,9 +107,4 @@ extern _X_EXPORT Bool DGAChangePixmapMode(int Index, int *x, int *y, int mode);
 extern _X_EXPORT int DGACreateColormap(int Index, ClientPtr client, int id,
                                        int mode, int alloc);
 
-extern _X_EXPORT unsigned char DGAReqCode;
-extern _X_EXPORT int DGAErrorBase;
-extern _X_EXPORT int DGAEventBase;
-extern _X_EXPORT int *XDGAEventBase;
-
 #endif                          /* __DGAPROC_H */
index aa43237..311d35c 100644 (file)
@@ -39,7 +39,7 @@ typedef union {
     float f;
 } vidMonitorValue;
 
-extern _X_EXPORT void XFree86VidModeExtensionInit(void);
+extern Bool VidModeExtensionInit(ScreenPtr pScreen);
 
 extern _X_EXPORT Bool VidModeAvailable(int scrnIndex);
 extern _X_EXPORT Bool VidModeGetCurrentModeline(int scrnIndex, pointer *mode,
similarity index 79%
rename from hw/xfree86/xaa/xaarop.h
rename to hw/xfree86/common/xaarop.h
index f2acde0..84aa9ba 100644 (file)
@@ -1,30 +1,3 @@
-/*
-
-   int XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop)
-
-       For use with solid fills emulated by solid 8x8 patterns.  You 
-       give it the foreground, planemask and X rop and it will replace 
-       the foreground with a new one and the rop with the appropriate 
-       MS triadic raster op.  The function will return which components 
-       (S-P) need to be enabled.  
-
-   int XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop)
-
-       For use with 8x8 opaque pattern fills.  You give it the foreground,     
-       and background, planemask and X rop and it will replace the 
-       foreground and background with new ones and the rop with the 
-       appropriate MS triadic raster op.  The function will return which 
-       components (S-P) need to be enabled.  
-
-          ROP_PAT - Means to enable 8x8 mono patterns (all bits 
-                    set for solid patterns).  Set the foreground and
-                    background as returned by the function.  
-
-          ROP_SRC - Means a source of color == planemask should be used.
-
-
-*/
-
 #ifndef _XAAROP_H
 #define _XAAROP_H
 
 #define NO_SRC_ROP(rop) \
    ((rop == GXnoop) || (rop == GXset) || (rop == GXclear) || (rop == GXinvert))
 
-extern _X_EXPORT int XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm,
-                                     int *rop);
-extern _X_EXPORT int XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg,
-                                       int pm, int *rop);
-
-/* XXX These four should be static, but it breaks the 6.7.0 ABI. */
-extern _X_EXPORT int XAACopyROP[16];
-extern _X_EXPORT int XAACopyROP_PM[16];
-extern _X_EXPORT int XAAPatternROP[16];
-extern _X_EXPORT int XAAPatternROP_PM[16];
-
-extern _X_EXPORT int XAAGetCopyROP(int i);
-extern _X_EXPORT int XAAGetCopyROP_PM(int i);
-extern _X_EXPORT int XAAGetPatternROP(int i);
-extern _X_EXPORT int XAAGetPatternROP_PM(int i);
-
 #endif                          /* _XAAROP_H */
index fc4c34e..bb2903d 100644 (file)
@@ -71,13 +71,18 @@ extern _X_EXPORT Bool fbSlotClaimed;
 #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
 extern _X_EXPORT Bool sbusSlotClaimed;
 #endif
+
+#if defined(XSERVER_PLATFORM_BUS)
+extern _X_EXPORT int platformSlotClaimed;
+#endif
+
 extern _X_EXPORT confDRIRec xf86ConfigDRI;
 extern _X_EXPORT Bool xf86DRI2Enabled(void);
 
 extern _X_EXPORT Bool VTSwitchEnabled;  /* kbd driver */
 
-#define XF86SCRNINFO(p) ((ScrnInfoPtr)dixLookupPrivate(&(p)->devPrivates, \
-                                                      xf86ScreenKey))
+#define XF86SCRNINFO(p) xf86ScreenToScrn(p)
+
 #define XF86FLIP_PIXELS() \
        do { \
            if (xf86GetFlipPixels()) { \
@@ -97,12 +102,12 @@ extern _X_EXPORT Bool VTSwitchEnabled;  /* kbd driver */
 /* PCI related */
 #ifdef XSERVER_LIBPCIACCESS
 #include <pciaccess.h>
-extern _X_EXPORT Bool pciSlotClaimed;
+extern _X_EXPORT int pciSlotClaimed;
 
 extern _X_EXPORT Bool xf86CheckPciSlot(const struct pci_device *);
 extern _X_EXPORT int xf86ClaimPciSlot(struct pci_device *, DriverPtr drvp,
                                       int chipset, GDevPtr dev, Bool active);
-extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *);
+extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *, GDevPtr dev);
 extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus,
                                             int *device, int *func);
 extern _X_EXPORT Bool xf86ComparePciBusString(const char *busID, int bus,
@@ -244,7 +249,7 @@ extern _X_EXPORT void xf86AddDriver(DriverPtr driver, pointer module,
                                     int flags);
 extern _X_EXPORT void xf86DeleteDriver(int drvIndex);
 extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
-extern _X_EXPORT void xf86DeleteScreen(int scrnIndex, int flags);
+extern _X_EXPORT void xf86DeleteScreen(ScrnInfoPtr pScrn);
 extern _X_EXPORT int xf86AllocateScrnInfoPrivateIndex(void);
 extern _X_EXPORT Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp,
                                        int pad);
@@ -256,7 +261,7 @@ extern _X_EXPORT Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
 extern _X_EXPORT Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
 extern _X_EXPORT void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
 extern _X_EXPORT void xf86SetBlackWhitePixels(ScreenPtr pScreen);
-extern _X_EXPORT void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
+extern _X_EXPORT void xf86EnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable);
 extern _X_EXPORT void
 xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
                 const char *format, va_list args)
@@ -347,7 +352,7 @@ xf86SetBackingStore(ScreenPtr pScreen);
 extern _X_EXPORT void
 xf86SetSilkenMouse(ScreenPtr pScreen);
 extern _X_EXPORT pointer
-xf86FindXvOptions(int scrnIndex, int adapt_index, char *port_name,
+xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, char *port_name,
                   char **adaptor_name, pointer *adaptor_options);
 extern _X_EXPORT void
 xf86GetOS(const char **name, int *major, int *minor, int *teeny);
@@ -357,7 +362,7 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
                    EntityProc enter, EntityProc leave, pointer private);
 
 extern _X_EXPORT Bool
-xf86IsScreenPrimary(int scrnIndex);
+xf86IsScreenPrimary(ScrnInfoPtr pScrn);
 extern _X_EXPORT int
 xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
                                int format, unsigned long len, pointer value);
@@ -417,6 +422,8 @@ extern _X_EXPORT void
 xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
 extern _X_EXPORT DisplayModePtr
 xf86DuplicateMode(const DisplayModeRec * pMode);
+extern _X_EXPORT void
+xf86SaveModeContents(DisplayModePtr intern, const DisplayModeRec * pMode);
 extern _X_EXPORT DisplayModePtr
 xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList);
 extern _X_EXPORT Bool
@@ -444,11 +451,21 @@ xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
                                     Bool resetMode);
 #endif
 
-/* xf86VidModeExtentionInit.c */
+/* xf86Extensions.c */
+extern void xf86ExtensionInit(void);
 
-extern _X_EXPORT Bool
-VidModeExtensionInit(ScreenPtr pScreen);
+/* convert ScreenPtr to ScrnInfoPtr */
+extern _X_EXPORT ScrnInfoPtr xf86ScreenToScrn(ScreenPtr pScreen);
+/* convert ScrnInfoPtr to ScreenPtr */
+extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn);
 
 #endif                          /* _NO_XF86_PROTOTYPES */
 
+#define XF86_HAS_SCRN_CONV 1 /* define for drivers to use in api compat */
+
+#define XF86_SCRN_INTERFACE 1 /* define for drivers to use in api compat */
+
+/* flags passed to xf86 allocate screen */
+#define XF86_ALLOCATE_GPU_SCREEN 1
+
 #endif                          /* _XF86_H */
index 43c746b..95d58fe 100644 (file)
@@ -39,6 +39,7 @@
 #include "xf86Config.h"
 #include "xf86Priv.h"
 #include "xf86_OSlib.h"
+#include "xf86platformBus.h"
 #include "xf86pciBus.h"
 #ifdef __sparc__
 #include "xf86sbusBus.h"
@@ -198,10 +199,13 @@ listPossibleVideoDrivers(char *matches[], int nmatches)
     }
     i = 0;
 
+#ifdef XSERVER_PLATFORM_BUS
+    i = xf86PlatformMatchDriver(matches, nmatches);
+#endif
 #ifdef sun
     /* Check for driver type based on /dev/fb type and if valid, use
        it instead of PCI bus probe results */
-    if (xf86Info.consoleFd >= 0) {
+    if (xf86Info.consoleFd >= 0 && (i < (nmatches - 1))) {
         struct vis_identifier visid;
         const char *cp;
         extern char xf86SolarisFbDev[PATH_MAX];
@@ -251,6 +255,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches)
     }
 #endif
 #ifdef __sparc__
+    if (i < (nmatches - 1))
     {
         char *sbusDriver = sparcDriverName();
 
@@ -259,7 +264,8 @@ listPossibleVideoDrivers(char *matches[], int nmatches)
     }
 #endif
 #ifdef XSERVER_LIBPCIACCESS
-    i = xf86PciMatchDriver(matches, nmatches);
+    if (i < (nmatches - 1))
+        i = xf86PciMatchDriver(matches, nmatches);
 #endif
     /* Fallback to platform default hardware */
     if (i < (nmatches - 1)) {
@@ -270,6 +276,10 @@ listPossibleVideoDrivers(char *matches[], int nmatches)
 #endif
     }
 
+#if defined(__linux__)
+    matches[i++] = xnfstrdup("modesetting");
+#endif
+
 #if !defined(sun)
     /* Fallback to platform default frame buffer driver */
     if (i < (nmatches - 1)) {
index b176e8c..6de8409 100644 (file)
@@ -77,8 +77,14 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only)
 {
     Bool foundScreen = FALSE;
 
+#ifdef XSERVER_PLATFORM_BUS
+    if (drv->platformProbe != NULL) {
+        foundScreen = xf86platformProbeDev(drv);
+    }
+#endif
+
 #ifdef XSERVER_LIBPCIACCESS
-    if (drv->PciProbe != NULL) {
+    if (!foundScreen && (drv->PciProbe != NULL)) {
         if (xf86DoConfigure && xf86DoConfigurePass1) {
             assert(detect_only);
             foundScreen = xf86PciAddMatchingDev(drv);
@@ -179,10 +185,14 @@ xf86BusConfig(void)
             xf86Msg(X_ERROR,
                     "Screen %d deleted because of no matching config section.\n",
                     i);
-            xf86DeleteScreen(i--, 0);
+            xf86DeleteScreen(xf86Screens[i--]);
         }
     }
 
+    /* bind GPU conf screen to protocol screen 0 */
+    for (i = 0; i < xf86NumGPUScreens; i++)
+        xf86GPUScreens[i]->confScreen = xf86Screens[0]->confScreen;
+
     /* If no screens left, return now.  */
     if (xf86NumScreens == 0) {
         xf86Msg(X_ERROR,
@@ -202,6 +212,9 @@ xf86BusConfig(void)
 void
 xf86BusProbe(void)
 {
+#ifdef XSERVER_PLATFORM_BUS
+    xf86platformProbe();
+#endif
 #ifdef XSERVER_LIBPCIACCESS
     xf86PciProbe();
 #endif
@@ -238,6 +251,8 @@ StringToBusType(const char *busID, const char **retID)
         ret = BUS_PCI;
     if (!xf86NameCmp(p, "sbus"))
         ret = BUS_SBUS;
+    if (!xf86NameCmp(p, "platform"))
+        ret = BUS_PLATFORM;
     if (ret != BUS_NONE)
         if (retID)
             *retID = busID + strlen(p) + 1;
@@ -270,6 +285,8 @@ xf86IsEntityPrimary(int entityIndex)
         return pEnt->bus.id.pci == primaryBus.id.pci;
     case BUS_SBUS:
         return pEnt->bus.id.sbus.fbNum == primaryBus.id.sbus.fbNum;
+    case BUS_PLATFORM:
+        return pEnt->bus.id.plat == primaryBus.id.plat;
     default:
         return FALSE;
     }
@@ -377,13 +394,12 @@ xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex)
 }
 
 /*
- * xf86ClearEntitiesForScreen() - called when a screen is deleted
+ * xf86ClearEntityListForScreen() - called when a screen is deleted
  * to mark it's entities unused. Called by xf86DeleteScreen().
  */
 void
-xf86ClearEntityListForScreen(int scrnIndex)
+xf86ClearEntityListForScreen(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     int i, entityIndex;
 
     if (pScrn->entityList == NULL || pScrn->numEntities == 0)
@@ -420,6 +436,26 @@ xf86AddDevToEntity(int entityIndex, GDevPtr dev)
     dev->claimed = TRUE;
 }
 
+
+void
+xf86RemoveDevFromEntity(int entityIndex, GDevPtr dev)
+{
+    EntityPtr pEnt;
+    int i, j;
+    if (entityIndex >= xf86NumEntities)
+        return;
+
+    pEnt = xf86Entities[entityIndex];
+    for (i = 0; i < pEnt->numInstances; i++) {
+        if (pEnt->devices[i] == dev) {
+            for (j = i; j < pEnt->numInstances - 1; j++)
+                pEnt->devices[j] = pEnt->devices[j + 1];
+            break;
+        }
+    }
+    pEnt->numInstances--;
+    dev->claimed = FALSE;
+}
 /*
  * xf86GetEntityInfo() -- This function hands information from the
  * EntityRec struct to the drivers. The EntityRec structure itself
@@ -522,6 +558,9 @@ xf86PostProbe(void)
 #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
                              sbusSlotClaimed ||
 #endif
+#ifdef XSERVER_PLATFORM_BUS
+                             platformSlotClaimed ||
+#endif
 #ifdef XSERVER_LIBPCIACCESS
                              pciSlotClaimed
 #else
index abf2efd..e83ba78 100644 (file)
@@ -42,6 +42,7 @@
 #if defined(__sparc__) || defined(__sparc)
 #include "xf86sbusBus.h"
 #endif
+#include "xf86platformBus.h"
 
 typedef struct {
     DriverPtr driver;
index ec679df..486752b 100644 (file)
 #endif
 
 static ModuleDefault ModuleDefaults[] = {
-    {.name = "extmod",.toLoad = TRUE,.load_opt = NULL},
-#ifdef DBE
-    {.name = "dbe",.toLoad = TRUE,.load_opt = NULL},
-#endif
 #ifdef GLXEXT
     {.name = "glx",.toLoad = TRUE,.load_opt = NULL},
 #endif
-#ifdef XRECORD
-    {.name = "record",.toLoad = TRUE,.load_opt = NULL},
-#endif
-#ifdef XF86DRI
-    {.name = "dri",.toLoad = TRUE,.load_opt = NULL},
-#endif
-#ifdef DRI2
-    {.name = "dri2",.toLoad = TRUE,.load_opt = NULL},
+#ifdef __CYGWIN__
+    /* load DIX modules used by drivers first */
+    {.name = "fb",.toLoad = TRUE,.load_opt = NULL},
+    {.name = "shadow",.toLoad = TRUE,.load_opt = NULL},
 #endif
     {.name = NULL,.toLoad = FALSE,.load_opt = NULL}
 };
@@ -707,7 +699,8 @@ typedef enum {
     FLAG_AUTO_ENABLE_DEVICES,
     FLAG_GLX_VISUALS,
     FLAG_DRI2,
-    FLAG_USE_SIGIO
+    FLAG_USE_SIGIO,
+    FLAG_AUTO_ADD_GPU,
 } FlagValues;
 
 /**
@@ -765,6 +758,8 @@ static OptionInfoRec FlagOptions[] = {
      {0}, FALSE},
     {FLAG_USE_SIGIO, "UseSIGIO", OPTV_BOOLEAN,
      {0}, FALSE},
+    {FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN,
+     {0}, FALSE},
     {-1, NULL, OPTV_NONE,
      {0}, FALSE},
 };
@@ -857,6 +852,16 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
     xf86Msg(from, "%sutomatically enabling devices\n",
             xf86Info.autoEnableDevices ? "A" : "Not a");
 
+    if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_GPU)) {
+        xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_GPU,
+                          &xf86Info.autoAddGPU);
+        from = X_CONFIG;
+    }
+    else {
+        from = X_DEFAULT;
+    }
+    xf86Msg(from, "%sutomatically adding GPU devices\n",
+            xf86Info.autoAddGPU ? "A" : "Not a");
     /*
      * Set things up based on the config file information.  Some of these
      * settings may be overridden later when the command line options are
@@ -2324,6 +2329,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout)
 
                 current = dev;
                 free(*dev);
+                *dev = NULL;
 
                 do {
                     *current = *(current + 1);
index 3716434..65a9e82 100644 (file)
@@ -66,7 +66,7 @@ static Bool xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y);
 static void xf86CrossScreen(ScreenPtr pScreen, Bool entering);
 static void xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
 
-static void xf86PointerMoved(int scrnIndex, int x, int y);
+static void xf86PointerMoved(ScrnInfoPtr pScrn, int x, int y);
 
 static miPointerScreenFuncRec xf86PointerScreenFuncs = {
     xf86CursorOffScreen,
@@ -133,16 +133,15 @@ xf86InitViewport(ScrnInfoPtr pScr)
 void
 xf86SetViewport(ScreenPtr pScreen, int x, int y)
 {
-    ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen);
 
-    (*pScr->PointerMoved) (pScreen->myNum, x, y);
+    (*pScr->PointerMoved) (pScr, x, y);
 }
 
 static void
-xf86PointerMoved(int scrnIndex, int x, int y)
+xf86PointerMoved(ScrnInfoPtr pScr, int x, int y)
 {
     Bool frameChanged = FALSE;
-    ScrnInfoPtr pScr = xf86Screens[scrnIndex];
 
     /*
      * check wether (x,y) belongs to the visual part of the screen
@@ -173,7 +172,7 @@ xf86PointerMoved(int scrnIndex, int x, int y)
     }
 
     if (frameChanged && pScr->AdjustFrame != NULL)
-        pScr->AdjustFrame(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0);
+        pScr->AdjustFrame(pScr, pScr->frameX0, pScr->frameY0);
 }
 
 /*
@@ -184,7 +183,8 @@ xf86PointerMoved(int scrnIndex, int x, int y)
 void
 xf86LockZoom(ScreenPtr pScreen, Bool lock)
 {
-    XF86SCRNINFO(pScreen)->zoomLocked = lock;
+    ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen);
+    pScr->zoomLocked = lock;
 }
 
 /*
@@ -196,10 +196,10 @@ xf86LockZoom(ScreenPtr pScreen, Bool lock)
 Bool
 xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
 {
-    ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen);
     ScreenPtr pCursorScreen;
     Bool Switched;
-    int px, py, was_blocked;
+    int px, py;
     DeviceIntPtr dev, it;
 
     if (!pScr->vtSema || !mode || !pScr->SwitchMode)
@@ -228,8 +228,8 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
     if (pScreen == pCursorScreen)
         miPointerGetPosition(dev, &px, &py);
 
-    was_blocked = xf86BlockSIGIO();
-    Switched = (*pScr->SwitchMode) (pScr->scrnIndex, mode, 0);
+    OsBlockSIGIO();
+    Switched = (*pScr->SwitchMode) (pScr, mode);
     if (Switched) {
         pScr->currentMode = mode;
 
@@ -267,10 +267,10 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
             pScr->frameY1 = pScr->virtualY - 1;
         }
     }
-    xf86UnblockSIGIO(was_blocked);
+    OsReleaseSIGIO();
 
     if (pScr->AdjustFrame)
-        (*pScr->AdjustFrame) (pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0);
+        (*pScr->AdjustFrame) (pScr, pScr->frameX0, pScr->frameY0);
 
     /* The original code centered the frame around the cursor if possible.
      * Since this is hard to achieve with multiple cursors, we do the following:
@@ -316,7 +316,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
 void
 xf86ZoomViewport(ScreenPtr pScreen, int zoom)
 {
-    ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen);
     DisplayModePtr mode;
 
     if (pScr->zoomLocked || !(mode = pScr->currentMode))
@@ -469,13 +469,11 @@ xf86CrossScreen(ScreenPtr pScreen, Bool entering)
 static void
 xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
-    int sigstate;
-
-    sigstate = xf86BlockSIGIO();
+    OsBlockSIGIO();
     miPointerWarpCursor(pDev, pScreen, x, y);
 
     xf86Info.currentScreen = pScreen;
-    xf86UnblockSIGIO(sigstate);
+    OsReleaseSIGIO();
 }
 
 void *
index 316978c..a441dee 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * Copyright (c) 1995  Jon Tombs
+ * Copyright (c) 1995, 1996, 1999  XFree86 Inc
  * Copyright (c) 1998-2002 by The XFree86 Project, Inc.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * Written by Mark Vojkovich
  */
 
+/*
+ * This is quite literally just two files glued together:
+ * hw/xfree86/common/xf86DGA.c is the first part, and
+ * hw/xfree86/dixmods/extmod/xf86dga2.c is the second part.  One day, if
+ * someone actually cares about DGA, it'd be nice to clean this up.  But trust
+ * me, I am not that person.
+ */
+
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
 
+#include <X11/X.h>
+#include <X11/Xproto.h>
 #include "xf86.h"
 #include "xf86str.h"
 #include "xf86Priv.h"
 #include "exevents.h"
 #include "eventstr.h"
 #include "eventconvert.h"
+#include "xf86Extensions.h"
 
 #include "mi.h"
 
+#include "misc.h"
+#include "dixstruct.h"
+#include "dixevents.h"
+#include "extnsionst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "swaprep.h"
+#include "dgaproc.h"
+#include "protocol-versions.h"
+
+#include <string.h>
+
+#define DGA_PROTOCOL_OLD_SUPPORT 1
+
 static DevPrivateKeyRec DGAScreenKeyRec;
 
 #define DGAScreenKeyRegistered dixPrivateKeyRegistered(&DGAScreenKeyRec)
 static Bool mieq_installed;
 
-static Bool DGACloseScreen(int i, ScreenPtr pScreen);
+static Bool DGACloseScreen(ScreenPtr pScreen);
 static void DGADestroyColormap(ColormapPtr pmap);
 static void DGAInstallColormap(ColormapPtr pmap);
 static void DGAUninstallColormap(ColormapPtr pmap);
@@ -66,7 +93,9 @@ static void DGAHandleEvent(int screen_num, InternalEvent *event,
 static void
  DGACopyModeInfo(DGAModePtr mode, XDGAModePtr xmode);
 
-int *XDGAEventBase = NULL;
+static unsigned char DGAReqCode = 0;
+static int DGAErrorBase;
+static int DGAEventBase;
 
 #define DGA_GET_SCREEN_PRIV(pScreen) ((DGAScreenPtr) \
     dixLookupPrivate(&(pScreen)->devPrivates, &DGAScreenKeyRec))
@@ -100,7 +129,7 @@ typedef struct {
 Bool
 DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes, int num)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     DGAScreenPtr pScreenPriv;
     int i;
 
@@ -235,7 +264,7 @@ FreeMarkedVisuals(ScreenPtr pScreen)
 }
 
 static Bool
-DGACloseScreen(int i, ScreenPtr pScreen)
+DGACloseScreen(ScreenPtr pScreen)
 {
     DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
 
@@ -256,7 +285,7 @@ DGACloseScreen(int i, ScreenPtr pScreen)
 
     free(pScreenPriv);
 
-    return ((*pScreen->CloseScreen) (i, pScreen));
+    return ((*pScreen->CloseScreen) (pScreen));
 }
 
 static void
@@ -323,11 +352,10 @@ DGAUninstallColormap(ColormapPtr pmap)
 }
 
 int
-xf86SetDGAMode(int index, int num, DGADevicePtr devRet)
+xf86SetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet)
 {
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     DGAScreenPtr pScreenPriv;
-    ScrnInfoPtr pScrn;
     DGADevicePtr device;
     PixmapPtr pPix = NULL;
     DGAModePtr pMode = NULL;
@@ -338,7 +366,6 @@ xf86SetDGAMode(int index, int num, DGADevicePtr devRet)
     pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
     if (!pScreenPriv)
         return BadValue;
-    pScrn = pScreenPriv->pScrn;
 
     if (!num) {
         if (pScreenPriv->current) {
@@ -359,7 +386,7 @@ xf86SetDGAMode(int index, int num, DGADevicePtr devRet)
                 pScreenPriv->savedColormap = NULL;
             }
             pScreenPriv->dgaColormap = NULL;
-            (*pScrn->EnableDisableFBAccess) (index, TRUE);
+            (*pScrn->EnableDisableFBAccess) (pScrn, TRUE);
 
             FreeMarkedVisuals(pScreen);
         }
@@ -385,7 +412,7 @@ xf86SetDGAMode(int index, int num, DGADevicePtr devRet)
         Bool oldVTSema = pScrn->vtSema;
 
         pScrn->vtSema = FALSE;  /* kludge until we rewrite VT switching */
-        (*pScrn->EnableDisableFBAccess) (index, FALSE);
+        (*pScrn->EnableDisableFBAccess) (pScrn, FALSE);
         pScrn->vtSema = oldVTSema;
     }
 
@@ -523,18 +550,27 @@ DGAChangePixmapMode(int index, int *x, int *y, int mode)
 }
 
 Bool
-DGAAvailable(int index)
+DGAScreenAvailable(ScreenPtr pScreen)
 {
     if (!DGAScreenKeyRegistered)
         return FALSE;
 
-    if (DGA_GET_SCREEN_PRIV(screenInfo.screens[index]))
+    if (DGA_GET_SCREEN_PRIV(pScreen))
         return TRUE;
-
     return FALSE;
 }
 
 Bool
+DGAAvailable(int index)
+{
+    ScreenPtr pScreen;
+
+    assert(index < MAXSCREENS);
+    pScreen = screenInfo.screens[index];
+    return DGAScreenAvailable(pScreen);
+}
+
+Bool
 DGAActive(int index)
 {
     DGAScreenPtr pScreenPriv;
@@ -564,7 +600,7 @@ DGAShutdown(void)
     for (i = 0; i < screenInfo.numScreens; i++) {
         pScrn = xf86Screens[i];
 
-        (void) (*pScrn->SetDGAMode) (pScrn->scrnIndex, 0, NULL);
+        (void) (*pScrn->SetDGAMode) (pScrn, 0, NULL);
     }
 }
 
@@ -579,7 +615,7 @@ DGASetMode(int index, int num, XDGAModePtr mode, PixmapPtr *pPix)
 
     /* We rely on the extension to check that DGA is available */
 
-    ret = (*pScrn->SetDGAMode) (index, num, &device);
+    ret = (*pScrn->SetDGAMode) (pScrn, num, &device);
     if ((ret == Success) && num) {
         DGACopyModeInfo(device.mode, mode);
         *pPix = device.pPix;
@@ -893,15 +929,16 @@ DGAStealKeyEvent(DeviceIntPtr dev, int index, int key_code, int is_down)
     if (!pScreenPriv || !pScreenPriv->grabKeyboard)     /* no direct mode */
         return FALSE;
 
-    memset(&event, 0, sizeof(event));
-    event.header = ET_Internal;
-    event.type = ET_DGAEvent;
-    event.length = sizeof(event);
-    event.time = GetTimeInMillis();
-    event.subtype = (is_down ? ET_KeyPress : ET_KeyRelease);
-    event.detail = key_code;
-    event.dx = 0;
-    event.dy = 0;
+    event = (DGAEvent) {
+        .header = ET_Internal,
+        .type = ET_DGAEvent,
+        .length = sizeof(event),
+        .time = GetTimeInMillis(),
+        .subtype = (is_down ? ET_KeyPress : ET_KeyRelease),
+        .detail = key_code,
+        .dx = 0,
+        .dy = 0
+    };
     mieqEnqueue(dev, (InternalEvent *) &event);
 
     return TRUE;
@@ -921,15 +958,16 @@ DGAStealMotionEvent(DeviceIntPtr dev, int index, int dx, int dy)
     if (!pScreenPriv || !pScreenPriv->grabMouse)        /* no direct mode */
         return FALSE;
 
-    memset(&event, 0, sizeof(event));
-    event.header = ET_Internal;
-    event.type = ET_DGAEvent;
-    event.length = sizeof(event);
-    event.time = GetTimeInMillis();
-    event.subtype = ET_Motion;
-    event.detail = 0;
-    event.dx = dx;
-    event.dy = dy;
+    event = (DGAEvent) {
+        .header = ET_Internal,
+        .type = ET_DGAEvent,
+        .length = sizeof(event),
+        .time = GetTimeInMillis(),
+        .subtype = ET_Motion,
+        .detail = 0,
+        .dx = dx,
+        .dy = dy
+    };
     mieqEnqueue(dev, (InternalEvent *) &event);
     return TRUE;
 }
@@ -948,15 +986,16 @@ DGAStealButtonEvent(DeviceIntPtr dev, int index, int button, int is_down)
     if (!pScreenPriv || !pScreenPriv->grabMouse)
         return FALSE;
 
-    memset(&event, 0, sizeof(event));
-    event.header = ET_Internal;
-    event.type = ET_DGAEvent;
-    event.length = sizeof(event);
-    event.time = GetTimeInMillis();
-    event.subtype = (is_down ? ET_ButtonPress : ET_ButtonRelease);
-    event.detail = button;
-    event.dx = 0;
-    event.dy = 0;
+    event = (DGAEvent) {
+        .header = ET_Internal,
+        .type = ET_DGAEvent,
+        .length = sizeof(event),
+        .time = GetTimeInMillis(),
+        .subtype = (is_down ? ET_ButtonPress : ET_ButtonRelease),
+        .detail = button,
+        .dx = 0,
+        .dy = 0
+    };
     mieqEnqueue(dev, (InternalEvent *) &event);
 
     return TRUE;
@@ -981,16 +1020,15 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd)
     KeyClassPtr keyc = keybd->key;
     DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
     DeviceIntPtr pointer = GetMaster(keybd, POINTER_OR_FLOAT);
-    DeviceEvent ev;
-
-    memset(&ev, 0, sizeof(ev));
-    ev.header = ET_Internal;
-    ev.length = sizeof(ev);
-    ev.detail.key = event->detail;
-    ev.type = event->subtype;
-    ev.root_x = 0;
-    ev.root_y = 0;
-    ev.corestate = XkbStateFieldFromRec(&keyc->xkbInfo->state);
+    DeviceEvent ev = {
+        .header = ET_Internal,
+        .length = sizeof(ev),
+        .detail.key = event->detail,
+        .type = event->subtype,
+        .root_x = 0,
+        .root_y = 0,
+        .corestate = XkbStateFieldFromRec(&keyc->xkbInfo->state)
+    };
     ev.corestate |= pointer->button->state;
 
     UpdateDeviceState(keybd, &ev);
@@ -999,15 +1037,15 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd)
      * Deliver the DGA event
      */
     if (pScreenPriv->client) {
-        dgaEvent de;
-
-        de.u.u.type = *XDGAEventBase + GetCoreType(ev.type);
+        dgaEvent de = {
+            .u.event.time = event->time,
+            .u.event.dx = event->dx,
+            .u.event.dy = event->dy,
+            .u.event.screen = pScreen->myNum,
+            .u.event.state = ev.corestate
+        };
+        de.u.u.type = DGAEventBase + GetCoreType(ev.type);
         de.u.u.detail = event->detail;
-        de.u.event.time = event->time;
-        de.u.event.dx = event->dx;
-        de.u.event.dy = event->dy;
-        de.u.event.screen = pScreen->myNum;
-        de.u.event.state = ev.corestate;
 
         /* If the DGA client has selected input, then deliver based on the usual filter */
         TryClientEvents(pScreenPriv->client, keybd, (xEvent *) &de, 1,
@@ -1032,14 +1070,14 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
 {
     ButtonClassPtr butc = mouse->button;
     DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-    DeviceEvent ev;
     DeviceIntPtr master = GetMaster(mouse, MASTER_KEYBOARD);
+    DeviceEvent ev = {
+        .header = ET_Internal,
+        .length = sizeof(ev),
+        .type = event->subtype,
+        .corestate = butc ? butc->state : 0
+    };
 
-    memset(&ev, 0, sizeof(ev));
-    ev.header = ET_Internal;
-    ev.length = sizeof(ev);
-    ev.type = event->subtype;
-    ev.corestate = butc ? butc->state : 0;
     if (master && master->key)
         ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state);
 
@@ -1049,18 +1087,16 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
      * Deliver the DGA event
      */
     if (pScreenPriv->client) {
-        dgaEvent de;
-        int coreEquiv;
-
-        coreEquiv = GetCoreType(ev.type);
-
-        de.u.u.type = *XDGAEventBase + coreEquiv;
+        int coreEquiv = GetCoreType(ev.type);
+        dgaEvent de = {
+            .u.event.time = event->time,
+            .u.event.dx = event->dx,
+            .u.event.dy = event->dy,
+            .u.event.screen = pScreen->myNum,
+            .u.event.state = ev.corestate
+        };
+        de.u.u.type = DGAEventBase + coreEquiv;
         de.u.u.detail = event->detail;
-        de.u.event.time = event->time;
-        de.u.event.dx = event->dx;
-        de.u.event.dy = event->dy;
-        de.u.event.screen = pScreen->myNum;
-        de.u.event.state = ev.corestate;
 
         /* If the DGA client has selected input, then deliver based on the usual filter */
         TryClientEvents(pScreenPriv->client, mouse, (xEvent *) &de, 1,
@@ -1146,8 +1182,8 @@ DGAHandleEvent(int screen_num, InternalEvent *ev, DeviceIntPtr device)
     DGAScreenPtr pScreenPriv;
 
     /* no DGA */
-    if (!DGAScreenKeyRegistered || XDGAEventBase == 0)
-        return;
+    if (!DGAScreenKeyRegistered || noXFree86DGAExtension)
+       return;
     pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
 
     /* DGA not initialized on this screen */
@@ -1171,3 +1207,989 @@ DGAHandleEvent(int screen_num, InternalEvent *ev, DeviceIntPtr device)
         break;
     }
 }
+
+static void XDGAResetProc(ExtensionEntry * extEntry);
+
+static void DGAClientStateChange(CallbackListPtr *, pointer, pointer);
+
+static DevPrivateKeyRec DGAScreenPrivateKeyRec;
+
+#define DGAScreenPrivateKey (&DGAScreenPrivateKeyRec)
+#define DGAScreenPrivateKeyRegistered (DGAScreenPrivateKeyRec.initialized)
+static DevPrivateKeyRec DGAClientPrivateKeyRec;
+
+#define DGAClientPrivateKey (&DGAClientPrivateKeyRec)
+static int DGACallbackRefCount = 0;
+
+/* This holds the client's version information */
+typedef struct {
+    int major;
+    int minor;
+} DGAPrivRec, *DGAPrivPtr;
+
+#define DGA_GETCLIENT(idx) ((ClientPtr) \
+    dixLookupPrivate(&screenInfo.screens[idx]->devPrivates, DGAScreenPrivateKey))
+#define DGA_SETCLIENT(idx,p) \
+    dixSetPrivate(&screenInfo.screens[idx]->devPrivates, DGAScreenPrivateKey, p)
+
+#define DGA_GETPRIV(c) ((DGAPrivPtr) \
+    dixLookupPrivate(&(c)->devPrivates, DGAClientPrivateKey))
+#define DGA_SETPRIV(c,p) \
+    dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p)
+
+static void
+XDGAResetProc(ExtensionEntry * extEntry)
+{
+    DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL);
+    DGACallbackRefCount = 0;
+}
+
+static int
+ProcXDGAQueryVersion(ClientPtr client)
+{
+    xXDGAQueryVersionReply rep;
+
+    REQUEST_SIZE_MATCH(xXDGAQueryVersionReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+    rep.majorVersion = SERVER_XDGA_MAJOR_VERSION;
+    rep.minorVersion = SERVER_XDGA_MINOR_VERSION;
+
+    WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *) &rep);
+    return Success;
+}
+
+static int
+ProcXDGAOpenFramebuffer(ClientPtr client)
+{
+    REQUEST(xXDGAOpenFramebufferReq);
+    xXDGAOpenFramebufferReply rep;
+    char *deviceName;
+    int nameSize;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (!DGAAvailable(stuff->screen))
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    REQUEST_SIZE_MATCH(xXDGAOpenFramebufferReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+
+    if (!DGAOpenFramebuffer(stuff->screen, &deviceName,
+                            (unsigned char **) (&rep.mem1),
+                            (int *) &rep.size, (int *) &rep.offset,
+                            (int *) &rep.extra)) {
+        return BadAlloc;
+    }
+
+    nameSize = deviceName ? (strlen(deviceName) + 1) : 0;
+    rep.length = bytes_to_int32(nameSize);
+
+    WriteToClient(client, sizeof(xXDGAOpenFramebufferReply), (char *) &rep);
+    if (rep.length)
+        WriteToClient(client, nameSize, deviceName);
+
+    return Success;
+}
+
+static int
+ProcXDGACloseFramebuffer(ClientPtr client)
+{
+    REQUEST(xXDGACloseFramebufferReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (!DGAAvailable(stuff->screen))
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    REQUEST_SIZE_MATCH(xXDGACloseFramebufferReq);
+
+    DGACloseFramebuffer(stuff->screen);
+
+    return Success;
+}
+
+static int
+ProcXDGAQueryModes(ClientPtr client)
+{
+    int i, num, size;
+
+    REQUEST(xXDGAQueryModesReq);
+    xXDGAQueryModesReply rep;
+    xXDGAModeInfo info;
+    XDGAModePtr mode;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    REQUEST_SIZE_MATCH(xXDGAQueryModesReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.number = 0;
+    rep.sequenceNumber = client->sequence;
+
+    if (!DGAAvailable(stuff->screen)) {
+        rep.number = 0;
+        rep.length = 0;
+        WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep);
+        return Success;
+    }
+
+    if (!(num = DGAGetModes(stuff->screen))) {
+        WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep);
+        return Success;
+    }
+
+    if (!(mode = (XDGAModePtr) malloc(num * sizeof(XDGAModeRec))))
+        return BadAlloc;
+
+    for (i = 0; i < num; i++)
+        DGAGetModeInfo(stuff->screen, mode + i, i + 1);
+
+    size = num * sz_xXDGAModeInfo;
+    for (i = 0; i < num; i++)
+        size += pad_to_int32(strlen(mode[i].name) + 1); /* plus NULL */
+
+    rep.number = num;
+    rep.length = bytes_to_int32(size);
+
+    WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep);
+
+    for (i = 0; i < num; i++) {
+        size = strlen(mode[i].name) + 1;
+
+        info.byte_order = mode[i].byteOrder;
+        info.depth = mode[i].depth;
+        info.num = mode[i].num;
+        info.bpp = mode[i].bitsPerPixel;
+        info.name_size = (size + 3) & ~3L;
+        info.vsync_num = mode[i].VSync_num;
+        info.vsync_den = mode[i].VSync_den;
+        info.flags = mode[i].flags;
+        info.image_width = mode[i].imageWidth;
+        info.image_height = mode[i].imageHeight;
+        info.pixmap_width = mode[i].pixmapWidth;
+        info.pixmap_height = mode[i].pixmapHeight;
+        info.bytes_per_scanline = mode[i].bytesPerScanline;
+        info.red_mask = mode[i].red_mask;
+        info.green_mask = mode[i].green_mask;
+        info.blue_mask = mode[i].blue_mask;
+        info.visual_class = mode[i].visualClass;
+        info.viewport_width = mode[i].viewportWidth;
+        info.viewport_height = mode[i].viewportHeight;
+        info.viewport_xstep = mode[i].xViewportStep;
+        info.viewport_ystep = mode[i].yViewportStep;
+        info.viewport_xmax = mode[i].maxViewportX;
+        info.viewport_ymax = mode[i].maxViewportY;
+        info.viewport_flags = mode[i].viewportFlags;
+        info.reserved1 = mode[i].reserved1;
+        info.reserved2 = mode[i].reserved2;
+
+        WriteToClient(client, sz_xXDGAModeInfo, (char *) (&info));
+        WriteToClient(client, size, mode[i].name);
+    }
+
+    free(mode);
+
+    return Success;
+}
+
+static void
+DGAClientStateChange(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
+{
+    NewClientInfoRec *pci = (NewClientInfoRec *) calldata;
+    ClientPtr client = NULL;
+    int i;
+
+    for (i = 0; i < screenInfo.numScreens; i++) {
+        if (DGA_GETCLIENT(i) == pci->client) {
+            client = pci->client;
+            break;
+        }
+    }
+
+    if (client &&
+        ((client->clientState == ClientStateGone) ||
+         (client->clientState == ClientStateRetained))) {
+        XDGAModeRec mode;
+        PixmapPtr pPix;
+
+        DGA_SETCLIENT(i, NULL);
+        DGASelectInput(i, NULL, 0);
+        DGASetMode(i, 0, &mode, &pPix);
+
+        if (--DGACallbackRefCount == 0)
+            DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL);
+    }
+}
+
+static int
+ProcXDGASetMode(ClientPtr client)
+{
+    REQUEST(xXDGASetModeReq);
+    xXDGASetModeReply rep;
+    XDGAModeRec mode;
+    xXDGAModeInfo info;
+    PixmapPtr pPix;
+    ClientPtr owner;
+    int size;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+    owner = DGA_GETCLIENT(stuff->screen);
+
+    REQUEST_SIZE_MATCH(xXDGASetModeReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.offset = 0;
+    rep.flags = 0;
+    rep.sequenceNumber = client->sequence;
+
+    if (!DGAAvailable(stuff->screen))
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    if (owner && owner != client)
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    if (!stuff->mode) {
+        if (owner) {
+            if (--DGACallbackRefCount == 0)
+                DeleteCallback(&ClientStateCallback, DGAClientStateChange,
+                               NULL);
+        }
+        DGA_SETCLIENT(stuff->screen, NULL);
+        DGASelectInput(stuff->screen, NULL, 0);
+        DGASetMode(stuff->screen, 0, &mode, &pPix);
+        WriteToClient(client, sz_xXDGASetModeReply, (char *) &rep);
+        return Success;
+    }
+
+    if (Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix))
+        return BadValue;
+
+    if (!owner) {
+        if (DGACallbackRefCount++ == 0)
+            AddCallback(&ClientStateCallback, DGAClientStateChange, NULL);
+    }
+
+    DGA_SETCLIENT(stuff->screen, client);
+
+    if (pPix) {
+        if (AddResource(stuff->pid, RT_PIXMAP, (pointer) (pPix))) {
+            pPix->drawable.id = (int) stuff->pid;
+            rep.flags = DGA_PIXMAP_AVAILABLE;
+        }
+    }
+
+    size = strlen(mode.name) + 1;
+
+    info.byte_order = mode.byteOrder;
+    info.depth = mode.depth;
+    info.num = mode.num;
+    info.bpp = mode.bitsPerPixel;
+    info.name_size = (size + 3) & ~3L;
+    info.vsync_num = mode.VSync_num;
+    info.vsync_den = mode.VSync_den;
+    info.flags = mode.flags;
+    info.image_width = mode.imageWidth;
+    info.image_height = mode.imageHeight;
+    info.pixmap_width = mode.pixmapWidth;
+    info.pixmap_height = mode.pixmapHeight;
+    info.bytes_per_scanline = mode.bytesPerScanline;
+    info.red_mask = mode.red_mask;
+    info.green_mask = mode.green_mask;
+    info.blue_mask = mode.blue_mask;
+    info.visual_class = mode.visualClass;
+    info.viewport_width = mode.viewportWidth;
+    info.viewport_height = mode.viewportHeight;
+    info.viewport_xstep = mode.xViewportStep;
+    info.viewport_ystep = mode.yViewportStep;
+    info.viewport_xmax = mode.maxViewportX;
+    info.viewport_ymax = mode.maxViewportY;
+    info.viewport_flags = mode.viewportFlags;
+    info.reserved1 = mode.reserved1;
+    info.reserved2 = mode.reserved2;
+
+    rep.length = bytes_to_int32(sz_xXDGAModeInfo + info.name_size);
+
+    WriteToClient(client, sz_xXDGASetModeReply, (char *) &rep);
+    WriteToClient(client, sz_xXDGAModeInfo, (char *) (&info));
+    WriteToClient(client, size, mode.name);
+
+    return Success;
+}
+
+static int
+ProcXDGASetViewport(ClientPtr client)
+{
+    REQUEST(xXDGASetViewportReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXDGASetViewportReq);
+
+    DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags);
+
+    return Success;
+}
+
+static int
+ProcXDGAInstallColormap(ClientPtr client)
+{
+    ColormapPtr cmap;
+    int rc;
+
+    REQUEST(xXDGAInstallColormapReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXDGAInstallColormapReq);
+
+    rc = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, RT_COLORMAP,
+                                 client, DixInstallAccess);
+    if (rc != Success)
+        return rc;
+    DGAInstallCmap(cmap);
+    return Success;
+}
+
+static int
+ProcXDGASelectInput(ClientPtr client)
+{
+    REQUEST(xXDGASelectInputReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXDGASelectInputReq);
+
+    if (DGA_GETCLIENT(stuff->screen) == client)
+        DGASelectInput(stuff->screen, client, stuff->mask);
+
+    return Success;
+}
+
+static int
+ProcXDGAFillRectangle(ClientPtr client)
+{
+    REQUEST(xXDGAFillRectangleReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXDGAFillRectangleReq);
+
+    if (Success != DGAFillRect(stuff->screen, stuff->x, stuff->y,
+                               stuff->width, stuff->height, stuff->color))
+        return BadMatch;
+
+    return Success;
+}
+
+static int
+ProcXDGACopyArea(ClientPtr client)
+{
+    REQUEST(xXDGACopyAreaReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXDGACopyAreaReq);
+
+    if (Success != DGABlitRect(stuff->screen, stuff->srcx, stuff->srcy,
+                               stuff->width, stuff->height, stuff->dstx,
+                               stuff->dsty))
+        return BadMatch;
+
+    return Success;
+}
+
+static int
+ProcXDGACopyTransparentArea(ClientPtr client)
+{
+    REQUEST(xXDGACopyTransparentAreaReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXDGACopyTransparentAreaReq);
+
+    if (Success != DGABlitTransRect(stuff->screen, stuff->srcx, stuff->srcy,
+                                    stuff->width, stuff->height, stuff->dstx,
+                                    stuff->dsty, stuff->key))
+        return BadMatch;
+
+    return Success;
+}
+
+static int
+ProcXDGAGetViewportStatus(ClientPtr client)
+{
+    REQUEST(xXDGAGetViewportStatusReq);
+    xXDGAGetViewportStatusReply rep;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXDGAGetViewportStatusReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+
+    rep.status = DGAGetViewportStatus(stuff->screen);
+
+    WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *) &rep);
+    return Success;
+}
+
+static int
+ProcXDGASync(ClientPtr client)
+{
+    REQUEST(xXDGASyncReq);
+    xXDGASyncReply rep;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXDGASyncReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+
+    DGASync(stuff->screen);
+
+    WriteToClient(client, sizeof(xXDGASyncReply), (char *) &rep);
+    return Success;
+}
+
+static int
+ProcXDGASetClientVersion(ClientPtr client)
+{
+    REQUEST(xXDGASetClientVersionReq);
+
+    DGAPrivPtr pPriv;
+
+    REQUEST_SIZE_MATCH(xXDGASetClientVersionReq);
+    if ((pPriv = DGA_GETPRIV(client)) == NULL) {
+        pPriv = malloc(sizeof(DGAPrivRec));
+        /* XXX Need to look into freeing this */
+        if (!pPriv)
+            return BadAlloc;
+        DGA_SETPRIV(client, pPriv);
+    }
+    pPriv->major = stuff->major;
+    pPriv->minor = stuff->minor;
+
+    return Success;
+}
+
+static int
+ProcXDGAChangePixmapMode(ClientPtr client)
+{
+    REQUEST(xXDGAChangePixmapModeReq);
+    xXDGAChangePixmapModeReply rep;
+    int x, y;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXDGAChangePixmapModeReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+
+    x = stuff->x;
+    y = stuff->y;
+
+    if (!DGAChangePixmapMode(stuff->screen, &x, &y, stuff->flags))
+        return BadMatch;
+
+    rep.x = x;
+    rep.y = y;
+    WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *) &rep);
+
+    return Success;
+}
+
+static int
+ProcXDGACreateColormap(ClientPtr client)
+{
+    REQUEST(xXDGACreateColormapReq);
+    int result;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXDGACreateColormapReq);
+
+    if (!stuff->mode)
+        return BadValue;
+
+    result = DGACreateColormap(stuff->screen, client, stuff->id,
+                               stuff->mode, stuff->alloc);
+    if (result != Success)
+        return result;
+
+    return Success;
+}
+
+/*
+ *
+ * Support for the old DGA protocol, used to live in xf86dga.c
+ *
+ */
+
+#ifdef DGA_PROTOCOL_OLD_SUPPORT
+
+static int
+ProcXF86DGAGetVideoLL(ClientPtr client)
+{
+    REQUEST(xXF86DGAGetVideoLLReq);
+    xXF86DGAGetVideoLLReply rep;
+    XDGAModeRec mode;
+    int num, offset, flags;
+    char *name;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+
+    if (!DGAAvailable(stuff->screen))
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    if (!(num = DGAGetOldDGAMode(stuff->screen)))
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    /* get the parameters for the mode that best matches */
+    DGAGetModeInfo(stuff->screen, &mode, num);
+
+    if (!DGAOpenFramebuffer(stuff->screen, &name,
+                            (unsigned char **) (&rep.offset),
+                            (int *) (&rep.bank_size), &offset, &flags))
+        return BadAlloc;
+
+    rep.offset += mode.offset;
+    rep.width = mode.bytesPerScanline / (mode.bitsPerPixel >> 3);
+    rep.ram_size = rep.bank_size >> 10;
+
+    WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *) &rep);
+    return Success;
+}
+
+static int
+ProcXF86DGADirectVideo(ClientPtr client)
+{
+    int num;
+    PixmapPtr pix;
+    XDGAModeRec mode;
+    ClientPtr owner;
+
+    REQUEST(xXF86DGADirectVideoReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+    REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq);
+
+    if (!DGAAvailable(stuff->screen))
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    owner = DGA_GETCLIENT(stuff->screen);
+
+    if (owner && owner != client)
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    if (stuff->enable & XF86DGADirectGraphics) {
+        if (!(num = DGAGetOldDGAMode(stuff->screen)))
+            return DGAErrorBase + XF86DGANoDirectVideoMode;
+    }
+    else
+        num = 0;
+
+    if (Success != DGASetMode(stuff->screen, num, &mode, &pix))
+        return DGAErrorBase + XF86DGAScreenNotActive;
+
+    DGASetInputMode(stuff->screen,
+                    (stuff->enable & XF86DGADirectKeyb) != 0,
+                    (stuff->enable & XF86DGADirectMouse) != 0);
+
+    /* We need to track the client and attach the teardown callback */
+    if (stuff->enable &
+        (XF86DGADirectGraphics | XF86DGADirectKeyb | XF86DGADirectMouse)) {
+        if (!owner) {
+            if (DGACallbackRefCount++ == 0)
+                AddCallback(&ClientStateCallback, DGAClientStateChange, NULL);
+        }
+
+        DGA_SETCLIENT(stuff->screen, client);
+    }
+    else {
+        if (owner) {
+            if (--DGACallbackRefCount == 0)
+                DeleteCallback(&ClientStateCallback, DGAClientStateChange,
+                               NULL);
+        }
+
+        DGA_SETCLIENT(stuff->screen, NULL);
+    }
+
+    return Success;
+}
+
+static int
+ProcXF86DGAGetViewPortSize(ClientPtr client)
+{
+    int num;
+    XDGAModeRec mode;
+
+    REQUEST(xXF86DGAGetViewPortSizeReq);
+    xXF86DGAGetViewPortSizeReply rep;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+
+    if (!DGAAvailable(stuff->screen))
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    if (!(num = DGAGetOldDGAMode(stuff->screen)))
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    DGAGetModeInfo(stuff->screen, &mode, num);
+
+    rep.width = mode.viewportWidth;
+    rep.height = mode.viewportHeight;
+
+    WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *) &rep);
+    return Success;
+}
+
+static int
+ProcXF86DGASetViewPort(ClientPtr client)
+{
+    REQUEST(xXF86DGASetViewPortReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq);
+
+    if (!DGAAvailable(stuff->screen))
+        return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+    if (!DGAActive(stuff->screen))
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    if (DGASetViewport(stuff->screen, stuff->x, stuff->y, DGA_FLIP_RETRACE)
+        != Success)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    return Success;
+}
+
+static int
+ProcXF86DGAGetVidPage(ClientPtr client)
+{
+    REQUEST(xXF86DGAGetVidPageReq);
+    xXF86DGAGetVidPageReply rep;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+    rep.vpage = 0;              /* silently fail */
+
+    WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *) &rep);
+    return Success;
+}
+
+static int
+ProcXF86DGASetVidPage(ClientPtr client)
+{
+    REQUEST(xXF86DGASetVidPageReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq);
+
+    /* silently fail */
+
+    return Success;
+}
+
+static int
+ProcXF86DGAInstallColormap(ClientPtr client)
+{
+    ColormapPtr pcmp;
+    int rc;
+
+    REQUEST(xXF86DGAInstallColormapReq);
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq);
+
+    if (!DGAActive(stuff->screen))
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    rc = dixLookupResourceByType((pointer *) &pcmp, stuff->id, RT_COLORMAP,
+                                 client, DixInstallAccess);
+    if (rc == Success) {
+        DGAInstallCmap(pcmp);
+        return Success;
+    }
+    else {
+        return rc;
+    }
+}
+
+static int
+ProcXF86DGAQueryDirectVideo(ClientPtr client)
+{
+    REQUEST(xXF86DGAQueryDirectVideoReq);
+    xXF86DGAQueryDirectVideoReply rep;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq);
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+    rep.flags = 0;
+
+    if (DGAAvailable(stuff->screen))
+        rep.flags = XF86DGADirectPresent;
+
+    WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *) &rep);
+    return Success;
+}
+
+static int
+ProcXF86DGAViewPortChanged(ClientPtr client)
+{
+    REQUEST(xXF86DGAViewPortChangedReq);
+    xXF86DGAViewPortChangedReply rep;
+
+    if (stuff->screen >= screenInfo.numScreens)
+        return BadValue;
+
+    if (DGA_GETCLIENT(stuff->screen) != client)
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq);
+
+    if (!DGAActive(stuff->screen))
+        return DGAErrorBase + XF86DGADirectNotActivated;
+
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+    rep.result = 1;
+
+    WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *) &rep);
+    return Success;
+}
+
+#endif                          /* DGA_PROTOCOL_OLD_SUPPORT */
+
+static int
+SProcXDGADispatch(ClientPtr client)
+{
+    return DGAErrorBase + XF86DGAClientNotLocal;
+}
+
+#if 0
+#define DGA_REQ_DEBUG
+#endif
+
+#ifdef DGA_REQ_DEBUG
+static char *dgaMinor[] = {
+    "QueryVersion",
+    "GetVideoLL",
+    "DirectVideo",
+    "GetViewPortSize",
+    "SetViewPort",
+    "GetVidPage",
+    "SetVidPage",
+    "InstallColormap",
+    "QueryDirectVideo",
+    "ViewPortChanged",
+    "10",
+    "11",
+    "QueryModes",
+    "SetMode",
+    "SetViewport",
+    "InstallColormap",
+    "SelectInput",
+    "FillRectangle",
+    "CopyArea",
+    "CopyTransparentArea",
+    "GetViewportStatus",
+    "Sync",
+    "OpenFramebuffer",
+    "CloseFramebuffer",
+    "SetClientVersion",
+    "ChangePixmapMode",
+    "CreateColormap",
+};
+#endif
+
+static int
+ProcXDGADispatch(ClientPtr client)
+{
+    REQUEST(xReq);
+
+    if (!LocalClient(client))
+        return DGAErrorBase + XF86DGAClientNotLocal;
+
+#ifdef DGA_REQ_DEBUG
+    if (stuff->data <= X_XDGACreateColormap)
+        fprintf(stderr, "    DGA %s\n", dgaMinor[stuff->data]);
+#endif
+
+    switch (stuff->data) {
+        /*
+         * DGA2 Protocol
+         */
+    case X_XDGAQueryVersion:
+        return ProcXDGAQueryVersion(client);
+    case X_XDGAQueryModes:
+        return ProcXDGAQueryModes(client);
+    case X_XDGASetMode:
+        return ProcXDGASetMode(client);
+    case X_XDGAOpenFramebuffer:
+        return ProcXDGAOpenFramebuffer(client);
+    case X_XDGACloseFramebuffer:
+        return ProcXDGACloseFramebuffer(client);
+    case X_XDGASetViewport:
+        return ProcXDGASetViewport(client);
+    case X_XDGAInstallColormap:
+        return ProcXDGAInstallColormap(client);
+    case X_XDGASelectInput:
+        return ProcXDGASelectInput(client);
+    case X_XDGAFillRectangle:
+        return ProcXDGAFillRectangle(client);
+    case X_XDGACopyArea:
+        return ProcXDGACopyArea(client);
+    case X_XDGACopyTransparentArea:
+        return ProcXDGACopyTransparentArea(client);
+    case X_XDGAGetViewportStatus:
+        return ProcXDGAGetViewportStatus(client);
+    case X_XDGASync:
+        return ProcXDGASync(client);
+    case X_XDGASetClientVersion:
+        return ProcXDGASetClientVersion(client);
+    case X_XDGAChangePixmapMode:
+        return ProcXDGAChangePixmapMode(client);
+    case X_XDGACreateColormap:
+        return ProcXDGACreateColormap(client);
+        /*
+         * Old DGA Protocol
+         */
+#ifdef DGA_PROTOCOL_OLD_SUPPORT
+    case X_XF86DGAGetVideoLL:
+        return ProcXF86DGAGetVideoLL(client);
+    case X_XF86DGADirectVideo:
+        return ProcXF86DGADirectVideo(client);
+    case X_XF86DGAGetViewPortSize:
+        return ProcXF86DGAGetViewPortSize(client);
+    case X_XF86DGASetViewPort:
+        return ProcXF86DGASetViewPort(client);
+    case X_XF86DGAGetVidPage:
+        return ProcXF86DGAGetVidPage(client);
+    case X_XF86DGASetVidPage:
+        return ProcXF86DGASetVidPage(client);
+    case X_XF86DGAInstallColormap:
+        return ProcXF86DGAInstallColormap(client);
+    case X_XF86DGAQueryDirectVideo:
+        return ProcXF86DGAQueryDirectVideo(client);
+    case X_XF86DGAViewPortChanged:
+        return ProcXF86DGAViewPortChanged(client);
+#endif                          /* DGA_PROTOCOL_OLD_SUPPORT */
+    default:
+        return BadRequest;
+    }
+}
+
+void
+XFree86DGAExtensionInit(void)
+{
+    ExtensionEntry *extEntry;
+
+    if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0))
+        return;
+
+    if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+        return;
+
+    if ((extEntry = AddExtension(XF86DGANAME,
+                                 XF86DGANumberEvents,
+                                 XF86DGANumberErrors,
+                                 ProcXDGADispatch,
+                                 SProcXDGADispatch,
+                                 XDGAResetProc, StandardMinorOpcode))) {
+        int i;
+
+        DGAReqCode = (unsigned char) extEntry->base;
+        DGAErrorBase = extEntry->errorBase;
+        DGAEventBase = extEntry->eventBase;
+        for (i = KeyPress; i <= MotionNotify; i++)
+            SetCriticalEvent(DGAEventBase + i);
+    }
+}
index 75f0342..ef4a2c1 100644 (file)
@@ -49,7 +49,7 @@
 #ifdef DPMSExtension
 static DevPrivateKeyRec DPMSKeyRec;
 static DevPrivateKey DPMSKey;
-static Bool DPMSClose(int i, ScreenPtr pScreen);
+static Bool DPMSClose(ScreenPtr pScreen);
 static int DPMSCount = 0;
 #endif
 
@@ -57,7 +57,7 @@ Bool
 xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
 {
 #ifdef DPMSExtension
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     DPMSPtr pDPMS;
     pointer DPMSOpt;
     MessageType enabled_from;
@@ -99,10 +99,10 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
 #ifdef DPMSExtension
 
 static Bool
-DPMSClose(int i, ScreenPtr pScreen)
+DPMSClose(ScreenPtr pScreen)
 {
     DPMSPtr pDPMS;
-
+    ScrnInfoPtr pScrn;
     /* This shouldn't happen */
     if (DPMSKey == NULL)
         return FALSE;
@@ -114,20 +114,20 @@ DPMSClose(int i, ScreenPtr pScreen)
         return FALSE;
 
     pScreen->CloseScreen = pDPMS->CloseScreen;
-
+    pScrn = xf86ScreenToScrn(pScreen);
     /*
      * Turn on DPMS when shutting down. If this function can be used
      * depends on the order the driver wraps things. If this is called
      * after the driver has shut down everything the driver will have
      * to deal with this internally.
      */
-    if (xf86Screens[i]->vtSema && xf86Screens[i]->DPMSSet) {
-        xf86Screens[i]->DPMSSet(xf86Screens[i], DPMSModeOn, 0);
+    if (pScrn->vtSema && pScrn->DPMSSet) {
+        pScrn->DPMSSet(pScrn, DPMSModeOn, 0);
     }
 
     if (--DPMSCount == 0)
         DPMSKey = NULL;
-    return pScreen->CloseScreen(i, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 /*
index 058057e..47429ec 100644 (file)
@@ -254,7 +254,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
             while (pInfo) {
                 if (pInfo->read_input && pInfo->fd >= 0 &&
                     (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
-                    int sigstate = xf86BlockSIGIO();
+                    OsBlockSIGIO();
 
                     /*
                      * Remove the descriptior from the set because more than one
@@ -263,7 +263,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
                     FD_CLR(pInfo->fd, &devicesWithInput);
 
                     pInfo->read_input(pInfo);
-                    xf86UnblockSIGIO(sigstate);
+                    OsReleaseSIGIO();
                 }
                 pInfo = pInfo->next;
             }
@@ -397,9 +397,9 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
     for (i = keyc->xkbInfo->desc->min_key_code;
          i < keyc->xkbInfo->desc->max_key_code; i++) {
         if (key_is_down(pDev, i, KEY_POSTED)) {
-            sigstate = xf86BlockSIGIO();
+            OsBlockSIGIO();
             QueueKeyboardEvents(pDev, KeyRelease, i, NULL);
-            xf86UnblockSIGIO(sigstate);
+            OsReleaseSIGIO();
         }
     }
 }
@@ -438,7 +438,7 @@ xf86VTSwitch(void)
         for (i = 0; i < xf86NumScreens; i++) {
             if (!(dispatchException & DE_TERMINATE))
                 if (xf86Screens[i]->EnableDisableFBAccess)
-                    (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE);
+                    (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], FALSE);
         }
 
         /*
@@ -449,15 +449,17 @@ xf86VTSwitch(void)
             xf86DisableInputHandler(ih);
         for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) {
             if (pInfo->dev) {
+                if (!pInfo->dev->enabled)
+                    pInfo->flags |= XI86_DEVICE_DISABLED;
                 xf86ReleaseKeys(pInfo->dev);
                 ProcessInputEvents();
                 DisableDevice(pInfo->dev, TRUE);
             }
         }
 
-        prevSIGIO = xf86BlockSIGIO();
+        OsBlockSIGIO();
         for (i = 0; i < xf86NumScreens; i++)
-            xf86Screens[i]->LeaveVT(i, 0);
+            xf86Screens[i]->LeaveVT(xf86Screens[i]);
 
         xf86AccessLeave();      /* We need this here, otherwise */
 
@@ -469,27 +471,28 @@ xf86VTSwitch(void)
             DebugF("xf86VTSwitch: Leave failed\n");
             xf86AccessEnter();
             for (i = 0; i < xf86NumScreens; i++) {
-                if (!xf86Screens[i]->EnterVT(i, 0))
+                if (!xf86Screens[i]->EnterVT(xf86Screens[i]))
                     FatalError("EnterVT failed for screen %d\n", i);
             }
             if (!(dispatchException & DE_TERMINATE)) {
                 for (i = 0; i < xf86NumScreens; i++) {
                     if (xf86Screens[i]->EnableDisableFBAccess)
-                        (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE);
+                        (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE);
                 }
             }
             dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
 
             pInfo = xf86InputDevs;
             while (pInfo) {
-                if (pInfo->dev)
+                if (pInfo->dev && (pInfo->flags & XI86_DEVICE_DISABLED) == 0)
                     EnableDevice(pInfo->dev, TRUE);
+                pInfo->flags &= ~XI86_DEVICE_DISABLED;
                 pInfo = pInfo->next;
             }
             for (ih = InputHandlers; ih; ih = ih->next)
                 xf86EnableInputHandler(ih);
 
-            xf86UnblockSIGIO(prevSIGIO);
+            OsReleaseSIGIO();
 
         }
         else {
@@ -524,12 +527,12 @@ xf86VTSwitch(void)
         xf86AccessEnter();
         for (i = 0; i < xf86NumScreens; i++) {
             xf86Screens[i]->vtSema = TRUE;
-            if (!xf86Screens[i]->EnterVT(i, 0))
+            if (!xf86Screens[i]->EnterVT(xf86Screens[i]))
                 FatalError("EnterVT failed for screen %d\n", i);
         }
         for (i = 0; i < xf86NumScreens; i++) {
             if (xf86Screens[i]->EnableDisableFBAccess)
-                (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE);
+                (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE);
         }
 
         /* Turn screen saver off when switching back */
@@ -537,15 +540,16 @@ xf86VTSwitch(void)
 
         pInfo = xf86InputDevs;
         while (pInfo) {
-            if (pInfo->dev)
+            if (pInfo->dev && (pInfo->flags & XI86_DEVICE_DISABLED) == 0)
                 EnableDevice(pInfo->dev, TRUE);
+            pInfo->flags &= ~XI86_DEVICE_DISABLED;
             pInfo = pInfo->next;
         }
 
         for (ih = InputHandlers; ih; ih = ih->next)
             xf86EnableInputHandler(ih);
 
-        xf86UnblockSIGIO(prevSIGIO);
+        OsReleaseSIGIO();
     }
 }
 
diff --git a/hw/xfree86/common/xf86Extensions.c b/hw/xfree86/common/xf86Extensions.c
new file mode 100644 (file)
index 0000000..d5309d5
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Copyright © 2011 Daniel Stone
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel@fooishbar.org>
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "extension.h"
+#include "globals.h"
+
+#include "xf86.h"
+#include "xf86Config.h"
+#include "xf86Module.h"
+#include "xf86Extensions.h"
+#include "xf86Opt.h"
+#include "optionstr.h"
+
+#ifdef XSELINUX
+#include "xselinux.h"
+#endif
+
+#ifdef XFreeXDGA
+#include <X11/extensions/xf86dgaproto.h>
+#endif
+
+#ifdef XF86VIDMODE
+#include <X11/extensions/xf86vmproto.h>
+#include "vidmodeproc.h"
+#endif
+
+/*
+ * DDX-specific extensions.
+ */
+static ExtensionModule extensionModules[] = {
+#ifdef XF86VIDMODE
+    {
+       XFree86VidModeExtensionInit,
+       XF86VIDMODENAME,
+       &noXFree86VidModeExtension
+    },
+#endif
+#ifdef XFreeXDGA
+    {
+       XFree86DGAExtensionInit,
+       XF86DGANAME,
+       &noXFree86DGAExtension
+    },
+#endif
+#ifdef XF86DRI
+    {
+        XFree86DRIExtensionInit,
+        "XFree86-DRI",
+        &noXFree86DRIExtension
+    },
+#endif
+#ifdef DRI2
+    {
+        DRI2ExtensionInit,
+        DRI2_NAME,
+        &noDRI2Extension
+    }
+#endif
+};
+
+static void
+load_extension_config(void)
+{
+    XF86ConfModulePtr mod_con = xf86configptr->conf_modules;
+    XF86LoadPtr modp;
+    int i;
+
+    /* Only the best. */
+    if (!mod_con)
+        return;
+
+    nt_list_for_each_entry(modp, mod_con->mod_load_lst, list.next) {
+        InputOption *opt;
+
+        if (strcasecmp(modp->load_name, "extmod") != 0)
+            continue;
+
+        /* extmod options are of the form "omit <extension-name>" */
+        nt_list_for_each_entry(opt, modp->load_opt, list.next) {
+            const char *key = input_option_get_key(opt);
+            if (strncasecmp(key, "omit", 4) != 0 || strlen(key) < 5)
+                continue;
+            if (EnableDisableExtension(key + 4, FALSE))
+                xf86MarkOptionUsed(opt);
+        }
+
+#ifdef XSELINUX
+        if ((opt = xf86FindOption(modp->load_opt,
+                                  "SELinux mode disabled"))) {
+            xf86MarkOptionUsed(opt);
+            selinuxEnforcingState = SELINUX_MODE_DISABLED;
+        }
+        if ((opt = xf86FindOption(modp->load_opt,
+                                  "SELinux mode permissive"))) {
+            xf86MarkOptionUsed(opt);
+            selinuxEnforcingState = SELINUX_MODE_PERMISSIVE;
+        }
+        if ((opt = xf86FindOption(modp->load_opt,
+                                  "SELinux mode enforcing"))) {
+            xf86MarkOptionUsed(opt);
+            selinuxEnforcingState = SELINUX_MODE_ENFORCING;
+        }
+#endif
+    }
+}
+
+void
+xf86ExtensionInit(void)
+{
+    int i;
+
+    load_extension_config();
+
+    for (i = 0; i < ARRAY_SIZE(extensionModules); i++)
+       LoadExtension(&extensionModules[i], TRUE);
+}
diff --git a/hw/xfree86/common/xf86Extensions.h b/hw/xfree86/common/xf86Extensions.h
new file mode 100644 (file)
index 0000000..cad86c8
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright © 2011 Daniel Stone
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel@fooishbar.org>
+ */
+
+#ifndef XF86EXTENSIONS_H
+#define XF86EXTENSIONS_H
+
+#include "extnsionst.h"
+
+#ifdef XF86DRI
+extern _X_EXPORT Bool noXFree86DRIExtension;
+extern void XFree86DRIExtensionInit(void);
+#endif
+
+#ifdef DRI2
+#include <X11/extensions/dri2proto.h>
+extern _X_EXPORT Bool noDRI2Extension;
+extern void DRI2ExtensionInit(void);
+#endif
+
+#ifdef XF86VIDMODE
+#include <X11/extensions/xf86vmproto.h>
+extern _X_EXPORT Bool noXFree86VidModeExtension;
+extern void XFree86VidModeExtensionInit(void);
+#endif
+
+#ifdef XFreeXDGA
+#include <X11/extensions/xf86dgaproto.h>
+extern _X_EXPORT Bool noXFree86DGAExtension;
+extern void XFree86DGAExtensionInit(void);
+extern void XFree86DGARegister(void);
+#endif
+
+#endif
index 0071004..7df7a80 100644 (file)
@@ -51,6 +51,7 @@ DevPrivateKeyRec xf86CreateRootWindowKeyRec;
 DevPrivateKeyRec xf86ScreenKeyRec;
 
 ScrnInfoPtr *xf86Screens = NULL;        /* List of ScrnInfos */
+ScrnInfoPtr *xf86GPUScreens = NULL;        /* List of ScrnInfos */
 
 const unsigned char byte_reversed[256] = {
     0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
@@ -125,11 +126,16 @@ xf86InfoRec xf86Info = {
 #if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
     .forceInputDevices = FALSE,
     .autoAddDevices = TRUE,
-    .autoEnableDevices = TRUE
+    .autoEnableDevices = TRUE,
 #else
     .forceInputDevices = TRUE,
     .autoAddDevices = FALSE,
-    .autoEnableDevices = FALSE
+    .autoEnableDevices = FALSE,
+#endif
+#if defined(CONFIG_UDEV_KMS)
+    .autoAddGPU = TRUE,
+#else
+    .autoAddGPU = FALSE,
 #endif
 };
 
@@ -153,6 +159,7 @@ int xf86NumDrivers = 0;
 InputDriverPtr *xf86InputDriverList = NULL;
 int xf86NumInputDrivers = 0;
 int xf86NumScreens = 0;
+int xf86NumGPUScreens = 0;
 
 const char *xf86VisualNames[] = {
     "StaticGray",
index 8c948cf..f681a85 100644 (file)
@@ -167,29 +167,43 @@ ScrnInfoPtr
 xf86AllocateScreen(DriverPtr drv, int flags)
 {
     int i;
+    ScrnInfoPtr pScrn;
 
-    if (xf86Screens == NULL)
-        xf86NumScreens = 0;
-
-    i = xf86NumScreens++;
-    xf86Screens = xnfrealloc(xf86Screens, xf86NumScreens * sizeof(ScrnInfoPtr));
-    xf86Screens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1);
-    xf86Screens[i]->scrnIndex = i;      /* Changes when a screen is removed */
-    xf86Screens[i]->origIndex = i;      /* This never changes */
-    xf86Screens[i]->privates = xnfcalloc(sizeof(DevUnion),
-                                         xf86ScrnInfoPrivateCount);
+    if (flags & XF86_ALLOCATE_GPU_SCREEN) {
+        if (xf86GPUScreens == NULL)
+            xf86NumGPUScreens = 0;
+        i = xf86NumGPUScreens++;
+        xf86GPUScreens = xnfrealloc(xf86GPUScreens, xf86NumGPUScreens * sizeof(ScrnInfoPtr));
+        xf86GPUScreens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1);
+        pScrn = xf86GPUScreens[i];
+        pScrn->scrnIndex = i + GPU_SCREEN_OFFSET;      /* Changes when a screen is removed */
+        pScrn->is_gpu = TRUE;
+    } else {
+        if (xf86Screens == NULL)
+            xf86NumScreens = 0;
+
+        i = xf86NumScreens++;
+        xf86Screens = xnfrealloc(xf86Screens, xf86NumScreens * sizeof(ScrnInfoPtr));
+        xf86Screens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1);
+        pScrn = xf86Screens[i];
+
+        pScrn->scrnIndex = i;      /* Changes when a screen is removed */
+    }
+
+    pScrn->origIndex = pScrn->scrnIndex;      /* This never changes */
+    pScrn->privates = xnfcalloc(sizeof(DevUnion), xf86ScrnInfoPrivateCount);
     /*
      * EnableDisableFBAccess now gets initialized in InitOutput()
-     * xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess;
+     * pScrn->EnableDisableFBAccess = xf86EnableDisableFBAccess;
      */
 
-    xf86Screens[i]->drv = drv;
+    pScrn->drv = drv;
     drv->refCount++;
-    xf86Screens[i]->module = DuplicateModule(drv->module, NULL);
+    pScrn->module = DuplicateModule(drv->module, NULL);
 
-    xf86Screens[i]->DriverFunc = drv->driverFunc;
+    pScrn->DriverFunc = drv->driverFunc;
 
-    return xf86Screens[i];
+    return pScrn;
 }
 
 /*
@@ -198,24 +212,29 @@ xf86AllocateScreen(DriverPtr drv, int flags)
  */
 
 void
-xf86DeleteScreen(int scrnIndex, int flags)
+xf86DeleteScreen(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn;
     int i;
+    int scrnIndex;
+    Bool is_gpu = FALSE;
+    if (pScrn->is_gpu) {
+        /* First check if the screen is valid */
+        if (xf86NumGPUScreens == 0 || xf86GPUScreens == NULL)
+            return;
+        is_gpu = TRUE;
+    } else {
+        /* First check if the screen is valid */
+        if (xf86NumScreens == 0 || xf86Screens == NULL)
+            return;
+    }
 
-    /* First check if the screen is valid */
-    if (xf86NumScreens == 0 || xf86Screens == NULL)
-        return;
-
-    if (scrnIndex > xf86NumScreens - 1)
-        return;
-
-    if (!(pScrn = xf86Screens[scrnIndex]))
+    if (!pScrn)
         return;
 
+    scrnIndex = pScrn->scrnIndex;
     /* If a FreeScreen function is defined, call it here */
     if (pScrn->FreeScreen != NULL)
-        pScrn->FreeScreen(scrnIndex, 0);
+        pScrn->FreeScreen(pScrn);
 
     while (pScrn->modes)
         xf86DeleteMode(&pScrn->modes, pScrn->modes);
@@ -233,18 +252,29 @@ xf86DeleteScreen(int scrnIndex, int flags)
 
     free(pScrn->privates);
 
-    xf86ClearEntityListForScreen(scrnIndex);
+    xf86ClearEntityListForScreen(pScrn);
 
     free(pScrn);
 
     /* Move the other entries down, updating their scrnIndex fields */
 
-    xf86NumScreens--;
+    if (is_gpu) {
+        xf86NumGPUScreens--;
+        scrnIndex -= GPU_SCREEN_OFFSET;
+        for (i = scrnIndex; i < xf86NumGPUScreens; i++) {
+            xf86GPUScreens[i] = xf86GPUScreens[i + 1];
+            xf86GPUScreens[i]->scrnIndex = i + GPU_SCREEN_OFFSET;
+            /* Also need to take care of the screen layout settings */
+        }
+    }
+    else {
+        xf86NumScreens--;
 
-    for (i = scrnIndex; i < xf86NumScreens; i++) {
-        xf86Screens[i] = xf86Screens[i + 1];
-        xf86Screens[i]->scrnIndex = i;
-        /* Also need to take care of the screen layout settings */
+        for (i = scrnIndex; i < xf86NumScreens; i++) {
+            xf86Screens[i] = xf86Screens[i + 1];
+            xf86Screens[i]->scrnIndex = i;
+            /* Also need to take care of the screen layout settings */
+        }
     }
 }
 
@@ -268,6 +298,14 @@ xf86AllocateScrnInfoPrivateIndex(void)
         memset(&nprivs[idx], 0, sizeof(DevUnion));
         pScr->privates = nprivs;
     }
+    for (i = 0; i < xf86NumGPUScreens; i++) {
+        pScr = xf86GPUScreens[i];
+        nprivs = xnfrealloc(pScr->privates,
+                            xf86ScrnInfoPrivateCount * sizeof(DevUnion));
+        /* Zero the new private */
+        memset(&nprivs[idx], 0, sizeof(DevUnion));
+        pScr->privates = nprivs;
+    }
     return idx;
 }
 
@@ -1027,9 +1065,8 @@ xf86SetBlackWhitePixels(ScreenPtr pScreen)
  * private data, and therefore don't need to access pScrnInfo->vtSema.
  */
 void
-xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
+xf86EnableDisableFBAccess(ScrnInfoPtr pScrnInfo, Bool enable)
 {
-    ScrnInfoPtr pScrnInfo = xf86Screens[scrnIndex];
     ScreenPtr pScreen = pScrnInfo->pScreen;
     PixmapPtr pspix;
 
@@ -1061,6 +1098,11 @@ xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
         xf86Screens[scrnIndex]->name)
         LogHdrMessageVerb(type, verb, format, args, "%s(%d): ",
                           xf86Screens[scrnIndex]->name, scrnIndex);
+    else if (scrnIndex >= GPU_SCREEN_OFFSET &&
+             scrnIndex < GPU_SCREEN_OFFSET + xf86NumGPUScreens &&
+             xf86GPUScreens[scrnIndex - GPU_SCREEN_OFFSET]->name)
+        LogHdrMessageVerb(type, verb, format, args, "%s(G%d): ",
+                          xf86GPUScreens[scrnIndex - GPU_SCREEN_OFFSET]->name, scrnIndex - GPU_SCREEN_OFFSET);
     else
         LogVMessageVerb(type, verb, format, args);
 }
@@ -1577,7 +1619,7 @@ xf86SetBackingStore(ScreenPtr pScreen)
 {
     Bool useBS = FALSE;
     MessageType from = X_DEFAULT;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     OptionInfoPtr options;
 
     options = xnfalloc(sizeof(BSOptions));
@@ -1618,7 +1660,7 @@ xf86SetSilkenMouse(ScreenPtr pScreen)
 {
     Bool useSM = TRUE;
     MessageType from = X_DEFAULT;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     OptionInfoPtr options;
 
     options = xnfalloc(sizeof(SMOptions));
@@ -1651,10 +1693,9 @@ xf86SetSilkenMouse(ScreenPtr pScreen)
 /* Wrote this function for the PM2 Xv driver, preliminary. */
 
 pointer
-xf86FindXvOptions(int scrnIndex, int adaptor_index, char *port_name,
+xf86FindXvOptions(ScrnInfoPtr pScrn, int adaptor_index, char *port_name,
                   char **adaptor_name, pointer *adaptor_options)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     confXvAdaptorPtr adaptor;
     int i;
 
@@ -1726,9 +1767,8 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
 }
 
 Bool
-xf86IsScreenPrimary(int scrnIndex)
+xf86IsScreenPrimary(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     int i;
 
     for (i = 0; i < pScrn->numEntities; i++) {
@@ -1834,3 +1874,27 @@ xf86MotionHistoryAllocate(InputInfoPtr pInfo)
 {
     AllocateMotionHistory(pInfo->dev);
 }
+
+ScrnInfoPtr
+xf86ScreenToScrn(ScreenPtr pScreen)
+{
+    if (pScreen->isGPU) {
+        assert(pScreen->myNum - GPU_SCREEN_OFFSET < xf86NumGPUScreens);
+        return xf86GPUScreens[pScreen->myNum - GPU_SCREEN_OFFSET];
+    } else {
+        assert(pScreen->myNum < xf86NumScreens);
+        return xf86Screens[pScreen->myNum];
+    }
+}
+
+ScreenPtr
+xf86ScrnToScreen(ScrnInfoPtr pScrn)
+{
+    if (pScrn->is_gpu) {
+        assert(pScrn->scrnIndex - GPU_SCREEN_OFFSET < screenInfo.numGPUScreens);
+        return screenInfo.gpuscreens[pScrn->scrnIndex - GPU_SCREEN_OFFSET];
+    } else {
+        assert(pScrn->scrnIndex < screenInfo.numScreens);
+        return screenInfo.screens[pScrn->scrnIndex];
+    }
+}
index 0974893..e4a6b86 100644 (file)
@@ -394,17 +394,20 @@ InstallSignalHandlers(void)
 void
 InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
 {
-    int i, j, k, scr_index, was_blocked = 0;
+    int i, j, k, scr_index;
     char **modulelist;
     pointer *optionlist;
     Pix24Flags screenpix24, pix24;
     MessageType pix24From = X_DEFAULT;
     Bool pix24Fail = FALSE;
     Bool autoconfig = FALSE;
+    Bool sigio_blocked = FALSE;
     GDevPtr configured_device;
 
     xf86Initialising = TRUE;
 
+    config_pre_init();
+
     if (serverGeneration == 1) {
         if ((xf86ServerName = strrchr(argv[0], '/')) != 0)
             xf86ServerName++;
@@ -469,6 +472,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
         xf86OSPMClose = xf86OSPMOpen();
 #endif
 
+        xf86ExtensionInit();
+
         /* Load all modules specified explicitly in the config file */
         if ((modulelist = xf86ModulelistFromConfig(&optionlist))) {
             xf86LoadModules(modulelist, optionlist);
@@ -589,7 +594,19 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
         }
         for (i = 0; i < xf86NumScreens; i++)
             if (!xf86Screens[i]->configured)
-                xf86DeleteScreen(i--, 0);
+                xf86DeleteScreen(xf86Screens[i--]);
+
+        for (i = 0; i < xf86NumGPUScreens; i++) {
+            xf86VGAarbiterScrnInit(xf86GPUScreens[i]);
+            xf86VGAarbiterLock(xf86GPUScreens[i]);
+            if (xf86GPUScreens[i]->PreInit &&
+                xf86GPUScreens[i]->PreInit(xf86GPUScreens[i], 0))
+                xf86GPUScreens[i]->configured = TRUE;
+            xf86VGAarbiterUnlock(xf86GPUScreens[i]);
+        }
+        for (i = 0; i < xf86NumGPUScreens; i++)
+            if (!xf86GPUScreens[i]->configured)
+                xf86DeleteScreen(xf86GPUScreens[i--]);
 
         /*
          * If no screens left, return now.
@@ -804,7 +821,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
             ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ);
 #endif
             xf86AccessEnter();
-            was_blocked = xf86BlockSIGIO();
+            OsBlockSIGIO();
+            sigio_blocked = TRUE;
         }
     }
 
@@ -816,6 +834,36 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
         !dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0))
         FatalError("Cannot register DDX private keys");
 
+    for (i = 0; i < xf86NumGPUScreens; i++) {
+        ScrnInfoPtr pScrn = xf86GPUScreens[i];
+        xf86VGAarbiterLock(pScrn);
+
+        /*
+         * Almost everything uses these defaults, and many of those that
+         * don't, will wrap them.
+         */
+        pScrn->EnableDisableFBAccess = xf86EnableDisableFBAccess;
+#ifdef XFreeXDGA
+        pScrn->SetDGAMode = xf86SetDGAMode;
+#endif
+        pScrn->DPMSSet = NULL;
+        pScrn->LoadPalette = NULL;
+        pScrn->SetOverscan = NULL;
+        pScrn->DriverFunc = NULL;
+        pScrn->pScreen = NULL;
+        scr_index = AddGPUScreen(pScrn->ScreenInit, argc, argv);
+        xf86VGAarbiterUnlock(pScrn);
+        if (scr_index == i) {
+            dixSetPrivate(&screenInfo.gpuscreens[scr_index]->devPrivates,
+                          xf86ScreenKey, xf86GPUScreens[i]);
+            pScrn->pScreen = screenInfo.gpuscreens[scr_index];
+            /* The driver should set this, but make sure it is set anyway */
+            pScrn->vtSema = TRUE;
+        } else {
+            FatalError("AddScreen/ScreenInit failed for gpu driver %d %d\n", i, scr_index);
+        }
+    }
+
     for (i = 0; i < xf86NumScreens; i++) {
         xf86VGAarbiterLock(xf86Screens[i]);
         /*
@@ -876,8 +924,12 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
 #endif
     }
 
+    for (i = 0; i < xf86NumGPUScreens; i++)
+        AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+
     xf86VGAarbiterWrapFunctions();
-    xf86UnblockSIGIO(was_blocked);
+    if (sigio_blocked)
+        OsReleaseSIGIO();
 
     xf86InitOrigins();
 
@@ -1020,7 +1072,7 @@ AbortDDX(enum ExitCode error)
 {
     int i;
 
-    xf86BlockSIGIO();
+    OsBlockSIGIO();
 
     /*
      * try to restore the original video state
@@ -1038,7 +1090,7 @@ AbortDDX(enum ExitCode error)
                  * screen explicitely.
                  */
                 xf86VGAarbiterLock(xf86Screens[i]);
-                (xf86Screens[i]->LeaveVT) (i, 0);
+                (xf86Screens[i]->LeaveVT) (xf86Screens[i]);
                 xf86VGAarbiterUnlock(xf86Screens[i]);
             }
     }
@@ -1053,19 +1105,19 @@ AbortDDX(enum ExitCode error)
 }
 
 void
-OsVendorFatalError(void)
+OsVendorFatalError(const char *f, va_list args)
 {
 #ifdef VENDORSUPPORT
-    ErrorF("\nPlease refer to your Operating System Vendor support pages\n"
-           "at %s for support on this crash.\n", VENDORSUPPORT);
+    ErrorFSigSafe("\nPlease refer to your Operating System Vendor support "
+                 "pages\nat %s for support on this crash.\n", VENDORSUPPORT);
 #else
-    ErrorF("\nPlease consult the " XVENDORNAME " support \n"
-           "\t at " __VENDORDWEBSUPPORT__ "\n for help. \n");
+    ErrorFSigSafe("\nPlease consult the " XVENDORNAME " support \n\t at "
+                 __VENDORDWEBSUPPORT__ "\n for help. \n");
 #endif
     if (xf86LogFile && xf86LogFileWasOpened)
-        ErrorF("Please also check the log file at \"%s\" for additional "
-               "information.\n", xf86LogFile);
-    ErrorF("\n");
+        ErrorFSigSafe("Please also check the log file at \"%s\" for additional "
+                     "information.\n", xf86LogFile);
+    ErrorFSigSafe("\n");
 }
 
 int
@@ -1580,3 +1632,10 @@ xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth)
     else
         return 0;
 }
+
+#ifdef DDXBEFORERESET
+void
+ddxBeforeReset(void)
+{
+}
+#endif
index ab4d595..d80dec8 100644 (file)
@@ -950,7 +950,7 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
                 mode->SynthClock /= 2;
         }
 
-        status = (*scrp->ValidMode) (scrp->scrnIndex, mode, FALSE,
+        status = (*scrp->ValidMode) (scrp, mode, FALSE,
                                      MODECHECK_INITIAL);
         if (status != MODE_OK)
             return status;
@@ -1840,7 +1840,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
             scrp->virtualX = newVirtX;
             scrp->virtualY = newVirtY;
             scrp->displayWidth = newLinePitch;
-            p->status = (scrp->ValidMode) (scrp->scrnIndex, p, FALSE,
+            p->status = (scrp->ValidMode) (scrp, p, FALSE,
                                            MODECHECK_FINAL);
 
             if (p->status != MODE_OK) {
index 894b93f..83f9790 100644 (file)
@@ -42,6 +42,7 @@
 #define _XF86MODULE_H
 
 #include "misc.h"
+#include "extension.h"
 #ifndef NULL
 #define NULL ((void *)0)
 #endif
@@ -55,9 +56,6 @@ typedef enum {
 
 #define DEFAULT_LIST ((char *)-1)
 
-/* This indicates a special module that doesn't have the usual entry point */
-#define EXTERN_MODULE ((pointer)-1)
-
 /* Built-in ABI classes.  These definitions must not be changed. */
 #define ABI_CLASS_NONE         NULL
 #define ABI_CLASS_ANSIC                "X.Org ANSI C Emulation"
@@ -82,9 +80,9 @@ typedef enum {
  * mask is 0xFFFF0000.
  */
 #define ABI_ANSIC_VERSION      SET_ABI_VERSION(0, 4)
-#define ABI_VIDEODRV_VERSION   SET_ABI_VERSION(12, 0)
-#define ABI_XINPUT_VERSION     SET_ABI_VERSION(16, 0)
-#define ABI_EXTENSION_VERSION  SET_ABI_VERSION(6, 0)
+#define ABI_VIDEODRV_VERSION   SET_ABI_VERSION(13, 0)
+#define ABI_XINPUT_VERSION     SET_ABI_VERSION(18, 0)
+#define ABI_EXTENSION_VERSION  SET_ABI_VERSION(7, 0)
 #define ABI_FONT_VERSION       SET_ABI_VERSION(0, 6)
 
 #define MODINFOSTRING1 0xef23fdc5
@@ -171,18 +169,6 @@ typedef struct {
 
 #define INITARGS void
 
-typedef void (*InitExtension) (INITARGS);
-
-typedef struct {
-    InitExtension initFunc;
-    const char *name;
-    Bool *disablePtr;
-    InitExtension setupFunc;
-    const char **initDependencies;
-} ExtensionModule;
-
-extern _X_EXPORT ExtensionModule *ExtensionModuleList;
-
 /* Prototypes for Loader functions that are exported to modules */
 extern _X_EXPORT pointer LoadSubModule(pointer, const char *, const char **,
                                        const char **, pointer,
@@ -193,7 +179,6 @@ extern _X_EXPORT pointer LoaderSymbol(const char *);
 extern _X_EXPORT char **LoaderListDirs(const char **, const char **);
 extern _X_EXPORT void LoaderFreeDirList(char **);
 extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);
-extern _X_EXPORT void LoadExtension(ExtensionModule *, Bool);
 extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor,
                                   int *teeny);
 extern _X_EXPORT Bool LoaderShouldIgnoreABI(void);
index f69fffa..15257cb 100644 (file)
@@ -92,8 +92,6 @@ eventName(pmEvent event, const char **str)
     }
 }
 
-static int sigio_blocked_for_suspend;
-
 static void
 suspend(pmEvent event, Bool undo)
 {
@@ -102,19 +100,19 @@ suspend(pmEvent event, Bool undo)
 
     for (i = 0; i < xf86NumScreens; i++) {
         if (xf86Screens[i]->EnableDisableFBAccess)
-            (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE);
+            (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], FALSE);
     }
     pInfo = xf86InputDevs;
     while (pInfo) {
         DisableDevice(pInfo->dev, TRUE);
         pInfo = pInfo->next;
     }
-    sigio_blocked_for_suspend = xf86BlockSIGIO();
+    OsBlockSIGIO();
     for (i = 0; i < xf86NumScreens; i++) {
         if (xf86Screens[i]->PMEvent)
-            xf86Screens[i]->PMEvent(i, event, undo);
+            xf86Screens[i]->PMEvent(xf86Screens[i], event, undo);
         else {
-            xf86Screens[i]->LeaveVT(i, 0);
+            xf86Screens[i]->LeaveVT(xf86Screens[i]);
             xf86Screens[i]->vtSema = FALSE;
         }
     }
@@ -131,16 +129,16 @@ resume(pmEvent event, Bool undo)
     xf86AccessEnter();
     for (i = 0; i < xf86NumScreens; i++) {
         if (xf86Screens[i]->PMEvent)
-            xf86Screens[i]->PMEvent(i, event, undo);
+            xf86Screens[i]->PMEvent(xf86Screens[i], event, undo);
         else {
             xf86Screens[i]->vtSema = TRUE;
-            xf86Screens[i]->EnterVT(i, 0);
+            xf86Screens[i]->EnterVT(xf86Screens[i]);
         }
     }
-    xf86UnblockSIGIO(sigio_blocked_for_suspend);
+    OsReleaseSIGIO();
     for (i = 0; i < xf86NumScreens; i++) {
         if (xf86Screens[i]->EnableDisableFBAccess)
-            (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE);
+            (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE);
     }
     dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
     pInfo = xf86InputDevs;
@@ -153,7 +151,7 @@ resume(pmEvent event, Bool undo)
 static void
 DoApmEvent(pmEvent event, Bool undo)
 {
-    int i, was_blocked;
+    int i;
 
     switch (event) {
 #if 0
@@ -184,13 +182,13 @@ DoApmEvent(pmEvent event, Bool undo)
         }
         break;
     default:
-        was_blocked = xf86BlockSIGIO();
+        OsBlockSIGIO();
         for (i = 0; i < xf86NumScreens; i++) {
             if (xf86Screens[i]->PMEvent) {
-                xf86Screens[i]->PMEvent(i, event, undo);
+                xf86Screens[i]->PMEvent(xf86Screens[i], event, undo);
             }
         }
-        xf86UnblockSIGIO(was_blocked);
+        OsReleaseSIGIO();
         break;
     }
 }
index 8d9cb55..c9f2e7e 100644 (file)
@@ -95,6 +95,8 @@ extern _X_EXPORT Bool xorgHWAccess;
 
 extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable;
 
+extern ScrnInfoPtr *xf86GPUScreens;      /* List of pointers to ScrnInfoRecs */
+extern int xf86NumGPUScreens;
 #ifndef DEFAULT_VERBOSE
 #define DEFAULT_VERBOSE                0
 #endif
@@ -114,8 +116,9 @@ extern _X_EXPORT void xf86BusProbe(void);
 extern _X_EXPORT void xf86AccessEnter(void);
 extern _X_EXPORT void xf86AccessLeave(void);
 extern _X_EXPORT void xf86PostProbe(void);
-extern _X_EXPORT void xf86ClearEntityListForScreen(int scrnIndex);
+extern _X_EXPORT void xf86ClearEntityListForScreen(ScrnInfoPtr pScrn);
 extern _X_EXPORT void xf86AddDevToEntity(int entityIndex, GDevPtr dev);
+extern _X_EXPORT void xf86RemoveDevFromEntity(int entityIndex, GDevPtr dev);
 
 /* xf86Config.c */
 
index e78cd40..e20be03 100644 (file)
@@ -110,6 +110,8 @@ typedef struct {
 
     Bool dri2;
     MessageType dri2From;
+
+    Bool autoAddGPU;
 } xf86InfoRec, *xf86InfoPtr;
 
 #ifdef DPMSExtension
index abd894d..5606bee 100644 (file)
@@ -66,7 +66,7 @@ static Bool
 xf86RandRGetInfo(ScreenPtr pScreen, Rotation * rotations)
 {
     RRScreenSizePtr pSize;
-    ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
     DisplayModePtr mode;
     int refresh0 = 60;
@@ -147,7 +147,7 @@ xf86RandRSetMode(ScreenPtr pScreen,
                  DisplayModePtr mode,
                  Bool useVirtual, int mmWidth, int mmHeight)
 {
-    ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
     int oldWidth = pScreen->width;
     int oldHeight = pScreen->height;
@@ -159,7 +159,7 @@ xf86RandRSetMode(ScreenPtr pScreen,
     Bool ret = TRUE;
 
     if (pRoot && scrp->vtSema)
-        (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE);
+        (*scrp->EnableDisableFBAccess) (scrp, FALSE);
     if (useVirtual) {
         scrp->virtualX = randrp->virtualX;
         scrp->virtualY = randrp->virtualY;
@@ -220,7 +220,7 @@ xf86RandRSetMode(ScreenPtr pScreen,
     xf86SetViewport(pScreen, pScreen->width, pScreen->height);
     xf86SetViewport(pScreen, 0, 0);
     if (pRoot && scrp->vtSema)
-        (*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE);
+        (*scrp->EnableDisableFBAccess) (scrp, TRUE);
     return ret;
 }
 
@@ -228,7 +228,7 @@ static Bool
 xf86RandRSetConfig(ScreenPtr pScreen,
                    Rotation rotation, int rate, RRScreenSizePtr pSize)
 {
-    ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
     DisplayModePtr mode;
     int pos[MAXDEVICES][2];
@@ -344,7 +344,7 @@ xf86RandRCreateScreenResources(ScreenPtr pScreen)
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
 
 #if 0
-    ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
     DisplayModePtr mode;
 #endif
 
@@ -365,9 +365,9 @@ xf86RandRCreateScreenResources(ScreenPtr pScreen)
  * Reset size back to original
  */
 static Bool
-xf86RandRCloseScreen(int index, ScreenPtr pScreen)
+xf86RandRCloseScreen(ScreenPtr pScreen)
 {
-    ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
 
     scrp->virtualX = pScreen->width = randrp->virtualX;
@@ -376,7 +376,7 @@ xf86RandRCloseScreen(int index, ScreenPtr pScreen)
     pScreen->CloseScreen = randrp->CloseScreen;
     free(randrp);
     dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, NULL);
-    return (*pScreen->CloseScreen) (index, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Rotation
@@ -417,8 +417,9 @@ xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
 
     /* This is only for during server start */
     if (resetMode) {
+       ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
         return (xf86RandRSetMode(pScreen,
-                                 XF86SCRNINFO(pScreen)->currentMode,
+                                 pScrn->currentMode,
                                  TRUE, pScreen->mmWidth, pScreen->mmHeight));
     }
 
@@ -430,7 +431,7 @@ xf86RandRInit(ScreenPtr pScreen)
 {
     rrScrPrivPtr rp;
     XF86RandRInfoPtr randrp;
-    ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
 
 #ifdef PANORAMIX
     /* XXX disable RandR when using Xinerama */
index 7c9e6ba..225fff0 100644 (file)
@@ -106,7 +106,7 @@ xf86VGAarbiterAllowDRI(ScreenPtr pScreen)
 {
     int vga_count;
     int rsrc_decodes;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
     if (vga_no_arb)
         return TRUE;
@@ -173,7 +173,7 @@ xf86VGAarbiterWrapFunctions(void)
     for (i = 0; i < xf86NumScreens; i++) {
         pScreen = xf86Screens[i]->pScreen;
         ps = GetPictureScreenIfSet(pScreen);
-        pScrn = xf86Screens[pScreen->myNum];
+        pScrn = xf86ScreenToScrn(pScreen);
         PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
 
         if (!dixRegisterPrivateKey
@@ -221,10 +221,10 @@ xf86VGAarbiterWrapFunctions(void)
 
 /* Screen funcs */
 static Bool
-VGAarbiterCloseScreen(int i, ScreenPtr pScreen)
+VGAarbiterCloseScreen(ScreenPtr pScreen)
 {
     Bool val;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     VGAarbiterScreenPtr pScreenPriv =
         (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                                VGAarbiterScreenKey);
@@ -258,34 +258,30 @@ VGAarbiterCloseScreen(int i, ScreenPtr pScreen)
     UNWRAP_SPRITE;
 
     free((pointer) pScreenPriv);
-    xf86VGAarbiterLock(xf86Screens[i]);
-    val = (*pScreen->CloseScreen) (i, pScreen);
-    xf86VGAarbiterUnlock(xf86Screens[i]);
+    xf86VGAarbiterLock(xf86ScreenToScrn(pScreen));
+    val = (*pScreen->CloseScreen) (pScreen);
+    xf86VGAarbiterUnlock(xf86ScreenToScrn(pScreen));
     return val;
 }
 
 static void
-VGAarbiterBlockHandler(int i,
-                       pointer blockData, pointer pTimeout, pointer pReadmask)
+VGAarbiterBlockHandler(ScreenPtr pScreen,
+                       pointer pTimeout, pointer pReadmask)
 {
-    ScreenPtr pScreen = screenInfo.screens[i];
-
     SCREEN_PROLOG(BlockHandler);
     VGAGet(pScreen);
-    pScreen->BlockHandler(i, blockData, pTimeout, pReadmask);
+    pScreen->BlockHandler(pScreen, pTimeout, pReadmask);
     VGAPut();
     SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler);
 }
 
 static void
-VGAarbiterWakeupHandler(int i, pointer blockData, unsigned long result,
+VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result,
                         pointer pReadmask)
 {
-    ScreenPtr pScreen = screenInfo.screens[i];
-
     SCREEN_PROLOG(WakeupHandler);
     VGAGet(pScreen);
-    pScreen->WakeupHandler(i, blockData, result, pReadmask);
+    pScreen->WakeupHandler(pScreen, result, pReadmask);
     VGAPut();
     SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler);
 }
@@ -298,9 +294,7 @@ VGAarbiterGetImage(DrawablePtr pDrawable,
     ScreenPtr pScreen = pDrawable->pScreen;
 
     SCREEN_PROLOG(GetImage);
-//    if (xf86Screens[pScreen->myNum]->vtSema) {
     VGAGet(pScreen);
-//    }
     (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine);
     VGAPut();
     SCREEN_EPILOG(GetImage, VGAarbiterGetImage);
@@ -468,46 +462,45 @@ VGAarbiterSetCursorPosition(DeviceIntPtr pDev,
 }
 
 static void
-VGAarbiterAdjustFrame(int index, int x, int y, int flags)
+VGAarbiterAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
 {
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     VGAarbiterScreenPtr pScreenPriv =
         (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                                VGAarbiterScreenKey);
 
     VGAGet(pScreen);
-    (*pScreenPriv->AdjustFrame) (index, x, y, flags);
+    (*pScreenPriv->AdjustFrame) (pScrn, x, y);
     VGAPut();
 }
 
 static Bool
-VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags)
+VGAarbiterSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
 {
     Bool val;
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     VGAarbiterScreenPtr pScreenPriv =
         (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                                VGAarbiterScreenKey);
 
     VGAGet(pScreen);
-    val = (*pScreenPriv->SwitchMode) (index, mode, flags);
+    val = (*pScreenPriv->SwitchMode) (pScrn, mode);
     VGAPut();
     return val;
 }
 
 static Bool
-VGAarbiterEnterVT(int index, int flags)
+VGAarbiterEnterVT(ScrnInfoPtr pScrn)
 {
     Bool val;
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     VGAarbiterScreenPtr pScreenPriv =
         (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                                VGAarbiterScreenKey);
 
     VGAGet(pScreen);
     pScrn->EnterVT = pScreenPriv->EnterVT;
-    val = (*pScrn->EnterVT) (index, flags);
+    val = (*pScrn->EnterVT) (pScrn);
     pScreenPriv->EnterVT = pScrn->EnterVT;
     pScrn->EnterVT = VGAarbiterEnterVT;
     VGAPut();
@@ -515,32 +508,31 @@ VGAarbiterEnterVT(int index, int flags)
 }
 
 static void
-VGAarbiterLeaveVT(int index, int flags)
+VGAarbiterLeaveVT(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     VGAarbiterScreenPtr pScreenPriv =
         (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                                VGAarbiterScreenKey);
 
     VGAGet(pScreen);
     pScrn->LeaveVT = pScreenPriv->LeaveVT;
-    (*pScreenPriv->LeaveVT) (index, flags);
+    (*pScreenPriv->LeaveVT) (pScrn);
     pScreenPriv->LeaveVT = pScrn->LeaveVT;
     pScrn->LeaveVT = VGAarbiterLeaveVT;
     VGAPut();
 }
 
 static void
-VGAarbiterFreeScreen(int index, int flags)
+VGAarbiterFreeScreen(ScrnInfoPtr pScrn)
 {
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     VGAarbiterScreenPtr pScreenPriv =
         (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                                VGAarbiterScreenKey);
 
     VGAGet(pScreen);
-    (*pScreenPriv->FreeScreen) (index, flags);
+    (*pScreenPriv->FreeScreen) (pScrn);
     VGAPut();
 }
 
index 2513ce6..ba6edfc 100644 (file)
@@ -95,7 +95,7 @@
 static inline void
 VGAGet(ScreenPtr pScreen)
 {
-    pci_device_vgaarb_set_target(xf86Screens[pScreen->myNum]->vgaDev);
+    pci_device_vgaarb_set_target(xf86ScreenToScrn(pScreen)->vgaDev);
     pci_device_vgaarb_lock();
 }
 
@@ -125,11 +125,11 @@ typedef struct _VGAarbiterScreen {
     UnrealizeCursorProcPtr UnrealizeCursor;
     RecolorCursorProcPtr RecolorCursor;
     SetCursorPositionProcPtr SetCursorPosition;
-    void (*AdjustFrame) (int, int, int, int);
-    Bool (*SwitchMode) (int, DisplayModePtr, int);
-    Bool (*EnterVT) (int, int);
-    void (*LeaveVT) (int, int);
-    void (*FreeScreen) (int, int);
+    void (*AdjustFrame) (ScrnInfoPtr, int, int);
+    Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr);
+    Bool (*EnterVT) (ScrnInfoPtr);
+    void (*LeaveVT) (ScrnInfoPtr);
+    void (*FreeScreen) (ScrnInfoPtr);
     miPointerSpriteFuncPtr miSprite;
     CompositeProcPtr Composite;
     GlyphsProcPtr Glyphs;
@@ -142,11 +142,11 @@ typedef struct _VGAarbiterGC {
 } VGAarbiterGCRec, *VGAarbiterGCPtr;
 
 /* Screen funcs */
-static void VGAarbiterBlockHandler(int i, pointer blockData, pointer pTimeout,
+static void VGAarbiterBlockHandler(ScreenPtr pScreen, pointer pTimeout,
                                    pointer pReadmask);
-static void VGAarbiterWakeupHandler(int i, pointer blockData,
+static void VGAarbiterWakeupHandler(ScreenPtr pScreen,
                                     unsigned long result, pointer pReadmask);
-static Bool VGAarbiterCloseScreen(int i, ScreenPtr pScreen);
+static Bool VGAarbiterCloseScreen(ScreenPtr pScreen);
 static void VGAarbiterGetImage(DrawablePtr pDrawable, int sx, int sy, int w,
                                int h, unsigned int format,
                                unsigned long planemask, char *pdstLine);
@@ -176,11 +176,11 @@ static Bool VGAarbiterDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
 static Bool VGAarbiterSetCursorPosition(DeviceIntPtr pDev, ScreenPtr
                                         pScreen, int x, int y,
                                         Bool generateEvent);
-static void VGAarbiterAdjustFrame(int index, int x, int y, int flags);
-static Bool VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags);
-static Bool VGAarbiterEnterVT(int index, int flags);
-static void VGAarbiterLeaveVT(int index, int flags);
-static void VGAarbiterFreeScreen(int index, int flags);
+static void VGAarbiterAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
+static Bool VGAarbiterSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode);
+static Bool VGAarbiterEnterVT(ScrnInfoPtr pScrn);
+static void VGAarbiterLeaveVT(ScrnInfoPtr pScrn);
+static void VGAarbiterFreeScreen(ScrnInfoPtr pScrn);
 
 /* GC funcs */
 static void VGAarbiterValidateGC(GCPtr pGC, unsigned long changes,
index 13ffe06..a7d1c25 100644 (file)
@@ -50,7 +50,7 @@
 static DevPrivateKeyRec VidModeKeyRec;
 static DevPrivateKey VidModeKey;
 static int VidModeCount = 0;
-static Bool VidModeClose(int i, ScreenPtr pScreen);
+static Bool VidModeClose(ScreenPtr pScreen);
 
 #define VMPTR(p) ((VidModePtr)dixLookupPrivate(&(p)->devPrivates, VidModeKey))
 
@@ -93,7 +93,7 @@ VidModeExtensionInit(ScreenPtr pScreen)
 #ifdef XF86VIDMODE
 
 static Bool
-VidModeClose(int i, ScreenPtr pScreen)
+VidModeClose(ScreenPtr pScreen)
 {
     VidModePtr pVidMode = VMPTR(pScreen);
 
@@ -108,7 +108,7 @@ VidModeClose(int i, ScreenPtr pScreen)
         dixSetPrivate(&pScreen->devPrivates, VidModeKey, NULL);
         VidModeKey = NULL;
     }
-    return pScreen->CloseScreen(i, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 Bool
@@ -303,7 +303,7 @@ VidModeSetViewPort(int scrnIndex, int x, int y)
                          pScrn->virtualY - pScrn->currentMode->VDisplay);
     pScrn->frameY1 = pScrn->frameY0 + pScrn->currentMode->VDisplay - 1;
     if (pScrn->AdjustFrame != NULL)
-        (pScrn->AdjustFrame) (scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+        (pScrn->AdjustFrame) (pScrn, pScrn->frameX0, pScrn->frameY0);
 
     return TRUE;
 }
index 77b8000..bee407b 100644 (file)
@@ -1059,26 +1059,24 @@ xf86PostMotionEventP(DeviceIntPtr device,
     xf86PostMotionEventM(device, is_absolute, &mask);
 }
 
-void
-xf86PostMotionEventM(DeviceIntPtr device,
-                     int is_absolute, const ValuatorMask *mask)
+static int
+xf86CheckMotionEvent4DGA(DeviceIntPtr device, int is_absolute,
+                         const ValuatorMask *mask)
 {
-    int flags = 0;
-
-    if (valuator_mask_num_valuators(mask) > 0) {
-        if (is_absolute)
-            flags = POINTER_ABSOLUTE;
-        else
-            flags = POINTER_RELATIVE | POINTER_ACCELERATE;
-    }
+    int stolen = 0;
 
 #if XFreeXDGA
+    ScreenPtr scr = NULL;
+    int idx, i;
+
     /* The evdev driver may not always send all axes across. */
-    if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1))
-        if (miPointerGetScreen(device)) {
-            int index = miPointerGetScreen(device)->myNum;
+    if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1)) {
+        scr = miPointerGetScreen(device);
+        if (scr) {
             int dx = 0, dy = 0;
 
+            idx = scr->myNum;
+
             if (valuator_mask_isset(mask, 0)) {
                 dx = valuator_mask_get(mask, 0);
                 if (is_absolute)
@@ -1091,11 +1089,75 @@ xf86PostMotionEventM(DeviceIntPtr device,
                     dy -= device->last.valuators[1];
             }
 
-            if (DGAStealMotionEvent(device, index, dx, dy))
-                return;
+            if (DGAStealMotionEvent(device, idx, dx, dy))
+                stolen = 1;
+        }
+    }
+
+    for (i = 2; i < valuator_mask_size(mask); i++) {
+        AxisInfoPtr ax;
+        double incr;
+        int val, button;
+
+        if (i >= device->valuator->numAxes)
+            break;
+
+        if (!valuator_mask_isset(mask, i))
+            continue;
+
+        ax = &device->valuator->axes[i];
+
+        if (ax->scroll.type == SCROLL_TYPE_NONE)
+            continue;
+
+        if (!scr) {
+            scr = miPointerGetScreen(device);
+            if (!scr)
+                break;
+            idx = scr->myNum;
+        }
+
+        incr = ax->scroll.increment;
+        val = valuator_mask_get(mask, i);
+
+        if (ax->scroll.type == SCROLL_TYPE_VERTICAL) {
+            if (incr * val < 0)
+                button = 4; /* up */
+            else
+                button = 5; /* down */
+        } else { /* SCROLL_TYPE_HORIZONTAL */
+            if (incr * val < 0)
+                button = 6; /* left */
+            else
+                button = 7; /* right */
         }
+
+        if (DGAStealButtonEvent(device, idx, button, 1) &&
+                DGAStealButtonEvent(device, idx, button, 0))
+            stolen = 1;
+    }
+
 #endif
 
+    return stolen;
+}
+
+void
+xf86PostMotionEventM(DeviceIntPtr device,
+                     int is_absolute, const ValuatorMask *mask)
+{
+    int flags = 0;
+
+    if (xf86CheckMotionEvent4DGA(device, is_absolute, mask))
+        return;
+
+    if (valuator_mask_num_valuators(mask) > 0) {
+        if (is_absolute)
+            flags = POINTER_ABSOLUTE;
+        else
+            flags = POINTER_RELATIVE | POINTER_ACCELERATE;
+    }
+
     QueuePointerEvents(device, MotionNotify, 0, flags, mask);
 }
 
index 3731a34..35c38a5 100644 (file)
 #define XI86_ALWAYS_CORE       0x04    /* device always controls the pointer */
 /* the device sends Xinput and core pointer events */
 #define XI86_SEND_CORE_EVENTS  XI86_ALWAYS_CORE
+/* 0x08 is reserved for legacy XI86_SEND_DRAG_EVENTS, do not use for now */
+/* server-internal only */
+#define XI86_DEVICE_DISABLED    0x10    /* device was disabled before vt switch */
 
 /* This holds the input driver entry and module information. */
 typedef struct _InputDriverRec {
     int driverVersion;
-    char *driverName;
+    const char *driverName;
     void (*Identify) (int flags);
     int (*PreInit) (struct _InputDriverRec * drv,
                     struct _InputInfoRec * pInfo, int flags);
     void (*UnInit) (struct _InputDriverRec * drv,
                     struct _InputInfoRec * pInfo, int flags);
     pointer module;
-    char **default_options;
+    const char **default_options;
 } InputDriverRec, *InputDriverPtr;
 
 /* This is to input devices what the ScrnInfoRec is to screens. */
@@ -95,7 +98,7 @@ typedef struct _InputInfoRec {
     int fd;
     DeviceIntPtr dev;
     pointer private;
-    char *type_name;
+    const char *type_name;
     InputDriverPtr drv;
     pointer module;
     XF86OptionPtr options;
index cdc8459..25f84e5 100644 (file)
@@ -66,7 +66,7 @@
 #define LOAD_PALETTE(pmap) \
     ((pmap == GetInstalledmiColormap(pmap->pScreen)) && \
      ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || \
-      xf86Screens[pmap->pScreen->myNum]->vtSema || pScreenPriv->isDGAmode))
+      xf86ScreenToScrn(pmap->pScreen)->vtSema || pScreenPriv->isDGAmode))
 
 typedef struct _CMapLink {
     ColormapPtr cmap;
@@ -80,9 +80,9 @@ typedef struct {
     DestroyColormapProcPtr DestroyColormap;
     InstallColormapProcPtr InstallColormap;
     StoreColorsProcPtr StoreColors;
-    Bool (*EnterVT) (int, int);
-    Bool (*SwitchMode) (int, DisplayModePtr, int);
-    int (*SetDGAMode) (int, int, DGADevicePtr);
+    Bool (*EnterVT) (ScrnInfoPtr);
+    Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr);
+    int (*SetDGAMode) (ScrnInfoPtr, int, DGADevicePtr);
     xf86ChangeGammaProc *ChangeGamma;
     int maxColors;
     int sigRGBbits;
@@ -111,17 +111,17 @@ static DevPrivateKeyRec CMapColormapKeyRec;
 
 static void CMapInstallColormap(ColormapPtr);
 static void CMapStoreColors(ColormapPtr, int, xColorItem *);
-static Bool CMapCloseScreen(int, ScreenPtr);
+static Bool CMapCloseScreen(ScreenPtr);
 static Bool CMapCreateColormap(ColormapPtr);
 static void CMapDestroyColormap(ColormapPtr);
 
-static Bool CMapEnterVT(int, int);
-static Bool CMapSwitchMode(int, DisplayModePtr, int);
+static Bool CMapEnterVT(ScrnInfoPtr);
+static Bool CMapSwitchMode(ScrnInfoPtr, DisplayModePtr);
 
 #ifdef XFreeXDGA
-static int CMapSetDGAMode(int, int, DGADevicePtr);
+static int CMapSetDGAMode(ScrnInfoPtr, int, DGADevicePtr);
 #endif
-static int CMapChangeGamma(int, Gamma);
+static int CMapChangeGamma(ScrnInfoPtr, Gamma);
 
 static void ComputeGamma(CMapScreenPtr);
 static Bool CMapAllocateColormapPrivate(ColormapPtr);
@@ -151,7 +151,7 @@ xf86HandleColormaps(ScreenPtr pScreen,
                     xf86LoadPaletteProc * loadPalette,
                     xf86SetOverscanProc * setOverscan, unsigned int flags)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     ColormapPtr pDefMap = NULL;
     CMapScreenPtr pScreenPriv;
     LOCO *gamma;
@@ -241,11 +241,11 @@ xf86HandleColormaps(ScreenPtr pScreen,
 /**** Screen functions ****/
 
 static Bool
-CMapCloseScreen(int i, ScreenPtr pScreen)
+CMapCloseScreen(ScreenPtr pScreen)
 {
     CMapUnwrapScreen(pScreen);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static Bool
@@ -462,16 +462,15 @@ CMapInstallColormap(ColormapPtr pmap)
 /**** ScrnInfoRec functions ****/
 
 static Bool
-CMapEnterVT(int index, int flags)
+CMapEnterVT(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     Bool ret;
     CMapScreenPtr pScreenPriv =
         (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey);
 
     pScrn->EnterVT = pScreenPriv->EnterVT;
-    ret = (*pScreenPriv->EnterVT) (index, flags);
+    ret = (*pScreenPriv->EnterVT) (pScrn);
     pScreenPriv->EnterVT = pScrn->EnterVT;
     pScrn->EnterVT = CMapEnterVT;
     if (ret) {
@@ -483,13 +482,13 @@ CMapEnterVT(int index, int flags)
 }
 
 static Bool
-CMapSwitchMode(int index, DisplayModePtr mode, int flags)
+CMapSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
 {
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     CMapScreenPtr pScreenPriv =
         (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey);
 
-    if ((*pScreenPriv->SwitchMode) (index, mode, flags)) {
+    if ((*pScreenPriv->SwitchMode) (pScrn, mode)) {
         if (GetInstalledmiColormap(pScreen))
             CMapReinstallMap(GetInstalledmiColormap(pScreen));
         return TRUE;
@@ -499,19 +498,19 @@ CMapSwitchMode(int index, DisplayModePtr mode, int flags)
 
 #ifdef XFreeXDGA
 static int
-CMapSetDGAMode(int index, int num, DGADevicePtr dev)
+CMapSetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr dev)
 {
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     CMapScreenPtr pScreenPriv =
         (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey);
     int ret;
 
-    ret = (*pScreenPriv->SetDGAMode) (index, num, dev);
+    ret = (*pScreenPriv->SetDGAMode) (pScrn, num, dev);
 
-    pScreenPriv->isDGAmode = DGAActive(index);
+    pScreenPriv->isDGAmode = DGAActive(pScrn->scrnIndex);
 
     if (!pScreenPriv->isDGAmode && GetInstalledmiColormap(pScreen)
-        && xf86Screens[pScreen->myNum]->vtSema)
+        && xf86ScreenToScrn(pScreen)->vtSema)
         CMapReinstallMap(GetInstalledmiColormap(pScreen));
 
     return ret;
@@ -528,7 +527,7 @@ CMapReinstallMap(ColormapPtr pmap)
                                          CMapScreenKey);
     CMapColormapPtr cmapPriv =
         (CMapColormapPtr) dixLookupPrivate(&pmap->devPrivates, CMapColormapKey);
-    ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pmap->pScreen);
     int i = cmapPriv->numColors;
     int *indices = pScreenPriv->PreAllocIndices;
 
@@ -560,7 +559,7 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int *indices)
     CMapColormapPtr pColPriv =
         (CMapColormapPtr) dixLookupPrivate(&pmap->devPrivates, CMapColormapKey);
     VisualPtr pVisual = pmap->pVisual;
-    ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pmap->pScreen);
     int numColors, i;
     LOCO *gamma, *colors;
     EntryPtr entry;
@@ -692,7 +691,7 @@ CMapSetOverscan(ColormapPtr pmap, int defs, int *indices)
                                          CMapScreenKey);
     CMapColormapPtr pColPriv =
         (CMapColormapPtr) dixLookupPrivate(&pmap->devPrivates, CMapColormapKey);
-    ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pmap->pScreen);
     VisualPtr pVisual = pmap->pVisual;
     int i;
     LOCO *colors;
@@ -833,7 +832,7 @@ CMapUnwrapScreen(ScreenPtr pScreen)
 {
     CMapScreenPtr pScreenPriv =
         (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey);
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
     pScreen->CloseScreen = pScreenPriv->CloseScreen;
     pScreen->CreateColormap = pScreenPriv->CreateColormap;
@@ -908,11 +907,10 @@ ComputeGamma(CMapScreenPtr priv)
 }
 
 int
-CMapChangeGamma(int index, Gamma gamma)
+CMapChangeGamma(ScrnInfoPtr pScrn, Gamma gamma)
 {
     int ret = Success;
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    ScreenPtr pScreen = pScrn->pScreen;
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     CMapColormapPtr pColPriv;
     CMapScreenPtr pScreenPriv;
     CMapLinkPtr pLink;
@@ -979,7 +977,7 @@ CMapChangeGamma(int index, Gamma gamma)
 
     pScrn->ChangeGamma = pScreenPriv->ChangeGamma;
     if (pScrn->ChangeGamma)
-        ret = pScrn->ChangeGamma(index, gamma);
+        ret = pScrn->ChangeGamma(pScrn, gamma);
     pScrn->ChangeGamma = CMapChangeGamma;
 
     return ret;
@@ -1008,7 +1006,7 @@ xf86ChangeGammaRamp(ScreenPtr pScreen,
                     unsigned short *red,
                     unsigned short *green, unsigned short *blue)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     CMapColormapPtr pColPriv;
     CMapScreenPtr pScreenPriv;
     CMapLinkPtr pLink;
@@ -1085,7 +1083,7 @@ xf86ChangeGammaRamp(ScreenPtr pScreen,
 int
 xf86GetGammaRampSize(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     CMapScreenPtr pScreenPriv;
 
     if (xf86_crtc_supports_gamma(pScrn)) {
@@ -1112,7 +1110,7 @@ xf86GetGammaRamp(ScreenPtr pScreen,
                  unsigned short *red,
                  unsigned short *green, unsigned short *blue)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     CMapScreenPtr pScreenPriv;
     LOCO *entry;
     int shift, sigbits;
@@ -1172,10 +1170,10 @@ xf86GetGammaRamp(ScreenPtr pScreen,
 int
 xf86ChangeGamma(ScreenPtr pScreen, Gamma gamma)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
     if (pScrn->ChangeGamma)
-        return (*pScrn->ChangeGamma) (pScreen->myNum, gamma);
+        return (*pScrn->ChangeGamma) (pScrn, gamma);
 
     return BadImplementation;
 }
index 1e51623..303b9c2 100644 (file)
@@ -54,6 +54,10 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
     EntityPtr p;
     int num;
 
+#ifdef XSERVER_PLATFORM_BUS
+    if (platformSlotClaimed)
+        return -1;
+#endif
 #ifdef XSERVER_LIBPCIACCESS
     if (pciSlotClaimed)
         return -1;
index 3c29bf5..c2e7bab 100644 (file)
@@ -1149,7 +1149,7 @@ static FBManagerFuncs xf86FBManFuncs = {
 };
 
 static Bool
-xf86FBCloseScreen(int i, ScreenPtr pScreen)
+xf86FBCloseScreen(ScreenPtr pScreen)
 {
     FBLinkPtr pLink, tmp;
     FBLinearLinkPtr pLinearLink, tmp2;
@@ -1180,13 +1180,13 @@ xf86FBCloseScreen(int i, ScreenPtr pScreen)
     free(offman);
     dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, NULL);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Bool
 xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     RegionRec ScreenRegion;
     RegionRec FullRegion;
     BoxRec ScreenBox;
@@ -1223,7 +1223,7 @@ xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox)
 Bool
 xf86InitFBManagerArea(ScreenPtr pScreen, int PixelArea, int Verbosity)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xRectangle Rect[3];
     RegionPtr pRegion, pScreenRegion;
     int nRect;
index e52f1da..a2c18eb 100644 (file)
@@ -52,7 +52,7 @@
 #define PCI_VENDOR_GENERIC             0x00FF
 
 /* Bus-specific globals */
-Bool pciSlotClaimed = FALSE;
+int pciSlotClaimed = 0;
 
 #define PCIINFOCLASSES(c) \
     ( (((c) & 0x00ff0000) == (PCI_CLASS_PREHISTORIC << 16)) \
@@ -110,7 +110,7 @@ xf86PciProbe(void)
             xf86PciVideoInfo[num - 1] = info;
 
             pci_device_probe(info);
-            if (pci_device_is_boot_vga(info)) {
+            if (primaryBus.type == BUS_NONE && pci_device_is_boot_vga(info)) {
                 primaryBus.type = BUS_PCI;
                 primaryBus.id.pci = info;
             }
@@ -223,7 +223,7 @@ xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp,
         p->inUse = FALSE;
         if (dev)
             xf86AddDevToEntity(num, dev);
-        pciSlotClaimed = TRUE;
+        pciSlotClaimed++;
 
         return num;
     }
@@ -235,7 +235,7 @@ xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp,
  * Unclaim PCI slot, e.g. if probing failed, so that a different driver can claim.
  */
 void
-xf86UnclaimPciSlot(struct pci_device *d)
+xf86UnclaimPciSlot(struct pci_device *d, GDevPtr dev)
 {
     int i;
 
@@ -244,6 +244,8 @@ xf86UnclaimPciSlot(struct pci_device *d)
 
         if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) {
             /* Probably the slot should be deallocated? */
+            xf86RemoveDevFromEntity(i, dev);
+            pciSlotClaimed--;
             p->bus.type = BUS_NONE;
             return;
         }
@@ -350,7 +352,15 @@ xf86ComparePciBusString(const char *busID, int bus, int device, int func)
 Bool
 xf86IsPrimaryPci(struct pci_device *pPci)
 {
-    return ((primaryBus.type == BUS_PCI) && (pPci == primaryBus.id.pci));
+    if (primaryBus.type == BUS_PCI)
+        return pPci == primaryBus.id.pci;
+#ifdef XSERVER_PLATFORM_BUS
+    if (primaryBus.type == BUS_PLATFORM)
+        if (primaryBus.id.plat->pdev)
+            if (MATCH_PCI_DEVICES(primaryBus.id.plat->pdev, pPci))
+                return TRUE;
+#endif
+    return FALSE;
 }
 
 /*
@@ -365,7 +375,15 @@ xf86GetPciInfoForEntity(int entityIndex)
         return NULL;
 
     p = xf86Entities[entityIndex];
-    return (p->bus.type == BUS_PCI) ? p->bus.id.pci : NULL;
+    switch (p->bus.type) {
+    case BUS_PCI:
+        return p->bus.id.pci;
+    case BUS_PLATFORM:
+        return p->bus.id.plat->pdev;
+    default:
+        break;
+    }
+    return NULL;
 }
 
 /*
@@ -398,6 +416,13 @@ xf86CheckPciSlot(const struct pci_device *d)
         if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) {
             return FALSE;
         }
+#ifdef XSERVER_PLATFORM_BUS
+        if ((p->bus.type == BUS_PLATFORM) && (p->bus.id.plat->pdev)) {
+            struct pci_device *ud = p->bus.id.plat->pdev;
+            if (MATCH_PCI_DEVICES(ud, d))
+                return FALSE;
+        }
+#endif
     }
     return TRUE;
 }
@@ -537,7 +562,7 @@ xf86PciProbeDev(DriverPtr drvp)
                         foundScreen = TRUE;
                     }
                     else
-                        xf86UnclaimPciSlot(pPci);
+                        xf86UnclaimPciSlot(pPci, devList[i]);
                 }
 
                 break;
@@ -1063,8 +1088,8 @@ xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
     return TRUE;
 }
 
-static int
-videoPtrToDriverList(struct pci_device *dev,
+int
+xf86VideoPtrToDriverList(struct pci_device *dev,
                      char *returnList[], int returnListMax)
 {
     int i;
@@ -1247,8 +1272,8 @@ xchomp(char *line)
  * don't export their PCI ID's properly. If distros don't end up using this
  * feature it can and should be removed because the symbol-based resolution
  * scheme should be the primary one */
-static void
-matchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_chip)
+void
+xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_chip)
 {
     DIR *idsdir;
     FILE *fp;
@@ -1377,7 +1402,7 @@ xf86PciMatchDriver(char *matches[], int nmatches)
     pci_iterator_destroy(iter);
 #ifdef __linux__
     if (info)
-        matchDriverFromFiles(matches, info->vendor_id, info->device_id);
+        xf86MatchDriverFromFiles(matches, info->vendor_id, info->device_id);
 #endif
 
     for (i = 0; (i < nmatches) && (matches[i]); i++) {
@@ -1385,7 +1410,7 @@ xf86PciMatchDriver(char *matches[], int nmatches)
     }
 
     if ((info != NULL) && (i < nmatches)) {
-        i += videoPtrToDriverList(info, &(matches[i]), nmatches - i);
+        i += xf86VideoPtrToDriverList(info, &(matches[i]), nmatches - i);
     }
 
     return i;
index 56ec6e9..4972c36 100644 (file)
@@ -42,4 +42,14 @@ Bool xf86PciConfigure(void *busData, struct pci_device *pDev);
 void xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo,
                             GDevRec * GDev, int *chipset);
 
+#define MATCH_PCI_DEVICES(x, y) (((x)->domain == (y)->domain) &&        \
+                                 ((x)->bus == (y)->bus) &&              \
+                                 ((x)->func == (y)->func) &&            \
+                                 ((x)->dev == (y)->dev))
+
+void
+xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_chip);
+int
+xf86VideoPtrToDriverList(struct pci_device *dev,
+                         char *returnList[], int returnListMax);
 #endif                          /* _XF86_PCI_BUS_H */
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
new file mode 100644 (file)
index 0000000..24b9473
--- /dev/null
@@ -0,0 +1,492 @@
+/*
+ * Copyright © 2012 Red Hat.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Dave Airlie <airlied@redhat.com>
+ */
+
+/*
+ * This file contains the interfaces to the bus-specific code
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#ifdef XSERVER_PLATFORM_BUS
+#include <errno.h>
+
+#include <pciaccess.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include "os.h"
+#include "hotplug.h"
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86Priv.h"
+#include "xf86str.h"
+#include "xf86Bus.h"
+#include "Pci.h"
+#include "xf86platformBus.h"
+
+int platformSlotClaimed;
+
+int xf86_num_platform_devices;
+
+static struct xf86_platform_device *xf86_platform_devices;
+
+int
+xf86_add_platform_device(struct OdevAttributes *attribs)
+{
+    xf86_platform_devices = xnfrealloc(xf86_platform_devices,
+                                   (sizeof(struct xf86_platform_device)
+                                    * (xf86_num_platform_devices + 1)));
+
+    xf86_platform_devices[xf86_num_platform_devices].attribs = attribs;
+    xf86_platform_devices[xf86_num_platform_devices].pdev = NULL;
+
+    xf86_num_platform_devices++;
+    return 0;
+}
+
+int
+xf86_remove_platform_device(int dev_index)
+{
+    int j;
+
+    config_odev_free_attribute_list(xf86_platform_devices[dev_index].attribs);
+
+    for (j = dev_index; j < xf86_num_platform_devices - 1; j++)
+        memcpy(&xf86_platform_devices[j], &xf86_platform_devices[j + 1], sizeof(struct xf86_platform_device));
+    xf86_num_platform_devices--;
+    return 0;
+}
+
+Bool
+xf86_add_platform_device_attrib(int index, int attrib_id, char *attrib_name)
+{
+    struct xf86_platform_device *device = &xf86_platform_devices[index];
+
+    return config_odev_add_attribute(device->attribs, attrib_id, attrib_name);
+}
+
+char *
+xf86_get_platform_attrib(int index, int attrib_id)
+{
+    struct xf86_platform_device *device = &xf86_platform_devices[index];
+    struct OdevAttribute *oa;
+
+    xorg_list_for_each_entry(oa, &device->attribs->list, member) {
+        if (oa->attrib_id == attrib_id)
+            return oa->attrib_name;
+    }
+    return NULL;
+}
+
+char *
+xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib_id)
+{
+    struct OdevAttribute *oa;
+
+    xorg_list_for_each_entry(oa, &device->attribs->list, member) {
+        if (oa->attrib_id == attrib_id)
+            return oa->attrib_name;
+    }
+    return NULL;
+}
+
+
+/*
+ * xf86IsPrimaryPlatform() -- return TRUE if primary device
+ * is a platform device and it matches this one.
+ */
+
+static Bool
+xf86IsPrimaryPlatform(struct xf86_platform_device *plat)
+{
+    return ((primaryBus.type == BUS_PLATFORM) && (plat == primaryBus.id.plat));
+}
+
+static void
+platform_find_pci_info(struct xf86_platform_device *pd, char *busid)
+{
+    struct pci_slot_match devmatch;
+    struct pci_device *info;
+    struct pci_device_iterator *iter;
+    int ret;
+
+    ret = sscanf(busid, "pci:%04x:%02x:%02x.%u",
+                 &devmatch.domain, &devmatch.bus, &devmatch.dev,
+                 &devmatch.func);
+    if (ret != 4)
+        return;
+
+    iter = pci_slot_match_iterator_create(&devmatch);
+    info = pci_device_next(iter);
+    if (info) {
+        pd->pdev = info;
+        pci_device_probe(info);
+        if (pci_device_is_boot_vga(info)) {
+            primaryBus.type = BUS_PLATFORM;
+            primaryBus.id.plat = pd;
+        }
+    }
+    pci_iterator_destroy(iter);
+
+}
+
+static Bool
+xf86_check_platform_slot(const struct xf86_platform_device *pd)
+{
+    int i;
+
+    for (i = 0; i < xf86NumEntities; i++) {
+        const EntityPtr u = xf86Entities[i];
+
+        if (pd->pdev && u->bus.type == BUS_PCI)
+            return !MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci);
+        if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat)) {
+            return FALSE;
+        }
+    }
+    return TRUE;
+}
+
+/**
+ *  @return The numbers of found devices that match with the current system
+ *  drivers.
+ */
+int
+xf86PlatformMatchDriver(char *matches[], int nmatches)
+{
+    int i, j = 0;
+    struct pci_device *info = NULL;
+    int pass = 0;
+
+    for (pass = 0; pass < 2; pass++) {
+        for (i = 0; i < xf86_num_platform_devices; i++) {
+
+            if (xf86IsPrimaryPlatform(&xf86_platform_devices[i]) && (pass == 1))
+                continue;
+            else if (!xf86IsPrimaryPlatform(&xf86_platform_devices[i]) && (pass == 0))
+                continue;
+
+            info = xf86_platform_devices[i].pdev;
+#ifdef __linux__
+            if (info)
+                xf86MatchDriverFromFiles(matches, info->vendor_id, info->device_id);
+#endif
+
+            for (j = 0; (j < nmatches) && (matches[j]); j++) {
+                /* find end of matches list */
+            }
+
+            if ((info != NULL) && (j < nmatches)) {
+                j += xf86VideoPtrToDriverList(info, &(matches[j]), nmatches - j);
+            }
+        }
+    }
+    return j;
+}
+
+int
+xf86platformProbe(void)
+{
+    int i;
+    Bool pci = TRUE;
+
+    if (!xf86scanpci()) {
+        pci = FALSE;
+    }
+
+    config_odev_probe(&xf86PlatformDeviceProbe);
+    for (i = 0; i < xf86_num_platform_devices; i++) {
+        char *busid = xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID);
+
+        if (pci && (strncmp(busid, "pci:", 4) == 0)) {
+            platform_find_pci_info(&xf86_platform_devices[i], busid);
+        }
+    }
+    return 0;
+}
+
+static int
+xf86ClaimPlatformSlot(struct xf86_platform_device * d, DriverPtr drvp,
+                  int chipset, GDevPtr dev, Bool active)
+{
+    EntityPtr p = NULL;
+    int num;
+
+    if (xf86_check_platform_slot(d)) {
+        num = xf86AllocateEntity();
+        p = xf86Entities[num];
+        p->driver = drvp;
+        p->chipset = chipset;
+        p->bus.type = BUS_PLATFORM;
+        p->bus.id.plat = d;
+        p->active = active;
+        p->inUse = FALSE;
+        if (dev)
+            xf86AddDevToEntity(num, dev);
+
+        platformSlotClaimed++;
+        return num;
+    }
+    else
+        return -1;
+}
+
+static int
+xf86UnclaimPlatformSlot(struct xf86_platform_device *d, GDevPtr dev)
+{
+    int i;
+
+    for (i = 0; i < xf86NumEntities; i++) {
+        const EntityPtr p = xf86Entities[i];
+
+        if ((p->bus.type == BUS_PLATFORM) && (p->bus.id.plat == d)) {
+            if (dev)
+                xf86RemoveDevFromEntity(i, dev);
+            platformSlotClaimed--;
+            p->bus.type = BUS_NONE;
+            return 0;
+        }
+    }
+    return 0;
+}
+
+
+#define END_OF_MATCHES(m)                                               \
+    (((m).vendor_id == 0) && ((m).device_id == 0) && ((m).subvendor_id == 0))
+
+static Bool doPlatformProbe(struct xf86_platform_device *dev, DriverPtr drvp,
+                            GDevPtr gdev, int flags, intptr_t match_data)
+{
+    Bool foundScreen = FALSE;
+    int entity;
+
+    if (gdev->screen == 0 && !xf86_check_platform_slot(dev))
+        return FALSE;
+
+    entity = xf86ClaimPlatformSlot(dev, drvp, 0,
+                                   gdev, gdev->active);
+
+    if ((entity == -1) && (gdev->screen > 0)) {
+        unsigned nent;
+
+        for (nent = 0; nent < xf86NumEntities; nent++) {
+            EntityPtr pEnt = xf86Entities[nent];
+
+            if (pEnt->bus.type != BUS_PLATFORM)
+                continue;
+            if (pEnt->bus.id.plat == dev) {
+                entity = nent;
+                xf86AddDevToEntity(nent, gdev);
+                break;
+            }
+        }
+    }
+    if (entity != -1) {
+        if (drvp->platformProbe(drvp, entity, flags, dev, match_data))
+            foundScreen = TRUE;
+        else
+            xf86UnclaimPlatformSlot(dev, gdev);
+    }
+    return foundScreen;
+}
+
+static Bool
+probeSingleDevice(struct xf86_platform_device *dev, DriverPtr drvp, GDevPtr gdev, int flags)
+{
+    int k;
+    Bool foundScreen = FALSE;
+    struct pci_device *pPci;
+    const struct pci_id_match *const devices = drvp->supported_devices;
+
+    if (dev->pdev && devices) {
+        int device_id = dev->pdev->device_id;
+        pPci = dev->pdev;
+        for (k = 0; !END_OF_MATCHES(devices[k]); k++) {
+            if (PCI_ID_COMPARE(devices[k].vendor_id, pPci->vendor_id)
+                && PCI_ID_COMPARE(devices[k].device_id, device_id)
+                && ((devices[k].device_class_mask & pPci->device_class)
+                    ==  devices[k].device_class)) {
+                foundScreen = doPlatformProbe(dev, drvp, gdev, flags, devices[k].match_data);
+                if (foundScreen)
+                    break;
+            }
+        }
+    }
+    else if (dev->pdev && !devices)
+        return FALSE;
+    else
+        foundScreen = doPlatformProbe(dev, drvp, gdev, flags, 0);
+    return foundScreen;
+}
+
+int
+xf86platformProbeDev(DriverPtr drvp)
+{
+    Bool foundScreen = FALSE;
+    GDevPtr *devList;
+    const unsigned numDevs = xf86MatchDevice(drvp->driverName, &devList);
+    int i, j;
+
+    /* find the main device or any device specificed in xorg.conf */
+    for (i = 0; i < numDevs; i++) {
+        for (j = 0; j < xf86_num_platform_devices; j++) {
+            if (devList[i]->busID && *devList[i]->busID) {
+                if (xf86PlatformDeviceCheckBusID(&xf86_platform_devices[j], devList[i]->busID))
+                    break;
+            }
+            else {
+                if (xf86_platform_devices[j].pdev) {
+                    if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
+                        break;
+                }
+            }
+        }
+
+        if (j == xf86_num_platform_devices)
+             continue;
+
+        foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], 0);
+        if (!foundScreen)
+            continue;
+    }
+
+    /* if autoaddgpu devices is enabled then go find a few more and add them as GPU screens */
+    if (xf86Info.autoAddGPU && numDevs) {
+        for (j = 0; j < xf86_num_platform_devices; j++) {
+            probeSingleDevice(&xf86_platform_devices[j], drvp, devList[0], PLATFORM_PROBE_GPU_SCREEN);
+        }
+    }
+
+    return foundScreen;
+}
+
+int
+xf86platformAddDevice(int index)
+{
+    int i, old_screens, scr_index;
+    DriverPtr drvp = NULL;
+    int entity;
+    screenLayoutPtr layout;
+    static char *hotplug_driver_name = "modesetting";
+
+    /* force load the driver for now */
+    xf86LoadOneModule(hotplug_driver_name, NULL);
+
+    for (i = 0; i < xf86NumDrivers; i++) {
+        if (!xf86DriverList[i])
+            continue;
+
+        if (!strcmp(xf86DriverList[i]->driverName, hotplug_driver_name)) {
+            drvp = xf86DriverList[i];
+            break;
+        }
+    }
+    if (i == xf86NumDrivers)
+        return -1;
+
+    old_screens = xf86NumGPUScreens;
+    entity = xf86ClaimPlatformSlot(&xf86_platform_devices[index],
+                                   drvp, 0, 0, 0);
+    if (!drvp->platformProbe(drvp, entity, PLATFORM_PROBE_GPU_SCREEN, &xf86_platform_devices[index], 0)) {
+        xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL);
+    }
+    if (old_screens == xf86NumGPUScreens)
+        return -1;
+    i = old_screens;
+
+    for (layout = xf86ConfigLayout.screens; layout->screen != NULL;
+         layout++) {
+        xf86GPUScreens[i]->confScreen = layout->screen;
+        break;
+    }
+
+    if (xf86GPUScreens[i]->PreInit &&
+        xf86GPUScreens[i]->PreInit(xf86GPUScreens[i], 0))
+        xf86GPUScreens[i]->configured = TRUE; 
+
+    if (!xf86GPUScreens[i]->configured) {
+        ErrorF("hotplugged device %d didn't configure\n", i);
+        xf86DeleteScreen(xf86GPUScreens[i]);
+        return -1;
+    }
+
+   scr_index = AddGPUScreen(xf86GPUScreens[i]->ScreenInit, 0, NULL);
+
+   dixSetPrivate(&xf86GPUScreens[i]->pScreen->devPrivates,
+                 xf86ScreenKey, xf86GPUScreens[i]);
+
+   CreateScratchPixmapsForScreen(xf86GPUScreens[i]->pScreen);
+
+   /* attach unbound to 0 protocol screen */
+   AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+
+   return 0;
+}
+
+void
+xf86platformRemoveDevice(int index)
+{
+    EntityPtr entity;
+    int ent_num, i, j;
+    Bool found;
+
+    for (ent_num = 0; ent_num < xf86NumEntities; ent_num++) {
+        entity = xf86Entities[ent_num];
+        if (entity->bus.type == BUS_PLATFORM &&
+            entity->bus.id.plat == &xf86_platform_devices[index])
+            break;
+    }
+    if (ent_num == xf86NumEntities)
+        goto out;
+
+    found = FALSE;
+    for (i = 0; i < xf86NumGPUScreens; i++) {
+        for (j = 0; j < xf86GPUScreens[i]->numEntities; j++)
+            if (xf86GPUScreens[i]->entityList[j] == ent_num) {
+                found = TRUE;
+                break;
+            }
+        if (found)
+            break;
+    }
+    if (!found) {
+        ErrorF("failed to find screen to remove\n");
+        goto out;
+    }
+
+    xf86GPUScreens[i]->pScreen->CloseScreen(xf86GPUScreens[i]->pScreen);
+
+    RemoveGPUScreen(xf86GPUScreens[i]->pScreen);
+    xf86DeleteScreen(xf86GPUScreens[i]);
+
+    xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL);
+
+    xf86_remove_platform_device(index);
+
+ out:
+    return;
+}
+#endif
diff --git a/hw/xfree86/common/xf86platformBus.h b/hw/xfree86/common/xf86platformBus.h
new file mode 100644 (file)
index 0000000..49afc24
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright © 2012 Red Hat.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Dave Airlie <airlied@redhat.com>
+ */
+#ifndef XF86_PLATFORM_BUS_H
+#define XF86_PLATFORM_BUS_H
+
+#include "hotplug.h"
+
+struct xf86_platform_device {
+    struct OdevAttributes *attribs;
+    /* for PCI devices */
+    struct pci_device *pdev;
+};
+
+#ifdef XSERVER_PLATFORM_BUS
+int xf86platformProbe(void);
+int xf86platformProbeDev(DriverPtr drvp);
+
+extern int xf86_num_platform_devices;
+
+extern char *
+xf86_get_platform_attrib(int index, int attrib_id);
+extern int
+xf86_add_platform_device(struct OdevAttributes *attribs);
+extern int
+xf86_remove_platform_device(int dev_index);
+extern Bool
+xf86_add_platform_device_attrib(int index, int attrib_id, char *attrib_str);
+
+extern int
+xf86platformAddDevice(int index);
+extern void
+xf86platformRemoveDevice(int index);
+
+extern _X_EXPORT char *
+xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib_id);
+extern _X_EXPORT Bool
+xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid);
+
+extern _X_EXPORT int
+xf86PlatformMatchDriver(char *matches[], int nmatches);
+#endif
+
+#endif
index c993b60..b6a6b94 100644 (file)
@@ -619,8 +619,9 @@ xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp)
     pScrn->virtualY = psdp->height;
 }
 
-static sbusPaletteKeyIndex;
-static DevPrivateKey sbusPaletteKey = &sbusPaletteKeyIndex;
+static DevPrivateKeyRec sbusPaletteKeyRec;
+#define sbusPaletteKey (&sbusPaletteKeyRec)
+
 typedef struct _sbusCmap {
     sbusDevicePtr psdp;
     CloseScreenProcPtr CloseScreen;
@@ -666,7 +667,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
 }
 
 static Bool
-xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen)
+xf86SbusCmapCloseScreen(ScreenPtr pScreen)
 {
     sbusCmapPtr cmap;
     struct fbcmap fbcmap;
@@ -682,7 +683,7 @@ xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen)
     }
     pScreen->CloseScreen = cmap->CloseScreen;
     free(cmap);
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Bool
@@ -692,6 +693,9 @@ xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp)
     struct fbcmap fbcmap;
     unsigned char data[2];
 
+    if (!dixRegisterPrivateKey(sbusPaletteKey, PRIVATE_SCREEN, 0))
+        FatalError("Cannot register sbus private key");
+
     cmap = xnfcalloc(1, sizeof(sbusCmapRec));
     dixSetPrivate(&pScreen->devPrivates, sbusPaletteKey, cmap);
     cmap->psdp = psdp;
index 6294845..0590262 100644 (file)
@@ -311,6 +311,7 @@ struct _SymTabRec;
 struct _PciChipsets;
 
 struct pci_device;
+struct xf86_platform_device;
 
 typedef struct _DriverRec {
     int driverVersion;
@@ -325,9 +326,16 @@ typedef struct _DriverRec {
     const struct pci_id_match *supported_devices;
     Bool (*PciProbe) (struct _DriverRec * drv, int entity_num,
                       struct pci_device * dev, intptr_t match_data);
+    Bool (*platformProbe) (struct _DriverRec * drv, int entity_num, int flags,
+                           struct xf86_platform_device * dev, intptr_t match_data);
 } DriverRec, *DriverPtr;
 
 /*
+ * platform probe flags
+ */
+#define PLATFORM_PROBE_GPU_SCREEN 1
+
+/*
  *  AddDriver flags
  */
 #define HaveDriverFuncs 1
@@ -343,6 +351,7 @@ typedef struct _DriverRec {
 #undef BUS_NONE
 #undef BUS_PCI
 #undef BUS_SBUS
+#undef BUS_PLATFORM
 #undef BUS_last
 #endif
 
@@ -350,6 +359,7 @@ typedef enum {
     BUS_NONE,
     BUS_PCI,
     BUS_SBUS,
+    BUS_PLATFORM,
     BUS_last                    /* Keep last */
 } BusType;
 
@@ -362,6 +372,7 @@ typedef struct _bus {
     union {
         struct pci_device *pci;
         SbusBusId sbus;
+        struct xf86_platform_device *plat;
     } id;
 } BusRec, *BusPtr;
 
@@ -630,18 +641,18 @@ typedef struct {
 
 typedef Bool xf86ProbeProc(DriverPtr, int);
 typedef Bool xf86PreInitProc(ScrnInfoPtr, int);
-typedef Bool xf86ScreenInitProc(int, ScreenPtr, int, char **);
-typedef Bool xf86SwitchModeProc(int, DisplayModePtr, int);
-typedef void xf86AdjustFrameProc(int, int, int, int);
-typedef Bool xf86EnterVTProc(int, int);
-typedef void xf86LeaveVTProc(int, int);
-typedef void xf86FreeScreenProc(int, int);
-typedef 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 Bool xf86ScreenInitProc(ScreenPtr, int, char **);
+typedef Bool xf86SwitchModeProc(ScrnInfoPtr, DisplayModePtr);
+typedef void xf86AdjustFrameProc(ScrnInfoPtr, int, int);
+typedef Bool xf86EnterVTProc(ScrnInfoPtr);
+typedef void xf86LeaveVTProc(ScrnInfoPtr);
+typedef void xf86FreeScreenProc(ScrnInfoPtr);
+typedef ModeStatus xf86ValidModeProc(ScrnInfoPtr, DisplayModePtr, Bool, int);
+typedef void xf86EnableDisableFBAccessProc(ScrnInfoPtr, Bool);
+typedef int xf86SetDGAModeProc(ScrnInfoPtr, int, DGADevicePtr);
+typedef int xf86ChangeGammaProc(ScrnInfoPtr, Gamma);
+typedef void xf86PointerMovedProc(ScrnInfoPtr, int, int);
+typedef Bool xf86PMEventProc(ScrnInfoPtr, pmEvent, Bool);
 typedef void xf86DPMSSetProc(ScrnInfoPtr, int, int);
 typedef void xf86LoadPaletteProc(ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
 typedef void xf86SetOverscanProc(ScrnInfoPtr, int);
@@ -802,6 +813,8 @@ typedef struct _ScrnInfoRec {
      */
     funcPointer reservedFuncs[NUM_RESERVED_FUNCS];
 
+    Bool is_gpu;
+    uint32_t capabilities;
 } ScrnInfoRec;
 
 typedef struct {
similarity index 92%
rename from hw/xfree86/dixmods/extmod/xf86vmode.c
rename to hw/xfree86/common/xf86vmode.c
index 68c4b58..7cd2eed 100644 (file)
@@ -39,6 +39,7 @@ from Kaleb S. KEITHLEY
 #include "misc.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
+#include "xf86Extensions.h"
 #include "scrnintstr.h"
 #include "servermd.h"
 #include <X11/extensions/xf86vmproto.h>
@@ -240,7 +241,6 @@ static void
 SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
 {
     XF86VidModeScreenPrivatePtr pPriv;
-    XF86VidModeEventPtr pEv;
     unsigned long mask;
     xXF86VidModeNotifyEvent ev;
     int kind;
@@ -253,17 +253,21 @@ SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
         return;
     kind = XF86VidModeModeChange;
     for (pEv = pPriv->events; pEv; pEv = pEv->next) {
-        if (!(pEv->mask & mask))
-            continue;
-        ev.type = XF86VidModeNotify + XF86VidModeEventBase;
-        ev.state = state;
-        ev.timestamp = currentTime.milliseconds;
-        ev.root = pScreen->root->drawable.id;
-        ev.kind = kind;
-        ev.forced = forced;
-        WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
-}} static void
+        if (pEv->mask & mask) {
+            XF86VidModeEventPtr pEv = {
+                .type = XF86VidModeNotify + XF86VidModeEventBase,
+                .state = state,
+                .timestamp = currentTime.milliseconds,
+                .root = pScreen->root->drawable.id,
+                .kind = kind,
+                .forced = forced
+            };
+            WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
+        }
+    }
+}
 
+static void
 SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent * from,
                         xXF86VidModeNotifyEvent * to)
 {
@@ -280,23 +284,25 @@ SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent * from,
 static int
 ProcXF86VidModeQueryVersion(ClientPtr client)
 {
-    xXF86VidModeQueryVersionReply rep;
+    xXF86VidModeQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_XF86VIDMODE_MAJOR_VERSION,
+        .minorVersion = SERVER_XF86VIDMODE_MINOR_VERSION
+    };
 
     DEBUG_P("XF86VidModeQueryVersion");
 
     REQUEST_SIZE_MATCH(xXF86VidModeQueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SERVER_XF86VIDMODE_MAJOR_VERSION;
-    rep.minorVersion = SERVER_XF86VIDMODE_MINOR_VERSION;
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swaps(&rep.majorVersion);
         swaps(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), &rep);
     return Success;
 }
 
@@ -304,8 +310,10 @@ static int
 ProcXF86VidModeGetModeLine(ClientPtr client)
 {
     REQUEST(xXF86VidModeGetModeLineReq);
-    xXF86VidModeGetModeLineReply rep;
-    xXF86OldVidModeGetModeLineReply oldrep;
+    xXF86VidModeGetModeLineReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence
+    };
     pointer mode;
     int dotClock;
     int ver;
@@ -314,7 +322,7 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
 
     ver = ClientMajorVersion(client);
     REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
-    rep.type = X_Reply;
+
     if (ver < 2) {
         rep.length = bytes_to_int32(SIZEOF(xXF86OldVidModeGetModeLineReply) -
                                     SIZEOF(xGenericReply));
@@ -323,7 +331,6 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
         rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetModeLineReply) -
                                     SIZEOF(xGenericReply));
     }
-    rep.sequenceNumber = client->sequence;
 
     if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
@@ -377,26 +384,26 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
         swapl(&rep.privsize);
     }
     if (ver < 2) {
-        oldrep.type = rep.type;
-        oldrep.sequenceNumber = rep.sequenceNumber;
-        oldrep.length = rep.length;
-        oldrep.dotclock = rep.dotclock;
-        oldrep.hdisplay = rep.hdisplay;
-        oldrep.hsyncstart = rep.hsyncstart;
-        oldrep.hsyncend = rep.hsyncend;
-        oldrep.htotal = rep.htotal;
-        oldrep.vdisplay = rep.vdisplay;
-        oldrep.vsyncstart = rep.vsyncstart;
-        oldrep.vsyncend = rep.vsyncend;
-        oldrep.vtotal = rep.vtotal;
-        oldrep.flags = rep.flags;
-        oldrep.privsize = rep.privsize;
-        WriteToClient(client, sizeof(xXF86OldVidModeGetModeLineReply),
-                      (char *) &oldrep);
+        xXF86OldVidModeGetModeLineReply oldrep = {
+            .type = rep.type,
+            .sequenceNumber = rep.sequenceNumber,
+            .length = rep.length,
+            .dotclock = rep.dotclock,
+            .hdisplay = rep.hdisplay,
+            .hsyncstart = rep.hsyncstart,
+            .hsyncend = rep.hsyncend,
+            .htotal = rep.htotal,
+            .vdisplay = rep.vdisplay,
+            .vsyncstart = rep.vsyncstart,
+            .vsyncend = rep.vsyncend,
+            .vtotal = rep.vtotal,
+            .flags = rep.flags,
+            .privsize = rep.privsize
+        };
+        WriteToClient(client, sizeof(xXF86OldVidModeGetModeLineReply), &oldrep);
     }
     else {
-        WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply),
-                      (char *) &rep);
+        WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply), &rep);
     }
     return Success;
 }
@@ -406,8 +413,6 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
 {
     REQUEST(xXF86VidModeGetAllModeLinesReq);
     xXF86VidModeGetAllModeLinesReply rep;
-    xXF86VidModeModeInfo mdinf;
-    xXF86OldVidModeModeInfo oldmdinf;
     pointer mode;
     int modecount, dotClock;
     int ver;
@@ -428,37 +433,40 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
     if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
         return BadValue;
 
-    rep.type = X_Reply;
-    rep.length = SIZEOF(xXF86VidModeGetAllModeLinesReply) -
-        SIZEOF(xGenericReply);
+    rep = (xXF86VidModeGetAllModeLinesReply) {
+        .type = X_Reply,
+        .length = SIZEOF(xXF86VidModeGetAllModeLinesReply) -
+            SIZEOF(xGenericReply),
+        .sequenceNumber = client->sequence,
+        .modecount = modecount
+    };
     if (ver < 2)
         rep.length += modecount * sizeof(xXF86OldVidModeModeInfo);
     else
         rep.length += modecount * sizeof(xXF86VidModeModeInfo);
     rep.length >>= 2;
-    rep.sequenceNumber = client->sequence;
-    rep.modecount = modecount;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.modecount);
     }
-    WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply),
-                  (char *) &rep);
+    WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), &rep);
 
     do {
-        mdinf.dotclock = dotClock;
-        mdinf.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY);
-        mdinf.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART);
-        mdinf.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND);
-        mdinf.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL);
-        mdinf.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW);
-        mdinf.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY);
-        mdinf.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART);
-        mdinf.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND);
-        mdinf.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL);
-        mdinf.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
-        mdinf.privsize = 0;
+        xXF86VidModeModeInfo mdinf = {
+            .dotclock = dotClock,
+            .hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
+            .hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
+            .hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
+            .htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL),
+            .hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW),
+            .vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
+            .vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
+            .vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
+            .vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
+            .flags = VidModeGetModeValue(mode, VIDMODE_FLAGS),
+            .privsize = 0
+        };
         if (client->swapped) {
             swapl(&mdinf.dotclock);
             swaps(&mdinf.hdisplay);
@@ -474,23 +482,23 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
             swapl(&mdinf.privsize);
         }
         if (ver < 2) {
-            oldmdinf.dotclock = mdinf.dotclock;
-            oldmdinf.hdisplay = mdinf.hdisplay;
-            oldmdinf.hsyncstart = mdinf.hsyncstart;
-            oldmdinf.hsyncend = mdinf.hsyncend;
-            oldmdinf.htotal = mdinf.htotal;
-            oldmdinf.vdisplay = mdinf.vdisplay;
-            oldmdinf.vsyncstart = mdinf.vsyncstart;
-            oldmdinf.vsyncend = mdinf.vsyncend;
-            oldmdinf.vtotal = mdinf.vtotal;
-            oldmdinf.flags = mdinf.flags;
-            oldmdinf.privsize = mdinf.privsize;
-            WriteToClient(client, sizeof(xXF86OldVidModeModeInfo),
-                          (char *) &oldmdinf);
+            xXF86OldVidModeModeInfo oldmdinf = {
+                .dotclock = mdinf.dotclock,
+                .hdisplay = mdinf.hdisplay,
+                .hsyncstart = mdinf.hsyncstart,
+                .hsyncend = mdinf.hsyncend,
+                .htotal = mdinf.htotal,
+                .vdisplay = mdinf.vdisplay,
+                .vsyncstart = mdinf.vsyncstart,
+                .vsyncend = mdinf.vsyncend,
+                .vtotal = mdinf.vtotal,
+                .flags = mdinf.flags,
+                .privsize = mdinf.privsize
+            };
+            WriteToClient(client, sizeof(xXF86OldVidModeModeInfo), &oldmdinf);
         }
         else {
-            WriteToClient(client, sizeof(xXF86VidModeModeInfo),
-                          (char *) &mdinf);
+            WriteToClient(client, sizeof(xXF86VidModeModeInfo), &mdinf);
         }
 
     } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
@@ -1030,18 +1038,19 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
  status_reply:
     free(modetmp);
 
-    rep.type = X_Reply;
-    rep.length = bytes_to_int32(SIZEOF(xXF86VidModeValidateModeLineReply)
-                                - SIZEOF(xGenericReply));
-    rep.sequenceNumber = client->sequence;
-    rep.status = status;
+    rep = (xXF86VidModeValidateModeLineReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(SIZEOF(xXF86VidModeValidateModeLineReply)
+                                 - SIZEOF(xGenericReply)),
+        .status = status
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.status);
     }
-    WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply),
-                  (char *) &rep);
+    WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), &rep);
     if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
         ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status);
     return Success;
@@ -1190,7 +1199,10 @@ static int
 ProcXF86VidModeGetMonitor(ClientPtr client)
 {
     REQUEST(xXF86VidModeGetMonitorReq);
-    xXF86VidModeGetMonitorReply rep;
+    xXF86VidModeGetMonitorReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence
+    };
     CARD32 *hsyncdata, *vsyncdata;
     int i, nHsync, nVrefresh;
     pointer monitor;
@@ -1208,7 +1220,6 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
     nHsync = VidModeGetMonitorValue(monitor, VIDMODE_MON_NHSYNC, 0).i;
     nVrefresh = VidModeGetMonitorValue(monitor, VIDMODE_MON_NVREFRESH, 0).i;
 
-    rep.type = X_Reply;
     if ((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr)
         rep.vendorLength = strlen((char *) (VidModeGetMonitorValue(monitor,
                                                                    VIDMODE_MON_VENDOR,
@@ -1227,7 +1238,6 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
                                                 nVrefresh) * sizeof(CARD32) +
                        pad_to_int32(rep.vendorLength) +
                        pad_to_int32(rep.modelLength));
-    rep.sequenceNumber = client->sequence;
     rep.nhsync = nHsync;
     rep.nvsync = nVrefresh;
     hsyncdata = malloc(nHsync * sizeof(CARD32));
@@ -1262,20 +1272,16 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
     }
-    WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), &rep);
     client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
     WriteSwappedDataToClient(client, nHsync * sizeof(CARD32), hsyncdata);
     WriteSwappedDataToClient(client, nVrefresh * sizeof(CARD32), vsyncdata);
     if (rep.vendorLength)
         WriteToClient(client, rep.vendorLength,
-                      (char
-                       *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR,
-                                                  0)).ptr);
+                 (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr);
     if (rep.modelLength)
         WriteToClient(client, rep.modelLength,
-                      (char
-                       *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL,
-                                                  0)).ptr);
+                 (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr);
 
     free(hsyncdata);
     free(vsyncdata);
@@ -1297,13 +1303,15 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
     if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     VidModeGetViewPort(stuff->screen, &x, &y);
-    rep.x = x;
-    rep.y = y;
+
+    rep = (xXF86VidModeGetViewPortReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .x = x,
+        .y = y
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
@@ -1311,7 +1319,7 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
         swapl(&rep.x);
         swapl(&rep.y);
     }
-    WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), &rep);
     return Success;
 }
 
@@ -1353,16 +1361,18 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
 
     numClocks = VidModeGetNumOfClocks(stuff->screen, &ClockProg);
 
-    rep.type = X_Reply;
-    rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetDotClocksReply)
-                                - SIZEOF(xGenericReply) + numClocks);
-    rep.sequenceNumber = client->sequence;
-    rep.clocks = numClocks;
-    rep.maxclocks = MAXCLOCKS;
-    rep.flags = 0;
+    rep = (xXF86VidModeGetDotClocksReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(SIZEOF(xXF86VidModeGetDotClocksReply)
+                                 - SIZEOF(xGenericReply) + numClocks),
+        .clocks = numClocks,
+        .maxclocks = MAXCLOCKS,
+        .flags = 0
+    };
 
     if (!ClockProg) {
-        Clocks = malloc(numClocks * sizeof(int));
+        Clocks = calloc(numClocks, sizeof(int));
         if (!Clocks)
             return BadValue;
         if (!VidModeGetClocks(stuff->screen, Clocks)) {
@@ -1380,7 +1390,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
         swapl(&rep.maxclocks);
         swapl(&rep.flags);
     }
-    WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), &rep);
     if (!ClockProg) {
         for (n = 0; n < numClocks; n++) {
             dotclock = *Clocks++;
@@ -1388,7 +1398,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
                 WriteSwappedDataToClient(client, 4, (char *) &dotclock);
             }
             else {
-                WriteToClient(client, 4, (char *) &dotclock);
+                WriteToClient(client, 4, &dotclock);
             }
         }
     }
@@ -1431,14 +1441,16 @@ ProcXF86VidModeGetGamma(ClientPtr client)
     if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
     if (!VidModeGetGamma(stuff->screen, &red, &green, &blue))
         return BadValue;
-    rep.red = (CARD32) (red * 10000.);
-    rep.green = (CARD32) (green * 10000.);
-    rep.blue = (CARD32) (blue * 10000.);
+    rep = (xXF86VidModeGetGammaReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .red = (CARD32) (red * 10000.),
+        .green = (CARD32) (green * 10000.),
+        .blue = (CARD32) (blue * 10000.)
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -1446,7 +1458,7 @@ ProcXF86VidModeGetGamma(ClientPtr client)
         swapl(&rep.green);
         swapl(&rep.blue);
     }
-    WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), &rep);
 
     return Success;
 }
@@ -1489,14 +1501,14 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client)
 
     REQUEST(xXF86VidModeGetGammaRampReq);
 
+    REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
+
     if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if (stuff->size != VidModeGetGammaRampSize(stuff->screen))
         return BadValue;
 
-    REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
-
     length = (stuff->size + 1) & ~1;
 
     if (stuff->size) {
@@ -1510,20 +1522,22 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client)
             return BadValue;
         }
     }
-    rep.type = X_Reply;
-    rep.length = (length >> 1) * 3;
-    rep.sequenceNumber = client->sequence;
-    rep.size = stuff->size;
+    rep = (xXF86VidModeGetGammaRampReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = (length >> 1) * 3,
+        .size = stuff->size
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swaps(&rep.size);
         SwapShorts((short *) ramp, length * 3);
     }
-    WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), &rep);
 
     if (stuff->size) {
-        WriteToClient(client, ramplen, (char *) ramp);
+        WriteToClient(client, ramplen, ramp);
         free(ramp);
     }
 
@@ -1537,22 +1551,23 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client)
 
     REQUEST(xXF86VidModeGetGammaRampSizeReq);
 
+    REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
+
     if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
-    REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
-
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.size = VidModeGetGammaRampSize(stuff->screen);
+    rep = (xXF86VidModeGetGammaRampSizeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .size = VidModeGetGammaRampSize(stuff->screen)
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swaps(&rep.size);
     }
-    WriteToClient(client, sizeof(xXF86VidModeGetGammaRampSizeReply),
-                  (char *) &rep);
+    WriteToClient(client, sizeof(xXF86VidModeGetGammaRampSizeReply), &rep);
 
     return Success;
 }
@@ -1560,19 +1575,20 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client)
 static int
 ProcXF86VidModeGetPermissions(ClientPtr client)
 {
-    xXF86VidModeGetPermissionsReply rep;
+    xXF86VidModeGetPermissionsReply rep =  {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .permissions = XF86VM_READ_PERMISSION
+    };
 
     REQUEST(xXF86VidModeGetPermissionsReq);
 
+    REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
+
     if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
-    REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
-
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.permissions = XF86VM_READ_PERMISSION;
     if (xf86GetVidModeEnabled() &&
         (xf86GetVidModeAllowNonLocal() || LocalClient(client))) {
         rep.permissions |= XF86VM_WRITE_PERMISSION;
@@ -1582,8 +1598,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
         swapl(&rep.length);
         swapl(&rep.permissions);
     }
-    WriteToClient(client, sizeof(xXF86VidModeGetPermissionsReply),
-                  (char *) &rep);
+    WriteToClient(client, sizeof(xXF86VidModeGetPermissionsReply), &rep);
 
     return Success;
 }
index e5b9e30..d810c5e 100644 (file)
 #include <X11/extensions/Xv.h>
 #include <X11/extensions/Xvproto.h>
 #include "xvdix.h"
-#include "xvmodproc.h"
 
 #include "xf86xvpriv.h"
 
 /* XvScreenRec fields */
 
-static Bool xf86XVCloseScreen(int, ScreenPtr);
+static Bool xf86XVCloseScreen(ScreenPtr);
 static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *);
 
 /* XvAdaptorRec fields */
@@ -101,9 +100,9 @@ static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy);
 
 /* ScrnInfoRec functions */
 
-static Bool xf86XVEnterVT(int, int);
-static void xf86XVLeaveVT(int, int);
-static void xf86XVAdjustFrame(int index, int x, int y, int flags);
+static Bool xf86XVEnterVT(ScrnInfoPtr);
+static void xf86XVLeaveVT(ScrnInfoPtr);
+static void xf86XVAdjustFrame(ScrnInfoPtr, int x, int y);
 static void xf86XVModeSet(ScrnInfoPtr pScrn);
 
 /* misc */
@@ -118,10 +117,6 @@ DevPrivateKey XF86XvScreenKey;
 
 static unsigned long PortResource = 0;
 
-DevPrivateKey (*XvGetScreenKeyProc) (void) = NULL;
-unsigned long (*XvGetRTPortProc) (void) = NULL;
-int (*XvScreenInitProc) (ScreenPtr) = NULL;
-
 #define GET_XV_SCREEN(pScreen) \
     ((XvScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XF86XvScreenKey))
 
@@ -239,19 +234,18 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num)
     XF86XVScreenPtr ScreenPriv;
     XvScreenPtr pxvs;
 
-    if (num <= 0 ||
-        !XvGetScreenKeyProc || !XvGetRTPortProc || !XvScreenInitProc)
+    if (num <= 0 || noXvExtension)
         return FALSE;
 
-    if (Success != (*XvScreenInitProc) (pScreen))
+    if (Success != XvScreenInit(pScreen))
         return FALSE;
 
     if (!dixRegisterPrivateKey(&XF86XVWindowKeyRec, PRIVATE_WINDOW, 0))
         return FALSE;
 
-    XF86XvScreenKey = (*XvGetScreenKeyProc) ();
+    XF86XvScreenKey = XvGetScreenKey();
 
-    PortResource = (*XvGetRTPortProc) ();
+    PortResource = XvGetRTPort();
 
     pxvs = GET_XV_SCREEN(pScreen);
 
@@ -272,7 +266,7 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num)
     if (!ScreenPriv)
         return FALSE;
 
-    pScrn = xf86Screens[pScreen->myNum];
+    pScrn = xf86ScreenToScrn(pScreen);
 
     ScreenPriv->DestroyWindow = pScreen->DestroyWindow;
     ScreenPriv->WindowExposures = pScreen->WindowExposures;
@@ -357,7 +351,7 @@ static Bool
 xf86XVInitAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr * infoPtr, int number)
 {
     XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     XF86VideoAdaptorPtr adaptorPtr;
     XvAdaptorPtr pAdaptor, pa;
     XvAdaptorRecPrivatePtr adaptorPriv;
@@ -1067,7 +1061,7 @@ xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv, WindowPtr pWin, Bool visible)
 static void
 xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn, Bool onlyChanged)
 {
-    ScreenPtr pScreen = pScrn->pScreen;
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
     XvAdaptorPtr pa;
     int c, i;
@@ -1151,7 +1145,7 @@ xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind)
         pScreen = pLayerWin->drawable.pScreen;
 
     ScreenPriv = GET_XF86XV_SCREEN(pScreen);
-    pScrn = xf86Screens[pScreen->myNum];
+    pScrn = xf86ScreenToScrn(pScreen);
 
     xf86XVReputOrStopAllPorts(pScrn, TRUE);
 
@@ -1256,9 +1250,9 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
 /**** Required XvScreenRec fields ****/
 
 static Bool
-xf86XVCloseScreen(int i, ScreenPtr pScreen)
+xf86XVCloseScreen(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
     XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
     XvAdaptorPtr pa;
@@ -1300,15 +1294,14 @@ xf86XVQueryAdaptors(ScreenPtr pScreen,
 /**** ScrnInfoRec fields ****/
 
 static Bool
-xf86XVEnterVT(int index, int flags)
+xf86XVEnterVT(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
     Bool ret;
 
     pScrn->EnterVT = ScreenPriv->EnterVT;
-    ret = (*ScreenPriv->EnterVT) (index, flags);
+    ret = (*ScreenPriv->EnterVT) (pScrn);
     ScreenPriv->EnterVT = pScrn->EnterVT;
     pScrn->EnterVT = xf86XVEnterVT;
 
@@ -1319,10 +1312,9 @@ xf86XVEnterVT(int index, int flags)
 }
 
 static void
-xf86XVLeaveVT(int index, int flags)
+xf86XVLeaveVT(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
     XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
     XvAdaptorPtr pAdaptor;
@@ -1354,21 +1346,20 @@ xf86XVLeaveVT(int index, int flags)
     }
 
     pScrn->LeaveVT = ScreenPriv->LeaveVT;
-    (*ScreenPriv->LeaveVT) (index, flags);
+    (*ScreenPriv->LeaveVT) (pScrn);
     ScreenPriv->LeaveVT = pScrn->LeaveVT;
     pScrn->LeaveVT = xf86XVLeaveVT;
 }
 
 static void
-xf86XVAdjustFrame(int index, int x, int y, int flags)
+xf86XVAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
 {
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    ScreenPtr pScreen = pScrn->pScreen;
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
 
     if (ScreenPriv->AdjustFrame) {
         pScrn->AdjustFrame = ScreenPriv->AdjustFrame;
-        (*pScrn->AdjustFrame) (index, x, y, flags);
+        (*pScrn->AdjustFrame) (pScrn, x, y);
         pScrn->AdjustFrame = xf86XVAdjustFrame;
     }
 
@@ -1378,7 +1369,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
 static void
 xf86XVModeSet(ScrnInfoPtr pScrn)
 {
-    ScreenPtr pScreen = pScrn->pScreen;
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     XF86XVScreenPtr ScreenPriv;
 
     /* Can be called before pScrn->pScreen is set */
@@ -1911,7 +1902,7 @@ xf86XVFillKeyHelperDrawable(DrawablePtr pDraw, CARD32 key, RegionPtr fillboxes)
     xRectangle *rects;
     GCPtr gc;
 
-    if (!xf86Screens[pScreen->myNum]->vtSema)
+    if (!xf86ScreenToScrn(pScreen)->vtSema)
         return;
 
     gc = GetScratchGC(pDraw->depth, pScreen);
index 2db00a8..091efca 100644 (file)
@@ -263,8 +263,4 @@ extern _X_EXPORT void
 xf86XVCopyPacked(const void *src,
                  void *dst, int srcPitch, int dstPitch, int h, int w);
 
-extern _X_EXPORT DevPrivateKey (*XvGetScreenKeyProc) (void);
-extern _X_EXPORT unsigned long (*XvGetRTPortProc) (void);
-extern _X_EXPORT int (*XvScreenInitProc) (ScreenPtr);
-
 #endif                          /* _XF86XV_H_ */
index e584652..78a32bf 100644 (file)
 #include "resource.h"
 #include "dixstruct.h"
 
-#include "xvmodproc.h"
-
 #include "xf86xvpriv.h"
 #include "xf86xvmc.h"
 
-XvMCScreenInitProcPtr XvMCScreenInitProc = NULL;
-
 typedef struct {
     CloseScreenProcPtr CloseScreen;
     int num_adaptors;
@@ -66,7 +62,7 @@ xf86XvMCCreateContext(XvPortPtr pPort,
                       XvMCContextPtr pContext, int *num_priv, CARD32 **priv)
 {
     xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen);
 
     pContext->port_priv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr);
 
@@ -80,7 +76,7 @@ static void
 xf86XvMCDestroyContext(XvMCContextPtr pContext)
 {
     xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen);
 
     (*pScreenPriv->adaptors[pContext->adapt_num]->DestroyContext) (pScrn,
                                                                    pContext);
@@ -91,7 +87,7 @@ xf86XvMCCreateSurface(XvMCSurfacePtr pSurface, int *num_priv, CARD32 **priv)
 {
     XvMCContextPtr pContext = pSurface->context;
     xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen);
 
     return (*pScreenPriv->adaptors[pContext->adapt_num]->CreateSurface) (pScrn,
                                                                          pSurface,
@@ -104,7 +100,7 @@ xf86XvMCDestroySurface(XvMCSurfacePtr pSurface)
 {
     XvMCContextPtr pContext = pSurface->context;
     xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen);
 
     (*pScreenPriv->adaptors[pContext->adapt_num]->DestroySurface) (pScrn,
                                                                    pSurface);
@@ -116,7 +112,7 @@ xf86XvMCCreateSubpicture(XvMCSubpicturePtr pSubpicture,
 {
     XvMCContextPtr pContext = pSubpicture->context;
     xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen);
 
     return (*pScreenPriv->adaptors[pContext->adapt_num]->
             CreateSubpicture) (pScrn, pSubpicture, num_priv, priv);
@@ -127,14 +123,14 @@ xf86XvMCDestroySubpicture(XvMCSubpicturePtr pSubpicture)
 {
     XvMCContextPtr pContext = pSubpicture->context;
     xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen);
 
     (*pScreenPriv->adaptors[pContext->adapt_num]->DestroySubpicture) (pScrn,
                                                                       pSubpicture);
 }
 
 static Bool
-xf86XvMCCloseScreen(int i, ScreenPtr pScreen)
+xf86XvMCCloseScreen(ScreenPtr pScreen)
 {
     xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pScreen);
 
@@ -143,7 +139,7 @@ xf86XvMCCloseScreen(int i, ScreenPtr pScreen)
     free(pScreenPriv->dixinfo);
     free(pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Bool
@@ -156,7 +152,7 @@ xf86XvMCScreenInit(ScreenPtr pScreen,
                                                       XF86XvScreenKey);
     int i, j;
 
-    if (!XvMCScreenInitProc)
+    if (noXvExtension)
         return FALSE;
 
     if (!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors)))
@@ -205,7 +201,7 @@ xf86XvMCScreenInit(ScreenPtr pScreen,
         adaptors++;
     }
 
-    if (Success != (*XvMCScreenInitProc) (pScreen, num_adaptors, pAdapt))
+    if (Success != XvMCScreenInit(pScreen, num_adaptors, pAdapt))
         return FALSE;
 
     return TRUE;
index ff32379..2478fe3 100644 (file)
@@ -138,7 +138,4 @@ extern _X_EXPORT Bool xf86XvMCScreenInit(ScreenPtr pScreen,
 extern _X_EXPORT XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec(void);
 extern _X_EXPORT void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor);
 
-typedef int (*XvMCScreenInitProcPtr) (ScreenPtr, int, XvMCAdaptorPtr);
-extern _X_EXPORT XvMCScreenInitProcPtr XvMCScreenInitProc;
-
 #endif                          /* _XF86XVMC_H */
index 289ca58..e95f959 100644 (file)
@@ -41,9 +41,9 @@ typedef struct {
     ClipNotifyProcPtr ClipNotify;
     WindowExposuresProcPtr WindowExposures;
     PostValidateTreeProcPtr PostValidateTree;
-    void (*AdjustFrame) (int, int, int, int);
-    Bool (*EnterVT) (int, int);
-    void (*LeaveVT) (int, int);
+    void (*AdjustFrame) (ScrnInfoPtr, int, int);
+    Bool (*EnterVT) (ScrnInfoPtr);
+    void (*LeaveVT) (ScrnInfoPtr);
     xf86ModeSetProc *ModeSet;
 } XF86XVScreenRec, *XF86XVScreenPtr;
 
index a1281d7..28c9696 100644 (file)
@@ -258,10 +258,9 @@ EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed,
  * @return NULL if no monitor attached or failure to interpret the EDID.
  */
 xf86MonPtr
-xf86DoEDID_DDC1(int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed,
+xf86DoEDID_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDC1SetSpeed,
                 unsigned int (*DDC1Read) (ScrnInfoPtr))
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     unsigned char *EDID_block = NULL;
     xf86MonPtr tmp = NULL;
 
@@ -285,7 +284,7 @@ xf86DoEDID_DDC1(int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed,
     OsReleaseSignals();
 
     if (EDID_block) {
-        tmp = xf86InterpretEDID(scrnIndex, EDID_block);
+        tmp = xf86InterpretEDID(pScrn->scrnIndex, EDID_block);
     }
 #ifdef DEBUG
     else
@@ -323,7 +322,7 @@ DDC2MakeDevice(I2CBusPtr pBus, int address, char *name)
 }
 
 static I2CDevPtr
-DDC2Init(int scrnIndex, I2CBusPtr pBus)
+DDC2Init(I2CBusPtr pBus)
 {
     I2CDevPtr dev = NULL;
 
@@ -403,9 +402,8 @@ DDC2Read(I2CDevPtr dev, int block, unsigned char *R_Buffer)
  * @return NULL if no monitor attached or failure to interpret the EDID.
  */
 xf86MonPtr
-xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete)
+xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool complete)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     unsigned char *EDID_block = NULL;
     xf86MonPtr tmp = NULL;
     I2CDevPtr dev = NULL;
@@ -427,7 +425,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete)
     if (noddc || noddc2)
         return NULL;
 
-    if (!(dev = DDC2Init(scrnIndex, pBus)))
+    if (!(dev = DDC2Init(pBus)))
         return NULL;
 
     EDID_block = calloc(1, EDID1_LEN);
@@ -444,7 +442,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete)
                 DDC2Read(dev, i + 1, EDID_block + (EDID1_LEN * (1 + i)));
         }
 
-        tmp = xf86InterpretEEDID(scrnIndex, EDID_block);
+        tmp = xf86InterpretEEDID(pScrn->scrnIndex, EDID_block);
     }
 
     if (tmp && complete)
@@ -465,9 +463,9 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete)
  * @return NULL if no monitor attached or failure to interpret the EDID.
  */
 xf86MonPtr
-xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
+xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus)
 {
-    return xf86DoEEDID(scrnIndex, pBus, FALSE);
+    return xf86DoEEDID(pScrn, pBus, FALSE);
 }
 
 /* XXX write me */
@@ -489,9 +487,8 @@ DDC2ReadDisplayID(void)
  * @return NULL if no monitor attached or failure to interpret the DisplayID.
  */
 xf86MonPtr
-xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus)
+xf86DoDisplayID(ScrnInfoPtr pScrn, I2CBusPtr pBus)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     unsigned char *did = NULL;
     xf86MonPtr tmp = NULL;
     I2CDevPtr dev = NULL;
@@ -513,7 +510,7 @@ xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus)
     if (noddc || noddc2)
         return NULL;
 
-    if (!(dev = DDC2Init(scrnIndex, pBus)))
+    if (!(dev = DDC2Init(pBus)))
         return NULL;
 
     if ((did = DDC2ReadDisplayID())) {
@@ -521,7 +518,7 @@ xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus)
         if (!tmp)
             return NULL;
 
-        tmp->scrnIndex = scrnIndex;
+        tmp->scrnIndex = pScrn->scrnIndex;
         tmp->flags |= MONITOR_DISPLAYID;
         tmp->rawData = did;
     }
index 2071d53..c63da8b 100644 (file)
@@ -24,15 +24,15 @@ typedef enum {
 
 typedef void (*DDC1SetSpeedProc) (ScrnInfoPtr, xf86ddcSpeed);
 
-extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC1(int scrnIndex,
+extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC1(ScrnInfoPtr pScrn,
                                             DDC1SetSpeedProc DDC1SetSpeed,
                                             unsigned
                                             int (*DDC1Read) (ScrnInfoPtr)
     );
 
-extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus);
+extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus);
 
-extern _X_EXPORT xf86MonPtr xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool);
+extern _X_EXPORT xf86MonPtr xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool);
 
 extern _X_EXPORT xf86MonPtr xf86PrintEDID(xf86MonPtr monPtr);
 
@@ -50,7 +50,7 @@ extern _X_EXPORT DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
 extern _X_EXPORT Bool
  xf86MonitorIsHDMI(xf86MonPtr mon);
 
-extern _X_EXPORT xf86MonPtr xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus);
+extern _X_EXPORT xf86MonPtr xf86DoDisplayID(ScrnInfoPtr pScrn, I2CBusPtr pBus);
 
 extern _X_EXPORT void
  xf86DisplayIDMonitorSet(int scrnIndex, MonPtr mon, xf86MonPtr DDC);
index a5be3ae..f161db6 100644 (file)
@@ -1,67 +1,50 @@
 noinst_LTLIBRARIES = libdixmods.la libxorgxkb.la
 
-SUBDIRS = extmod
-
 if GLX
 GLXMODS = libglx.la
 endif
 
-if DBE
-DBEMOD = libdbe.la
-endif
-
-if RECORD
-RECORDMOD = librecord.la
-endif
-
 module_LTLIBRARIES = libfb.la \
                      libwfb.la \
                      libshadow.la
 
 extsmoduledir = $(moduledir)/extensions
-extsmodule_LTLIBRARIES = $(RECORDMOD) \
-                        $(DBEMOD) \
-                         $(GLXMODS)
+extsmodule_LTLIBRARIES = $(GLXMODS)
 
 AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@
 INCLUDES = @XORG_INCS@ \
-           -I$(top_srcdir)/dbe \
            -I$(top_srcdir)/hw/xfree86/loader \
            -I$(top_srcdir)/miext/shadow \
            -I$(top_srcdir)/glx
 
-libdbe_la_LDFLAGS = -module -avoid-version
-libdbe_la_LIBADD = $(top_builddir)/dbe/libdbe.la
-libdbe_la_SOURCES = dbemodule.c
-
-libfb_la_LDFLAGS = -module -avoid-version
+libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libfb_la_LIBADD = $(top_builddir)/fb/libfb.la
 libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
 libfb_la_CFLAGS = $(AM_CFLAGS)
 
-libwfb_la_LDFLAGS = -module -avoid-version
+libwfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la
 libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
 libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
 
-libglx_la_LDFLAGS = -module -avoid-version
+libglx_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
+libglx_la_LIBADD = $(top_builddir)/glx/libglx.la $(GLX_SYS_LIBS)
 if AIGLX_DRI_LOADER
-GLXDRI_LIBRARY = $(top_builddir)/glx/libglxdri.la
+libglx_la_LIBADD += $(top_builddir)/glx/libglxdri.la
+if NO_UNDEFINED
+libglx_la_LIBADD += ../dri/libdri.la ../dri2/libdri2.la
+endif
 endif
-libglx_la_LIBADD = \
-       $(top_builddir)/glx/libglx.la \
-       $(GLXDRI_LIBRARY)
 libglx_la_SOURCES = glxmodule.c
 
-librecord_la_LDFLAGS = -module -avoid-version
-librecord_la_LIBADD = $(top_builddir)/record/librecord.la
-librecord_la_SOURCES = recordmod.c
-
-libshadow_la_LDFLAGS = -module -avoid-version
+libshadow_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libshadow_la_LIBADD = $(top_builddir)/miext/shadow/libshadow.la
+if NO_UNDEFINED
+libshadow_la_LIBADD += libfb.la
+endif
 libshadow_la_SOURCES = shmodule.c
 
 libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c
-libdixmods_la_CFLAGS = -DXFree86LOADER $(AM_CFLAGS)
+libdixmods_la_CFLAGS = $(AM_CFLAGS)
 
 libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c
diff --git a/hw/xfree86/dixmods/dbemodule.c b/hw/xfree86/dixmods/dbemodule.c
deleted file mode 100644 (file)
index 5541eac..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-#include "globals.h"
-
-static MODULESETUPPROTO(dbeSetup);
-
-extern void DbeExtensionInit(INITARGS);
-
-static ExtensionModule dbeExt = {
-    DbeExtensionInit,
-    "DOUBLE-BUFFER",
-    &noDbeExtension,
-    NULL,
-    NULL
-};
-
-static XF86ModuleVersionInfo VersRec = {
-    "dbe",
-    MODULEVENDORSTRING,
-    MODINFOSTRING1,
-    MODINFOSTRING2,
-    XORG_VERSION_CURRENT,
-    1, 0, 0,
-    ABI_CLASS_EXTENSION,
-    ABI_EXTENSION_VERSION,
-    MOD_CLASS_EXTENSION,
-    {0, 0, 0, 0}
-};
-
-/*
- * Data for the loader
- */
-_X_EXPORT XF86ModuleData dbeModuleData = { &VersRec, dbeSetup, NULL };
-
-static pointer
-dbeSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
-    LoadExtension(&dbeExt, FALSE);
-
-    /* Need a non-NULL return value to indicate success */
-    return (pointer) 1;
-}
diff --git a/hw/xfree86/dixmods/extmod/Makefile.am b/hw/xfree86/dixmods/extmod/Makefile.am
deleted file mode 100644 (file)
index 87c28a4..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-sdk_HEADERS = dgaproc.h
-
-extsmoduledir = $(moduledir)/extensions
-extsmodule_LTLIBRARIES = libextmod.la
-
-if DGA
-DGA_SRCS = xf86dga2.c dgaproc.h
-endif
-
-if XV
-XV_SRCS = xvmod.c xvmodproc.h
-endif
-
-if XF86VIDMODE
-XF86VMODE_SRCS = xf86vmode.c
-endif
-
-AM_CFLAGS = @DIX_CFLAGS@ @XORG_CFLAGS@
-INCLUDES = @XORG_INCS@ \
-           -I$(top_srcdir)/dbe \
-           -I$(top_srcdir)/hw/xfree86/loader \
-           -I$(top_srcdir)/miext/shadow
-
-libextmod_la_LDFLAGS = -module -avoid-version
-libextmod_la_SOURCES = modinit.c \
-                       modinit.h \
-                       $(DGA_SRCS) \
-                       $(XF86VMODE_SRCS) \
-                       $(XV_SRCS)
-libextmod_la_LIBADD = $(top_builddir)/Xext/libXextmodule.la
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
deleted file mode 100644 (file)
index ca15ee0..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 1997 Matthieu Herrb
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Matthieu Herrb not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Matthieu Herrb makes no
- * representations about the suitability of this software for any purpose.
- *  It is provided "as is" without express or implied warranty.
- *
- * MATTHIEU HERRB DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL MATTHIEU HERRB BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-#include "xf86Opt.h"
-
-#include <X11/Xproto.h>
-
-#include "modinit.h"
-#include "globals.h"
-
-static MODULESETUPPROTO(extmodSetup);
-
-/*
- * Array describing extensions to be initialized
- */
-static ExtensionModule extensionModules[] = {
-#ifdef XSELINUX
-    {
-     SELinuxExtensionInit,
-     SELINUX_EXTENSION_NAME,
-     &noSELinuxExtension,
-     NULL,
-     NULL},
-#endif
-#ifdef SCREENSAVER
-    {
-     ScreenSaverExtensionInit,
-     ScreenSaverName,
-     &noScreenSaverExtension,
-     NULL,
-     NULL},
-#endif
-#ifdef XF86VIDMODE
-    {
-     XFree86VidModeExtensionInit,
-     XF86VIDMODENAME,
-     &noXFree86VidModeExtension,
-     NULL,
-     NULL},
-#endif
-#ifdef XFreeXDGA
-    {
-     XFree86DGAExtensionInit,
-     XF86DGANAME,
-     &noXFree86DGAExtension,
-     XFree86DGARegister,
-     NULL},
-#endif
-#ifdef DPMSExtension
-    {
-     DPMSExtensionInit,
-     DPMSExtensionName,
-     &noDPMSExtension,
-     NULL,
-     NULL},
-#endif
-#ifdef XV
-    {
-     XvExtensionInit,
-     XvName,
-     &noXvExtension,
-     XvRegister,
-     NULL},
-    {
-     XvMCExtensionInit,
-     XvMCName,
-     &noXvExtension,
-     NULL,
-     NULL},
-#endif
-#ifdef RES
-    {
-     ResExtensionInit,
-     XRES_NAME,
-     &noResExtension,
-     NULL,
-     NULL},
-#endif
-    {                           /* DON'T delete this entry ! */
-     NULL,
-     NULL,
-     NULL,
-     NULL,
-     NULL}
-};
-
-static XF86ModuleVersionInfo VersRec = {
-    "extmod",
-    MODULEVENDORSTRING,
-    MODINFOSTRING1,
-    MODINFOSTRING2,
-    XORG_VERSION_CURRENT,
-    1, 0, 0,
-    ABI_CLASS_EXTENSION,
-    ABI_EXTENSION_VERSION,
-    MOD_CLASS_EXTENSION,
-    {0, 0, 0, 0}
-};
-
-/*
- * Data for the loader
- */
-_X_EXPORT XF86ModuleData extmodModuleData = { &VersRec, extmodSetup, NULL };
-
-static pointer
-extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
-    int i;
-
-    /* XXX the option stuff here is largely a sample/test case */
-
-    for (i = 0; extensionModules[i].name != NULL; i++) {
-        if (opts) {
-            char *s;
-
-            if (asprintf(&s, "omit%s", extensionModules[i].name) != -1) {
-                pointer o;
-
-                o = xf86FindOption(opts, s);
-                free(s);
-                if (o) {
-                    xf86MarkOptionUsed(o);
-                    continue;
-                }
-            }
-        }
-
-#ifdef XSELINUX
-        if (!strcmp(SELINUX_EXTENSION_NAME, extensionModules[i].name)) {
-            pointer o;
-
-            selinuxEnforcingState = SELINUX_MODE_DEFAULT;
-
-            if ((o = xf86FindOption(opts, "SELinux mode disabled"))) {
-                xf86MarkOptionUsed(o);
-                selinuxEnforcingState = SELINUX_MODE_DISABLED;
-            }
-            if ((o = xf86FindOption(opts, "SELinux mode permissive"))) {
-                xf86MarkOptionUsed(o);
-                selinuxEnforcingState = SELINUX_MODE_PERMISSIVE;
-            }
-            if ((o = xf86FindOption(opts, "SELinux mode enforcing"))) {
-                xf86MarkOptionUsed(o);
-                selinuxEnforcingState = SELINUX_MODE_ENFORCING;
-            }
-        }
-#endif
-
-        LoadExtension(&extensionModules[i], FALSE);
-    }
-    /* Need a non-NULL return */
-    return (pointer) 1;
-}
index 9753fe0..4c9b6e3 100644 (file)
@@ -3,91 +3,78 @@
 #include <dix-config.h>
 #endif
 
-#ifndef INITARGS
-#define INITARGS void
-#endif
-
 #include <X11/extensions/shapeproto.h>
 
 #ifdef XTEST
-extern void XTestExtensionInit(INITARGS);
-
+extern void XTestExtensionInit(void);
 #include <X11/extensions/xtestproto.h>
 #endif
 
 #if 1
-extern void XTestExtension1Init(INITARGS);
+extern void XTestExtension1Init(void);
 #endif
 
 #if 1
-extern void XCMiscExtensionInit(INITARGS);
+extern void XCMiscExtensionInit(void);
 #endif
 
 #ifdef SCREENSAVER
-extern void ScreenSaverExtensionInit(INITARGS);
-
+extern void ScreenSaverExtensionInit(void);
 #include <X11/extensions/saver.h>
 #endif
 
 #ifdef XF86VIDMODE
-extern void XFree86VidModeExtensionInit(INITARGS);
-
+extern void XFree86VidModeExtensionInit(void);
 #include <X11/extensions/xf86vmproto.h>
 #endif
 
 #ifdef XFreeXDGA
-extern void XFree86DGAExtensionInit(INITARGS);
-extern void XFree86DGARegister(INITARGS);
-
+extern void XFree86DGAExtensionInit(void);
+extern void XFree86DGARegister(void);
 #include <X11/extensions/xf86dgaproto.h>
 #endif
 
 #ifdef DPMSExtension
-extern void DPMSExtensionInit(INITARGS);
-
+extern void DPMSExtensionInit(void);
 #include <X11/extensions/dpmsconst.h>
 #endif
 
 #ifdef XV
-extern void XvExtensionInit(INITARGS);
-extern void XvMCExtensionInit(INITARGS);
-extern void XvRegister(INITARGS);
-
+extern void XvExtensionInit(void);
+extern void XvMCExtensionInit(void);
+extern void XvRegister(void);
 #include <X11/extensions/Xv.h>
 #include <X11/extensions/XvMC.h>
 #endif
 
 #ifdef RES
-extern void ResExtensionInit(INITARGS);
-
+extern void ResExtensionInit(void);
 #include <X11/extensions/XResproto.h>
 #endif
 
 #ifdef SHM
-extern void ShmExtensionInit(INITARGS);
-
 #include <X11/extensions/shmproto.h>
+extern void ShmExtensionInit(void);
 extern void ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs);
 #endif
 
 #ifdef XSELINUX
-extern void SELinuxExtensionInit(INITARGS);
-
+extern void SELinuxExtensionInit(void);
 #include "xselinux.h"
 #endif
 
 #ifdef XEVIE
-extern void XevieExtensionInit(INITARGS);
+extern void XevieExtensionInit(void);
 #endif
 
 #if 1
-extern void SecurityExtensionInit(INITARGS);
+extern void SecurityExtensionInit(void);
 #endif
 
 #if 1
-extern void PanoramiXExtensionInit(int argc, char *argv[]);
+extern void PanoramiXExtensionInit(void);
 #endif
 
 #if 1
-extern void XkbExtensionInit(INITARGS);
+extern void XkbExtensionInit(void);
 #endif
diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c
deleted file mode 100644 (file)
index 6b33941..0000000
+++ /dev/null
@@ -1,1029 +0,0 @@
-/*
- * Copyright (c) 1995  Jon Tombs
- * Copyright (c) 1995, 1996, 1999  XFree86 Inc
- * Copyright (c) 1999 - The XFree86 Project Inc.
- *
- * Written by Mark Vojkovich
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "dixstruct.h"
-#include "dixevents.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#include <X11/extensions/xf86dgaproto.h>
-#include "swaprep.h"
-#include "dgaproc.h"
-#include "protocol-versions.h"
-
-#include <string.h>
-
-#include "modinit.h"
-
-#define DGA_PROTOCOL_OLD_SUPPORT 1
-
-static void XDGAResetProc(ExtensionEntry * extEntry);
-
-static void DGAClientStateChange(CallbackListPtr *, pointer, pointer);
-
-unsigned char DGAReqCode = 0;
-int DGAErrorBase;
-int DGAEventBase;
-
-static DevPrivateKeyRec DGAScreenPrivateKeyRec;
-
-#define DGAScreenPrivateKey (&DGAScreenPrivateKeyRec)
-#define DGAScreenPrivateKeyRegistered (DGAScreenPrivateKeyRec.initialized)
-static DevPrivateKeyRec DGAClientPrivateKeyRec;
-
-#define DGAClientPrivateKey (&DGAClientPrivateKeyRec)
-static int DGACallbackRefCount = 0;
-
-/* This holds the client's version information */
-typedef struct {
-    int major;
-    int minor;
-} DGAPrivRec, *DGAPrivPtr;
-
-#define DGA_GETCLIENT(idx) ((ClientPtr) \
-    dixLookupPrivate(&screenInfo.screens[idx]->devPrivates, DGAScreenPrivateKey))
-#define DGA_SETCLIENT(idx,p) \
-    dixSetPrivate(&screenInfo.screens[idx]->devPrivates, DGAScreenPrivateKey, p)
-
-#define DGA_GETPRIV(c) ((DGAPrivPtr) \
-    dixLookupPrivate(&(c)->devPrivates, DGAClientPrivateKey))
-#define DGA_SETPRIV(c,p) \
-    dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p)
-
-static void
-XDGAResetProc(ExtensionEntry * extEntry)
-{
-    DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL);
-    DGACallbackRefCount = 0;
-}
-
-static int
-ProcXDGAQueryVersion(ClientPtr client)
-{
-    xXDGAQueryVersionReply rep;
-
-    REQUEST_SIZE_MATCH(xXDGAQueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SERVER_XDGA_MAJOR_VERSION;
-    rep.minorVersion = SERVER_XDGA_MINOR_VERSION;
-
-    WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *) &rep);
-    return Success;
-}
-
-static int
-ProcXDGAOpenFramebuffer(ClientPtr client)
-{
-    REQUEST(xXDGAOpenFramebufferReq);
-    xXDGAOpenFramebufferReply rep;
-    char *deviceName;
-    int nameSize;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (!DGAAvailable(stuff->screen))
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    REQUEST_SIZE_MATCH(xXDGAOpenFramebufferReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
-    if (!DGAOpenFramebuffer(stuff->screen, &deviceName,
-                            (unsigned char **) (&rep.mem1),
-                            (int *) &rep.size, (int *) &rep.offset,
-                            (int *) &rep.extra)) {
-        return BadAlloc;
-    }
-
-    nameSize = deviceName ? (strlen(deviceName) + 1) : 0;
-    rep.length = bytes_to_int32(nameSize);
-
-    WriteToClient(client, sizeof(xXDGAOpenFramebufferReply), (char *) &rep);
-    if (rep.length)
-        WriteToClient(client, nameSize, deviceName);
-
-    return Success;
-}
-
-static int
-ProcXDGACloseFramebuffer(ClientPtr client)
-{
-    REQUEST(xXDGACloseFramebufferReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (!DGAAvailable(stuff->screen))
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    REQUEST_SIZE_MATCH(xXDGACloseFramebufferReq);
-
-    DGACloseFramebuffer(stuff->screen);
-
-    return Success;
-}
-
-static int
-ProcXDGAQueryModes(ClientPtr client)
-{
-    int i, num, size;
-
-    REQUEST(xXDGAQueryModesReq);
-    xXDGAQueryModesReply rep;
-    xXDGAModeInfo info;
-    XDGAModePtr mode;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    REQUEST_SIZE_MATCH(xXDGAQueryModesReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.number = 0;
-    rep.sequenceNumber = client->sequence;
-
-    if (!DGAAvailable(stuff->screen)) {
-        rep.number = 0;
-        rep.length = 0;
-        WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep);
-        return Success;
-    }
-
-    if (!(num = DGAGetModes(stuff->screen))) {
-        WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep);
-        return Success;
-    }
-
-    if (!(mode = (XDGAModePtr) malloc(num * sizeof(XDGAModeRec))))
-        return BadAlloc;
-
-    for (i = 0; i < num; i++)
-        DGAGetModeInfo(stuff->screen, mode + i, i + 1);
-
-    size = num * sz_xXDGAModeInfo;
-    for (i = 0; i < num; i++)
-        size += pad_to_int32(strlen(mode[i].name) + 1); /* plus NULL */
-
-    rep.number = num;
-    rep.length = bytes_to_int32(size);
-
-    WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep);
-
-    for (i = 0; i < num; i++) {
-        size = strlen(mode[i].name) + 1;
-
-        info.byte_order = mode[i].byteOrder;
-        info.depth = mode[i].depth;
-        info.num = mode[i].num;
-        info.bpp = mode[i].bitsPerPixel;
-        info.name_size = (size + 3) & ~3L;
-        info.vsync_num = mode[i].VSync_num;
-        info.vsync_den = mode[i].VSync_den;
-        info.flags = mode[i].flags;
-        info.image_width = mode[i].imageWidth;
-        info.image_height = mode[i].imageHeight;
-        info.pixmap_width = mode[i].pixmapWidth;
-        info.pixmap_height = mode[i].pixmapHeight;
-        info.bytes_per_scanline = mode[i].bytesPerScanline;
-        info.red_mask = mode[i].red_mask;
-        info.green_mask = mode[i].green_mask;
-        info.blue_mask = mode[i].blue_mask;
-        info.visual_class = mode[i].visualClass;
-        info.viewport_width = mode[i].viewportWidth;
-        info.viewport_height = mode[i].viewportHeight;
-        info.viewport_xstep = mode[i].xViewportStep;
-        info.viewport_ystep = mode[i].yViewportStep;
-        info.viewport_xmax = mode[i].maxViewportX;
-        info.viewport_ymax = mode[i].maxViewportY;
-        info.viewport_flags = mode[i].viewportFlags;
-        info.reserved1 = mode[i].reserved1;
-        info.reserved2 = mode[i].reserved2;
-
-        WriteToClient(client, sz_xXDGAModeInfo, (char *) (&info));
-        WriteToClient(client, size, mode[i].name);
-    }
-
-    free(mode);
-
-    return Success;
-}
-
-static void
-DGAClientStateChange(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
-{
-    NewClientInfoRec *pci = (NewClientInfoRec *) calldata;
-    ClientPtr client = NULL;
-    int i;
-
-    for (i = 0; i < screenInfo.numScreens; i++) {
-        if (DGA_GETCLIENT(i) == pci->client) {
-            client = pci->client;
-            break;
-        }
-    }
-
-    if (client &&
-        ((client->clientState == ClientStateGone) ||
-         (client->clientState == ClientStateRetained))) {
-        XDGAModeRec mode;
-        PixmapPtr pPix;
-
-        DGA_SETCLIENT(i, NULL);
-        DGASelectInput(i, NULL, 0);
-        DGASetMode(i, 0, &mode, &pPix);
-
-        if (--DGACallbackRefCount == 0)
-            DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL);
-    }
-}
-
-static int
-ProcXDGASetMode(ClientPtr client)
-{
-    REQUEST(xXDGASetModeReq);
-    xXDGASetModeReply rep;
-    XDGAModeRec mode;
-    xXDGAModeInfo info;
-    PixmapPtr pPix;
-    ClientPtr owner;
-    int size;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-    owner = DGA_GETCLIENT(stuff->screen);
-
-    REQUEST_SIZE_MATCH(xXDGASetModeReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.offset = 0;
-    rep.flags = 0;
-    rep.sequenceNumber = client->sequence;
-
-    if (!DGAAvailable(stuff->screen))
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    if (owner && owner != client)
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    if (!stuff->mode) {
-        if (owner) {
-            if (--DGACallbackRefCount == 0)
-                DeleteCallback(&ClientStateCallback, DGAClientStateChange,
-                               NULL);
-        }
-        DGA_SETCLIENT(stuff->screen, NULL);
-        DGASelectInput(stuff->screen, NULL, 0);
-        DGASetMode(stuff->screen, 0, &mode, &pPix);
-        WriteToClient(client, sz_xXDGASetModeReply, (char *) &rep);
-        return Success;
-    }
-
-    if (Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix))
-        return BadValue;
-
-    if (!owner) {
-        if (DGACallbackRefCount++ == 0)
-            AddCallback(&ClientStateCallback, DGAClientStateChange, NULL);
-    }
-
-    DGA_SETCLIENT(stuff->screen, client);
-
-    if (pPix) {
-        if (AddResource(stuff->pid, RT_PIXMAP, (pointer) (pPix))) {
-            pPix->drawable.id = (int) stuff->pid;
-            rep.flags = DGA_PIXMAP_AVAILABLE;
-        }
-    }
-
-    size = strlen(mode.name) + 1;
-
-    info.byte_order = mode.byteOrder;
-    info.depth = mode.depth;
-    info.num = mode.num;
-    info.bpp = mode.bitsPerPixel;
-    info.name_size = (size + 3) & ~3L;
-    info.vsync_num = mode.VSync_num;
-    info.vsync_den = mode.VSync_den;
-    info.flags = mode.flags;
-    info.image_width = mode.imageWidth;
-    info.image_height = mode.imageHeight;
-    info.pixmap_width = mode.pixmapWidth;
-    info.pixmap_height = mode.pixmapHeight;
-    info.bytes_per_scanline = mode.bytesPerScanline;
-    info.red_mask = mode.red_mask;
-    info.green_mask = mode.green_mask;
-    info.blue_mask = mode.blue_mask;
-    info.visual_class = mode.visualClass;
-    info.viewport_width = mode.viewportWidth;
-    info.viewport_height = mode.viewportHeight;
-    info.viewport_xstep = mode.xViewportStep;
-    info.viewport_ystep = mode.yViewportStep;
-    info.viewport_xmax = mode.maxViewportX;
-    info.viewport_ymax = mode.maxViewportY;
-    info.viewport_flags = mode.viewportFlags;
-    info.reserved1 = mode.reserved1;
-    info.reserved2 = mode.reserved2;
-
-    rep.length = bytes_to_int32(sz_xXDGAModeInfo + info.name_size);
-
-    WriteToClient(client, sz_xXDGASetModeReply, (char *) &rep);
-    WriteToClient(client, sz_xXDGAModeInfo, (char *) (&info));
-    WriteToClient(client, size, mode.name);
-
-    return Success;
-}
-
-static int
-ProcXDGASetViewport(ClientPtr client)
-{
-    REQUEST(xXDGASetViewportReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXDGASetViewportReq);
-
-    DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags);
-
-    return Success;
-}
-
-static int
-ProcXDGAInstallColormap(ClientPtr client)
-{
-    ColormapPtr cmap;
-    int rc;
-
-    REQUEST(xXDGAInstallColormapReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXDGAInstallColormapReq);
-
-    rc = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, RT_COLORMAP,
-                                 client, DixInstallAccess);
-    if (rc != Success)
-        return rc;
-    DGAInstallCmap(cmap);
-    return Success;
-}
-
-static int
-ProcXDGASelectInput(ClientPtr client)
-{
-    REQUEST(xXDGASelectInputReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXDGASelectInputReq);
-
-    if (DGA_GETCLIENT(stuff->screen) == client)
-        DGASelectInput(stuff->screen, client, stuff->mask);
-
-    return Success;
-}
-
-static int
-ProcXDGAFillRectangle(ClientPtr client)
-{
-    REQUEST(xXDGAFillRectangleReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXDGAFillRectangleReq);
-
-    if (Success != DGAFillRect(stuff->screen, stuff->x, stuff->y,
-                               stuff->width, stuff->height, stuff->color))
-        return BadMatch;
-
-    return Success;
-}
-
-static int
-ProcXDGACopyArea(ClientPtr client)
-{
-    REQUEST(xXDGACopyAreaReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXDGACopyAreaReq);
-
-    if (Success != DGABlitRect(stuff->screen, stuff->srcx, stuff->srcy,
-                               stuff->width, stuff->height, stuff->dstx,
-                               stuff->dsty))
-        return BadMatch;
-
-    return Success;
-}
-
-static int
-ProcXDGACopyTransparentArea(ClientPtr client)
-{
-    REQUEST(xXDGACopyTransparentAreaReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXDGACopyTransparentAreaReq);
-
-    if (Success != DGABlitTransRect(stuff->screen, stuff->srcx, stuff->srcy,
-                                    stuff->width, stuff->height, stuff->dstx,
-                                    stuff->dsty, stuff->key))
-        return BadMatch;
-
-    return Success;
-}
-
-static int
-ProcXDGAGetViewportStatus(ClientPtr client)
-{
-    REQUEST(xXDGAGetViewportStatusReq);
-    xXDGAGetViewportStatusReply rep;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXDGAGetViewportStatusReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
-    rep.status = DGAGetViewportStatus(stuff->screen);
-
-    WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *) &rep);
-    return Success;
-}
-
-static int
-ProcXDGASync(ClientPtr client)
-{
-    REQUEST(xXDGASyncReq);
-    xXDGASyncReply rep;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXDGASyncReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
-    DGASync(stuff->screen);
-
-    WriteToClient(client, sizeof(xXDGASyncReply), (char *) &rep);
-    return Success;
-}
-
-static int
-ProcXDGASetClientVersion(ClientPtr client)
-{
-    REQUEST(xXDGASetClientVersionReq);
-
-    DGAPrivPtr pPriv;
-
-    REQUEST_SIZE_MATCH(xXDGASetClientVersionReq);
-    if ((pPriv = DGA_GETPRIV(client)) == NULL) {
-        pPriv = malloc(sizeof(DGAPrivRec));
-        /* XXX Need to look into freeing this */
-        if (!pPriv)
-            return BadAlloc;
-        DGA_SETPRIV(client, pPriv);
-    }
-    pPriv->major = stuff->major;
-    pPriv->minor = stuff->minor;
-
-    return Success;
-}
-
-static int
-ProcXDGAChangePixmapMode(ClientPtr client)
-{
-    REQUEST(xXDGAChangePixmapModeReq);
-    xXDGAChangePixmapModeReply rep;
-    int x, y;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXDGAChangePixmapModeReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
-    x = stuff->x;
-    y = stuff->y;
-
-    if (!DGAChangePixmapMode(stuff->screen, &x, &y, stuff->flags))
-        return BadMatch;
-
-    rep.x = x;
-    rep.y = y;
-    WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *) &rep);
-
-    return Success;
-}
-
-static int
-ProcXDGACreateColormap(ClientPtr client)
-{
-    REQUEST(xXDGACreateColormapReq);
-    int result;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXDGACreateColormapReq);
-
-    if (!stuff->mode)
-        return BadValue;
-
-    result = DGACreateColormap(stuff->screen, client, stuff->id,
-                               stuff->mode, stuff->alloc);
-    if (result != Success)
-        return result;
-
-    return Success;
-}
-
-/*
- *
- * Support for the old DGA protocol, used to live in xf86dga.c
- *
- */
-
-#ifdef DGA_PROTOCOL_OLD_SUPPORT
-
-static int
-ProcXF86DGAGetVideoLL(ClientPtr client)
-{
-    REQUEST(xXF86DGAGetVideoLLReq);
-    xXF86DGAGetVideoLLReply rep;
-    XDGAModeRec mode;
-    int num, offset, flags;
-    char *name;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
-    if (!DGAAvailable(stuff->screen))
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    if (!(num = DGAGetOldDGAMode(stuff->screen)))
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    /* get the parameters for the mode that best matches */
-    DGAGetModeInfo(stuff->screen, &mode, num);
-
-    if (!DGAOpenFramebuffer(stuff->screen, &name,
-                            (unsigned char **) (&rep.offset),
-                            (int *) (&rep.bank_size), &offset, &flags))
-        return BadAlloc;
-
-    rep.offset += mode.offset;
-    rep.width = mode.bytesPerScanline / (mode.bitsPerPixel >> 3);
-    rep.ram_size = rep.bank_size >> 10;
-
-    WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *) &rep);
-    return Success;
-}
-
-static int
-ProcXF86DGADirectVideo(ClientPtr client)
-{
-    int num;
-    PixmapPtr pix;
-    XDGAModeRec mode;
-    ClientPtr owner;
-
-    REQUEST(xXF86DGADirectVideoReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-    REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq);
-
-    if (!DGAAvailable(stuff->screen))
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    owner = DGA_GETCLIENT(stuff->screen);
-
-    if (owner && owner != client)
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    if (stuff->enable & XF86DGADirectGraphics) {
-        if (!(num = DGAGetOldDGAMode(stuff->screen)))
-            return DGAErrorBase + XF86DGANoDirectVideoMode;
-    }
-    else
-        num = 0;
-
-    if (Success != DGASetMode(stuff->screen, num, &mode, &pix))
-        return DGAErrorBase + XF86DGAScreenNotActive;
-
-    DGASetInputMode(stuff->screen,
-                    (stuff->enable & XF86DGADirectKeyb) != 0,
-                    (stuff->enable & XF86DGADirectMouse) != 0);
-
-    /* We need to track the client and attach the teardown callback */
-    if (stuff->enable &
-        (XF86DGADirectGraphics | XF86DGADirectKeyb | XF86DGADirectMouse)) {
-        if (!owner) {
-            if (DGACallbackRefCount++ == 0)
-                AddCallback(&ClientStateCallback, DGAClientStateChange, NULL);
-        }
-
-        DGA_SETCLIENT(stuff->screen, client);
-    }
-    else {
-        if (owner) {
-            if (--DGACallbackRefCount == 0)
-                DeleteCallback(&ClientStateCallback, DGAClientStateChange,
-                               NULL);
-        }
-
-        DGA_SETCLIENT(stuff->screen, NULL);
-    }
-
-    return Success;
-}
-
-static int
-ProcXF86DGAGetViewPortSize(ClientPtr client)
-{
-    int num;
-    XDGAModeRec mode;
-
-    REQUEST(xXF86DGAGetViewPortSizeReq);
-    xXF86DGAGetViewPortSizeReply rep;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
-    if (!DGAAvailable(stuff->screen))
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    if (!(num = DGAGetOldDGAMode(stuff->screen)))
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    DGAGetModeInfo(stuff->screen, &mode, num);
-
-    rep.width = mode.viewportWidth;
-    rep.height = mode.viewportHeight;
-
-    WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *) &rep);
-    return Success;
-}
-
-static int
-ProcXF86DGASetViewPort(ClientPtr client)
-{
-    REQUEST(xXF86DGASetViewPortReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq);
-
-    if (!DGAAvailable(stuff->screen))
-        return DGAErrorBase + XF86DGANoDirectVideoMode;
-
-    if (!DGAActive(stuff->screen))
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    if (DGASetViewport(stuff->screen, stuff->x, stuff->y, DGA_FLIP_RETRACE)
-        != Success)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    return Success;
-}
-
-static int
-ProcXF86DGAGetVidPage(ClientPtr client)
-{
-    REQUEST(xXF86DGAGetVidPageReq);
-    xXF86DGAGetVidPageReply rep;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.vpage = 0;              /* silently fail */
-
-    WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *) &rep);
-    return Success;
-}
-
-static int
-ProcXF86DGASetVidPage(ClientPtr client)
-{
-    REQUEST(xXF86DGASetVidPageReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq);
-
-    /* silently fail */
-
-    return Success;
-}
-
-static int
-ProcXF86DGAInstallColormap(ClientPtr client)
-{
-    ColormapPtr pcmp;
-    int rc;
-
-    REQUEST(xXF86DGAInstallColormapReq);
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq);
-
-    if (!DGAActive(stuff->screen))
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    rc = dixLookupResourceByType((pointer *) &pcmp, stuff->id, RT_COLORMAP,
-                                 client, DixInstallAccess);
-    if (rc == Success) {
-        DGAInstallCmap(pcmp);
-        return Success;
-    }
-    else {
-        return rc;
-    }
-}
-
-static int
-ProcXF86DGAQueryDirectVideo(ClientPtr client)
-{
-    REQUEST(xXF86DGAQueryDirectVideoReq);
-    xXF86DGAQueryDirectVideoReply rep;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.flags = 0;
-
-    if (DGAAvailable(stuff->screen))
-        rep.flags = XF86DGADirectPresent;
-
-    WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *) &rep);
-    return Success;
-}
-
-static int
-ProcXF86DGAViewPortChanged(ClientPtr client)
-{
-    REQUEST(xXF86DGAViewPortChangedReq);
-    xXF86DGAViewPortChangedReply rep;
-
-    if (stuff->screen >= screenInfo.numScreens)
-        return BadValue;
-
-    if (DGA_GETCLIENT(stuff->screen) != client)
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq);
-
-    if (!DGAActive(stuff->screen))
-        return DGAErrorBase + XF86DGADirectNotActivated;
-
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.result = 1;
-
-    WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *) &rep);
-    return Success;
-}
-
-#endif                          /* DGA_PROTOCOL_OLD_SUPPORT */
-
-static int
-SProcXDGADispatch(ClientPtr client)
-{
-    return DGAErrorBase + XF86DGAClientNotLocal;
-}
-
-#if 0
-#define DGA_REQ_DEBUG
-#endif
-
-#ifdef DGA_REQ_DEBUG
-static char *dgaMinor[] = {
-    "QueryVersion",
-    "GetVideoLL",
-    "DirectVideo",
-    "GetViewPortSize",
-    "SetViewPort",
-    "GetVidPage",
-    "SetVidPage",
-    "InstallColormap",
-    "QueryDirectVideo",
-    "ViewPortChanged",
-    "10",
-    "11",
-    "QueryModes",
-    "SetMode",
-    "SetViewport",
-    "InstallColormap",
-    "SelectInput",
-    "FillRectangle",
-    "CopyArea",
-    "CopyTransparentArea",
-    "GetViewportStatus",
-    "Sync",
-    "OpenFramebuffer",
-    "CloseFramebuffer",
-    "SetClientVersion",
-    "ChangePixmapMode",
-    "CreateColormap",
-};
-#endif
-
-static int
-ProcXDGADispatch(ClientPtr client)
-{
-    REQUEST(xReq);
-
-    if (!LocalClient(client))
-        return DGAErrorBase + XF86DGAClientNotLocal;
-
-#ifdef DGA_REQ_DEBUG
-    if (stuff->data <= X_XDGACreateColormap)
-        fprintf(stderr, "    DGA %s\n", dgaMinor[stuff->data]);
-#endif
-
-    switch (stuff->data) {
-        /*
-         * DGA2 Protocol
-         */
-    case X_XDGAQueryVersion:
-        return ProcXDGAQueryVersion(client);
-    case X_XDGAQueryModes:
-        return ProcXDGAQueryModes(client);
-    case X_XDGASetMode:
-        return ProcXDGASetMode(client);
-    case X_XDGAOpenFramebuffer:
-        return ProcXDGAOpenFramebuffer(client);
-    case X_XDGACloseFramebuffer:
-        return ProcXDGACloseFramebuffer(client);
-    case X_XDGASetViewport:
-        return ProcXDGASetViewport(client);
-    case X_XDGAInstallColormap:
-        return ProcXDGAInstallColormap(client);
-    case X_XDGASelectInput:
-        return ProcXDGASelectInput(client);
-    case X_XDGAFillRectangle:
-        return ProcXDGAFillRectangle(client);
-    case X_XDGACopyArea:
-        return ProcXDGACopyArea(client);
-    case X_XDGACopyTransparentArea:
-        return ProcXDGACopyTransparentArea(client);
-    case X_XDGAGetViewportStatus:
-        return ProcXDGAGetViewportStatus(client);
-    case X_XDGASync:
-        return ProcXDGASync(client);
-    case X_XDGASetClientVersion:
-        return ProcXDGASetClientVersion(client);
-    case X_XDGAChangePixmapMode:
-        return ProcXDGAChangePixmapMode(client);
-    case X_XDGACreateColormap:
-        return ProcXDGACreateColormap(client);
-        /*
-         * Old DGA Protocol
-         */
-#ifdef DGA_PROTOCOL_OLD_SUPPORT
-    case X_XF86DGAGetVideoLL:
-        return ProcXF86DGAGetVideoLL(client);
-    case X_XF86DGADirectVideo:
-        return ProcXF86DGADirectVideo(client);
-    case X_XF86DGAGetViewPortSize:
-        return ProcXF86DGAGetViewPortSize(client);
-    case X_XF86DGASetViewPort:
-        return ProcXF86DGASetViewPort(client);
-    case X_XF86DGAGetVidPage:
-        return ProcXF86DGAGetVidPage(client);
-    case X_XF86DGASetVidPage:
-        return ProcXF86DGASetVidPage(client);
-    case X_XF86DGAInstallColormap:
-        return ProcXF86DGAInstallColormap(client);
-    case X_XF86DGAQueryDirectVideo:
-        return ProcXF86DGAQueryDirectVideo(client);
-    case X_XF86DGAViewPortChanged:
-        return ProcXF86DGAViewPortChanged(client);
-#endif                          /* DGA_PROTOCOL_OLD_SUPPORT */
-    default:
-        return BadRequest;
-    }
-}
-
-void
-XFree86DGARegister(INITARGS)
-{
-    XDGAEventBase = &DGAEventBase;
-}
-
-void
-XFree86DGAExtensionInit(INITARGS)
-{
-    ExtensionEntry *extEntry;
-
-    if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0))
-        return;
-
-    if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
-        return;
-
-    if ((extEntry = AddExtension(XF86DGANAME,
-                                 XF86DGANumberEvents,
-                                 XF86DGANumberErrors,
-                                 ProcXDGADispatch,
-                                 SProcXDGADispatch,
-                                 XDGAResetProc, StandardMinorOpcode))) {
-        int i;
-
-        DGAReqCode = (unsigned char) extEntry->base;
-        DGAErrorBase = extEntry->errorBase;
-        DGAEventBase = extEntry->eventBase;
-        for (i = KeyPress; i <= MotionNotify; i++)
-            SetCriticalEvent(DGAEventBase + i);
-    }
-}
diff --git a/hw/xfree86/dixmods/extmod/xvmod.c b/hw/xfree86/dixmods/extmod/xvmod.c
deleted file mode 100644 (file)
index 97616c7..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "misc.h"
-#include "scrnintstr.h"
-#include "gc.h"
-#include <X11/extensions/Xv.h>
-#include <X11/extensions/Xvproto.h>
-#include "xvdix.h"
-#include "xvmodproc.h"
-
-void
-XvRegister(void)
-{
-    XvScreenInitProc = XvScreenInit;
-    XvGetScreenKeyProc = XvGetScreenKey;
-    XvGetRTPortProc = XvGetRTPort;
-    XvMCScreenInitProc = XvMCScreenInit;
-}
diff --git a/hw/xfree86/dixmods/extmod/xvmodproc.h b/hw/xfree86/dixmods/extmod/xvmodproc.h
deleted file mode 100644 (file)
index be51e55..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "xvmcext.h"
-
-extern DevPrivateKey (*XvGetScreenKeyProc) (void);
-extern unsigned long (*XvGetRTPortProc) (void);
-extern int (*XvScreenInitProc) (ScreenPtr);
-extern int (*XvMCScreenInitProc) (ScreenPtr, int, XvMCAdaptorPtr);
-
-extern void XvRegister(void);
index e72f382..c0c6114 100644 (file)
@@ -42,17 +42,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "micmap.h"
 #include "globals.h"
 #include "glxserver.h"
+#include "extinit.h"
+#include "glx_extinit.h"
 
 static MODULESETUPPROTO(glxSetup);
 
-static const char *initdeps[] = { "DOUBLE-BUFFER", "COMPOSITE", NULL };
-
 static ExtensionModule GLXExt = {
     GlxExtensionInit,
     "GLX",
-    &noGlxExtension,
-    NULL,
-    initdeps
+    &noGlxExtension
 };
 
 static XF86ModuleVersionInfo VersRec = {
@@ -84,11 +82,6 @@ glxSetup(pointer module, pointer opts, int *errmaj, int *errmin)
 
     setupDone = TRUE;
 
-    provider = LoaderSymbol("__glXDRISWRastProvider");
-    if (provider == NULL)
-        return NULL;
-    GlxPushProvider(provider);
-
     xf86Msg(xf86Info.aiglxFrom, "AIGLX %s\n",
             xf86Info.aiglx ? "enabled" : "disabled");
     if (xf86Info.aiglx) {
diff --git a/hw/xfree86/dixmods/recordmod.c b/hw/xfree86/dixmods/recordmod.c
deleted file mode 100644 (file)
index b75cc3f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-extern Bool noTestExtensions;
-
-static MODULESETUPPROTO(recordSetup);
-
-extern void RecordExtensionInit(INITARGS);
-
-static ExtensionModule recordExt = {
-    RecordExtensionInit,
-    "RECORD",
-    &noTestExtensions,
-    NULL,
-    NULL
-};
-
-static XF86ModuleVersionInfo VersRec = {
-    "record",
-    MODULEVENDORSTRING,
-    MODINFOSTRING1,
-    MODINFOSTRING2,
-    XORG_VERSION_CURRENT,
-    1, 13, 0,
-    ABI_CLASS_EXTENSION,
-    ABI_EXTENSION_VERSION,
-    MOD_CLASS_EXTENSION,
-    {0, 0, 0, 0}
-};
-
-_X_EXPORT XF86ModuleData recordModuleData = { &VersRec, recordSetup, NULL };
-
-static pointer
-recordSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
-    LoadExtension(&recordExt, FALSE);
-
-    /* Need a non-NULL return value to indicate success */
-    return (pointer) 1;
-}
index 894e213..ea228e5 100644 (file)
@@ -133,11 +133,10 @@ this function computes an initial configuration for the server. It tries to
 enable as much hardware as possible using some fairly simple heuristics. 
 
 The 'canGrow' parameter indicates that the frame buffer does not have a fixed
-size (fixed size frame buffers are required by XAA). When the frame buffer
-has a fixed size, the configuration selects a 'reasonablely large' frame
-buffer so that common reconfiguration options are possible. For resizable
-frame buffers, the frame buffer is set to the smallest size that encloses
-the desired configuration.
+size. When the frame buffer has a fixed size, the configuration selects a
+'reasonablely large' frame buffer so that common reconfiguration options are
+possible. For resizable frame buffers, the frame buffer is set to the smallest
+size that encloses the desired configuration.
     
 3.2 ScreenInit functions
 
index ca5efc9..4c2ca47 100644 (file)
@@ -330,8 +330,8 @@ that.  This is a significant difference compared with the old design.
 
     <para>
 The entry points for drawing operations are already taken care of by
-the framebuffer code (including, XAA).  Extensions and enhancements to
-framebuffer code are outside the scope of this document.
+the framebuffer code.  Extensions and enhancements to framebuffer code
+are outside the scope of this document.
     </para>
 
     <para>
@@ -665,11 +665,6 @@ Here is what <function>InitOutput()</function> does:
       </para>
 
       <para>
-    The core server contains a list of mandatory modules.  These are loaded
-    first.  Currently the only module on this list is the bitmap font module.
-      </para>
-
-      <para>
     The next set of modules loaded are those specified explicitly in the
     &k.module; section of the config file.
       </para>
@@ -1311,7 +1306,7 @@ Here is what <function>InitOutput()</function> does:
 
       <blockquote><para>
          <programlisting>
-    Bool ChipScreenInit(int index, ScreenPtr pScreen,
+    Bool ChipScreenInit(ScreenPtr pScreen,
                         int argc, char **argv);
          </programlisting>
          <blockquote><para>
@@ -1447,7 +1442,7 @@ Here is what <function>InitOutput()</function> does:
 
       <blockquote><para>
          <programlisting>
-    Bool ChipSwitchMode(int index, DisplayModePtr mode, int flags);
+    Bool ChipSwitchMode(int index, DisplayModePtr mode);
          </programlisting>
          <blockquote><para>
       Initialises the new mode for the screen identified by
@@ -1469,7 +1464,7 @@ Here is what <function>InitOutput()</function> does:
 
       <blockquote><para>
          <programlisting>
-    void ChipAdjustFrame(int index, int x, int y, int flags);
+    void ChipAdjustFrame(int index, int x, int y);
          </programlisting>
          <blockquote><para>
       Changes the viewport for the screen identified by
@@ -1577,7 +1572,7 @@ Here is what <function>InitOutput()</function> does:
 
       <blockquote><para>
          <programlisting>
-    Bool ChipEnterVT(int index, int flags);
+    Bool ChipEnterVT(ScrnInfoPtr pScrn);
          </programlisting>
          <blockquote><para>
       This function should initialise the current video mode and
@@ -1594,7 +1589,7 @@ Here is what <function>InitOutput()</function> does:
 
       <blockquote><para>
          <programlisting>
-    void ChipLeaveVT(int index, int flags);
+    void ChipLeaveVT(ScrnInfoPtr pScrn);
          </programlisting>
          <blockquote><para>
       This function should restore the saved video state.  If
@@ -1696,7 +1691,7 @@ but their presence is optional.
 
       <blockquote><para>
          <programlisting>
-    ModeStatus ChipValidMode(int index, DisplayModePtr mode,
+    ModeStatus ChipValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
                              Bool verbose, int flags);
          </programlisting>
          <blockquote><para>
@@ -1744,7 +1739,7 @@ MODECHECK_FINAL are intended for checks that may involve more than one mode.
 
       <blockquote><para>
          <programlisting>
-    void ChipFreeScreen(int scrnindex, int flags);
+    void ChipFreeScreen(ScrnInfoPtr pScrn);
          </programlisting>
          <blockquote><para>
       Free any driver-allocated data that may have been allocated up to
@@ -2008,10 +2003,9 @@ also include the video card's saved state.
       </para>
 
       <para>
-Per-screen data for other modules that the driver uses (for example,
-the XAA module) that is reset for each server generation is hooked into
-the <structname>ScrnInfoRec</structname> through it's <structfield>privates</structfield>
-field.
+Per-screen data for other modules that the driver uses that is reset for each
+server generation is hooked into the <structname>ScrnInfoRec</structname>
+through its <structfield>privates</structfield> field.
       </para>
 
       <para>
@@ -2829,12 +2823,12 @@ Several functions are provided to simplify resource registration:
 
          <blockquote><para>
              <programlisting>
-    Bool xf86IsScreenPrimary(int scrnIndex);
+    Bool xf86IsScreenPrimary(ScrnInfoPtr pScrn);
              </programlisting>
              <blockquote><para>
       This function returns <constant>TRUE</constant> if the primary entity
       is registered with the screen referenced by
-      <parameter>scrnIndex</parameter>.
+      <parameter>pScrn</parameter>.
                </para>
 
              </blockquote></para></blockquote>
@@ -3620,14 +3614,6 @@ The following include files are typically required by video drivers:
          </para>
 
          <para>
-  If a driver uses XAA, it needs these:
-           <literallayout><filename>
-    "xaa.h"
-    "xaalocal.h"
-             </filename></literallayout>
-         </para>
-
-         <para>
   If a driver uses the fb manager, it needs this:
            <literallayout><filename>
     "xf86fbman.h"
@@ -3845,31 +3831,6 @@ manager is allowed to manage.  This is typically a box with a width of
 can be fit within the total video memory, however, the driver can reserve
 areas at the extremities by passing a smaller area to the manager.
     </para>
-
-    <para>
-<function>xf86InitFBManager()</function> must be called before XAA is
-initialized since XAA uses the manager for it's pixmap cache.
-    </para>
-
-    <para>
-An alternative function is provided to allow the driver to initialize
-the framebuffer manager with a Region rather than a box.
-
-    <programlisting>
-    Bool xf86InitFBManagerRegion(ScreenPtr pScreen,
-                                 RegionPtr FullRegion);
-    </programlisting>
-
-<function>xf86InitFBManagerRegion()</function>, unlike
-<function>xf86InitFBManager()</function>, does not remove the area used for
-the visible screen so that area should not be included in the region
-passed to the function.  <function>xf86InitFBManagerRegion()</function> is
-useful when non-contiguous areas are available to be managed, and is
-required when multiple framebuffers are stored in video memory (as in
-the case where an overlay of a different depth is stored as a second
-framebuffer in offscreen memory).
-    </para>
-
   </sect1>
 
   <sect1 id="cmap">
@@ -5368,15 +5329,6 @@ XFree86 common layer.
                  way by modules loaded directly by the XFree86 common
                  layer.  However, it may be used for application-specific
                  parameter passing in other situations.
-                   </para>
-
-                   <para>
-                 When loading <quote>external</quote> modules (modules that don't
-                 have the standard entry point, for example a
-                 special shared library) the options parameter can be
-                 set to <constant>EXTERN_MODULE</constant> to tell the
-                 loader not to reject the module when it doesn't find
-                 the standard entry point.
                    </para></listitem></varlistentry>
 
 
@@ -5987,33 +5939,12 @@ typedef struct {
     InitExtension       initFunc;
     char *              name;
     Bool                *disablePtr;
-    InitExtension       setupFunc;
 } ExtensionModule;
              </programlisting>
            </para>
 
          </blockquote></para></blockquote>
 
-      <blockquote><para>
-         <programlisting>
-    void LoadFont(FontModule *font);
-         </programlisting>
-         <blockquote><para>
-    This registers the entry points for the font rasteriser module
-    identified by <parameter>font</parameter>.  The <structname>FontModule</structname>
-    struct is defined as:
-
-             <programlisting>
- typedef struct {
-    InitFont    initFunc;
-    char *      name;
-    pointer     module;
-} FontModule;
-             </programlisting>
-           </para>
-
-         </blockquote></para></blockquote>
-
     </sect2>
 
   </sect1>
@@ -8935,12 +8866,6 @@ ZZZPreInit(ScrnInfoPtr pScrn, int flags)
         ZZZFreeRec(pScrn);
         return FALSE;
 
-    /* Load XAA if needed */
-    if (!pZzz-&gt;noAccel || pZzz-&gt;hwCursor)
-        if (!xf86LoadSubModule(pScrn, "xaa")) {
-            ZZZFreeRec(pScrn);
-            return FALSE;
-        }
 
     /* Done */
     return TRUE;
@@ -9058,10 +8983,10 @@ ZZZModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
 
        <programlisting>
 static Bool
-ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ZZZScreenInit(ScreenPtr pScreen, int argc, char **argv)
 {
     /* Get the ScrnInfoRec */
-    pScrn = xf86Screens[pScreen-&gt;myNum];
+    pScrn = xf86ScreenToScrn(pScreen);
 
     /*
      * If using the vgahw module, its data structures and related
@@ -9076,7 +9001,7 @@ ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
     /* Set the viewport if supported */
 
-    ZZZAdjustFrame(scrnIndex, pScrn-&gt;frameX0, pScrn-&gt;frameY0, 0);
+    ZZZAdjustFrame(pScrn, pScrn-&gt;frameX0, pScrn-&gt;frameY0);
 
     /*
      * Setup the screen's visuals, and initialise the framebuffer
@@ -9245,9 +9170,9 @@ ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
        <programlisting>
 static Bool
-ZZZSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+ZZZSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
 {
-    return ZZZModeInit(xf86Screens[scrnIndex], mode);
+    return ZZZModeInit(pScrn, mode);
 }
        </programlisting>
       </sect3>
@@ -9262,7 +9187,7 @@ ZZZSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
 
        <programlisting>
 static void
-ZZZAdjustFrame(int scrnIndex, int x, int y, int flags)
+ZZZAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
 {
     /* Adjust the viewport */
 }
@@ -9283,16 +9208,14 @@ ZZZAdjustFrame(int scrnIndex, int x, int y, int flags)
 
        <programlisting>
 static Bool
-ZZZEnterVT(int scrnIndex, int flags)
+ZZZEnterVT(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     return ZZZModeInit(pScrn, pScrn-&gt;currentMode);
 }
 
 static void
-ZZZLeaveVT(int scrnIndex, int flags)
+ZZZLeaveVT(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     ZZZRestore(pScrn);
 }
        </programlisting>
@@ -9313,16 +9236,16 @@ ZZZLeaveVT(int scrnIndex, int flags)
 
        <programlisting>
 static Bool
-ZZZCloseScreen(int scrnIndex, ScreenPtr pScreen)
+ZZZCloseScreen(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     if (pScrn-&gt;vtSema) {
         ZZZRestore(pScrn);
         ZZZUnmapMem(pScrn);
     }
     pScrn-&gt;vtSema = FALSE;
     pScreen-&gt;CloseScreen = ZZZPTR(pScrn)-&gt;CloseScreen;
-    return (*pScreen-&gt;CloseScreen)(scrnIndex, pScreen);
+    return (*pScreen-&gt;CloseScreen)(pScreen);
 }
        </programlisting>
       </sect3>
@@ -9367,13 +9290,13 @@ ZZZSaveScreen(ScreenPtr pScreen, int mode)
 
        <programlisting>
 static void
-ZZZFreeScreen(int scrnIndex, int flags)
+ZZZFreeScreen(ScrnInfoPtr pScrn)
 {
     /*
      * If the vgahw module is used vgaHWFreeHWRec() would be called
      * here.
      */
-    ZZZFreeRec(xf86Screens[scrnIndex]);
+    ZZZFreeRec(pScrn);
 }
 
        </programlisting>
index 048307e..da39d3f 100644 (file)
@@ -8,15 +8,10 @@ from system memory, and Porter-Duff compositing and transform operations.
 
 Configuration
 -------------
-A new config file option, AccelMethod, should be added to your driver, to allow
-the user to select between the EXA and XAA acceleration APIs.
-
 Some drivers implement a per-instance useEXA flag to track whether EXA is
-active or not.  It can be helpful to also conditionalize XAA support with an
-ifdef so that it can easily be turned off/removed in the future.
+active or not.
 
-Setting the flag and checking for AccelMethod can be done in the driver's
-Options parsing routine.
+Setting the flag can be done in the driver's Options parsing routine.
 
 Loading EXA
 ------------
index a7b491c..ced04ff 100644 (file)
@@ -1,23 +1,18 @@
-libdri_la_LTLIBRARIES = libdri.la
-libdri_la_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \
-                   -I$(top_srcdir)/hw/xfree86/os-support \
-                   -I$(top_srcdir)/hw/xfree86/modes \
-                   -I$(top_srcdir)/hw/xfree86/ddc \
-                   -I$(top_srcdir)/hw/xfree86/i2c \
-                   -I$(top_srcdir)/hw/xfree86/parser \
-                   -I$(top_srcdir)/hw/xfree86/ramdac \
-                   -I$(top_srcdir)/hw/xfree86/os-support/bus \
-                   -I$(top_srcdir)/glx \
-                   -DHAVE_XORG_CONFIG_H \
-                   @DIX_CFLAGS@ @XORG_CFLAGS@ @DRIPROTO_CFLAGS@ \
-                   @LIBDRM_CFLAGS@ \
-                   @DRI_CFLAGS@
-libdri_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@
-libdri_ladir = $(moduledir)/extensions
+noinst_LTLIBRARIES = libdri.la
+AM_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \
+            -I$(top_srcdir)/hw/xfree86/os-support \
+            -I$(top_srcdir)/hw/xfree86/modes \
+            -I$(top_srcdir)/hw/xfree86/ddc \
+            -I$(top_srcdir)/hw/xfree86/i2c \
+            -I$(top_srcdir)/hw/xfree86/parser \
+            -I$(top_srcdir)/hw/xfree86/ramdac \
+            -I$(top_srcdir)/hw/xfree86/os-support/bus \
+            -I$(top_srcdir)/glx \
+            -DHAVE_XORG_CONFIG_H \
+            @DIX_CFLAGS@ @XORG_CFLAGS@
 libdri_la_SOURCES = \
        dri.c \
        dri.h \
-       drimodule.c \
        dristruct.h \
        sarea.h \
        xf86dri.c
index 9530eb4..398178e 100644 (file)
@@ -51,6 +51,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "misc.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "scrnintstr.h"
@@ -68,6 +69,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xf86_OSproc.h"
 #include "inputstr.h"
 #include "xf86VGAarbiter.h"
+#include "xf86Extensions.h"
 
 static int DRIEntPrivIndex = -1;
 static DevPrivateKeyRec DRIScreenPrivKeyRec;
@@ -315,7 +317,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
     int reserved_count;
     int i;
     DRIEntPrivPtr pDRIEntPriv;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     DRIContextFlags flags = 0;
     DRIContextPrivPtr pDRIContextPriv;
 
@@ -615,7 +617,7 @@ DRIFinishScreenInit(ScreenPtr pScreen)
         pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify;
     }
     if (pDRIInfo->wrap.AdjustFrame) {
-        ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+        ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
         pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
         pScrn->AdjustFrame = pDRIInfo->wrap.AdjustFrame;
@@ -634,7 +636,7 @@ DRICloseScreen(ScreenPtr pScreen)
     DRIInfoPtr pDRIInfo;
     drm_context_t *reserved;
     int reserved_count;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     DRIEntPrivPtr pDRIEntPriv = DRI_ENT_PRIV(pScrn);
     Bool closeMaster;
 
@@ -672,7 +674,7 @@ DRICloseScreen(ScreenPtr pScreen)
                 pDRIPriv->wrap.ClipNotify = NULL;
             }
             if (pDRIInfo->wrap.AdjustFrame) {
-                ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+                ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
                 pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
                 pDRIPriv->wrap.AdjustFrame = NULL;
@@ -789,6 +791,8 @@ DRIExtensionInit(void)
 
     RegisterBlockAndWakeupHandlers(DRIBlockHandler, DRIWakeupHandler, NULL);
 
+    drmSetServerInfo(&DRIDRMServerInfo);
+
     return TRUE;
 }
 
@@ -1618,7 +1622,7 @@ DRIWakeupHandler(pointer wakeupData, int result, pointer pReadmask)
         DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
 
         if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.WakeupHandler)
-            (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (i, wakeupData,
+            (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen,
                                                           result, pReadmask);
     }
 }
@@ -1633,16 +1637,15 @@ DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
         DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
 
         if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.BlockHandler)
-            (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (i, blockData,
+            (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen,
                                                          pTimeout, pReadmask);
     }
 }
 
 void
-DRIDoWakeupHandler(int screenNum, pointer wakeupData,
+DRIDoWakeupHandler(ScreenPtr pScreen,
                    unsigned long result, pointer pReadmask)
 {
-    ScreenPtr pScreen = screenInfo.screens[screenNum];
     DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
 
     DRILock(pScreen, 0);
@@ -1658,10 +1661,9 @@ DRIDoWakeupHandler(int screenNum, pointer wakeupData,
 }
 
 void
-DRIDoBlockHandler(int screenNum, pointer blockData,
+DRIDoBlockHandler(ScreenPtr pScreen,
                   pointer pTimeout, pointer pReadmask)
 {
-    ScreenPtr pScreen = screenInfo.screens[screenNum];
     DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
 
     if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
@@ -2307,15 +2309,14 @@ _DRIAdjustFrame(ScrnInfoPtr pScrn, DRIScreenPrivPtr pDRIPriv, int x, int y)
 }
 
 void
-DRIAdjustFrame(int scrnIndex, int x, int y, int flags)
+DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
 {
-    ScreenPtr pScreen = screenInfo.screens[scrnIndex];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     int px, py;
 
     if (!pDRIPriv || !pDRIPriv->pSAREA) {
-        DRIDrvMsg(scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n",
+        DRIDrvMsg(pScrn->scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n",
                   pDRIPriv, pDRIPriv ? pDRIPriv->pSAREA : NULL);
         return;
     }
@@ -2347,7 +2348,7 @@ DRIAdjustFrame(int scrnIndex, int x, int y, int flags)
         /* unwrap */
         pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
         /* call lower layers */
-        (*pScrn->AdjustFrame) (scrnIndex, x, y, flags);
+        (*pScrn->AdjustFrame) (pScrn, x, y);
         /* rewrap */
         pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
         pScrn->AdjustFrame = DRIAdjustFrame;
index 53458bb..4bfaf16 100644 (file)
@@ -73,7 +73,7 @@ typedef int DRIWindowRequests;
 #define DRI_ALL_WINDOWS      2
 
 typedef void (*ClipNotifyPtr) (WindowPtr, int, int);
-typedef void (*AdjustFramePtr) (int scrnIndex, int x, int y, int flags);
+typedef void (*AdjustFramePtr) (ScrnInfoPtr pScrn, int x, int y);
 
 /*
  * These functions can be wrapped by the DRI.  Each of these have
@@ -197,7 +197,7 @@ extern _X_EXPORT Bool DRIScreenInit(ScreenPtr pScreen,
 
 extern _X_EXPORT void DRICloseScreen(ScreenPtr pScreen);
 
-extern _X_EXPORT Bool DRIExtensionInit(void);
+extern Bool DRIExtensionInit(void);
 
 extern _X_EXPORT void DRIReset(void);
 
@@ -271,13 +271,11 @@ extern _X_EXPORT void DRIWakeupHandler(pointer wakeupData,
 extern _X_EXPORT void DRIBlockHandler(pointer blockData,
                                       OSTimePtr pTimeout, pointer pReadmask);
 
-extern _X_EXPORT void DRIDoWakeupHandler(int screenNum,
-                                         pointer wakeupData,
+extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen,
                                          unsigned long result,
                                          pointer pReadmask);
 
-extern _X_EXPORT void DRIDoBlockHandler(int screenNum,
-                                        pointer blockData,
+extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen,
                                         pointer pTimeout, pointer pReadmask);
 
 extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx);
@@ -334,7 +332,7 @@ extern _X_EXPORT drm_context_t DRIGetContext(ScreenPtr pScreen);
 extern _X_EXPORT void DRIQueryVersion(int *majorVersion,
                                       int *minorVersion, int *patchVersion);
 
-extern _X_EXPORT void DRIAdjustFrame(int scrnIndex, int x, int y, int flags);
+extern _X_EXPORT void DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
 
 extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen,
                                            int dx,
diff --git a/hw/xfree86/dri/drimodule.c b/hw/xfree86/dri/drimodule.c
deleted file mode 100644 (file)
index 83eca4e..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/**************************************************************************
-
-Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- *   Kevin E. Martin <kevin@precisioninsight.com>
- *   Rickard E. Faith <faith@precisioninsight.com>
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-#include "globals.h"
-
-#include "xf86drm.h"
-static MODULESETUPPROTO(driSetup);
-
-drmServerInfo DRIDRMServerInfo;
-
-static XF86ModuleVersionInfo VersRec = {
-    "dri",
-    MODULEVENDORSTRING,
-    MODINFOSTRING1,
-    MODINFOSTRING2,
-    XORG_VERSION_CURRENT,
-    1, 0, 0,
-    ABI_CLASS_EXTENSION,
-    ABI_EXTENSION_VERSION,
-    MOD_CLASS_NONE,
-    {0, 0, 0, 0}
-};
-
-extern void XFree86DRIExtensionInit(INITARGS);
-
-#define _XF86DRI_SERVER_
-#include <X11/dri/xf86driproto.h>
-
-static ExtensionModule XF86DRIExt = {
-    XFree86DRIExtensionInit,
-    XF86DRINAME,
-    &noXFree86DRIExtension,
-    NULL,
-    NULL
-};
-
-_X_EXPORT XF86ModuleData driModuleData = { &VersRec, driSetup, NULL };
-
-static pointer
-driSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
-    static Bool setupDone = FALSE;
-
-    if (!setupDone) {
-        setupDone = TRUE;
-        LoadExtension(&XF86DRIExt, FALSE);
-    }
-    else {
-        if (errmaj)
-            *errmaj = LDR_ONCEONLY;
-    }
-
-    drmSetServerInfo(&DRIDRMServerInfo);
-
-    /* Need a non-NULL return value to indicate success */
-    return (pointer) 1;
-}
index 72ce869..ba74bb0 100644 (file)
@@ -47,6 +47,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "misc.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "scrnintstr.h"
@@ -60,17 +61,17 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "dristruct.h"
 #include "xf86drm.h"
 #include "protocol-versions.h"
+#include "xf86Extensions.h"
 
 static int DRIErrorBase;
 
-static void XF86DRIResetProc(ExtensionEntry * extEntry);
+static void XF86DRIResetProc(ExtensionEntry *extEntry);
 
 static unsigned char DRIReqCode = 0;
 
-extern void XFree86DRIExtensionInit(void);
-
- /*ARGSUSED*/ static void
-XF86DRIResetProc(ExtensionEntry * extEntry)
+/*ARGSUSED*/
+static void
+XF86DRIResetProc(ExtensionEntry *extEntry)
 {
     DRIReset();
 }
@@ -78,15 +79,16 @@ XF86DRIResetProc(ExtensionEntry * extEntry)
 static int
 ProcXF86DRIQueryVersion(register ClientPtr client)
 {
-    xXF86DRIQueryVersionReply rep;
+    xXF86DRIQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_XF86DRI_MAJOR_VERSION,
+        .minorVersion = SERVER_XF86DRI_MINOR_VERSION,
+        .patchVersion = SERVER_XF86DRI_PATCH_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SERVER_XF86DRI_MAJOR_VERSION;
-    rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION;
-    rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -94,7 +96,7 @@ ProcXF86DRIQueryVersion(register ClientPtr client)
         swaps(&rep.minorVersion);
         swapl(&rep.patchVersion);
     }
-    WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), &rep);
     return Success;
 }
 
@@ -111,18 +113,20 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     if (!DRIQueryDirectRenderingCapable(screenInfo.screens[stuff->screen],
                                         &isCapable)) {
         return BadValue;
     }
-    rep.isCapable = isCapable;
 
     if (!LocalClient(client) || client->swapped)
-        rep.isCapable = 0;
+        isCapable = 0;
+
+    rep = (xXF86DRIQueryDirectRenderingCapableReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .isCapable = isCapable
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
@@ -131,7 +135,7 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client)
 
     WriteToClient(client,
                   sizeof(xXF86DRIQueryDirectRenderingCapableReply),
-                  (char *) &rep);
+                  &rep);
     return Success;
 }
 
@@ -141,6 +145,7 @@ ProcXF86DRIOpenConnection(register ClientPtr client)
     xXF86DRIOpenConnectionReply rep;
     drm_handle_t hSAREA;
     char *busIdString;
+    CARD32 busIdStringLength = 0;
 
     REQUEST(xXF86DRIOpenConnectionReq);
     REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq);
@@ -154,33 +159,40 @@ ProcXF86DRIOpenConnection(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.busIdStringLength = 0;
     if (busIdString)
-        rep.busIdStringLength = strlen(busIdString);
-    rep.length =
-        bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) -
-                       SIZEOF(xGenericReply) +
-                       pad_to_int32(rep.busIdStringLength));
+        busIdStringLength = strlen(busIdString);
 
-    rep.hSAREALow = (CARD32) (hSAREA & 0xffffffff);
+    rep = (xXF86DRIOpenConnectionReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) -
+                                 SIZEOF(xGenericReply) +
+                                 pad_to_int32(busIdStringLength)),
+        .busIdStringLength = busIdStringLength,
+
+        .hSAREALow = (CARD32) (hSAREA & 0xffffffff),
 #if defined(LONG64) && !defined(__linux__)
-    rep.hSAREAHigh = (CARD32) (hSAREA >> 32);
+        .hSAREAHigh = (CARD32) (hSAREA >> 32),
 #else
-    rep.hSAREAHigh = 0;
+        .hSAREAHigh = 0
 #endif
+    };
 
-    WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *) &rep);
-    if (rep.busIdStringLength)
-        WriteToClient(client, rep.busIdStringLength, busIdString);
+    WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), &rep);
+    if (busIdStringLength)
+        WriteToClient(client, busIdStringLength, busIdString);
     return Success;
 }
 
 static int
 ProcXF86DRIAuthConnection(register ClientPtr client)
 {
-    xXF86DRIAuthConnectionReply rep;
+    xXF86DRIAuthConnectionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .authenticated = 1
+    };
 
     REQUEST(xXF86DRIAuthConnectionReq);
     REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq);
@@ -189,16 +201,11 @@ ProcXF86DRIAuthConnection(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.authenticated = 1;
-
     if (!DRIAuthConnection(screenInfo.screens[stuff->screen], stuff->magic)) {
         ErrorF("Failed to authenticate %lu\n", (unsigned long) stuff->magic);
         rep.authenticated = 0;
     }
-    WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), &rep);
     return Success;
 }
 
@@ -220,7 +227,11 @@ ProcXF86DRICloseConnection(register ClientPtr client)
 static int
 ProcXF86DRIGetClientDriverName(register ClientPtr client)
 {
-    xXF86DRIGetClientDriverNameReply rep;
+    xXF86DRIGetClientDriverNameReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .clientDriverNameLength = 0
+    };
     char *clientDriverName;
 
     REQUEST(xXF86DRIGetClientDriverNameReq);
@@ -236,17 +247,13 @@ ProcXF86DRIGetClientDriverName(register ClientPtr client)
                            (int *) &rep.ddxDriverPatchVersion,
                            &clientDriverName);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.clientDriverNameLength = 0;
     if (clientDriverName)
         rep.clientDriverNameLength = strlen(clientDriverName);
     rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetClientDriverNameReply) -
                                 SIZEOF(xGenericReply) +
                                 pad_to_int32(rep.clientDriverNameLength));
 
-    WriteToClient(client,
-                  sizeof(xXF86DRIGetClientDriverNameReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), &rep);
     if (rep.clientDriverNameLength)
         WriteToClient(client, rep.clientDriverNameLength, clientDriverName);
     return Success;
@@ -255,7 +262,11 @@ ProcXF86DRIGetClientDriverName(register ClientPtr client)
 static int
 ProcXF86DRICreateContext(register ClientPtr client)
 {
-    xXF86DRICreateContextReply rep;
+    xXF86DRICreateContextReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     ScreenPtr pScreen;
 
     REQUEST(xXF86DRICreateContextReq);
@@ -265,10 +276,6 @@ ProcXF86DRICreateContext(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     pScreen = screenInfo.screens[stuff->screen];
 
     if (!DRICreateContext(pScreen,
@@ -277,7 +284,7 @@ ProcXF86DRICreateContext(register ClientPtr client)
         return BadValue;
     }
 
-    WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRICreateContextReply), &rep);
     return Success;
 }
 
@@ -301,7 +308,11 @@ ProcXF86DRIDestroyContext(register ClientPtr client)
 static int
 ProcXF86DRICreateDrawable(ClientPtr client)
 {
-    xXF86DRICreateDrawableReply rep;
+    xXF86DRICreateDrawableReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     DrawablePtr pDrawable;
     int rc;
 
@@ -312,10 +323,6 @@ ProcXF86DRICreateDrawable(ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
                            DixReadAccess);
     if (rc != Success)
@@ -326,7 +333,7 @@ ProcXF86DRICreateDrawable(ClientPtr client)
         return BadValue;
     }
 
-    WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), &rep);
     return Success;
 }
 
@@ -360,7 +367,11 @@ ProcXF86DRIDestroyDrawable(register ClientPtr client)
 static int
 ProcXF86DRIGetDrawableInfo(register ClientPtr client)
 {
-    xXF86DRIGetDrawableInfoReply rep;
+    xXF86DRIGetDrawableInfoReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     DrawablePtr pDrawable;
     int X, Y, W, H;
     drm_clip_rect_t *pClipRects, *pClippedRects;
@@ -374,10 +385,6 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
                            DixReadAccess);
     if (rc != Success)
@@ -444,19 +451,19 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client)
 
     rep.length = bytes_to_int32(rep.length);
 
-    WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), &rep);
 
     if (rep.numClipRects) {
         WriteToClient(client,
                       sizeof(drm_clip_rect_t) * rep.numClipRects,
-                      (char *) pClippedRects);
+                      pClippedRects);
         free(pClippedRects);
     }
 
     if (rep.numBackClipRects) {
         WriteToClient(client,
                       sizeof(drm_clip_rect_t) * rep.numBackClipRects,
-                      (char *) pBackClipRects);
+                      pBackClipRects);
     }
 
     return Success;
@@ -465,7 +472,11 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client)
 static int
 ProcXF86DRIGetDeviceInfo(register ClientPtr client)
 {
-    xXF86DRIGetDeviceInfoReply rep;
+    xXF86DRIGetDeviceInfoReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     drm_handle_t hFrameBuffer;
     void *pDevPrivate;
 
@@ -476,10 +487,6 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client)
         return BadValue;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
     if (!DRIGetDeviceInfo(screenInfo.screens[stuff->screen],
                           &hFrameBuffer,
                           (int *) &rep.framebufferOrigin,
@@ -496,16 +503,15 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client)
     rep.hFrameBufferHigh = 0;
 #endif
 
-    rep.length = 0;
     if (rep.devPrivateSize) {
         rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetDeviceInfoReply) -
                                     SIZEOF(xGenericReply) +
                                     pad_to_int32(rep.devPrivateSize));
     }
 
-    WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), &rep);
     if (rep.length) {
-        WriteToClient(client, rep.devPrivateSize, (char *) pDevPrivate);
+        WriteToClient(client, rep.devPrivateSize, pDevPrivate);
     }
     return Success;
 }
index c9fdde2..502a2ee 100644 (file)
@@ -1,16 +1,14 @@
-libdri2_la_LTLIBRARIES = libdri2.la
-libdri2_la_CFLAGS = \
+noinst_LTLIBRARIES = libdri2.la
+AM_CFLAGS = \
        -DHAVE_XORG_CONFIG_H \
-       @DRI_CFLAGS@ \
-       @DIX_CFLAGS@ @XORG_CFLAGS@ @DRI2PROTO_CFLAGS@ @LIBDRM_CFLAGS@ \
+       @DIX_CFLAGS@ @XORG_CFLAGS@ \
        -I$(top_srcdir)/hw/xfree86/common \
        -I$(top_srcdir)/hw/xfree86/os-support/bus
 
-libdri2_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@
-libdri2_ladir = $(moduledir)/extensions
 libdri2_la_SOURCES = \
        dri2.c \
        dri2.h \
-       dri2ext.c
+       dri2ext.c \
+       dri2int.h
 
 sdk_HEADERS = dri2.h
index 18d9cd2..1c31f43 100644 (file)
 #include "windowstr.h"
 #include "dixstruct.h"
 #include "dri2.h"
+#include "dri2int.h"
 #include "xf86VGAarbiter.h"
-
+#include "damage.h"
 #include "xf86.h"
 
 CARD8 dri2_major;               /* version of DRI2 supported by DDX */
 CARD8 dri2_minor;
 
+uint32_t prime_id_allocate_bitmask;
+
 static DevPrivateKeyRec dri2ScreenPrivateKeyRec;
 
 #define dri2ScreenPrivateKey (&dri2ScreenPrivateKeyRec)
@@ -63,6 +66,17 @@ static DevPrivateKeyRec dri2PixmapPrivateKeyRec;
 
 #define dri2PixmapPrivateKey (&dri2PixmapPrivateKeyRec)
 
+static DevPrivateKeyRec dri2ClientPrivateKeyRec;
+
+#define dri2ClientPrivateKey (&dri2ClientPrivateKeyRec)
+
+#define dri2ClientPrivate(_pClient) (dixLookupPrivate(&(_pClient)->devPrivates, \
+                                                      dri2ClientPrivateKey))
+
+typedef struct _DRI2Client {
+    int prime_id;
+} DRI2ClientRec, *DRI2ClientPtr;
+
 static RESTYPE dri2DrawableRes;
 
 typedef struct _DRI2Screen *DRI2ScreenPtr;
@@ -87,6 +101,9 @@ typedef struct _DRI2Drawable {
     int swap_limit;             /* for N-buffering */
     unsigned long serialNumber;
     Bool needInvalidate;
+    int prime_id;
+    PixmapPtr prime_slave_pixmap;
+    PixmapPtr redirectpixmap;
 } DRI2DrawableRec, *DRI2DrawablePtr;
 
 typedef struct _DRI2Screen {
@@ -97,6 +114,7 @@ typedef struct _DRI2Screen {
     const char *deviceName;
     int fd;
     unsigned int lastSequence;
+    int prime_id;
 
     DRI2CreateBufferProcPtr CreateBuffer;
     DRI2DestroyBufferProcPtr DestroyBuffer;
@@ -104,21 +122,55 @@ typedef struct _DRI2Screen {
     DRI2ScheduleSwapProcPtr ScheduleSwap;
     DRI2GetMSCProcPtr GetMSC;
     DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC;
-    DRI2AuthMagicProcPtr AuthMagic;
+    DRI2AuthMagic2ProcPtr AuthMagic;
+    DRI2AuthMagicProcPtr LegacyAuthMagic;
     DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify;
     DRI2SwapLimitValidateProcPtr SwapLimitValidate;
+    DRI2GetParamProcPtr GetParam;
 
     HandleExposuresProcPtr HandleExposures;
 
     ConfigNotifyProcPtr ConfigNotify;
+    DRI2CreateBuffer2ProcPtr CreateBuffer2;
+    DRI2DestroyBuffer2ProcPtr DestroyBuffer2;
+    DRI2CopyRegion2ProcPtr CopyRegion2;
 } DRI2ScreenRec;
 
+static void
+destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, int prime_id);
+
 static DRI2ScreenPtr
 DRI2GetScreen(ScreenPtr pScreen)
 {
     return dixLookupPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey);
 }
 
+static ScreenPtr
+GetScreenPrime(ScreenPtr master, int prime_id)
+{
+    ScreenPtr slave;
+    if (prime_id == 0 || xorg_list_is_empty(&master->offload_slave_list)) {
+        return master;
+    }
+    xorg_list_for_each_entry(slave, &master->offload_slave_list, offload_head) {
+        DRI2ScreenPtr ds;
+
+        ds = DRI2GetScreen(slave);
+        if (ds->prime_id == prime_id)
+            break;
+    }
+    if (!slave)
+        return master;
+    return slave;
+}
+
+static DRI2ScreenPtr
+DRI2GetScreenPrime(ScreenPtr master, int prime_id)
+{
+    ScreenPtr slave = GetScreenPrime(master, prime_id);
+    return DRI2GetScreen(slave);
+}
+
 static DRI2DrawablePtr
 DRI2GetDrawable(DrawablePtr pDraw)
 {
@@ -185,7 +237,8 @@ DRI2AllocateDrawable(DrawablePtr pDraw)
     xorg_list_init(&pPriv->reference_list);
     pPriv->serialNumber = DRI2DrawableSerial(pDraw);
     pPriv->needInvalidate = FALSE;
-
+    pPriv->redirectpixmap = NULL;
+    pPriv->prime_slave_pixmap = NULL;
     if (pDraw->type == DRAWABLE_WINDOW) {
         pWin = (WindowPtr) pDraw;
         dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv);
@@ -280,10 +333,12 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id,
 }
 
 int
-DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
-                   DRI2InvalidateProcPtr invalidate, void *priv)
+DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id,
+                    DRI2InvalidateProcPtr invalidate, void *priv,
+                    XID *dri2_id_out)
 {
     DRI2DrawablePtr pPriv;
+    DRI2ClientPtr dri2_client = dri2ClientPrivate(client);
     XID dri2_id;
     int rc;
 
@@ -293,19 +348,30 @@ DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
     if (pPriv == NULL)
         return BadAlloc;
 
+    pPriv->prime_id = dri2_client->prime_id;
+
     dri2_id = FakeClientID(client->index);
     rc = DRI2AddDrawableRef(pPriv, id, dri2_id, invalidate, priv);
     if (rc != Success)
         return rc;
 
+    if (dri2_id_out)
+        *dri2_id_out = dri2_id;
+
     return Success;
 }
 
+int
+DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
+                   DRI2InvalidateProcPtr invalidate, void *priv)
+{
+    return DRI2CreateDrawable2(client, pDraw, id, invalidate, priv, NULL);
+}
+
 static int
 DRI2DrawableGone(pointer p, XID id)
 {
     DRI2DrawablePtr pPriv = p;
-    DRI2ScreenPtr ds = pPriv->dri2_screen;
     DRI2DrawableRefPtr ref, next;
     WindowPtr pWin;
     PixmapPtr pPixmap;
@@ -343,18 +409,59 @@ DRI2DrawableGone(pointer p, XID id)
         dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, NULL);
     }
 
+    if (pPriv->prime_slave_pixmap) {
+        (*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap);
+        (*pPriv->prime_slave_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap);
+    }
+
     if (pPriv->buffers != NULL) {
         for (i = 0; i < pPriv->bufferCount; i++)
-            (*ds->DestroyBuffer) (pDraw, pPriv->buffers[i]);
+            destroy_buffer(pDraw, pPriv->buffers[i], pPriv->prime_id);
 
         free(pPriv->buffers);
     }
 
+    if (pPriv->redirectpixmap) {
+        (*pDraw->pScreen->ReplaceScanoutPixmap)(pDraw, pPriv->redirectpixmap, FALSE);
+        (*pDraw->pScreen->DestroyPixmap)(pPriv->redirectpixmap);
+    }
+
     free(pPriv);
 
     return Success;
 }
 
+static DRI2BufferPtr
+create_buffer(DrawablePtr pDraw,
+              unsigned int attachment, unsigned int format)
+{
+    ScreenPtr primeScreen;
+    DRI2DrawablePtr pPriv;
+    DRI2ScreenPtr ds;
+    DRI2BufferPtr buffer;
+    pPriv = DRI2GetDrawable(pDraw);
+    primeScreen = GetScreenPrime(pDraw->pScreen, pPriv->prime_id);
+    ds = DRI2GetScreenPrime(pDraw->pScreen, pPriv->prime_id);
+    if (ds->CreateBuffer2)
+        buffer = (*ds->CreateBuffer2)(primeScreen, pDraw, attachment, format);
+    else
+        buffer = (*ds->CreateBuffer)(pDraw, attachment, format);
+    return buffer;
+}
+
+static void
+destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, int prime_id)
+{
+    ScreenPtr primeScreen;
+    DRI2ScreenPtr ds;
+    primeScreen = GetScreenPrime(pDraw->pScreen, prime_id);
+    ds = DRI2GetScreen(primeScreen);
+    if (ds->DestroyBuffer2)
+        (*ds->DestroyBuffer2)(primeScreen, pDraw, buffer);
+    else
+        (*ds->DestroyBuffer)(pDraw, buffer);
+}
+
 static int
 find_attachment(DRI2DrawablePtr pPriv, unsigned attachment)
 {
@@ -387,7 +494,7 @@ allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
         || attachment == DRI2BufferFrontLeft
 #endif
         || !dimensions_match || (pPriv->buffers[old_buf]->format != format)) {
-        *buffer = (*ds->CreateBuffer) (pDraw, attachment, format);
+        *buffer = create_buffer (pDraw, attachment, format);
         pPriv->serialNumber = DRI2DrawableSerial(pDraw);
         return TRUE;
 
@@ -408,13 +515,12 @@ update_dri2_drawable_buffers(DRI2DrawablePtr pPriv, DrawablePtr pDraw,
                              DRI2BufferPtr * buffers, int out_count, int *width,
                              int *height)
 {
-    DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen);
     int i;
 
     if (pPriv->buffers != NULL) {
         for (i = 0; i < pPriv->bufferCount; i++) {
             if (pPriv->buffers[i] != NULL) {
-                (*ds->DestroyBuffer) (pDraw, pPriv->buffers[i]);
+                destroy_buffer(pDraw, pPriv->buffers[i], pPriv->prime_id);
             }
         }
 
@@ -434,8 +540,8 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
                unsigned int *attachments, int count, int *out_count,
                int has_format)
 {
-    DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen);
     DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
+    DRI2ScreenPtr ds;
     DRI2BufferPtr *buffers;
     int need_real_front = 0;
     int need_fake_front = 0;
@@ -452,6 +558,8 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
         return NULL;
     }
 
+    ds = DRI2GetScreen(pDraw->pScreen);
+
     dimensions_match = (pDraw->width == pPriv->width)
         && (pDraw->height == pPriv->height)
         && (pPriv->serialNumber == DRI2DrawableSerial(pDraw));
@@ -556,7 +664,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
     if (buffers) {
         for (i = 0; i < count; i++) {
             if (buffers[i] != NULL)
-                (*ds->DestroyBuffer) (pDraw, buffers[i]);
+                destroy_buffer(pDraw, buffers[i], 0);
         }
 
         free(buffers);
@@ -650,11 +758,119 @@ DRI2BlockClient(ClientPtr client, DrawablePtr pDraw)
     pPriv->blockedOnMsc = TRUE;
 }
 
+static inline PixmapPtr GetDrawablePixmap(DrawablePtr drawable)
+{
+    if (drawable->type == DRAWABLE_PIXMAP)
+        return (PixmapPtr)drawable;
+    else {
+        struct _Window *pWin = (struct _Window *)drawable;
+        return drawable->pScreen->GetWindowPixmap(pWin);
+    }
+}
+
+DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
+{
+    DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
+    PixmapPtr spix;
+    PixmapPtr mpix = GetDrawablePixmap(pDraw);
+    ScreenPtr master, slave;
+    Bool ret;
+
+    master = mpix->drawable.pScreen;
+
+    if (pDraw->type == DRAWABLE_WINDOW) {
+        WindowPtr pWin = (WindowPtr)pDraw;
+        PixmapPtr pPixmap = pDraw->pScreen->GetWindowPixmap(pWin);
+
+        if (pDraw->pScreen->GetScreenPixmap(pDraw->pScreen) == pPixmap) {
+            if (pPriv->redirectpixmap &&
+                pPriv->redirectpixmap->drawable.width == pDraw->width &&
+                pPriv->redirectpixmap->drawable.height == pDraw->height &&
+                pPriv->redirectpixmap->drawable.depth == pDraw->depth) {
+                mpix = pPriv->redirectpixmap;
+            } else {
+                if (master->ReplaceScanoutPixmap) {
+                    mpix = (*master->CreatePixmap)(master, pDraw->width, pDraw->height,
+                                                   pDraw->depth, CREATE_PIXMAP_USAGE_SHARED);
+                    if (!mpix)
+                        return NULL;
+
+                    ret = (*master->ReplaceScanoutPixmap)(pDraw, mpix, TRUE);
+                    if (ret == FALSE) {
+                        (*master->DestroyPixmap)(mpix);
+                        return NULL;
+                    }
+                    pPriv->redirectpixmap = mpix;
+                } else
+                    return NULL;
+            }
+        } else if (pPriv->redirectpixmap) {
+            (*master->ReplaceScanoutPixmap)(pDraw, pPriv->redirectpixmap, FALSE);
+            (*master->DestroyPixmap)(pPriv->redirectpixmap);
+            pPriv->redirectpixmap = NULL;
+        }
+    }
+
+    slave = GetScreenPrime(pDraw->pScreen, pPriv->prime_id);
+
+    /* check if the pixmap is still fine */
+    if (pPriv->prime_slave_pixmap) {
+        if (pPriv->prime_slave_pixmap->master_pixmap == mpix)
+            return &pPriv->prime_slave_pixmap->drawable;
+        else {
+            (*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap);
+            (*slave->DestroyPixmap)(pPriv->prime_slave_pixmap);
+            pPriv->prime_slave_pixmap = NULL;
+        }
+    }
+
+    spix = PixmapShareToSlave(mpix, slave);
+    if (!spix)
+        return NULL;
+
+    pPriv->prime_slave_pixmap = spix;
+#ifdef COMPOSITE
+    spix->screen_x = mpix->screen_x;
+    spix->screen_y = mpix->screen_y;
+#endif
+    return &spix->drawable;
+}
+
+static void dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
+                             DRI2BufferPtr pDest, DRI2BufferPtr pSrc)
+{
+    DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
+    DRI2ScreenPtr ds;
+    ScreenPtr primeScreen;
+
+    primeScreen = GetScreenPrime(pDraw->pScreen, pPriv->prime_id);
+    ds = DRI2GetScreen(primeScreen);
+
+    if (ds->CopyRegion2)
+        (*ds->CopyRegion2)(primeScreen, pDraw, pRegion, pDest, pSrc);
+    else
+        (*ds->CopyRegion) (pDraw, pRegion, pDest, pSrc);
+
+    /* cause damage to the box */
+    if (pPriv->prime_id) {
+       BoxRec box;
+       RegionRec region;
+       box.x1 = 0;
+       box.x2 = box.x1 + pDraw->width;
+       box.y1 = 0;
+       box.y2 = box.y1 + pDraw->height;
+       RegionInit(&region, &box, 1);
+       RegionTranslate(&region, pDraw->x, pDraw->y);
+       DamageRegionAppend(pDraw, &region);
+       DamageRegionProcessPending(pDraw);
+       RegionUninit(&region);
+    }
+}
+
 int
 DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion,
                unsigned int dest, unsigned int src)
 {
-    DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen);
     DRI2DrawablePtr pPriv;
     DRI2BufferPtr pDestBuffer, pSrcBuffer;
     int i;
@@ -674,7 +890,7 @@ DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion,
     if (pSrcBuffer == NULL || pDestBuffer == NULL)
         return BadValue;
 
-    (*ds->CopyRegion) (pDraw, pRegion, pDestBuffer, pSrcBuffer);
+    dri2_copy_region(pDraw, pRegion, pDestBuffer, pSrcBuffer);
 
     return Success;
 }
@@ -879,7 +1095,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
     }
 
     /* Old DDX or no swap interval, just blit */
-    if (!ds->ScheduleSwap || !pPriv->swap_interval) {
+    if (!ds->ScheduleSwap || !pPriv->swap_interval || pPriv->prime_id) {
         BoxRec box;
         RegionRec region;
 
@@ -891,7 +1107,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
 
         pPriv->swapsPending++;
 
-        (*ds->CopyRegion) (pDraw, &region, pDestBuffer, pSrcBuffer);
+        dri2_copy_region(pDraw, &region, pDestBuffer, pSrcBuffer);
         DRI2SwapComplete(client, pDraw, target_msc, 0, 0, DRI2_BLIT_COMPLETE,
                          func, data);
         return Success;
@@ -1091,34 +1307,62 @@ DRI2HasSwapControl(ScreenPtr pScreen)
 }
 
 Bool
-DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd,
+DRI2Connect(ClientPtr client, ScreenPtr pScreen,
+            unsigned int driverType, int *fd,
             const char **driverName, const char **deviceName)
 {
     DRI2ScreenPtr ds;
+    uint32_t prime_id = DRI2DriverPrimeId(driverType);
+    uint32_t driver_id = driverType & 0xffff;
 
     if (!dixPrivateKeyRegistered(dri2ScreenPrivateKey))
         return FALSE;
 
-    ds = DRI2GetScreen(pScreen);
-    if (ds == NULL || driverType >= ds->numDrivers ||
-        !ds->driverNames[driverType])
+    ds = DRI2GetScreenPrime(pScreen, prime_id);
+    if (ds == NULL)
         return FALSE;
 
-    *fd = ds->fd;
-    *driverName = ds->driverNames[driverType];
+    if (driver_id >= ds->numDrivers ||
+        !ds->driverNames[driver_id])
+        return FALSE;
+
+    *driverName = ds->driverNames[driver_id];
     *deviceName = ds->deviceName;
+    *fd = ds->fd;
+
+    if (client) {
+        DRI2ClientPtr dri2_client;
+        dri2_client = dri2ClientPrivate(client);
+        dri2_client->prime_id = prime_id;
+    }
 
     return TRUE;
 }
 
-Bool
-DRI2Authenticate(ScreenPtr pScreen, uint32_t magic)
+static int
+DRI2AuthMagic (ScreenPtr pScreen, uint32_t magic)
 {
     DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
+    if (ds == NULL)
+        return -EINVAL;
+
+    return (*ds->LegacyAuthMagic) (ds->fd, magic);
+}
+
+Bool
+DRI2Authenticate(ClientPtr client, ScreenPtr pScreen, uint32_t magic)
+{
+    DRI2ScreenPtr ds;
+    DRI2ClientPtr dri2_client = dri2ClientPrivate(client);
+    ScreenPtr primescreen;
 
-    if (ds == NULL || (*ds->AuthMagic) (ds->fd, magic))
+    ds = DRI2GetScreenPrime(pScreen, dri2_client->prime_id);
+    if (ds == NULL)
         return FALSE;
 
+    primescreen = GetScreenPrime(pScreen, dri2_client->prime_id);
+    if ((*ds->AuthMagic)(primescreen, magic))
+        return FALSE;
     return TRUE;
 }
 
@@ -1150,6 +1394,22 @@ DRI2ConfigNotify(WindowPtr pWin, int x, int y, int w, int h, int bw,
     return Success;
 }
 
+#define MAX_PRIME DRI2DriverPrimeMask
+static int
+get_prime_id(void)
+{
+    int i;
+    /* start at 1, prime id 0 is just normal driver */
+    for (i = 1; i < MAX_PRIME; i++) {
+         if (prime_id_allocate_bitmask & (1 << i))
+             continue;
+
+         prime_id_allocate_bitmask |= (1 << i);
+         return i;
+    }
+    return -1;
+}
+
 Bool
 DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
 {
@@ -1180,6 +1440,9 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
     if (!dixRegisterPrivateKey(&dri2PixmapPrivateKeyRec, PRIVATE_PIXMAP, 0))
         return FALSE;
 
+    if (!dixRegisterPrivateKey(&dri2ClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DRI2ClientRec)))
+        return FALSE;
+
     ds = calloc(1, sizeof *ds);
     if (!ds)
         return FALSE;
@@ -1203,8 +1466,11 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
         cur_minor = 1;
     }
 
+    if (info->version >= 8) {
+        ds->AuthMagic = info->AuthMagic2;
+    }
     if (info->version >= 5) {
-        ds->AuthMagic = info->AuthMagic;
+        ds->LegacyAuthMagic = info->AuthMagic;
     }
 
     if (info->version >= 6) {
@@ -1212,16 +1478,41 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
         ds->SwapLimitValidate = info->SwapLimitValidate;
     }
 
+    if (info->version >= 7) {
+        ds->GetParam = info->GetParam;
+        cur_minor = 4;
+    }
+
+    if (info->version >= 9) {
+        ds->CreateBuffer2 = info->CreateBuffer2;
+        if (info->CreateBuffer2 && pScreen->isGPU) {
+            ds->prime_id = get_prime_id();
+            if (ds->prime_id == -1) {
+                free(ds);
+                return FALSE;
+            }
+        }
+        ds->DestroyBuffer2 = info->DestroyBuffer2;
+        ds->CopyRegion2 = info->CopyRegion2;
+    }
+
     /*
      * if the driver doesn't provide an AuthMagic function or the info struct
-     * version is too low, it relies on the old method (using libdrm) or fail
+     * version is too low, call through LegacyAuthMagic
      */
-    if (!ds->AuthMagic)
+    if (!ds->AuthMagic) {
+        ds->AuthMagic = DRI2AuthMagic;
+        /*
+         * If the driver doesn't provide an AuthMagic function
+         * it relies on the old method (using libdrm) or fails
+         */
+        if (!ds->LegacyAuthMagic)
 #ifdef WITH_LIBDRM
-        ds->AuthMagic = drmAuthMagic;
+            ds->LegacyAuthMagic = drmAuthMagic;
 #else
-        goto err_out;
+            goto err_out;
 #endif
+    }
 
     /* Initialize minor if needed and set to minimum provied by DDX */
     if (!dri2_minor || dri2_minor > cur_minor)
@@ -1274,12 +1565,13 @@ DRI2CloseScreen(ScreenPtr pScreen)
 
     pScreen->ConfigNotify = ds->ConfigNotify;
 
+    if (ds->prime_id)
+        prime_id_allocate_bitmask &= ~(1 << ds->prime_id);
     free(ds->driverNames);
     free(ds);
     dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, NULL);
 }
 
-extern ExtensionModule dri2ExtensionModule;
 extern Bool DRI2ModuleSetup(void);
 
 /* Called by InitExtensions() */
@@ -1293,44 +1585,47 @@ DRI2ModuleSetup(void)
     return TRUE;
 }
 
-static pointer
-DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
-    static Bool setupDone = FALSE;
-
-    if (!setupDone) {
-        setupDone = TRUE;
-        LoadExtension(&dri2ExtensionModule, FALSE);
-    }
-    else {
-        if (errmaj)
-            *errmaj = LDR_ONCEONLY;
-    }
-
-    return (pointer) 1;
-}
-
-static XF86ModuleVersionInfo DRI2VersRec = {
-    "dri2",
-    MODULEVENDORSTRING,
-    MODINFOSTRING1,
-    MODINFOSTRING2,
-    XORG_VERSION_CURRENT,
-    1, 2, 0,
-    ABI_CLASS_EXTENSION,
-    ABI_EXTENSION_VERSION,
-    MOD_CLASS_NONE,
-    {0, 0, 0, 0}
-};
-
-_X_EXPORT XF86ModuleData dri2ModuleData = { &DRI2VersRec, DRI2Setup, NULL };
-
 void
 DRI2Version(int *major, int *minor)
 {
     if (major != NULL)
-        *major = DRI2VersRec.majorversion;
+        *major = 1;
 
     if (minor != NULL)
-        *minor = DRI2VersRec.minorversion;
+        *minor = 2;
+}
+
+int
+DRI2GetParam(ClientPtr client,
+             DrawablePtr drawable,
+             CARD64 param,
+             BOOL *is_param_recognized,
+             CARD64 *value)
+{
+    DRI2ScreenPtr ds = DRI2GetScreen(drawable->pScreen);
+    char high_byte = (param >> 24);
+
+    switch (high_byte) {
+    case 0:
+        /* Parameter names whose high_byte is 0 are reserved for the X
+         * server. The server currently recognizes no parameters.
+         */
+        goto not_recognized;
+    case 1:
+        /* Parameter names whose high byte is 1 are reserved for the DDX. */
+        if (ds->GetParam)
+            return ds->GetParam(client, drawable, param,
+                                is_param_recognized, value);
+        else
+            goto not_recognized;
+    default:
+        /* Other parameter names are reserved for future use. They are never
+         * recognized.
+         */
+        goto not_recognized;
+    }
+
+not_recognized:
+    *is_param_recognized = FALSE;
+    return Success;
 }
index 00b3668..1e7afdd 100644 (file)
@@ -64,6 +64,7 @@ typedef void (*DRI2CopyRegionProcPtr) (DrawablePtr pDraw,
                                        DRI2BufferPtr pSrcBuffer);
 typedef void (*DRI2WaitProcPtr) (WindowPtr pWin, unsigned int sequence);
 typedef int (*DRI2AuthMagicProcPtr) (int fd, uint32_t magic);
+typedef int (*DRI2AuthMagic2ProcPtr) (ScreenPtr pScreen, uint32_t magic);
 
 /**
  * Schedule a buffer swap
@@ -175,10 +176,36 @@ typedef void (*DRI2InvalidateProcPtr) (DrawablePtr pDraw, void *data, XID id);
 typedef Bool (*DRI2SwapLimitValidateProcPtr) (DrawablePtr pDraw,
                                               int swap_limit);
 
+typedef DRI2BufferPtr(*DRI2CreateBuffer2ProcPtr) (ScreenPtr pScreen,
+                                                  DrawablePtr pDraw,
+                                                  unsigned int attachment,
+                                                  unsigned int format);
+typedef void (*DRI2DestroyBuffer2ProcPtr) (ScreenPtr pScreen, DrawablePtr pDraw,
+                                          DRI2BufferPtr buffer);
+
+typedef void (*DRI2CopyRegion2ProcPtr) (ScreenPtr pScreen, DrawablePtr pDraw,
+                                        RegionPtr pRegion,
+                                        DRI2BufferPtr pDestBuffer,
+                                        DRI2BufferPtr pSrcBuffer);
+
+/**
+ * \brief Get the value of a parameter.
+ *
+ * The parameter's \a value is looked up on the screen associated with
+ * \a pDrawable.
+ *
+ * \return \c Success or error code.
+ */
+typedef int (*DRI2GetParamProcPtr) (ClientPtr client,
+                                    DrawablePtr pDrawable,
+                                    CARD64 param,
+                                    BOOL *is_param_recognized,
+                                    CARD64 *value);
+
 /**
  * Version of the DRI2InfoRec structure defined in this header
  */
-#define DRI2INFOREC_VERSION 6
+#define DRI2INFOREC_VERSION 9
 
 typedef struct {
     unsigned int version;       /**< Version of this struct */
@@ -211,9 +238,21 @@ typedef struct {
 
     DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify;
     DRI2SwapLimitValidateProcPtr SwapLimitValidate;
-} DRI2InfoRec, *DRI2InfoPtr;
 
-extern _X_EXPORT int DRI2EventBase;
+    /* added in version 7 */
+    DRI2GetParamProcPtr GetParam;
+
+    /* added in version 8 */
+    /* AuthMagic callback which passes extra context */
+    /* If this is NULL the AuthMagic callback is used */
+    /* If this is non-NULL the AuthMagic callback is ignored */
+    DRI2AuthMagic2ProcPtr AuthMagic2;
+
+    /* added in version 9 */
+    DRI2CreateBuffer2ProcPtr CreateBuffer2;
+    DRI2DestroyBuffer2ProcPtr DestroyBuffer2;
+    DRI2CopyRegion2ProcPtr CopyRegion2;
+} DRI2InfoRec, *DRI2InfoPtr;
 
 extern _X_EXPORT Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info);
 
@@ -221,13 +260,13 @@ extern _X_EXPORT void DRI2CloseScreen(ScreenPtr pScreen);
 
 extern _X_EXPORT Bool DRI2HasSwapControl(ScreenPtr pScreen);
 
-extern _X_EXPORT Bool DRI2Connect(ScreenPtr pScreen,
+extern _X_EXPORT Bool DRI2Connect(ClientPtr client, ScreenPtr pScreen,
                                   unsigned int driverType,
                                   int *fd,
                                   const char **driverName,
                                   const char **deviceName);
 
-extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, uint32_t magic);
+extern _X_EXPORT Bool DRI2Authenticate(ClientPtr client, ScreenPtr pScreen, uint32_t magic);
 
 extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client,
                                         DrawablePtr pDraw,
@@ -235,7 +274,12 @@ extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client,
                                         DRI2InvalidateProcPtr invalidate,
                                         void *priv);
 
-extern _X_EXPORT void DRI2DestroyDrawable(DrawablePtr pDraw);
+extern _X_EXPORT int DRI2CreateDrawable2(ClientPtr client,
+                                         DrawablePtr pDraw,
+                                         XID id,
+                                         DRI2InvalidateProcPtr invalidate,
+                                         void *priv,
+                                         XID *dri2_id_out);
 
 extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw,
                                                int *width,
@@ -308,4 +352,11 @@ extern _X_EXPORT void DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw,
                                           int frame, unsigned int tv_sec,
                                           unsigned int tv_usec);
 
+extern _X_EXPORT int DRI2GetParam(ClientPtr client,
+                                  DrawablePtr pDrawable,
+                                  CARD64 param,
+                                  BOOL *is_param_recognized,
+                                  CARD64 *value);
+
+extern _X_EXPORT DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest);
 #endif
index 2579a5c..ee610c0 100644 (file)
 #include "extnsionst.h"
 #include "xfixes.h"
 #include "dri2.h"
+#include "dri2int.h"
 #include "protocol-versions.h"
 
-/* The only xf86 include */
+/* The only xf86 includes */
 #include "xf86Module.h"
+#include "xf86Extensions.h"
+
+static int DRI2EventBase;
 
-static ExtensionEntry *dri2Extension;
-extern Bool DRI2ModuleSetup(void);
 
 static Bool
 validDrawable(ClientPtr client, XID drawable, Mask access_mode,
@@ -71,17 +73,18 @@ static int
 ProcDRI2QueryVersion(ClientPtr client)
 {
     REQUEST(xDRI2QueryVersionReq);
-    xDRI2QueryVersionReply rep;
+    xDRI2QueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = dri2_major,
+        .minorVersion = dri2_minor
+    };
 
     if (client->swapped)
         swaps(&stuff->length);
 
     REQUEST_SIZE_MATCH(xDRI2QueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = dri2_major;
-    rep.minorVersion = dri2_minor;
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
@@ -99,7 +102,13 @@ static int
 ProcDRI2Connect(ClientPtr client)
 {
     REQUEST(xDRI2ConnectReq);
-    xDRI2ConnectReply rep;
+    xDRI2ConnectReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .driverNameLength = 0,
+        .deviceNameLength = 0
+    };
     DrawablePtr pDraw;
     int fd, status;
     const char *driverName;
@@ -110,13 +119,7 @@ ProcDRI2Connect(ClientPtr client)
                        &pDraw, &status))
         return status;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.driverNameLength = 0;
-    rep.deviceNameLength = 0;
-
-    if (!DRI2Connect(pDraw->pScreen,
+    if (!DRI2Connect(client, pDraw->pScreen,
                      stuff->driverType, &fd, &driverName, &deviceName))
         goto fail;
 
@@ -146,10 +149,12 @@ ProcDRI2Authenticate(ClientPtr client)
                        &pDraw, &status))
         return status;
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.authenticated = DRI2Authenticate(pDraw->pScreen, stuff->magic);
+    rep = (xDRI2AuthenticateReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .authenticated = DRI2Authenticate(client, pDraw->pScreen, stuff->magic)
+    };
     WriteToClient(client, sizeof(xDRI2AuthenticateReply), &rep);
 
     return Success;
@@ -158,11 +163,11 @@ ProcDRI2Authenticate(ClientPtr client)
 static void
 DRI2InvalidateBuffersEvent(DrawablePtr pDraw, void *priv, XID id)
 {
-    xDRI2InvalidateBuffers event;
     ClientPtr client = priv;
-
-    event.type = DRI2EventBase + DRI2_InvalidateBuffers;
-    event.drawable = id;
+    xDRI2InvalidateBuffers event = {
+        .type = DRI2EventBase + DRI2_InvalidateBuffers,
+        .drawable = id
+    };
 
     WriteEventsToClient(client, 1, (xEvent *) &event);
 }
@@ -225,12 +230,14 @@ send_buffers_reply(ClientPtr client, DrawablePtr pDrawable,
         }
     }
 
-    rep.type = X_Reply;
-    rep.length = (count - skip) * sizeof(xDRI2Buffer) / 4;
-    rep.sequenceNumber = client->sequence;
-    rep.width = width;
-    rep.height = height;
-    rep.count = count - skip;
+    rep = (xDRI2GetBuffersReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = (count - skip) * sizeof(xDRI2Buffer) / 4,
+        .width = width,
+        .height = height,
+        .count = count - skip
+    };
     WriteToClient(client, sizeof(xDRI2GetBuffersReply), &rep);
 
     for (i = 0; i < count; i++) {
@@ -330,9 +337,11 @@ ProcDRI2CopyRegion(ClientPtr client)
      * that yet.
      */
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xDRI2CopyRegionReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     WriteToClient(client, sizeof(xDRI2CopyRegionReply), &rep);
 
@@ -356,17 +365,17 @@ static void
 DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
               CARD32 sbc)
 {
-    xDRI2BufferSwapComplete2 event;
     DrawablePtr pDrawable = data;
-
-    event.type = DRI2EventBase + DRI2_BufferSwapComplete;
-    event.event_type = type;
-    event.drawable = pDrawable->id;
-    event.ust_hi = (CARD64) ust >> 32;
-    event.ust_lo = ust & 0xffffffff;
-    event.msc_hi = (CARD64) msc >> 32;
-    event.msc_lo = msc & 0xffffffff;
-    event.sbc = sbc;
+    xDRI2BufferSwapComplete2 event = {
+        .type = DRI2EventBase + DRI2_BufferSwapComplete,
+        .event_type = type,
+        .drawable = pDrawable->id,
+        .ust_hi = (CARD64) ust >> 32,
+        .ust_lo = ust & 0xffffffff,
+        .msc_hi = (CARD64) msc >> 32,
+        .msc_lo = msc & 0xffffffff,
+        .sbc = sbc
+    };
 
     WriteEventsToClient(client, 1, (xEvent *) &event);
 }
@@ -375,7 +384,11 @@ static int
 ProcDRI2SwapBuffers(ClientPtr client)
 {
     REQUEST(xDRI2SwapBuffersReq);
-    xDRI2SwapBuffersReply rep;
+    xDRI2SwapBuffersReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     DrawablePtr pDrawable;
     CARD64 target_msc, divisor, remainder, swap_target;
     int status;
@@ -402,9 +415,6 @@ ProcDRI2SwapBuffers(ClientPtr client)
     if (status != Success)
         return BadDrawable;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
     load_swap_reply(&rep, swap_target);
 
     WriteToClient(client, sizeof(xDRI2SwapBuffersReply), &rep);
@@ -427,7 +437,11 @@ static int
 ProcDRI2GetMSC(ClientPtr client)
 {
     REQUEST(xDRI2GetMSCReq);
-    xDRI2MSCReply rep;
+    xDRI2MSCReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     DrawablePtr pDrawable;
     CARD64 ust, msc, sbc;
     int status;
@@ -442,9 +456,6 @@ ProcDRI2GetMSC(ClientPtr client)
     if (status != Success)
         return status;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
     load_msc_reply(&rep, ust, msc, sbc);
 
     WriteToClient(client, sizeof(xDRI2MSCReply), &rep);
@@ -482,11 +493,12 @@ ProcDRI2WaitMSC(ClientPtr client)
 int
 ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust, CARD64 msc, CARD64 sbc)
 {
-    xDRI2MSCReply rep;
+    xDRI2MSCReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
     load_msc_reply(&rep, ust, msc, sbc);
 
     WriteToClient(client, sizeof(xDRI2MSCReply), &rep);
@@ -535,6 +547,38 @@ ProcDRI2WaitSBC(ClientPtr client)
 }
 
 static int
+ProcDRI2GetParam(ClientPtr client)
+{
+    REQUEST(xDRI2GetParamReq);
+    xDRI2GetParamReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
+    DrawablePtr pDrawable;
+    CARD64 value;
+    int status;
+
+    REQUEST_SIZE_MATCH(xDRI2GetParamReq);
+
+    if (!validDrawable(client, stuff->drawable, DixReadAccess,
+                       &pDrawable, &status))
+        return status;
+
+    status = DRI2GetParam(client, pDrawable, stuff->param,
+                          &rep.is_param_recognized, &value);
+    rep.value_hi = value >> 32;
+    rep.value_lo = value & 0xffffffff;
+
+    if (status != Success)
+        return status;
+
+    WriteToClient(client, sizeof(xDRI2GetParamReply), &rep);
+
+    return status;
+}
+
+static int
 ProcDRI2Dispatch(ClientPtr client)
 {
     REQUEST(xReq);
@@ -572,6 +616,8 @@ ProcDRI2Dispatch(ClientPtr client)
         return ProcDRI2WaitSBC(client);
     case X_DRI2SwapInterval:
         return ProcDRI2SwapInterval(client);
+    case X_DRI2GetParam:
+        return ProcDRI2GetParam(client);
     default:
         return BadRequest;
     }
@@ -581,7 +627,13 @@ static int
 SProcDRI2Connect(ClientPtr client)
 {
     REQUEST(xDRI2ConnectReq);
-    xDRI2ConnectReply rep;
+    xDRI2ConnectReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .driverNameLength = 0,
+        .deviceNameLength = 0
+    };
 
     /* If the client is swapped, it's not local.  Talk to the hand. */
 
@@ -589,11 +641,9 @@ SProcDRI2Connect(ClientPtr client)
     if (sizeof(*stuff) / 4 != client->req_len)
         return BadLength;
 
-    rep.sequenceNumber = client->sequence;
     swaps(&rep.sequenceNumber);
-    rep.length = 0;
-    rep.driverNameLength = 0;
-    rep.deviceNameLength = 0;
+
+    WriteToClient(client, sizeof(xDRI2ConnectReply), &rep);
 
     return Success;
 }
@@ -617,11 +667,11 @@ SProcDRI2Dispatch(ClientPtr client)
     }
 }
 
-int DRI2EventBase;
-
-static void
+void
 DRI2ExtensionInit(void)
 {
+    ExtensionEntry *dri2Extension;
+
     dri2Extension = AddExtension(DRI2_NAME,
                                  DRI2NumberEvents,
                                  DRI2NumberErrors,
@@ -632,13 +682,3 @@ DRI2ExtensionInit(void)
 
     DRI2ModuleSetup();
 }
-
-extern Bool noDRI2Extension;
-
-_X_HIDDEN ExtensionModule dri2ExtensionModule = {
-    DRI2ExtensionInit,
-    DRI2_NAME,
-    &noDRI2Extension,
-    NULL,
-    NULL
-};
diff --git a/hw/xfree86/dri2/dri2int.h b/hw/xfree86/dri2/dri2int.h
new file mode 100644 (file)
index 0000000..7f53eba
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright © 2011 Daniel Stone
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel@fooishbar.org>
+ */
+
+extern Bool DRI2ModuleSetup(void);
index 3ced531..4339084 100644 (file)
@@ -2,7 +2,7 @@ SUBDIRS = man
 
 module_LTLIBRARIES = libexa.la
 
-libexa_la_LDFLAGS = -module -avoid-version
+libexa_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 
 INCLUDES = \
        $(XORG_INCS) \
@@ -15,4 +15,4 @@ libexa_la_SOURCES = \
        examodule.c
 
 libexa_la_LIBADD = \
-       ../../../exa/libexa.la
+       ../../../exa/libexa.la $(PIXMAN_LIBS)
index 72cf798..4e809ea 100644 (file)
@@ -38,7 +38,7 @@
 
 typedef struct _ExaXorgScreenPrivRec {
     CloseScreenProcPtr SavedCloseScreen;
-    EnableDisableFBAccessProcPtr SavedEnableDisableFBAccess;
+    xf86EnableDisableFBAccessProc *SavedEnableDisableFBAccess;
     OptionInfoPtr options;
 } ExaXorgScreenPrivRec, *ExaXorgScreenPrivPtr;
 
@@ -70,9 +70,9 @@ static const OptionInfoRec EXAOptions[] = {
 };
 
 static Bool
-exaXorgCloseScreen(int i, ScreenPtr pScreen)
+exaXorgCloseScreen(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr)
         dixLookupPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey);
 
@@ -83,24 +83,24 @@ exaXorgCloseScreen(int i, ScreenPtr pScreen)
     free(pScreenPriv->options);
     free(pScreenPriv);
 
-    return pScreen->CloseScreen(i, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 static void
-exaXorgEnableDisableFBAccess(int index, Bool enable)
+exaXorgEnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable)
 {
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr)
         dixLookupPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey);
 
     if (!enable)
-        exaEnableDisableFBAccess(index, enable);
+        exaEnableDisableFBAccess(pScreen, enable);
 
     if (pScreenPriv->SavedEnableDisableFBAccess)
-        pScreenPriv->SavedEnableDisableFBAccess(index, enable);
+        pScreenPriv->SavedEnableDisableFBAccess(pScrn, enable);
 
     if (enable)
-        exaEnableDisableFBAccess(index, enable);
+        exaEnableDisableFBAccess(pScreen, enable);
 }
 
 /**
@@ -111,8 +111,7 @@ void
 exaDDXDriverInit(ScreenPtr pScreen)
 {
     ExaScreenPriv(pScreen);
-    /* Do NOT use XF86SCRNINFO macro here!! */
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     ExaXorgScreenPrivPtr pScreenPriv;
 
     if (!dixRegisterPrivateKey(&exaXorgScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
index 30d0182..42a8de3 100644 (file)
@@ -14,7 +14,7 @@ The
 .B EXA
 architecture is designed to make accelerating the Render extension simple and
 efficient, and results in various performance tradeoffs compared to XAA.  Some
-__xconfigfile__ options are available for debugging performance issues or
+xorg.conf options are available for debugging performance issues or
 driver rendering problems.  They are not intended for general use.
 .TP
 .BI "Option \*qEXANoComposite\*q \*q" boolean \*q
@@ -36,7 +36,7 @@ default is intended to be the best performing one for general use, though others
 may help with specific use cases.  Available options include \*qalways\*q,
 \*qgreedy\*q, and \*qsmart\*q.  Default: always.
 .SH "SEE ALSO"
-.BR __xservername__ (__appmansuffix__),
-.BR __xconfigfile__(__filemansuffix__).
+.BR Xorg (__appmansuffix__),
+.BR xorg.conf(__filemansuffix__).
 .SH AUTHORS
 Authors include: Keith Packard, Eric Anholt, Zack Rusin, and Michel D\(:anzer
index 4472acd..1fa9321 100644 (file)
@@ -2,7 +2,7 @@ SUBDIRS = man
 
 module_LTLIBRARIES = libfbdevhw.la
 
-libfbdevhw_la_LDFLAGS = -module -avoid-version
+libfbdevhw_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 
 if FBDEVHW
 libfbdevhw_la_SOURCES = fbdevhw.c
index 2881d7e..d4b5558 100644 (file)
@@ -775,10 +775,8 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
 /* these can be hooked directly into ScrnInfoRec                        */
 
 ModeStatus
-fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
+fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-
     if (!fbdevHWSetMode(pScrn, mode, TRUE))
         return MODE_BAD;
 
@@ -786,10 +784,8 @@ fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
 }
 
 Bool
-fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-
     if (!fbdevHWSetMode(pScrn, mode, FALSE))
         return FALSE;
 
@@ -797,9 +793,8 @@ fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
 }
 
 void
-fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
+fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
 
     if (x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual ||
@@ -809,26 +804,22 @@ fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
     fPtr->var.xoffset = x;
     fPtr->var.yoffset = y;
     if (-1 == ioctl(fPtr->fd, FBIOPAN_DISPLAY, (void *) &fPtr->var))
-        xf86DrvMsgVerb(scrnIndex, X_WARNING, 5,
+        xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 5,
                        "FBIOPAN_DISPLAY: %s\n", strerror(errno));
 }
 
 Bool
-fbdevHWEnterVT(int scrnIndex, int flags)
+fbdevHWEnterVT(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-
     if (!fbdevHWModeInit(pScrn, pScrn->currentMode))
         return FALSE;
-    fbdevHWAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+    fbdevHWAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0);
     return TRUE;
 }
 
 void
-fbdevHWLeaveVT(int scrnIndex, int flags)
+fbdevHWLeaveVT(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-
     fbdevHWRestore(pScrn);
 }
 
@@ -866,7 +857,7 @@ fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
 Bool
 fbdevHWSaveScreen(ScreenPtr pScreen, int mode)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
     unsigned long unblank;
 
index 5369871..4984ccf 100644 (file)
@@ -44,14 +44,12 @@ extern _X_EXPORT void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors,
                                          int *indices, LOCO * colors,
                                          VisualPtr pVisual);
 
-extern _X_EXPORT ModeStatus fbdevHWValidMode(int scrnIndex, DisplayModePtr mode,
+extern _X_EXPORT ModeStatus fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
                                              Bool verbose, int flags);
-extern _X_EXPORT Bool fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode,
-                                        int flags);
-extern _X_EXPORT void fbdevHWAdjustFrame(int scrnIndex, int x, int y,
-                                         int flags);
-extern _X_EXPORT Bool fbdevHWEnterVT(int scrnIndex, int flags);
-extern _X_EXPORT void fbdevHWLeaveVT(int scrnIndex, int flags);
+extern _X_EXPORT Bool fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode);
+extern _X_EXPORT void fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
+extern _X_EXPORT Bool fbdevHWEnterVT(ScrnInfoPtr pScrn);
+extern _X_EXPORT void fbdevHWLeaveVT(ScrnInfoPtr pScrn);
 extern _X_EXPORT void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags);
 
 extern _X_EXPORT Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode);
index 6e0a470..7d554e6 100644 (file)
@@ -131,30 +131,30 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
 }
 
 ModeStatus
-fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
+fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags)
 {
     return MODE_ERROR;
 }
 
 Bool
-fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
 {
     return FALSE;
 }
 
 void
-fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
+fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
 {
 }
 
 Bool
-fbdevHWEnterVT(int scrnIndex, int flags)
+fbdevHWEnterVT(ScrnInfoPtr pScrn)
 {
     return FALSE;
 }
 
 void
-fbdevHWLeaveVT(int scrnIndex, int flags)
+fbdevHWLeaveVT(ScrnInfoPtr pScrn)
 {
 }
 
index fe5d1e1..fa46df0 100644 (file)
@@ -14,7 +14,7 @@ fbdev(__drivermansuffix__) is a non-accelerated driver which runs on top of the
 fbdevhw module.  fbdevhw can be used by other drivers too, this
 is usually activated with `Option "UseFBDev"' in the device section.
 .SH "SEE ALSO"
-__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__),
+Xorg(__appmansuffix__), xorg.conf(__filemansuffix__),
 xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__),
 fbdev(__drivermansuffix__)
 .SH AUTHORS
index 0b80cc8..cb18db1 100644 (file)
@@ -21,23 +21,23 @@ sdk_HEADERS = xf86i2c.h bt829.h fi1236.h msp3430.h tda8425.h tda9850.h tda9885.h
 #
 # i2c drivers
 #
-bt829_drv_la_LDFLAGS = -module -avoid-version
+bt829_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 bt829_drv_la_SOURCES = bt829.c bt829.h bt829_module.c
 
-fi1236_drv_la_LDFLAGS = -module -avoid-version
-fi1236_drv_la_SOURCES = fi1236.c fi1236.h fi1236_module.c
+fi1236_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
+fi1236_drv_la_SOURCES = fi1236.c fi1236.h fi1236_module.c tda9885.c
 
-msp3430_drv_la_LDFLAGS = -module -avoid-version
+msp3430_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 msp3430_drv_la_SOURCES = msp3430.c msp3430.h msp3430_module.c
 
-tda8425_drv_la_LDFLAGS = -module -avoid-version
+tda8425_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 tda8425_drv_la_SOURCES = tda8425.c tda8425.h tda8425_module.c
 
-tda9850_drv_la_LDFLAGS = -module -avoid-version
+tda9850_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 tda9850_drv_la_SOURCES = tda9850.c tda9850.h tda9850_module.c
 
-tda9885_drv_la_LDFLAGS = -module -avoid-version
+tda9885_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 tda9885_drv_la_SOURCES = tda9885.c tda9885.h tda9885_module.c
 
-uda1380_drv_la_LDFLAGS = -module -avoid-version
+uda1380_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 uda1380_drv_la_SOURCES = uda1380.c uda1380.h uda1380_module.c
index 1273f4b..2d261d4 100644 (file)
@@ -709,6 +709,7 @@ xf86CreateI2CBusRec(void)
 
     if (b != NULL) {
         b->scrnIndex = -1;
+        b->pScrn = NULL;
         b->HoldTime = 5;        /* 100 kHz bus */
         b->BitTimeout = 5;
         b->ByteTimeout = 5;
index 9a8fb21..e296d7d 100644 (file)
@@ -6,6 +6,7 @@
 #define _XF86I2C_H
 
 #include "regionstr.h"
+#include "xf86.h"
 
 typedef unsigned char I2CByte;
 typedef unsigned short I2CSlaveAddr;
@@ -18,6 +19,7 @@ typedef struct _I2CDevRec *I2CDevPtr;
 typedef struct _I2CBusRec {
     char *BusName;
     int scrnIndex;
+    ScrnInfoPtr pScrn;
 
     void (*I2CUDelay) (I2CBusPtr b, int usec);
 
index 8614e0b..4633120 100644 (file)
@@ -70,12 +70,12 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
     void *base = 0;
     void *vbiosMem = 0;
     void *options = NULL;
-    int screen;
     legacyVGARec vga;
+    ScrnInfoPtr pScrn;
 
-    screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
+    pScrn = xf86FindScreenForEntity(entityIndex);
 
-    options = xf86HandleInt10Options(xf86Screens[screen], entityIndex);
+    options = xf86HandleInt10Options(pScrn, entityIndex);
 
     if (int10skip(options)) {
         free(options);
@@ -89,7 +89,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
     pInt->mem = &genericMem;
     pInt->private = (pointer) xnfcalloc(1, sizeof(genericInt10Priv));
     INTPriv(pInt)->alloc = (pointer) xnfcalloc(1, ALLOC_ENTRIES(getpagesize()));
-    pInt->scrnIndex = screen;
+    pInt->pScrn = pScrn;
     base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS);
 
     /* FIXME: Shouldn't this be a failure case?  Leaving dev as NULL seems like
@@ -109,7 +109,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
     INTPriv(pInt)->sysMem = sysMem;
 
     if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) {
-        xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n");
+        xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read int vect\n");
         goto error1;
     }
 
@@ -148,7 +148,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
             vbiosMem = (unsigned char *) base + bios_location;
             err = pci_device_read_rom(rom_device, vbiosMem);
             if (err) {
-                xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (3) %s\n",
+                xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read V_BIOS (3) %s\n",
                            strerror(err));
                 goto error1;
             }
@@ -179,7 +179,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
     vbiosMem = (char *) base + V_BIOS;
     memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
     if (pci_device_read_rom(pInt->dev, vbiosMem) < V_BIOS_SIZE) {
-        xf86DrvMsg(screen, X_WARNING,
+        xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
                    "Unable to retrieve all of segment 0x0C0000.\n");
     }
 
@@ -194,10 +194,10 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
         vbiosMem = (unsigned char *) base + bios_location;
 
         if (xf86IsEntityPrimary(entityIndex)) {
-            if (int10_check_bios(screen, bios_location >> 4, vbiosMem))
+            if (int10_check_bios(pScrn->scrnIndex, bios_location >> 4, vbiosMem))
                 done = TRUE;
             else
-                xf86DrvMsg(screen, X_INFO,
+                xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                            "No legacy BIOS found -- trying PCI\n");
         }
         if (!done) {
@@ -207,7 +207,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
 
             err = pci_device_read_rom(rom_device, vbiosMem);
             if (err) {
-                xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (5) %s\n",
+                xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read V_BIOS (5) %s\n",
                            strerror(err));
                 goto error1;
             }
@@ -249,7 +249,6 @@ MapVRam(xf86Int10InfoPtr pInt)
 static void
 UnmapVRam(xf86Int10InfoPtr pInt)
 {
-    int screen = pInt->scrnIndex;
     int pagesize = getpagesize();
     int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize;
 
index 1e90877..1c58cf7 100644 (file)
@@ -125,7 +125,7 @@ run_bios_int(int num, xf86Int10InfoPtr pInt)
     if (MEM_RW(pInt, (num << 2) + 2) == (SYS_BIOS >> 4)) {      /* SYS_BIOS_SEG ? */
 
         if (num == 21 && X86_AH == 0x4e) {
-            xf86DrvMsg(pInt->scrnIndex, X_NOTICE,
+            xf86DrvMsg(pInt->pScrn->scrnIndex, X_NOTICE,
                        "Failing Find-Matching-File on non-PC"
                        " (int 21, func 4e)\n");
             X86_AX = 2;
@@ -133,7 +133,7 @@ run_bios_int(int num, xf86Int10InfoPtr pInt)
             return 1;
         }
         else {
-            xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+            xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                            "Ignoring int 0x%02x call\n", num);
             if (xf86GetVerbosity() > 3) {
                 dump_registers(pInt);
@@ -169,7 +169,7 @@ dump_code(xf86Int10InfoPtr pInt)
     int i;
     CARD32 lina = SEG_ADR((CARD32), X86_CS, IP);
 
-    xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n",
+    xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n",
                    lina);
     for (i = 0; i < 0x10; i++)
         xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
@@ -182,19 +182,19 @@ dump_code(xf86Int10InfoPtr pInt)
 void
 dump_registers(xf86Int10InfoPtr pInt)
 {
-    xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+    xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3,
                    "EAX=0x%8.8lx, EBX=0x%8.8lx, ECX=0x%8.8lx, EDX=0x%8.8lx\n",
                    (unsigned long) X86_EAX, (unsigned long) X86_EBX,
                    (unsigned long) X86_ECX, (unsigned long) X86_EDX);
-    xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+    xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3,
                    "ESP=0x%8.8lx, EBP=0x%8.8lx, ESI=0x%8.8lx, EDI=0x%8.8lx\n",
                    (unsigned long) X86_ESP, (unsigned long) X86_EBP,
                    (unsigned long) X86_ESI, (unsigned long) X86_EDI);
-    xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+    xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3,
                    "CS=0x%4.4x, SS=0x%4.4x,"
                    " DS=0x%4.4x, ES=0x%4.4x, FS=0x%4.4x, GS=0x%4.4x\n",
                    X86_CS, X86_SS, X86_DS, X86_ES, X86_FS, X86_GS);
-    xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+    xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3,
                    "EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n",
                    (unsigned long) X86_EIP, (unsigned long) X86_EFLAGS);
 }
@@ -337,7 +337,7 @@ x_inb(CARD16 port)
     }
     else if (port < 0x0100) {   /* Don't interfere with mainboard */
         val = 0;
-        xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(Int10Current->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "inb 0x%4.4x\n", port);
         if (xf86GetVerbosity() > 3) {
             dump_registers(Int10Current);
@@ -395,7 +395,7 @@ x_outb(CARD16 port, CARD8 val)
 #ifdef __NOT_YET__
     }
     else if (port < 0x0100) {   /* Don't interfere with mainboard */
-        xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(Int10Current->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "outb 0x%4.4x,0x%2.2x\n", port, val);
         if (xf86GetVerbosity() > 3) {
             dump_registers(Int10Current);
index 96c598a..160c5ae 100644 (file)
@@ -281,7 +281,7 @@ xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt)
 
 #define CHECK_V_SEGMENT_RANGE(x)   \
     if (((x) << 4) < V_BIOS) { \
-       xf86DrvMsg(pInt->scrnIndex, X_ERROR, \
+       xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, \
                   "V_BIOS address 0x%lx out of range\n", \
                   (unsigned long)(x) << 4); \
        return FALSE; \
@@ -306,17 +306,17 @@ xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base)
 
         CHECK_V_SEGMENT_RANGE(cs);
         vbiosMem = (unsigned char *) base + (cs << 4);
-        if (int10_check_bios(pInt->scrnIndex, cs, vbiosMem)) {
+        if (int10_check_bios(pInt->pScrn->scrnIndex, cs, vbiosMem)) {
             break;
         }
     }
 
     if (segments[i] == ~0) {
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR, "No V_BIOS found\n");
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "No V_BIOS found\n");
         return FALSE;
     }
 
-    xf86DrvMsg(pInt->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n",
+    xf86DrvMsg(pInt->pScrn->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n",
                (unsigned long) cs);
 
     pInt->BIOSseg = cs;
index df347d4..5ead44f 100644 (file)
@@ -57,7 +57,7 @@ int_handler(xf86Int10InfoPtr pInt)
         ret = run_bios_int(num, pInt);
 
     if (!ret) {
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Halting on int 0x%2.2x!\n", num);
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Halting on int 0x%2.2x!\n", num);
         dump_registers(pInt);
         stack_trace(pInt);
     }
@@ -257,7 +257,7 @@ int42_handler(xf86Int10InfoPtr pInt)
         /*         DL = character column                      */
         /* Not Implemented                                    */
     {                           /* Localise */
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x%2.2x(AH=0x04) -- Get Light Pen Position\n",
                        pInt->num);
         if (xf86GetVerbosity() > 3) {
@@ -314,10 +314,10 @@ int42_handler(xf86Int10InfoPtr pInt)
         /* Leave:  Nothing                                    */
         /* Not Implemented                                    */
     {                           /* Localise */
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x%2.2x(AH=0x06) -- Initialise or Scroll Window Up\n",
                        pInt->num);
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3,
                        " AL=0x%2.2x, BH=0x%2.2x,"
                        " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n",
                        X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL);
@@ -339,10 +339,10 @@ int42_handler(xf86Int10InfoPtr pInt)
         /* Leave:  Nothing                                    */
         /* Not Implemented                                    */
     {                           /* Localise */
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x%2.2x(AH=0x07) -- Initialise or Scroll Window Down\n",
                        pInt->num);
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3,
                        " AL=0x%2.2x, BH=0x%2.2x,"
                        " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n",
                        X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL);
@@ -360,10 +360,10 @@ int42_handler(xf86Int10InfoPtr pInt)
         /*         AL = character                             */
         /* Not Implemented                                    */
     {                           /* Localise */
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x%2.2x(AH=0x08) -- Read Character and Attribute at"
                        " Cursor\n", pInt->num);
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3,
                        "BH=0x%2.2x\n", X86_BH);
         if (xf86GetVerbosity() > 3) {
             dump_registers(pInt);
@@ -382,10 +382,10 @@ int42_handler(xf86Int10InfoPtr pInt)
         /* Leave:  Nothing                                    */
         /* Not Implemented                                    */
     {                           /* Localise */
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x%2.2x(AH=0x09) -- Write Character and Attribute at"
                        " Cursor\n", pInt->num);
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3,
                        "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n",
                        X86_AL, X86_BH, X86_BL, X86_CX);
         if (xf86GetVerbosity() > 3) {
@@ -404,10 +404,10 @@ int42_handler(xf86Int10InfoPtr pInt)
         /* Leave:  Nothing                                    */
         /* Not Implemented                                    */
     {                           /* Localise */
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x%2.2x(AH=0x0A) -- Write Character at Cursor\n",
                        pInt->num);
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3,
                        "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n",
                        X86_AL, X86_BH, X86_BL, X86_CX);
         if (xf86GetVerbosity() > 3) {
@@ -450,10 +450,10 @@ int42_handler(xf86Int10InfoPtr pInt)
         /* Leave:  Nothing                                    */
         /* Not Implemented                                    */
     {                           /* Localise */
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x%2.2x(AH=0x0C) -- Write Graphics Pixel\n",
                        pInt->num);
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3,
                        "AL=0x%2.2x, BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n",
                        X86_AL, X86_BH, X86_CX, X86_DX);
         if (xf86GetVerbosity() > 3) {
@@ -471,10 +471,10 @@ int42_handler(xf86Int10InfoPtr pInt)
         /* Leave:  AL = pixel value                           */
         /* Not Implemented                                    */
     {                           /* Localise */
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x%2.2x(AH=0x0D) -- Read Graphics Pixel\n",
                        pInt->num);
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3,
                        "BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n", X86_BH, X86_CX,
                        X86_DX);
         if (xf86GetVerbosity() > 3) {
@@ -498,10 +498,10 @@ int42_handler(xf86Int10InfoPtr pInt)
         /*           which might or might not have been       */
         /*           installed yet.                           */
     {                           /* Localise */
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x%2.2x(AH=0x0E) -- Write Character in Teletype Mode\n",
                        pInt->num);
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3,
                        "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x\n",
                        X86_AL, X86_BH, X86_BL);
         if (xf86GetVerbosity() > 3) {
@@ -564,10 +564,10 @@ int42_handler(xf86Int10InfoPtr pInt)
         /*           which might or might not have been       */
         /*           installed yet.                           */
     {                           /* Localise */
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x%2.2x(AH=0x13) -- Write String in Teletype Mode\n",
                        pInt->num);
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3,
                        "AL=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x,"
                        " DH=0x%2.2x, DL=0x%2.2x, ES:BP=0x%4.4x:0x%4.4x\n",
                        X86_AL, X86_BL, X86_CX, X86_DH, X86_DL, X86_ES, X86_BP);
@@ -840,7 +840,7 @@ int1A_handler(xf86Int10InfoPtr pInt)
 #endif
         return 1;
     default:
-        xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+        xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2,
                        "int 0x1a subfunction\n");
         dump_registers(pInt);
         if (xf86GetVerbosity() > 3)
index 36b659f..6d564fc 100644 (file)
 /* int10 info structure */
 typedef struct {
     int entityIndex;
-    int scrnIndex;
-    pointer cpuRegs;
     CARD16 BIOSseg;
     CARD16 inb40time;
+    ScrnInfoPtr pScrn;
+    pointer cpuRegs;
     char *BIOSScratch;
     int Flags;
     pointer private;
index ebe0c81..bd47a63 100644 (file)
@@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libloader.la
 
 INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \
           -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \
-          -I$(srcdir)/../ramdac
+          -I$(srcdir)/../ramdac -I$(srcdir)/../dri -I$(srcdir)/../dri2
 
 #AM_LDFLAGS = -r
 AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
@@ -14,7 +14,6 @@ EXTRA_DIST = \
 libloader_la_SOURCES = \
        loader.c \
        loaderProcs.h \
-       loadext.c \
         loadmod.c \
        os.c
 
index b72b8b8..64c69bb 100644 (file)
@@ -160,10 +160,16 @@ LoaderSymbol(const char *name)
     return NULL;
 }
 
+void *
+LoaderSymbolFromModule(void *handle, const char *name)
+{
+    return dlsym(handle, name);
+}
+
 void
 LoaderUnload(const char *name, void *handle)
 {
-    xf86Msg(X_INFO, "Unloading %s\n", name);
+    LogMessageVerbSigSafe(X_INFO, 1, "Unloading %s\n", name);
     if (handle)
         dlclose(handle);
 }
@@ -189,13 +195,12 @@ LoaderGetABIVersion(const char *abiclass)
         const char *name;
         int version;
     } classes[] = {
-        {
-        ABI_CLASS_ANSIC, LoaderVersionInfo.ansicVersion}, {
-        ABI_CLASS_VIDEODRV, LoaderVersionInfo.videodrvVersion}, {
-        ABI_CLASS_XINPUT, LoaderVersionInfo.xinputVersion}, {
-        ABI_CLASS_EXTENSION, LoaderVersionInfo.extensionVersion}, {
-        ABI_CLASS_FONT, LoaderVersionInfo.fontVersion}, {
-        NULL, 0}
+        {ABI_CLASS_ANSIC, LoaderVersionInfo.ansicVersion},
+        {ABI_CLASS_VIDEODRV, LoaderVersionInfo.videodrvVersion},
+        {ABI_CLASS_XINPUT, LoaderVersionInfo.xinputVersion},
+        {ABI_CLASS_EXTENSION, LoaderVersionInfo.extensionVersion},
+        {ABI_CLASS_FONT, LoaderVersionInfo.fontVersion},
+        {NULL, 0}
     };
     int i;
 
index 5cadd5a..c89c641 100644 (file)
@@ -72,5 +72,6 @@ extern unsigned long LoaderOptions;
 
 /* Internal Functions */
 void *LoaderOpen(const char *, int *, int *);
+void *LoaderSymbolFromModule(void *, const char *);
 
 #endif                          /* _LOADER_H */
index a7b752b..8b4b53f 100644 (file)
@@ -80,7 +80,6 @@ ModuleDescPtr LoadModule(const char *, const char *, const char **,
 ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent);
 void UnloadDriver(ModuleDescPtr);
 void LoaderSetPath(const char *path);
-void LoaderSortExtensions(void);
 
 void LoaderUnload(const char *, void *);
 unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
diff --git a/hw/xfree86/loader/loadext.c b/hw/xfree86/loader/loadext.c
deleted file mode 100644 (file)
index daa1abf..0000000
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * Copyright (c) 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).
- */
-
-/* Maybe this file belongs elsewhere? */
-
-#define LOADERDECLARATIONS
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "loaderProcs.h"
-#include "misc.h"
-#include "xf86.h"
-
-/*
- * This should be static, but miinitext wants it.  FIXME: make extension
- * initialization not completely terrible.
- */
-ExtensionModule *ExtensionModuleList = NULL;
-static int numExtensionModules = 0;
-
-static ExtensionModule *
-NewExtensionModule(void)
-{
-    ExtensionModule *save = ExtensionModuleList;
-    int n;
-
-    /* Sanity check */
-    if (!ExtensionModuleList)
-        numExtensionModules = 0;
-
-    n = numExtensionModules + 1;
-    ExtensionModuleList = realloc(ExtensionModuleList,
-                                  (n + 1) * sizeof(ExtensionModule));
-    if (ExtensionModuleList == NULL) {
-        ExtensionModuleList = save;
-        return NULL;
-    }
-    else {
-        numExtensionModules++;
-        ExtensionModuleList[numExtensionModules].name = NULL;
-        return ExtensionModuleList + (numExtensionModules - 1);
-    }
-}
-
-void
-LoadExtension(ExtensionModule * e, Bool builtin)
-{
-    ExtensionModule *newext;
-
-    if (e == NULL || e->name == NULL)
-        return;
-
-    if (!(newext = NewExtensionModule()))
-        return;
-
-    if (builtin)
-        xf86MsgVerb(X_INFO, 2, "Initializing built-in extension %s\n", e->name);
-    else
-        xf86MsgVerb(X_INFO, 2, "Loading extension %s\n", e->name);
-
-    newext->name = e->name;
-    newext->initFunc = e->initFunc;
-    newext->disablePtr = e->disablePtr;
-    newext->setupFunc = e->setupFunc;
-    newext->initDependencies = e->initDependencies;
-
-    if (e->setupFunc != NULL)
-        e->setupFunc();
-}
-
-/*
- * Sort ExtensionModuleList according to the initialisation order
- * dependencies.  The code for this is taken from BSD's tsort,
- * and carries the following copyright/license:
- *
- *
- * Copyright (c) 1989, 1993, 1994
- *      The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Michael Rendell of Memorial University of Newfoundland.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by the University of
- *      California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#define        NF_MARK         0x1     /* marker for cycle detection */
-#define        NF_ACYCLIC      0x2     /* this node is cycle free */
-#define        NF_NODEST       0x4     /* Unreachable */
-
-typedef struct node_str NODE;
-struct node_str {
-    NODE **n_prevp;             /* pointer to previous node's n_next */
-    NODE *n_next;               /* next node in graph */
-    NODE **n_arcs;              /* array of arcs to other nodes */
-    int n_narcs;                /* number of arcs in n_arcs[] */
-    int n_arcsize;              /* size of n_arcs[] array */
-    int n_refcnt;               /* # of arcs pointing to this node */
-    int n_flags;                /* NF_* */
-    const char *n_name;         /* name of this node */
-};
-
-static NODE *graph = NULL, **cycle_buf = NULL, **longest_cycle = NULL;
-static int longest = 0;
-static NODE *sorted = NULL, *last = NULL;
-
-/* Find a node in the graph (insert if not found) and return a pointer to it. */
-static NODE *
-get_node(const char *name)
-{
-    NODE *n;
-
-    for (n = graph; n && n->n_name && strcmp(n->n_name, name); n = n->n_next);
-    if (n)
-        return n;
-
-    n = xnfalloc(sizeof(NODE));
-
-    n->n_narcs = 0;
-    n->n_arcsize = 0;
-    n->n_arcs = NULL;
-    n->n_refcnt = 0;
-    n->n_flags = 0;
-    n->n_name = name;
-
-    /* Add to linked list. */
-    if ((n->n_next = graph) != NULL)
-        graph->n_prevp = &n->n_next;
-    n->n_prevp = &graph;
-    graph = n;
-
-    return n;
-}
-
-/*
- * add an arc from node s1 to node s2 in the graph.  If s1 or s2 are not in
- * the graph, then add them.
- */
-static void
-add_arc(const char *s1, const char *s2)
-{
-    NODE *n1;
-    NODE *n2;
-    int bsize, i;
-
-    n1 = get_node(s1);
-
-    if (!strcmp(s1, s2))
-        return;
-
-    n2 = get_node(s2);
-
-    /*
-     * Check if this arc is already here.
-     */
-    for (i = 0; i < n1->n_narcs; i++)
-        if (n1->n_arcs[i] == n2)
-            return;
-    /*
-     * Add it.
-     */
-    if (n1->n_narcs == n1->n_arcsize) {
-        if (!n1->n_arcsize)
-            n1->n_arcsize = 10;
-        bsize = n1->n_arcsize * sizeof(*n1->n_arcs) * 2;
-        n1->n_arcs = xnfrealloc(n1->n_arcs, bsize);
-        n1->n_arcsize = bsize / sizeof(*n1->n_arcs);
-    }
-    n1->n_arcs[n1->n_narcs++] = n2;
-    ++n2->n_refcnt;
-}
-
-/*
- * Clear the NODEST flag from all nodes.
- */
-static void
-clear_cycle(void)
-{
-    NODE *n;
-
-    for (n = graph; n != NULL; n = n->n_next)
-        n->n_flags &= ~NF_NODEST;
-}
-
-/* print node and remove from graph (does not actually free node) */
-static void
-remove_node(NODE * n)
-{
-    NODE **np;
-    NODE *newnode;
-    int i;
-
-#ifdef DEBUG
-    ErrorF("%s\n", n->n_name);
-#endif
-    newnode = xnfalloc(sizeof(NODE));
-    memcpy(newnode, n, sizeof(NODE));
-    if (last)
-        last->n_next = newnode;
-    else
-        sorted = newnode;
-    last = newnode;
-    newnode->n_next = NULL;
-
-    for (np = n->n_arcs, i = n->n_narcs; --i >= 0; np++)
-        --(*np)->n_refcnt;
-    n->n_narcs = 0;
-    *n->n_prevp = n->n_next;
-    if (n->n_next)
-        n->n_next->n_prevp = n->n_prevp;
-}
-
-static void
-free_nodes(NODE * nodelist)
-{
-    NODE *n, *nextnode;
-
-    for (n = nodelist; n;) {
-        nextnode = n->n_next;
-        free(n);
-        n = nextnode;
-    }
-}
-
-/* look for the longest? cycle from node from to node to. */
-static int
-find_cycle(NODE * from, NODE * to, int longest_len, int depth)
-{
-    NODE **np;
-    int i, len;
-
-    /*
-     * avoid infinite loops and ignore portions of the graph known
-     * to be acyclic
-     */
-    if (from->n_flags & (NF_NODEST | NF_MARK | NF_ACYCLIC))
-        return 0;
-    from->n_flags |= NF_MARK;
-
-    for (np = from->n_arcs, i = from->n_narcs; --i >= 0; np++) {
-        cycle_buf[depth] = *np;
-        if (*np == to) {
-            if (depth + 1 > longest_len) {
-                longest_len = depth + 1;
-                memcpy((char *) longest_cycle,
-                       (char *) cycle_buf, longest_len * sizeof(NODE *));
-            }
-        }
-        else {
-            if ((*np)->n_flags & (NF_MARK | NF_ACYCLIC | NF_NODEST))
-                continue;
-            len = find_cycle(*np, to, longest_len, depth + 1);
-
-#ifdef DEBUG
-            ErrorF("%*s %s->%s %d\n", depth, "", from->n_name, to->n_name, len);
-#endif
-
-            if (len == 0)
-                (*np)->n_flags |= NF_NODEST;
-
-            if (len > longest_len)
-                longest_len = len;
-
-            if (len > 0 && !longest)
-                break;
-        }
-    }
-    from->n_flags &= ~NF_MARK;
-    return longest_len;
-}
-
-/* do topological sort on graph */
-static void
-tsort(void)
-{
-    NODE *n, *next;
-    int cnt, i;
-
-    while (graph != NULL) {
-        /*
-         * Keep getting rid of simple cases until there are none left,
-         * if there are any nodes still in the graph, then there is
-         * a cycle in it.
-         */
-        do {
-            for (cnt = 0, n = graph; n != NULL; n = next) {
-                next = n->n_next;
-                if (n->n_refcnt == 0) {
-                    remove_node(n);
-                    ++cnt;
-                }
-            }
-        } while (graph != NULL && cnt);
-
-        if (graph == NULL)
-            break;
-
-        if (!cycle_buf) {
-            /*
-             * Allocate space for two cycle logs - one to be used
-             * as scratch space, the other to save the longest
-             * cycle.
-             */
-            for (cnt = 0, n = graph; n != NULL; n = n->n_next)
-                ++cnt;
-            cycle_buf = xnfalloc(sizeof(NODE *) * cnt);
-            longest_cycle = xnfalloc(sizeof(NODE *) * cnt);
-            if (cycle_buf == NULL || longest_cycle == NULL)
-                return;
-        }
-        for (n = graph; n != NULL; n = n->n_next)
-            if (!(n->n_flags & NF_ACYCLIC)) {
-                if ((cnt = find_cycle(n, n, 0, 0))) {
-                    ErrorF("tsort: cycle in data");
-                    for (i = 0; i < cnt; i++)
-                        ErrorF("%s", longest_cycle[i]->n_name);
-                    remove_node(n);
-                    clear_cycle();
-                    break;
-                }
-                else {
-                    /* to avoid further checks */
-                    n->n_flags |= NF_ACYCLIC;
-                    clear_cycle();
-                }
-            }
-
-        if (n == NULL)
-            ErrorF("tsort: internal error -- could not find cycle");
-    }
-    free(cycle_buf);
-    free(longest_cycle);
-    if (graph)
-        free_nodes(graph);
-}
-
-void
-LoaderSortExtensions(void)
-{
-    int i, j;
-    ExtensionModule *ext, *newList;
-    NODE *node;
-
-    graph = NULL;
-    longest = 0;
-    sorted = NULL;
-    last = NULL;
-    cycle_buf = NULL;
-    longest_cycle = NULL;
-
-    /*
-     * Parse list and build the graph.  Enter them in reverse order
-     * because tsort() will reverse those that have no depedencies.
-     */
-    for (i = numExtensionModules - 1; i >= 0; i--) {
-        ext = &ExtensionModuleList[i];
-        add_arc(ext->name, ext->name);
-#ifdef DEBUG
-        ErrorF("Extension %s:\n", ext->name);
-#endif
-        if (ext->initDependencies)
-            for (j = 0; ext->initDependencies[j]; j++) {
-                add_arc(ext->initDependencies[j], ext->name);
-#ifdef DEBUG
-                ErrorF("\t%s\n", ext->initDependencies[j]);
-#endif
-            }
-    }
-    tsort();
-    newList = xnfalloc((numExtensionModules + 1) * sizeof(ExtensionModule));
-    i = 0;
-    for (node = sorted; node; node = node->n_next) {
-        for (j = 0; j < numExtensionModules; j++)
-            if (!strcmp(node->n_name, ExtensionModuleList[j].name))
-                break;
-        if (j != numExtensionModules)
-            newList[i++] = ExtensionModuleList[j];
-    }
-    if (sorted)
-        free_nodes(sorted);
-    if (graph)
-        free_nodes(graph);
-    newList[i].name = NULL;
-    free(ExtensionModuleList);
-    ExtensionModuleList = newList;
-#ifdef DEBUG
-    for (i = 0; ExtensionModuleList[i].name; i++)
-        ErrorF("Extension %s\n", ExtensionModuleList[i].name);
-#endif
-}
index c6b5590..2347b8e 100644 (file)
@@ -212,9 +212,15 @@ static const char *stdSubdirs[] = {
  * to port this DDX to, say, Darwin, we'll need to fix this.
  */
 static PatternRec stdPatterns[] = {
+#ifdef __CYGWIN__
+    {"^cyg(.*)\\.dll$",},
+    {"(.*)_drv\\.dll$",},
+    {"(.*)\\.dll$",},
+#else
     {"^lib(.*)\\.so$",},
     {"(.*)_drv\\.so$",},
     {"(.*)\\.so$",},
+#endif
     {NULL,}
 };
 
@@ -408,21 +414,33 @@ FindModuleInSubdir(const char *dirpath, const char *module)
             continue;
         }
 
+#ifdef __CYGWIN__
+        snprintf(tmpBuf, PATH_MAX, "cyg%s.dll", module);
+#else
         snprintf(tmpBuf, PATH_MAX, "lib%s.so", module);
+#endif
         if (strcmp(direntry->d_name, tmpBuf) == 0) {
             if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1)
                 ret = NULL;
             break;
         }
 
+#ifdef __CYGWIN__
+        snprintf(tmpBuf, PATH_MAX, "%s_drv.dll", module);
+#else
         snprintf(tmpBuf, PATH_MAX, "%s_drv.so", module);
+#endif
         if (strcmp(direntry->d_name, tmpBuf) == 0) {
             if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1)
                 ret = NULL;
             break;
         }
 
+#ifdef __CYGWIN__
+        snprintf(tmpBuf, PATH_MAX, "%s.dll", module);
+#else
         snprintf(tmpBuf, PATH_MAX, "%s.so", module);
+#endif
         if (strcmp(direntry->d_name, tmpBuf) == 0) {
             if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1)
                 ret = NULL;
@@ -815,6 +833,11 @@ static const char *compiled_in_modules[] = {
     "ddc",
     "i2c",
     "ramdac",
+    "dbe",
+    "record",
+    "extmod",
+    "dri",
+    "dri2",
     NULL
 };
 
@@ -938,7 +961,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
             *errmin = 0;
         goto LoadModule_fail;
     }
-    initdata = LoaderSymbol(p);
+    initdata = LoaderSymbolFromModule(ret->handle, p);
     if (initdata) {
         ModuleSetupProc setup;
         ModuleTearDownProc teardown;
@@ -974,10 +997,6 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
         ret->VersionInfo = vers;
     }
     else {
-        /* No initdata is OK for external modules */
-        if (options == EXTERN_MODULE)
-            goto LoadModule_exit;
-
         /* no initdata, fail the load */
         xf86Msg(X_ERROR, "LoadModule: Module %s does not have a %s "
                 "data object.\n", module, p);
@@ -1075,9 +1094,10 @@ UnloadModuleOrDriver(ModuleDescPtr mod)
         return;
 
     if (mod->parent)
-        xf86MsgVerb(X_INFO, 3, "UnloadSubModule: \"%s\"\n", mod->name);
+        LogMessageVerbSigSafe(X_INFO, 3, "UnloadSubModule: \"%s\"\n",
+                              mod->name);
     else
-        xf86MsgVerb(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name);
+        LogMessageVerbSigSafe(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name);
 
     if (mod->TearDownData != ModuleDuplicated) {
         if ((mod->TearDownProc) && (mod->TearDownData))
index 2fa72d6..0cd5a10 100644 (file)
@@ -1,16 +1,16 @@
 .\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
-.TH __xservername__ __appmansuffix__ __vendorversion__
+.TH Xorg __appmansuffix__ __vendorversion__
 .SH NAME
-__xservername__ - X11R7 X server
+Xorg - X11R7 X server
 .SH SYNOPSIS
-.B __xservername__
+.B Xorg
 .RI [\fB:\fP display ]
 .RI [ option
 .IR ... ]
 .SH DESCRIPTION
-.B __xservername__
+.B Xorg
 is a full featured X server that was originally designed for UNIX and
 UNIX-like operating systems running on Intel x86 hardware.  It now runs
 on a wider range of hardware and OS platforms.
@@ -24,7 +24,7 @@ by Thomas Roell which was contributed to X11R5 by Snitily Graphics
 Consulting Service.
 .SH PLATFORMS
 .PP
-.B __xservername__
+.B Xorg
 operates under a wide range of operating systems and hardware platforms.
 The Intel x86 (IA32) architecture is the most widely supported hardware
 platform.  Other hardware platforms include Compaq Alpha, Intel IA64, AMD64,
@@ -37,7 +37,7 @@ Xquartz(__appmansuffix__) X server.  Win32/Cygwin is supported with the
 XWin(__appmansuffix__) X server.
 .PP
 .SH "NETWORK CONNECTIONS"
-.B __xservername__
+.B Xorg
 supports connections made using the following reliable
 byte-streams:
 .TP 4
@@ -47,7 +47,7 @@ On some System V platforms, the "local" connection types also include
 STREAMS pipes, named pipes, and some other mechanisms.
 .TP 4
 .I TCP\/IP
-.B __xservername__
+.B Xorg
 listens on port
 .RI 6000+ n ,
 where
@@ -108,10 +108,10 @@ file.  If you use xdm(1), the definitions should be early on in the
 .I __projectroot__/lib/X11/xdm/Xsession
 script.
 .SH OPTIONS
-.B __xservername__
+.B Xorg
 supports several mechanisms for supplying/obtaining configuration and
 run-time parameters: command line options, environment variables, the
-__xconfigfile__(__filemansuffix__) configuration files, auto-detection, and
+xorg.conf(__filemansuffix__) configuration files, auto-detection, and
 fallback defaults.  When the same information is supplied in more than
 one way, the highest precedence mechanism is used.  The list of mechanisms
 is ordered from highest precedence to lowest.  Note that not all parameters
@@ -119,21 +119,21 @@ can be supplied via all methods.  The available command line options
 and environment variables (and some defaults) are described here and in
 the Xserver(__appmansuffix__) manual page.  Most configuration file
 parameters, with their defaults, are described in the
-__xconfigfile__(__filemansuffix__) manual page.  Driver and module specific
+xorg.conf(__filemansuffix__) manual page.  Driver and module specific
 configuration parameters are described in the relevant driver or module
 manual page.
 .PP
 In addition to the normal server options described in the
 Xserver(__appmansuffix__) manual page,
-.B __xservername__
+.B Xorg
 accepts the following command line switches:
 .TP 8
 .BI vt XX
 .I XX
 specifies the Virtual Terminal device number which
-.B __xservername__
+.B Xorg
 will use.  Without this option,
-.B __xservername__
+.B Xorg
 will pick the first available Virtual Terminal that it can locate.  This
 option applies only to platforms that have virtual terminal support, such
 as Linux, BSD, OpenSolaris, SVR3, and SVR4.
@@ -142,14 +142,14 @@ as Linux, BSD, OpenSolaris, SVR3, and SVR4.
 Allow the server to start up even if the mouse device can't be opened
 or initialised.  This is equivalent to the
 .B AllowMouseOpenFail
-__xconfigfile__(__filemansuffix__) file option.
+xorg.conf(__filemansuffix__) file option.
 .TP 8
 .B \-allowNonLocalXvidtune
 Make the VidMode extension available to remote clients.  This allows
 the xvidtune client to connect from another host.  This is equivalent
 to the
 .B AllowNonLocalXvidtune
-__xconfigfile__(__filemansuffix__) file option.  By default non-local
+xorg.conf(__filemansuffix__) file option.  By default non-local
 connections are not allowed.
 .TP 8
 .BI \-bgamma " value"
@@ -187,9 +187,9 @@ config directory search path for all other users.
 .TP 8
 .B \-configure
 When this option is specified, the
-.B __xservername__
+.B Xorg
 server loads all video driver modules, probes for available hardware,
-and writes out an initial __xconfigfile__(__filemansuffix__) file based on
+and writes out an initial xorg.conf(__filemansuffix__) file based on
 what was detected.  This option currently has some problems on some
 platforms, but in most cases it is a good way to bootstrap the
 configuration process.  This option is only available when the server
@@ -209,7 +209,7 @@ Disable the parts of the VidMode extension (used by the xvidtune
 client) that can be used to change the video modes.  This is equivalent
 to the
 .B DisableVidModeExtension
-__xconfigfile__(__filemansuffix__) file option.
+xorg.conf(__filemansuffix__) file option.
 .TP 8
 .B \-fbbpp \fIn\fP
 Sets the number of framebuffer bits per pixel.  You should only set this
@@ -249,7 +249,7 @@ options.
 .TP 8
 .B \-ignoreABI
 The
-.B __xservername__
+.B Xorg
 server checks the ABI revision levels of each module that it loads.  It
 will normally refuse to load modules with ABI revisions that are newer
 than the server's.  This is because such modules might use interfaces
@@ -276,7 +276,7 @@ This option is only useful when debugging the server.  Not all platforms
 support (or can use) this option.
 .TP 8
 .BI \-keyboard " keyboard-name"
-Use the __xconfigfile__(__filemansuffix__) file
+Use the xorg.conf(__filemansuffix__) file
 .B InputDevice
 section called
 .I keyboard-name
@@ -288,7 +288,7 @@ section and this option, the first relevant
 section is used for the core keyboard.
 .TP 8
 .BI \-layout " layout-name"
-Use the __xconfigfile__(__filemansuffix__) file
+Use the xorg.conf(__filemansuffix__) file
 .B Layout
 section called
 .IR layout-name .
@@ -300,20 +300,20 @@ section is used.
 Use the file called
 .I filename
 as the
-.B __xservername__
+.B Xorg
 server log file.  The default log file is
-.BI __logdir__/__xservername__. n .log
+.BI __logdir__/Xorg. n .log
 on most platforms, where
 .I n
 is the display number of the
-.B __xservername__
+.B Xorg
 server.  The default may be in a different directory on some platforms.
 This option is only available when the server is run as root (i.e, with
 real-uid 0).
 .TP 8
 .BR \-logverbose " [\fIn\fP]"
 Sets the verbosity level for information printed to the
-.B __xservername__
+.B Xorg
 server log file.  If the
 .I n
 value isn't supplied, each occurrence of this option increments the log
@@ -327,7 +327,7 @@ Set the module search path to
 .IR searchpath .
 .I searchpath
 is a comma separated list of directories to search for
-.B __xservername__
+.B Xorg
 server modules.  This option is only available when the server is run
 as root (i.e, with real-uid 0).
 .TP 8
@@ -345,16 +345,16 @@ reason to use this option.  Some client applications don't like this
 pixmap format, even though it is a perfectly legal format.  This is
 equivalent to the
 .B Pixmap
-__xconfigfile__(__filemansuffix__) file option.
+xorg.conf(__filemansuffix__) file option.
 .TP 8
 .B \-pixmap32
 Set the internal pixmap format for depth 24 pixmaps to 32 bits per pixel.
 This is usually the default.  This is equivalent to the
 .B Pixmap
-__xconfigfile__(__filemansuffix__) file option.
+xorg.conf(__filemansuffix__) file option.
 .TP 8
 .BI \-pointer " pointer-name"
-Use the __xconfigfile__(__filemansuffix__) file
+Use the xorg.conf(__filemansuffix__) file
 .B InputDevice
 section called
 .I pointer-name
@@ -384,7 +384,7 @@ options.
 Share virtual terminals with another X server, if supported by the OS.
 .TP 8
 .BI \-screen " screen-name"
-Use the __xconfigfile__(__filemansuffix__) file
+Use the xorg.conf(__filemansuffix__) file
 .B Screen
 section called
 .IR screen-name .
@@ -434,7 +434,7 @@ support.
 .SH "KEYBOARD"
 .PP
 The
-.B __xservername__
+.B Xorg
 server is normally configured to recognize various special combinations
 of key presses that instruct the server to perform some action, rather
 than just sending the key press event to a client application. These actions
@@ -448,7 +448,7 @@ keymap.
 Immediately kills the server -- no questions asked. It can be disabled by
 setting the
 .B DontZap
-__xconfigfile__(__filemansuffix__) file option to a TRUE value.
+xorg.conf(__filemansuffix__) file option to a TRUE value.
 .PP
 .RS 8
 It should be noted that zapping is triggered by the
@@ -462,43 +462,43 @@ but can be enabled with the XKB option
 Change video mode to next one specified in the configuration file.
 This can be disabled with the
 .B DontZoom
-__xconfigfile__(__filemansuffix__) file option.
+xorg.conf(__filemansuffix__) file option.
 .TP 8
 .B Ctrl+Alt+Keypad-Minus
 Change video mode to previous one specified in the configuration file.
 This can be disabled with the
 .B DontZoom
-__xconfigfile__(__filemansuffix__) file option.
+xorg.conf(__filemansuffix__) file option.
 .TP 8
 .B Ctrl+Alt+F1...F12
 For systems with virtual terminal support, these keystroke
 combinations are used to switch to virtual terminals 1 through 12,
 respectively.  This can be disabled with the
 .B DontVTSwitch
-__xconfigfile__(__filemansuffix__) file option.
+xorg.conf(__filemansuffix__) file option.
 .SH CONFIGURATION
-.B __xservername__
+.B Xorg
 typically uses a configuration file called
-.B __xconfigfile__
+.B xorg.conf
 and configuration files with the suffix
 .I .conf
 in a directory called
 .B __xconfigdir__
 for its initial setup.
-Refer to the __xconfigfile__(__filemansuffix__) manual page for information
+Refer to the xorg.conf(__filemansuffix__) manual page for information
 about the format of this file.
 .PP
-.B __xservername__
+.B Xorg
 has a mechanism for automatically generating a built-in configuration
 at run-time when no
-.B __xconfigfile__
+.B xorg.conf
 file or
 .B __xconfigdir__
 files are present.  The current version of this automatic configuration
 mechanism works in two ways.
 .PP
 The first is via enhancements that have made many components of the
-.B __xconfigfile__
+.B xorg.conf
 file optional.  This means that information that can be probed or
 reasonably deduced doesn't need to be specified explicitly, greatly
 reducing the amount of built-in configuration information that needs to
@@ -506,33 +506,33 @@ be generated at run-time.
 .PP
 The second is to have "safe" fallbacks for most configuration information.
 This maximises the likelihood that the
-.B __xservername__
+.B Xorg
 server will start up in some usable configuration even when information
 about the specific hardware is not available.
 .PP
-The automatic configuration support for __xservername__ is work in progress.
+The automatic configuration support for Xorg is work in progress.
 It is currently aimed at the most popular hardware and software platforms
-supported by __xservername__.  Enhancements are planned for future releases.
+supported by Xorg.  Enhancements are planned for future releases.
 .SH FILES
 The
-.B __xservername__
+.B Xorg
 server config files can be found in a range of locations.  These are
-documented fully in the __xconfigfile__(__filemansuffix__) manual page.  The
+documented fully in the xorg.conf(__filemansuffix__) manual page.  The
 most commonly used locations are shown here.
 .TP 30
-.B /etc/X11/__xconfigfile__
+.B /etc/X11/xorg.conf
 Server configuration file.
 .TP 30
-.B /etc/X11/__xconfigfile__-4
+.B /etc/X11/xorg.conf-4
 Server configuration file.
 .TP 30
-.B /etc/__xconfigfile__
+.B /etc/xorg.conf
 Server configuration file.
 .TP 30
-.B __projectroot__/etc/__xconfigfile__
+.B __projectroot__/etc/xorg.conf
 Server configuration file.
 .TP 30
-.B __projectroot__/lib/X11/__xconfigfile__
+.B __projectroot__/lib/X11/xorg.conf
 Server configuration file.
 .TP 30
 .B /etc/X11/__xconfigdir__
@@ -550,7 +550,7 @@ Server configuration directory.
 .B __projectroot__/lib/X11/__xconfigdir__
 Server configuration directory.
 .TP 30
-.BI __logdir__/__xservername__. n .log
+.BI __logdir__/Xorg. n .log
 Server log file for display
 .IR n .
 .TP 30
@@ -580,7 +580,7 @@ Initial access control list for display
 .IR n .
 .SH "SEE ALSO"
 X(__miscmansuffix__), Xserver(__appmansuffix__), xdm(__appmansuffix__), xinit(__appmansuffix__),
-__xconfigfile__(__filemansuffix__), xvidtune(__appmansuffix__),
+xorg.conf(__filemansuffix__), xvidtune(__appmansuffix__),
 xkeyboard-config (__miscmansuffix__),
 apm(__drivermansuffix__),
 ati(__drivermansuffix__),
@@ -623,15 +623,15 @@ Web site
 .IR <http://www.x.org> .
 
 .SH AUTHORS
-__xservername__ has many contributors world wide.  The names of most of them
+Xorg has many contributors world wide.  The names of most of them
 can be found in the documentation, ChangeLog files in the source tree,
 and in the actual source code.
 .PP
-__xservername__ was originally based on XFree86 4.4rc2.
+Xorg was originally based on XFree86 4.4rc2.
 That was originally based on \fIX386 1.2\fP by Thomas Roell, which
 was contributed to the then X Consortium's X11R5 distribution by SGCS.
 .PP
-__xservername__ is released by the X.Org Foundation.
+Xorg is released by the X.Org Foundation.
 .PP
 The project that became XFree86 was originally founded in 1992 by
 David Dawes, Glenn Lai, Jim Tsillas and David Wexelblat.
@@ -671,7 +671,7 @@ Orest Zborowski    \fIorestz@eskimo.com\fP
 .fi
 .RE
 .PP
-__xservername__ source is available from the FTP server
+Xorg source is available from the FTP server
 \fI<ftp://ftp.x.org/>\fP, and from the X.Org
 server \fI<http://gitweb.freedesktop.org/>\fP.  Documentation and other
 information can be found from the X.Org web site
@@ -679,10 +679,10 @@ information can be found from the X.Org web site
 
 .SH LEGAL
 .PP
-.B __xservername__
+.B Xorg
 is copyright software, provided under licenses that permit modification
 and redistribution in source and binary form without fee.
-.B __xservername__ is copyright by numerous authors and
+.B Xorg is copyright by numerous authors and
 contributors from around the world.  Licensing information can be found
 at
 .IR <http://www.x.org> .
index c1b3c4f..5d92bbe 100644 (file)
@@ -1,35 +1,35 @@
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
-.TH __xconfigfile__ __filemansuffix__ __vendorversion__
+.TH xorg.conf __filemansuffix__ __vendorversion__
 .SH NAME
-__xconfigfile__, __xconfigdir__ \- configuration files for
-__xservername__ X server
+xorg.conf, __xconfigdir__ \- configuration files for
+Xorg X server
 .SH INTRODUCTION
-.B __xservername__
+.B Xorg
 supports several mechanisms for supplying/obtaining configuration and
 run-time parameters: command line options, environment variables, the
-__xconfigfile__ and __xconfigdir__ configuration files, auto-detection,
+xorg.conf and __xconfigdir__ configuration files, auto-detection,
 and fallback defaults. When the same information is supplied in more
 than one way, the highest precedence mechanism is used. The list of
 mechanisms is ordered from highest precedence to lowest. Note that not
 all parameters can be supplied via all methods. The available command
 line options and environment variables (and some defaults) are
 described in the Xserver(__appmansuffix__) and
-__xservername__(__appmansuffix__) manual pages. Most configuration file
+Xorg(__appmansuffix__) manual pages. Most configuration file
 parameters, with their defaults, are described below. Driver and module
 specific configuration parameters are described in the relevant driver
 or module manual page.
 .SH DESCRIPTION
-.B __xservername__
+.B Xorg
 uses a configuration file called
-.I __xconfigfile__
+.I xorg.conf
 and files ending in the suffix
 .I .conf
 from the directory
 .I __xconfigdir__
 for its initial setup.
 The
-.I __xconfigfile__
+.I xorg.conf
 configuration file is searched for in the following places when the
 server is started as a normal user:
 .PP
@@ -39,12 +39,12 @@ server is started as a normal user:
 .IR __projectroot__/etc/X11/ <cmdline>
 .IB /etc/X11/ $XORGCONFIG
 .IB __projectroot__/etc/X11/ $XORGCONFIG
-.I /etc/X11/__xconfigfile__
-.I /etc/__xconfigfile__
-.IR __projectroot__/etc/X11/__xconfigfile__. <hostname>
-.I __projectroot__/etc/X11/__xconfigfile__
-.IR __projectroot__/lib/X11/__xconfigfile__. <hostname>
-.I __projectroot__/lib/X11/__xconfigfile__
+.I /etc/X11/xorg.conf
+.I /etc/xorg.conf
+.IR __projectroot__/etc/X11/xorg.conf. <hostname>
+.I __projectroot__/etc/X11/xorg.conf
+.IR __projectroot__/lib/X11/xorg.conf. <hostname>
+.I __projectroot__/lib/X11/xorg.conf
 .fi
 .RE
 .PP
@@ -60,7 +60,7 @@ environment variable, and
 is the machine's hostname as reported by
 .BR gethostname (__libmansuffix__).
 .PP
-When the __xservername__ server is started by the \(lqroot\(rq user, the config file
+When the Xorg server is started by the \(lqroot\(rq user, the config file
 search locations are as follows:
 .PP
 .RS 4
@@ -71,12 +71,12 @@ search locations are as follows:
 .B $XORGCONFIG
 .IB /etc/X11/ $XORGCONFIG
 .IB __projectroot__/etc/X11/ $XORGCONFIG
-.I /etc/X11/__xconfigfile__
-.I /etc/__xconfigfile__
-.IR __projectroot__/etc/X11/__xconfigfile__. <hostname>
-.I __projectroot__/etc/X11/__xconfigfile__
-.IR __projectroot__/lib/X11/__xconfigfile__. <hostname>
-.I __projectroot__/lib/X11/__xconfigfile__
+.I /etc/X11/xorg.conf
+.I /etc/xorg.conf
+.IR __projectroot__/etc/X11/xorg.conf. <hostname>
+.I __projectroot__/etc/X11/xorg.conf
+.IR __projectroot__/lib/X11/xorg.conf. <hostname>
+.I __projectroot__/lib/X11/xorg.conf
 .fi
 .RE
 .PP
@@ -113,7 +113,7 @@ is a relative path (with no \(lq..\(rq components) specified with the
 .B \-configdir
 command line option.
 .PP
-When the __xservername__ server is started by the \(lqroot\(rq user, the
+When the Xorg server is started by the \(lqroot\(rq user, the
 config directory search locations are as follows:
 .PP
 .RS 4
@@ -145,7 +145,7 @@ These files are found in the following directories:
 .RE
 .PP
 The
-.I __xconfigfile__
+.I xorg.conf
 and
 .I __xconfigdir__
 files are composed of a number of sections which may be present in any order,
@@ -331,7 +331,7 @@ section is used to specify some path names required by the server.
 Some of these paths can also be set from the command line (see
 .BR Xserver (__appmansuffix__)
 and
-.BR __xservername__ (__appmansuffix__)).
+.BR Xorg (__appmansuffix__)).
 The command line settings override the values specified in the config
 file.
 The
@@ -342,7 +342,7 @@ The entries that can appear in this section are:
 .TP 7
 .BI "FontPath \*q" path \*q
 sets the search path for fonts.
-This path is a comma separated list of font path elements which the __xservername__
+This path is a comma separated list of font path elements which the Xorg
 server searches for font databases.
 Multiple
 .B FontPath
@@ -426,8 +426,8 @@ font path when the server starts up.
 .RE
 .TP 7
 .BI "ModulePath \*q" path \*q
-sets the search path for loadable __xservername__ server modules.
-This path is a comma separated list of directories which the __xservername__ server
+sets the search path for loadable Xorg server modules.
+This path is a comma separated list of directories which the Xorg server
 searches for loadable modules loading in the order specified.
 Multiple
 .B ModulePath
@@ -441,17 +441,17 @@ __modulepath__
 .ig
 .TP 7
 .BI "LogFile \*q" path \*q
-sets the name of the __xservername__ server log file.
+sets the name of the Xorg server log file.
 The default log file name is
 .PP
 .RS 11
-.RI __logdir__/__xservername__. <n> .log
+.RI __logdir__/Xorg. <n> .log
 .RE
 .PP
 .RS 7
 where
 .I <n>
-is the display number for the __xservername__ server.
+is the display number for the Xorg server.
 ..
 .TP 7
 .BI "XkbDir \*q" path \*q
@@ -466,7 +466,7 @@ __xkbdir__
 In addition to options specific to this section (described below), the
 .B ServerFlags
 section is used to specify some global
-__xservername__ server options.
+Xorg server options.
 All of the entries in this section are
 .BR Options ,
 although for compatibility purposes some of the old style entries are
@@ -498,20 +498,20 @@ section to use in the absence of the
 command line option.
 .TP 7
 .BI "Option \*qNoTrapSignals\*q  \*q" boolean \*q
-This prevents the __xservername__ server from trapping a range of unexpected fatal
+This prevents the Xorg server from trapping a range of unexpected fatal
 signals and exiting cleanly.
-Instead, the __xservername__ server will die and drop core where the fault occurred.
-The default behaviour is for the __xservername__ server to exit cleanly, but still drop a
+Instead, the Xorg server will die and drop core where the fault occurred.
+The default behaviour is for the Xorg server to exit cleanly, but still drop a
 core file.
-In general you never want to use this option unless you are debugging an __xservername__
+In general you never want to use this option unless you are debugging an Xorg
 server problem and know how to deal with the consequences.
 .TP 7
 .BI "Option \*qUseSIGIO\*q  \*q" boolean \*q
-This controls whether the __xservername__ server requests that events from
+This controls whether the Xorg server requests that events from
 input devices be reported via a SIGIO signal handler (also known as SIGPOLL
 on some platforms), or only reported via the standard select(3) loop.
 The default behaviour is platform specific.   In general you do not want to
-use this option unless you are debugging the __xservername__ server, or
+use this option unless you are debugging the Xorg server, or
 working around a specific bug until it is fixed, and understand the
 consequences.
 .TP 7
@@ -531,7 +531,7 @@ Default: off.
 This disallows the use of the
 .B Terminate_Server
 XKB action (usually on Ctrl+Alt+Backspace, depending on XKB options).
-This action is normally used to terminate the __xservername__ server.
+This action is normally used to terminate the Xorg server.
 When this option is enabled, the action has no effect.
 Default: off.
 .TP 7
@@ -568,7 +568,7 @@ sets the inactivity timeout for the
 phase of the screensaver.
 .I time
 is in minutes.
-This is equivalent to the __xservername__ server's
+This is equivalent to the Xorg server's
 .B \-s
 flag, and the value can be changed at run\-time with
 .BR xset(__appmansuffix__).
@@ -679,9 +679,9 @@ Unset by default.
 .SH "MODULE SECTION"
 The
 .B Module
-section is used to specify which __xservername__ server modules should be loaded.
-This section is ignored when the __xservername__ server is built in static form.
-The type of modules normally loaded in this section are __xservername__ server
+section is used to specify which Xorg server modules should be loaded.
+This section is ignored when the Xorg server is built in static form.
+The type of modules normally loaded in this section are Xorg server
 extension modules.
 Most other module types are loaded automatically when they are needed via
 other mechanisms.
@@ -701,7 +701,7 @@ This instructs the server to load the module called
 The module name given should be the module's standard name, not the
 module file name.
 The standard name is case\-sensitive, and does not include the \(lqlib\(rq
-prefix, or the \(lq.a\(rq, \(lq.o\(rq, or \(lq.so\(rq suffixes.
+or \(lqcyg\(rq prefixes, or the \(lq.so\(rq or \(lq.dll\(rq suffixes.
 .PP
 .RS 7
 Example: the DRI extension module can be loaded with the following entry:
@@ -1324,14 +1324,14 @@ recommends that you do.
 .BI "ClockChip  \*q" clockchip\-type \*q
 This optional entry is used to specify the clock chip type on graphics
 boards which have a programmable clock generator.
-Only a few __xservername__ drivers support programmable clock chips.
+Only a few Xorg drivers support programmable clock chips.
 For details, see the appropriate driver manual page.
 .TP 7
 .BI "VideoRam  " "mem"
 This optional entry specifies the amount of video ram that is installed
 on the graphics board.
 This is measured in kBytes.
-In most cases this is not required because the __xservername__ server probes
+In most cases this is not required because the Xorg server probes
 the graphics board to determine this quantity.
 The driver-specific documentation should indicate when it might be needed.
 .TP 7
@@ -1481,7 +1481,7 @@ if
 or
 .B Hz
 is added to the end of the line.
-The data given here is used by the __xservername__ server to determine if video
+The data given here is used by the Xorg server to determine if video
 modes are within the specifications of the monitor.
 This information should be available in the monitor's handbook.
 If this entry is omitted, a default range of 28\-33kHz is used.
@@ -1500,7 +1500,7 @@ if
 or
 .B kHz
 is added to the end of the line.
-The data given here is used by the __xservername__ server to determine if video
+The data given here is used by the Xorg server to determine if video
 modes are within the specifications of the monitor.
 This information should be available in the monitor's handbook.
 If this entry is omitted, a default range of 43\-72Hz is used.
@@ -1894,8 +1894,7 @@ Others are driver\-independent, and will eventually be described here.
 .\" XXX These should really be in an xaa man page.
 .TP 7
 .BI "Option \*qAccel\*q"
-Enables XAA (X Acceleration Architecture), a mechanism that makes video cards'
-2D hardware acceleration available to the  __xservername__ server.
+Enables 2D hardware acceleration.
 This option is on by default, but it may be necessary to turn it off if
 there are bugs in the driver.
 There are many options to disable specific accelerated operations, listed
@@ -1920,73 +1919,6 @@ Disables MTRR (Memory Type Range Register) support, a feature of modern
 processors which can improve video performance by a factor of up to 2.5.
 Some hardware has buggy MTRR support, and some video drivers have been
 known to exhibit problems when MTRR's are used.
-.TP 7
-.BI "Option \*qXaaNoCPUToScreenColorExpandFill\*q"
-Disables accelerated rectangular expansion blits from source patterns
-stored in system memory (using a memory\-mapped aperture).
-.TP 7
-.BI "Option \*qXaaNoColor8x8PatternFillRect\*q"
-Disables accelerated fills of a rectangular region with a full\-color
-pattern.
-.TP 7
-.BI "Option \*qXaaNoColor8x8PatternFillTrap\*q"
-Disables accelerated fills of a trapezoidal region with a full\-color
-pattern.
-.TP 7
-.BI "Option \*qXaaNoDashedBresenhamLine\*q"
-Disables accelerated dashed Bresenham line draws.
-.TP 7
-.BI "Option \*qXaaNoDashedTwoPointLine\*q"
-Disables accelerated dashed line draws between two arbitrary points.
-.TP 7
-.BI "Option \*qXaaNoImageWriteRect\*q"
-Disables accelerated transfers of full\-color rectangular patterns from
-system memory to video memory (using a memory\-mapped aperture).
-.TP 7
-.BI "Option \*qXaaNoMono8x8PatternFillRect\*q"
-Disables accelerated fills of a rectangular region with a monochrome
-pattern.
-.TP 7
-.BI "Option \*qXaaNoMono8x8PatternFillTrap\*q"
-Disables accelerated fills of a trapezoidal region with a monochrome
-pattern.
-.TP 7
-.BI "Option \*qXaaNoOffscreenPixmaps\*q"
-Disables accelerated draws into pixmaps stored in offscreen video memory.
-.TP 7
-.BI "Option \*qXaaNoPixmapCache\*q"
-Disables caching of patterns in offscreen video memory.
-.TP 7
-.BI "Option \*qXaaNoScanlineCPUToScreenColorExpandFill\*q"
-Disables accelerated rectangular expansion blits from source patterns
-stored in system memory (one scan line at a time).
-.TP 7
-.BI "Option \*qXaaNoScanlineImageWriteRect\*q"
-Disables accelerated transfers of full\-color rectangular patterns from
-system memory to video memory (one scan line at a time).
-.TP 7
-.BI "Option \*qXaaNoScreenToScreenColorExpandFill\*q"
-Disables accelerated rectangular expansion blits from source patterns
-stored in offscreen video memory.
-.TP 7
-.BI "Option \*qXaaNoScreenToScreenCopy\*q"
-Disables accelerated copies of rectangular regions from one part of
-video memory to another part of video memory.
-.TP 7
-.BI "Option \*qXaaNoSolidBresenhamLine\*q"
-Disables accelerated solid Bresenham line draws.
-.TP 7
-.BI "Option \*qXaaNoSolidFillRect\*q"
-Disables accelerated solid\-color fills of rectangles.
-.TP 7
-.BI "Option \*qXaaNoSolidFillTrap\*q"
-Disables accelerated solid\-color fills of Bresenham trapezoids.
-.TP 7
-.BI "Option \*qXaaNoSolidHorVertLine\*q"
-Disables accelerated solid horizontal and vertical line draws.
-.TP 7
-.BI "Option \*qXaaNoSolidTwoPointLine\*q"
-Disables accelerated solid line draws between two arbitrary points.
 .PP
 Each
 .B Screen
@@ -2070,7 +2002,7 @@ formats.
 This may also be specified from the command line with the
 .B \-weight
 option (see
-.BR __xservername__(__appmansuffix__)).
+.BR Xorg(__appmansuffix__)).
 .TP 7
 .BI "Virtual  " "xdim ydim"
 This optional entry specifies the virtual screen resolution to be used.
@@ -2414,7 +2346,7 @@ The data therein is not used in this release.
 General:
 .BR X (__miscmansuffix__),
 .BR Xserver (__appmansuffix__),
-.BR __xservername__ (__appmansuffix__),
+.BR Xorg (__appmansuffix__),
 .BR cvt (__appmansuffix__),
 .BR gtf (__appmansuffix__).
 .PP
index 6d5e92f..1947c5b 100644 (file)
@@ -44,7 +44,9 @@
 #include "X11/Xatom.h"
 #include "picturestr.h"
 
+#ifdef XV
 #include "xf86xv.h"
+#endif
 
 #define NO_OUTPUT_DEFAULT_WIDTH 1024
 #define NO_OUTPUT_DEFAULT_HEIGHT 768
@@ -180,7 +182,7 @@ xf86CrtcSetScreenSubpixelOrder(ScreenPtr pScreen)
 {
     int subpixel_order = SubPixelUnknown;
     Bool has_none = FALSE;
-    ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     int c, o;
 
@@ -696,7 +698,7 @@ xf86OutputDestroy(xf86OutputPtr output)
 static Bool
 xf86CrtcCreateScreenResources(ScreenPtr screen)
 {
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
 
     screen->CreateScreenResources = config->CreateScreenResources;
@@ -714,9 +716,9 @@ xf86CrtcCreateScreenResources(ScreenPtr screen)
  * Clean up config on server reset
  */
 static Bool
-xf86CrtcCloseScreen(int index, ScreenPtr screen)
+xf86CrtcCloseScreen(ScreenPtr screen)
 {
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
     int o, c;
 
@@ -724,6 +726,12 @@ xf86CrtcCloseScreen(int index, ScreenPtr screen)
 
     xf86RotateCloseScreen(screen);
 
+    xf86RandR12CloseScreen(screen);
+
+    free(config->name);
+
+    screen->CloseScreen(screen);
+
     for (o = 0; o < config->num_output; o++) {
         xf86OutputPtr output = config->output[o];
 
@@ -734,9 +742,20 @@ xf86CrtcCloseScreen(int index, ScreenPtr screen)
 
         crtc->randr_crtc = NULL;
     }
-    xf86RandR12CloseScreen(screen);
-
-    return screen->CloseScreen(index, screen);
+    /* detach any providers */
+    if (config->randr_provider) {
+        if (config->randr_provider->offload_sink) {
+            DetachOffloadGPU(screen);
+            config->randr_provider->offload_sink = NULL;
+        }
+        else if (config->randr_provider->output_source) {
+            DetachOutputGPU(screen);
+            config->randr_provider->output_source = NULL;
+        }
+        else if (screen->current_master)
+            DetachUnboundGPU(screen);
+    }
+    return TRUE;
 }
 
 /*
@@ -749,7 +768,7 @@ Bool
 #endif
 xf86CrtcScreenInit(ScreenPtr screen)
 {
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
     int c;
 
@@ -2054,12 +2073,13 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
 
     /*
      * If there's no preferred mode, but only one monitor, pick the
-     * biggest mode for its aspect ratio, assuming one exists.
+     * biggest mode for its aspect ratio or 4:3, assuming one exists.
      */
     if (!ret)
         do {
             int i = 0;
             float aspect = 0.0;
+            DisplayModePtr a = NULL, b = NULL;
 
             /* count the number of enabled outputs */
             for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++);
@@ -2073,8 +2093,11 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
                 aspect = (float) config->output[p]->mm_width /
                     (float) config->output[p]->mm_height;
 
+            a = bestModeForAspect(config, enabled, 4.0/3.0);
             if (aspect)
-                preferred_match[p] = bestModeForAspect(config, enabled, aspect);
+                b = bestModeForAspect(config, enabled, aspect);
+
+            preferred_match[p] = biggestMode(a, b);
 
             if (preferred_match[p])
                 ret = TRUE;
@@ -2434,7 +2457,7 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
         xf86CrtcPtr crtc = crtcs[o];
 
         if (mode && crtc) {
-            crtc->desiredMode = *mode;
+            xf86SaveModeContents(&crtc->desiredMode, mode);
             crtc->desiredRotation = output->initial_rotation;
             crtc->desiredX = output->initial_x;
             crtc->desiredY = output->initial_y;
@@ -2618,7 +2641,7 @@ xf86SetDesiredModes(ScrnInfoPtr scrn)
 
             if (!mode)
                 return FALSE;
-            crtc->desiredMode = *mode;
+            xf86SaveModeContents(&crtc->desiredMode, mode);
             crtc->desiredRotation = RR_Rotate_0;
             crtc->desiredTransformPresent = FALSE;
             crtc->desiredX = 0;
@@ -2757,7 +2780,7 @@ xf86SetSingleMode(ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation)
         if (!xf86CrtcSetModeTransform(crtc, crtc_mode, rotation, NULL, 0, 0))
             ok = FALSE;
         else {
-            crtc->desiredMode = *crtc_mode;
+            xf86SaveModeContents(&crtc->desiredMode, crtc_mode);
             crtc->desiredRotation = rotation;
             crtc->desiredTransformPresent = FALSE;
             crtc->desiredX = 0;
@@ -2821,7 +2844,7 @@ xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags)
 Bool
 xf86SaveScreen(ScreenPtr pScreen, int mode)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
     if (xf86IsUnblank(mode))
         xf86DPMSSet(pScrn, DPMSModeOn, 0);
@@ -3007,7 +3030,7 @@ xf86OutputGetEDID(xf86OutputPtr output, I2CBusPtr pDDCBus)
     ScrnInfoPtr scrn = output->scrn;
     xf86MonPtr mon;
 
-    mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE);
+    mon = xf86DoEEDID(scrn, pDDCBus, TRUE);
     if (mon)
         xf86DDCApplyQuirks(scrn->scrnIndex, mon);
 
@@ -3149,7 +3172,7 @@ xf86_crtc_notify_proc_ptr
 xf86_wrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr new)
 {
     if (xf86CrtcConfigPrivateIndex != -1) {
-        ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+        ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
         xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
         xf86_crtc_notify_proc_ptr old;
 
@@ -3164,7 +3187,7 @@ void
 xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old)
 {
     if (xf86CrtcConfigPrivateIndex != -1) {
-        ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+        ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
         xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
 
         config->xf86_crtc_notify = old;
@@ -3174,7 +3197,7 @@ xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old)
 void
 xf86_crtc_notify(ScreenPtr screen)
 {
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
 
     if (config->xf86_crtc_notify)
@@ -3200,3 +3223,40 @@ xf86_crtc_supports_gamma(ScrnInfoPtr pScrn)
 
     return FALSE;
 }
+
+void
+xf86ProviderSetup(ScrnInfoPtr scrn,
+                  const xf86ProviderFuncsRec *funcs, const char *name)
+{
+    xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+
+    assert(!xf86_config->name);
+    assert(name);
+
+    xf86_config->name = strdup(name);
+    xf86_config->provider_funcs = funcs;
+#ifdef RANDR_12_INTERFACE
+    xf86_config->randr_provider = NULL;
+#endif
+}
+
+void
+xf86DetachAllCrtc(ScrnInfoPtr scrn)
+{
+        xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+        int i;
+
+        for (i = 0; i < xf86_config->num_crtc; i++) {
+            xf86CrtcPtr crtc = xf86_config->crtc[i];
+
+            if (crtc->randr_crtc)
+                RRCrtcDetachScanoutPixmap(crtc->randr_crtc);
+
+            /* dpms off */
+            (*crtc->funcs->dpms) (crtc, DPMSModeOff);
+            /* force a reset the next time its used */
+            crtc->randr_crtc->mode = NULL;
+            crtc->mode.HDisplay = 0;
+            crtc->x = crtc->y = 0;
+        }
+}
index a6a3c2e..802303f 100644 (file)
@@ -218,9 +218,14 @@ typedef struct _xf86CrtcFuncs {
     void
      (*set_origin) (xf86CrtcPtr crtc, int x, int y);
 
+    /**
+     */
+    Bool
+    (*set_scanout_pixmap)(xf86CrtcPtr crtc, PixmapPtr pixmap);
+
 } xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
 
-#define XF86_CRTC_VERSION 4
+#define XF86_CRTC_VERSION 5
 
 struct _xf86Crtc {
     /**
@@ -371,6 +376,10 @@ struct _xf86Crtc {
      * Added in ABI version 4
      */
     Bool driverIsPerformingTransform;
+
+    /* Added in ABI version 5
+     */
+    PixmapPtr current_scanout;
 };
 
 typedef struct _xf86OutputFuncs {
@@ -607,6 +616,29 @@ struct _xf86Output {
     INT16 initialBorder[4];
 };
 
+typedef struct _xf86ProviderFuncs {
+    /**
+     * Called to allow the provider a chance to create properties after the
+     * RandR objects have been created.
+     */
+    void
+    (*create_resources) (ScrnInfoPtr scrn);
+
+    /**
+     * Callback when an provider's property has changed.
+     */
+    Bool
+    (*set_property) (ScrnInfoPtr scrn,
+                     Atom property, RRPropertyValuePtr value);
+
+    /**
+     * Callback to get an updated property value
+     */
+    Bool
+    (*get_property) (ScrnInfoPtr provider, Atom property);
+
+} xf86ProviderFuncsRec, *xf86ProviderFuncsPtr;
+
 typedef struct _xf86CrtcConfigFuncs {
     /**
      * Requests that the driver resize the screen.
@@ -681,6 +713,13 @@ typedef struct _xf86CrtcConfig {
     /* callback when crtc configuration changes */
     xf86_crtc_notify_proc_ptr xf86_crtc_notify;
 
+    char *name;
+    const xf86ProviderFuncsRec *provider_funcs;
+#ifdef RANDR_12_INTERFACE
+    RRProviderPtr randr_provider;
+#else
+    void *randr_provider;
+#endif
 } xf86CrtcConfigRec, *xf86CrtcConfigPtr;
 
 extern _X_EXPORT int xf86CrtcConfigPrivateIndex;
@@ -975,4 +1014,11 @@ extern _X_EXPORT void
 extern _X_EXPORT Bool
  xf86_crtc_supports_gamma(ScrnInfoPtr pScrn);
 
+extern _X_EXPORT void
+xf86ProviderSetup(ScrnInfoPtr scrn,
+                  const xf86ProviderFuncsRec * funcs, const char *name);
+
+extern _X_EXPORT void
+xf86DetachAllCrtc(ScrnInfoPtr scrn);
+
 #endif                          /* _XF86CRTC_H_ */
index 95a7892..634ee3f 100644 (file)
@@ -477,7 +477,7 @@ xf86_load_cursor_image(ScrnInfoPtr scrn, unsigned char *src)
 static Bool
 xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor)
 {
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
 
@@ -496,7 +496,7 @@ xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor)
 static Bool
 xf86_use_hw_cursor_argb(ScreenPtr screen, CursorPtr cursor)
 {
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
 
@@ -564,7 +564,7 @@ xf86_load_cursor_argb(ScrnInfoPtr scrn, CursorPtr cursor)
 Bool
 xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags)
 {
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     xf86CursorInfoPtr cursor_info;
 
@@ -631,7 +631,7 @@ xf86_reload_cursors(ScreenPtr screen)
     if (!cursor_screen_priv || !cursor_screen_priv->isUp)
         return;
 
-    scrn = xf86Screens[screen->myNum];
+    scrn = xf86ScreenToScrn(screen);
     xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
 
     /* make sure the cursor code has been initialized */
@@ -667,7 +667,7 @@ xf86_reload_cursors(ScreenPtr screen)
 void
 xf86_cursors_fini(ScreenPtr screen)
 {
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
 
     if (xf86_config->cursor_info) {
index fafd95a..3f1a330 100644 (file)
@@ -41,7 +41,7 @@
 static Bool
 xf86_dga_get_modes(ScreenPtr pScreen)
 {
-    ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     DGAModePtr modes, mode;
     DisplayModePtr display_mode;
@@ -137,7 +137,7 @@ xf86_dga_get_viewport(ScrnInfoPtr scrn)
 static void
 xf86_dga_set_viewport(ScrnInfoPtr scrn, int x, int y, int flags)
 {
-    scrn->AdjustFrame(scrn->pScreen->myNum, x, y, flags);
+    scrn->AdjustFrame(scrn, x, y);
 }
 
 static Bool
@@ -175,10 +175,10 @@ xf86DiDGAReInit(ScreenPtr pScreen)
 Bool
 _xf86_di_dga_reinit_internal(ScreenPtr pScreen)
 {
-    ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
 
-    if (!DGAAvailable(pScreen->myNum))
+    if (!DGAScreenAvailable(pScreen))
         return TRUE;
 
     if (!xf86_dga_get_modes(pScreen))
@@ -197,7 +197,7 @@ xf86DiDGAInit(ScreenPtr pScreen, unsigned long dga_address)
 Bool
 _xf86_di_dga_init_internal(ScreenPtr pScreen)
 {
-    ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
 
     xf86_config->dga_flags = 0;
index 781c806..bead126 100644 (file)
@@ -184,105 +184,96 @@ static const struct did_dmt {
     short w, h, r, f;
 } did_dmt[] = {
     /* byte 3 */
-    {
-    640, 350, 85, 0}, {
-    640, 400, 85, 0}, {
-    720, 400, 85, 0}, {
-    640, 480, 60, 0}, {
-    640, 480, 72, 0}, {
-    640, 480, 75, 0}, {
-    640, 480, 85, 0}, {
-    800, 600, 56, 0},
+    {640, 350, 85, 0},
+    {640, 400, 85, 0},
+    {720, 400, 85, 0},
+    {640, 480, 60, 0},
+    {640, 480, 72, 0},
+    {640, 480, 75, 0},
+    {640, 480, 85, 0},
+    {800, 600, 56, 0},
         /* byte 4 */
-    {
-    800, 600, 60, 0}, {
-    800, 600, 72, 0}, {
-    800, 600, 75, 0}, {
-    800, 600, 85, 0}, {
-    800, 600, 120, RB}, {
-    848, 480, 60, 0}, {
-    1024, 768, 43, INT}, {
-    1024, 768, 60, 0},
+    {800, 600, 60, 0},
+    {800, 600, 72, 0},
+    {800, 600, 75, 0},
+    {800, 600, 85, 0},
+    {800, 600, 120, RB},
+    {848, 480, 60, 0},
+    {1024, 768, 43, INT},
+    {1024, 768, 60, 0},
         /* byte 5 */
-    {
-    1024, 768, 70, 0}, {
-    1024, 768, 75, 0}, {
-    1024, 768, 85, 0}, {
-    1024, 768, 120, RB}, {
-    1152, 864, 75, 0}, {
-    1280, 768, 60, RB}, {
-    1280, 768, 60, 0}, {
-    1280, 768, 75, 0},
+    {1024, 768, 70, 0},
+    {1024, 768, 75, 0},
+    {1024, 768, 85, 0},
+    {1024, 768, 120, RB},
+    {1152, 864, 75, 0},
+    {1280, 768, 60, RB},
+    {1280, 768, 60, 0},
+    {1280, 768, 75, 0},
         /* byte 6 */
-    {
-    1280, 768, 85, 0}, {
-    1280, 768, 120, RB}, {
-    1280, 800, 60, RB}, {
-    1280, 800, 60, 0}, {
-    1280, 800, 75, 0}, {
-    1280, 800, 85, 0}, {
-    1280, 800, 120, RB}, {
-    1280, 960, 60, 0},
+    {1280, 768, 85, 0},
+    {1280, 768, 120, RB},
+    {1280, 800, 60, RB},
+    {1280, 800, 60, 0},
+    {1280, 800, 75, 0},
+    {1280, 800, 85, 0},
+    {1280, 800, 120, RB},
+    {1280, 960, 60, 0},
         /* byte 7 */
-    {
-    1280, 960, 85, 0}, {
-    1280, 960, 120, RB}, {
-    1280, 1024, 60, 0}, {
-    1280, 1024, 75, 0}, {
-    1280, 1024, 85, 0}, {
-    1280, 1024, 120, RB}, {
-    1360, 768, 60, 0}, {
-    1360, 768, 120, RB},
+    {1280, 960, 85, 0},
+    {1280, 960, 120, RB},
+    {1280, 1024, 60, 0},
+    {1280, 1024, 75, 0},
+    {1280, 1024, 85, 0},
+    {1280, 1024, 120, RB},
+    {1360, 768, 60, 0},
+    {1360, 768, 120, RB},
         /* byte 8 */
-    {
-    1400, 1050, 60, RB}, {
-    1400, 1050, 60, 0}, {
-    1400, 1050, 75, 0}, {
-    1400, 1050, 85, 0}, {
-    1400, 1050, 120, RB}, {
-    1440, 900, 60, RB}, {
-    1440, 900, 60, 0}, {
-    1440, 900, 75, 0},
+    {1400, 1050, 60, RB},
+    {1400, 1050, 60, 0},
+    {1400, 1050, 75, 0},
+    {1400, 1050, 85, 0},
+    {1400, 1050, 120, RB},
+    {1440, 900, 60, RB},
+    {1440, 900, 60, 0},
+    {1440, 900, 75, 0},
         /* byte 9 */
-    {
-    1440, 900, 85, 0}, {
-    1440, 900, 120, RB}, {
-    1600, 1200, 60, 0}, {
-    1600, 1200, 65, 0}, {
-    1600, 1200, 70, 0}, {
-    1600, 1200, 75, 0}, {
-    1600, 1200, 85, 0}, {
-    1600, 1200, 120, RB},
+    {1440, 900, 85, 0},
+    {1440, 900, 120, RB},
+    {1600, 1200, 60, 0},
+    {1600, 1200, 65, 0},
+    {1600, 1200, 70, 0},
+    {1600, 1200, 75, 0},
+    {1600, 1200, 85, 0},
+    {1600, 1200, 120, RB},
         /* byte a */
-    {
-    1680, 1050, 60, RB}, {
-    1680, 1050, 60, 0}, {
-    1680, 1050, 75, 0}, {
-    1680, 1050, 85, 0}, {
-    1680, 1050, 120, RB}, {
-    1792, 1344, 60, 0}, {
-    1792, 1344, 75, 0}, {
-    1792, 1344, 120, RB},
+    {1680, 1050, 60, RB},
+    {1680, 1050, 60, 0},
+    {1680, 1050, 75, 0},
+    {1680, 1050, 85, 0},
+    {1680, 1050, 120, RB},
+    {1792, 1344, 60, 0},
+    {1792, 1344, 75, 0},
+    {1792, 1344, 120, RB},
         /* byte b */
-    {
-    1856, 1392, 60, 0}, {
-    1856, 1392, 75, 0}, {
-    1856, 1392, 120, RB}, {
-    1920, 1200, 60, RB}, {
-    1920, 1200, 60, 0}, {
-    1920, 1200, 75, 0}, {
-    1920, 1200, 85, 0}, {
-    1920, 1200, 120, RB},
+    {1856, 1392, 60, 0},
+    {1856, 1392, 75, 0},
+    {1856, 1392, 120, RB},
+    {1920, 1200, 60, RB},
+    {1920, 1200, 60, 0},
+    {1920, 1200, 75, 0},
+    {1920, 1200, 85, 0},
+    {1920, 1200, 120, RB},
         /* byte c */
-    {
-    1920, 1440, 60, 0}, {
-    1920, 1440, 75, 0}, {
-    1920, 1440, 120, RB}, {
-    2560, 1600, 60, RB}, {
-    2560, 1600, 60, 0}, {
-    2560, 1600, 75, 0}, {
-    2560, 1600, 85, 0}, {
-2560, 1600, 120, RB},};
+    {1920, 1440, 60, 0},
+    {1920, 1440, 75, 0},
+    {1920, 1440, 120, RB},
+    {2560, 1600, 60, RB},
+    {2560, 1600, 60, 0},
+    {2560, 1600, 75, 0},
+    {2560, 1600, 85, 0},
+    {2560, 1600, 120, RB},
+};
 
 static void
 didVesaTiming(int scrn, unsigned char *x, MonPtr mon)
index 8aa82d1..4ee862d 100644 (file)
@@ -513,14 +513,14 @@ DDCModeDoInterlaceQuirks(DisplayModePtr mode)
     static const struct {
         int w, h;
     } cea_interlaced[] = {
-        {
-        1920, 1080}, {
-        720, 480}, {
-        1440, 480}, {
-        2880, 480}, {
-        720, 576}, {
-        1440, 576}, {
-    2880, 576},};
+        {1920, 1080},
+        {720, 480},
+        {1440, 480},
+        {2880, 480},
+        {720, 576},
+        {1440, 576},
+        {2880, 576},
+    };
     static const int n_modes =
         sizeof(cea_interlaced) / sizeof(cea_interlaced[0]);
     int i;
@@ -668,62 +668,62 @@ static const struct {
     short r;
     short rb;
 } EstIIIModes[] = {
-    /* byte 6 */
-    {
-    640, 350, 85, 0}, {
-    640, 400, 85, 0}, {
-    720, 400, 85, 0}, {
-    640, 480, 85, 0}, {
-    848, 480, 60, 0}, {
-    800, 600, 85, 0}, {
-    1024, 768, 85, 0}, {
-    1152, 864, 75, 0},
+        /* byte 6 */
+    {640, 350, 85, 0},
+    {640, 400, 85, 0},
+    {720, 400, 85, 0},
+    {640, 480, 85, 0},
+    {848, 480, 60, 0},
+    {800, 600, 85, 0},
+    {1024, 768, 85, 0},
+    {1152, 864, 75, 0},
         /* byte 7 */
-    {
-    1280, 768, 60, 1}, {
-    1280, 768, 60, 0}, {
-    1280, 768, 75, 0}, {
-    1280, 768, 85, 0}, {
-    1280, 960, 60, 0}, {
-    1280, 960, 85, 0}, {
-    1280, 1024, 60, 0}, {
-    1280, 1024, 85, 0},
+    {1280, 768, 60, 1},
+    {1280, 768, 60, 0},
+    {1280, 768, 75, 0},
+    {1280, 768, 85, 0},
+    {1280, 960, 60, 0},
+    {1280, 960, 85, 0},
+    {1280, 1024, 60, 0},
+    {1280, 1024, 85, 0},
         /* byte 8 */
-    {
-    1360, 768, 60, 0}, {
-    1440, 900, 60, 1}, {
-    1440, 900, 60, 0}, {
-    1440, 900, 75, 0}, {
-    1440, 900, 85, 0}, {
-    1400, 1050, 60, 1}, {
-    1400, 1050, 60, 0}, {
-    1400, 1050, 75, 0},
+    {1360, 768, 60, 0},
+    {1440, 900, 60, 1},
+    {1440, 900, 60, 0},
+    {1440, 900, 75, 0},
+    {1440, 900, 85, 0},
+    {1400, 1050, 60, 1},
+    {1400, 1050, 60, 0},
+    {1400, 1050, 75, 0},
         /* byte 9 */
-    {
-    1400, 1050, 85, 0}, {
-    1680, 1050, 60, 1}, {
-    1680, 1050, 60, 0}, {
-    1680, 1050, 75, 0}, {
-    1680, 1050, 85, 0}, {
-    1600, 1200, 60, 0}, {
-    1600, 1200, 65, 0}, {
-    1600, 1200, 70, 0},
+    {1400, 1050, 85, 0},
+    {1680, 1050, 60, 1},
+    {1680, 1050, 60, 0},
+    {1680, 1050, 75, 0},
+    {1680, 1050, 85, 0},
+    {1600, 1200, 60, 0},
+    {1600, 1200, 65, 0},
+    {1600, 1200, 70, 0},
         /* byte 10 */
-    {
-    1600, 1200, 75, 0}, {
-    1600, 1200, 85, 0}, {
-    1792, 1344, 60, 0}, {
-    1792, 1344, 85, 0}, {
-    1856, 1392, 60, 0}, {
-    1856, 1392, 75, 0}, {
-    1920, 1200, 60, 1}, {
-    1920, 1200, 60, 0},
+    {1600, 1200, 75, 0},
+    {1600, 1200, 85, 0},
+    {1792, 1344, 60, 0},
+    {1792, 1344, 85, 0},
+    {1856, 1392, 60, 0},
+    {1856, 1392, 75, 0},
+    {1920, 1200, 60, 1},
+    {1920, 1200, 60, 0},
         /* byte 11 */
-    {
-    1920, 1200, 75, 0}, {
-    1920, 1200, 85, 0}, {
-    1920, 1440, 60, 0}, {
-1920, 1440, 75, 0},};
+    {1920, 1200, 75, 0},
+    {1920, 1200, 85, 0},
+    {1920, 1440, 60, 0},
+    {1920, 1440, 75, 0},
+        /* fill up last byte */
+    {0,0,0,0},
+    {0,0,0,0},
+    {0,0,0,0},
+    {0,0,0,0},
+};
 
 static DisplayModePtr
 DDCModesFromEstIII(unsigned char *est)
@@ -732,10 +732,11 @@ DDCModesFromEstIII(unsigned char *est)
     int i, j, m;
 
     for (i = 0; i < 6; i++) {
-        for (j = 7; j > 0; j--) {
+        for (j = 7; j >= 0; j--) {
             if (est[i] & (1 << j)) {
                 m = (i * 8) + (7 - j);
-                modes = xf86ModesAdd(modes,
+                if (EstIIIModes[m].w)
+                    modes = xf86ModesAdd(modes,
                                      FindDMTMode(EstIIIModes[m].w,
                                                  EstIIIModes[m].h,
                                                  EstIIIModes[m].r,
index 2a6d267..c4a3eb0 100644 (file)
@@ -191,6 +191,21 @@ xf86SetModeCrtc(DisplayModePtr p, int adjustFlags)
 }
 
 /**
+ * Fills in a copy of mode, removing all stale pointer references.
+ * xf86ModesEqual will return true when comparing with original mode.
+ */
+void
+xf86SaveModeContents(DisplayModePtr intern, const DisplayModeRec *mode)
+{
+    *intern = *mode;
+    intern->prev = intern->next = NULL;
+    intern->name = NULL;
+    intern->PrivSize = 0;
+    intern->PrivFlags = 0;
+    intern->Private = NULL;
+}
+
+/**
  * Allocates and returns a copy of pMode, including pointers within pMode.
  */
 DisplayModePtr
index a773c34..3530abf 100644 (file)
@@ -60,6 +60,9 @@ typedef struct _xf86RandR12Info {
      * See https://bugs.freedesktop.org/show_bug.cgi?id=21554
      */
     xf86EnterVTProc *orig_EnterVT;
+
+    Bool                         panning;
+    ConstrainCursorHarderProcPtr orig_ConstrainCursorHarder;
 } XF86RandRInfoRec, *XF86RandRInfoPtr;
 
 #ifdef RANDR_12_INTERFACE
@@ -447,7 +450,7 @@ static Bool
 xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations)
 {
     RRScreenSizePtr pSize;
-    ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
     DisplayModePtr mode;
     int refresh0 = 60;
@@ -504,7 +507,7 @@ xf86RandR12SetMode(ScreenPtr pScreen,
                    DisplayModePtr mode,
                    Bool useVirtual, int mmWidth, int mmHeight)
 {
-    ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
     int oldWidth = pScreen->width;
     int oldHeight = pScreen->height;
@@ -515,7 +518,7 @@ xf86RandR12SetMode(ScreenPtr pScreen,
     Bool ret = TRUE;
 
     if (pRoot)
-        (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE);
+        (*scrp->EnableDisableFBAccess) (scrp, FALSE);
     if (useVirtual) {
         scrp->virtualX = randrp->virtualX;
         scrp->virtualY = randrp->virtualY;
@@ -568,7 +571,7 @@ xf86RandR12SetMode(ScreenPtr pScreen,
     xf86SetViewport(pScreen, pScreen->width, pScreen->height);
     xf86SetViewport(pScreen, 0, 0);
     if (pRoot)
-        (*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE);
+        (*scrp->EnableDisableFBAccess) (scrp, TRUE);
     return ret;
 }
 
@@ -576,7 +579,7 @@ Bool
 xf86RandR12SetConfig(ScreenPtr pScreen,
                      Rotation rotation, int rate, RRScreenSizePtr pSize)
 {
-    ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
     DisplayModePtr mode;
     int pos[MAXDEVICES][2];
@@ -665,17 +668,22 @@ xf86RandR12SetConfig(ScreenPtr pScreen,
     return TRUE;
 }
 
+#define PANNING_ENABLED(crtc)                                           \
+    ((crtc)->panningTotalArea.x2 > (crtc)->panningTotalArea.x1 ||       \
+     (crtc)->panningTotalArea.y2 > (crtc)->panningTotalArea.y1)
+
 static Bool
 xf86RandR12ScreenSetSize(ScreenPtr pScreen,
                          CARD16 width,
                          CARD16 height, CARD32 mmWidth, CARD32 mmHeight)
 {
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
-    ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
     WindowPtr pRoot = pScreen->root;
     PixmapPtr pScrnPix;
     Bool ret = FALSE;
+    Bool panning = FALSE;
     int c;
 
     if (xf86RandR12Key) {
@@ -685,7 +693,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen,
         }
     }
     if (pRoot && pScrn->vtSema)
-        (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
+        (*pScrn->EnableDisableFBAccess) (pScrn, FALSE);
 
     /* Let the driver update virtualX and virtualY */
     if (!(*config->funcs->resize) (pScrn, width, height))
@@ -696,8 +704,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen,
     for (c = 0; c < config->num_crtc; c++) {
         xf86CrtcPtr crtc = config->crtc[c];
 
-        if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1 ||
-            crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
+       if (PANNING_ENABLED (crtc)) {
             if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1)
                 crtc->panningTotalArea.x2 += width - pScreen->width;
             if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1)
@@ -708,6 +715,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen,
                 crtc->panningTrackingArea.y2 += height - pScreen->height;
             xf86RandR13VerifyPanningArea(crtc, width, height);
             xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
+           panning = TRUE;
         }
     }
 
@@ -724,7 +732,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen,
     update_desktop_dimensions();
 
     if (pRoot && pScrn->vtSema)
-        (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
+        (*pScrn->EnableDisableFBAccess) (pScrn, TRUE);
 #if RANDR_12_INTERFACE
     if (xf86RandR12Key && pScreen->root && ret)
         RRScreenSizeNotify(pScreen);
@@ -743,7 +751,7 @@ xf86RandR12GetRotation(ScreenPtr pScreen)
 Bool
 xf86RandR12CreateScreenResources(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr config;
     XF86RandRInfoPtr randrp;
     int c;
@@ -902,7 +910,8 @@ xf86RandR12CloseScreen(ScreenPtr pScreen)
 
     randrp = XF86RANDRINFO(pScreen);
 #if RANDR_12_INTERFACE
-    xf86Screens[pScreen->myNum]->EnterVT = randrp->orig_EnterVT;
+    xf86ScreenToScrn(pScreen)->EnterVT = randrp->orig_EnterVT;
+    pScreen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder;
 #endif
 
     free(randrp);
@@ -914,7 +923,7 @@ xf86RandR12SetRotations(ScreenPtr pScreen, Rotation rotations)
     XF86RandRInfoPtr randrp;
 
 #if RANDR_12_INTERFACE
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     int c;
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
 #endif
@@ -939,7 +948,7 @@ xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms)
     XF86RandRInfoPtr randrp;
 
 #if RANDR_13_INTERFACE
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     int c;
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
 #endif
@@ -960,7 +969,7 @@ xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms)
 void
 xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y)
 {
-    ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
 
     if (xf86RandR12Generation != serverGeneration ||
         XF86RANDRINFO(pScreen)->virtualX == -1) {
@@ -1041,7 +1050,7 @@ static Bool
 xf86RandR12CrtcNotify(RRCrtcPtr randr_crtc)
 {
     ScreenPtr pScreen = randr_crtc->pScreen;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
     RRModePtr randr_mode = NULL;
     int x;
@@ -1136,7 +1145,7 @@ xf86RandR12CrtcSet(ScreenPtr pScreen,
                    int num_randr_outputs, RROutputPtr * randr_outputs)
 {
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
     xf86CrtcPtr crtc = randr_crtc->devPrivate;
     RRTransformPtr transform;
@@ -1157,6 +1166,9 @@ xf86RandR12CrtcSet(ScreenPtr pScreen,
     if (rotation != crtc->rotation)
         changed = TRUE;
 
+    if (crtc->current_scanout != randr_crtc->scanout_pixmap)
+        changed = TRUE;
+
     transform = RRCrtcGetTransform(randr_crtc);
     if ((transform != NULL) != crtc->transformPresent)
         changed = TRUE;
@@ -1213,11 +1225,13 @@ xf86RandR12CrtcSet(ScreenPtr pScreen,
             }
             xf86RandR13VerifyPanningArea(crtc, pScreen->width, pScreen->height);
             xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
+            randrp->panning = PANNING_ENABLED (crtc);
             /*
              * Save the last successful setting for EnterVT
              */
-            crtc->desiredMode = mode;
+            xf86SaveModeContents(&crtc->desiredMode, &mode);
             crtc->desiredRotation = rotation;
+            crtc->current_scanout = randr_crtc->scanout_pixmap;
             if (transform) {
                 crtc->desiredTransform = *transform;
                 crtc->desiredTransformPresent = TRUE;
@@ -1349,7 +1363,7 @@ static Bool
 xf86RandR12OutputValidateMode(ScreenPtr pScreen,
                               RROutputPtr randr_output, RRModePtr randr_mode)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86OutputPtr output = randr_output->devPrivate;
     DisplayModeRec mode;
 
@@ -1434,7 +1448,7 @@ xf86RROutputSetModes(RROutputPtr randr_output, DisplayModePtr modes)
 static Bool
 xf86RandR12SetInfo12(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
     RROutputPtr *clones;
     RRCrtcPtr *crtcs;
@@ -1510,7 +1524,7 @@ xf86RandR12SetInfo12(ScreenPtr pScreen)
 static Bool
 xf86RandR12GetInfo12(ScreenPtr pScreen, Rotation * rotations)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
     if (!pScrn->vtSema)
         return TRUE;
@@ -1522,7 +1536,7 @@ xf86RandR12GetInfo12(ScreenPtr pScreen, Rotation * rotations)
 static Bool
 xf86RandR12CreateObjects12(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
     int c;
     int o;
@@ -1552,6 +1566,14 @@ xf86RandR12CreateObjects12(ScreenPtr pScreen)
             output->funcs->create_resources(output);
         RRPostPendingProperties(output->randr_output);
     }
+
+    if (config->name) {
+        config->randr_provider = RRProviderCreate(pScreen, config->name,
+                                                  strlen(config->name));
+
+        RRProviderSetCapabilities(config->randr_provider, pScrn->capabilities);
+    }
+
     return TRUE;
 }
 
@@ -1559,7 +1581,7 @@ static Bool
 xf86RandR12CreateScreenResources12(ScreenPtr pScreen)
 {
     int c;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
 
     if (xf86RandR12Key == NULL)
@@ -1581,7 +1603,7 @@ xf86RandR12CreateScreenResources12(ScreenPtr pScreen)
 void
 xf86RandR12TellChanged(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
     int c;
 
@@ -1596,10 +1618,9 @@ xf86RandR12TellChanged(ScreenPtr pScreen)
 }
 
 static void
-xf86RandR12PointerMoved(int scrnIndex, int x, int y)
+xf86RandR12PointerMoved(ScrnInfoPtr pScrn, int x, int y)
 {
-    ScreenPtr pScreen = screenInfo.screens[scrnIndex];
-    ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
     int c;
@@ -1639,6 +1660,7 @@ xf86RandR13SetPanning(ScreenPtr pScreen,
     BoxRec oldTotalArea;
     BoxRec oldTrackingArea;
     INT16 oldBorder[4];
+    Bool oldPanning = randrp->panning;
 
     if (crtc->version < 2)
         return FALSE;
@@ -1656,6 +1678,7 @@ xf86RandR13SetPanning(ScreenPtr pScreen,
 
     if (xf86RandR13VerifyPanningArea(crtc, pScreen->width, pScreen->height)) {
         xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
+        randrp->panning = PANNING_ENABLED (crtc);
         return TRUE;
     }
     else {
@@ -1663,6 +1686,7 @@ xf86RandR13SetPanning(ScreenPtr pScreen,
         memcpy(&crtc->panningTotalArea, &oldTotalArea, sizeof(BoxRec));
         memcpy(&crtc->panningTrackingArea, &oldTrackingArea, sizeof(BoxRec));
         memcpy(crtc->panningBorder, oldBorder, 4 * sizeof(INT16));
+        randrp->panning = oldPanning;
         return FALSE;
     }
 }
@@ -1679,19 +1703,18 @@ gamma_to_ramp(float gamma, CARD16 *ramp, int size)
 
     for (i = 0; i < size; i++) {
         if (gamma == 1.0)
-            ramp[i] = i << 8;
+            ramp[i] = i | i << 8;
         else
             ramp[i] =
                 (CARD16) (pow((double) i / (double) (size - 1), 1. / gamma)
-                          * (double) (size - 1) * 256);
+                          * (double) (size - 1) * 257);
     }
 }
 
 static int
-xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma)
+xf86RandR12ChangeGamma(ScrnInfoPtr pScrn, Gamma gamma)
 {
     CARD16 *points, *red, *green, *blue;
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn);
     int size;
 
@@ -1723,10 +1746,9 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma)
 }
 
 static Bool
-xf86RandR12EnterVT(int screen_index, int flags)
+xf86RandR12EnterVT(ScrnInfoPtr pScrn)
 {
-    ScreenPtr pScreen = screenInfo.screens[screen_index];
-    ScrnInfoPtr pScrn = xf86Screens[screen_index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
     rrScrPrivPtr rp = rrGetScrPriv(pScreen);
     Bool ret;
@@ -1734,7 +1756,7 @@ xf86RandR12EnterVT(int screen_index, int flags)
 
     if (randrp->orig_EnterVT) {
         pScrn->EnterVT = randrp->orig_EnterVT;
-        ret = pScrn->EnterVT(screen_index, flags);
+        ret = pScrn->EnterVT(pScrn);
         randrp->orig_EnterVT = pScrn->EnterVT;
         pScrn->EnterVT = xf86RandR12EnterVT;
         if (!ret)
@@ -1749,9 +1771,124 @@ xf86RandR12EnterVT(int screen_index, int flags)
 }
 
 static Bool
+xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen,
+                                   RRProviderPtr provider,
+                                   RRProviderPtr source_provider)
+{
+    if (!source_provider) {
+        if (provider->output_source) {
+            ScreenPtr cmScreen = pScreen->current_master;
+
+            DetachOutputGPU(pScreen);
+            AttachUnboundGPU(cmScreen, pScreen);
+        }
+        provider->output_source = NULL;
+        return TRUE;
+    }
+
+    if (provider->output_source == source_provider)
+        return TRUE;
+
+    SetRootClip(source_provider->pScreen, FALSE);
+
+    DetachUnboundGPU(pScreen);
+    AttachOutputGPU(source_provider->pScreen, pScreen);
+
+    provider->output_source = source_provider;
+    SetRootClip(source_provider->pScreen, TRUE);
+    return TRUE;
+}
+
+static Bool
+xf86RandR14ProviderSetOffloadSink(ScreenPtr pScreen,
+                                  RRProviderPtr provider,
+                                  RRProviderPtr sink_provider)
+{
+    if (!sink_provider) {
+        if (provider->offload_sink) {
+            ScreenPtr cmScreen = pScreen->current_master;
+            DetachOutputGPU(pScreen);
+            AttachUnboundGPU(cmScreen, pScreen);
+        }
+
+        provider->offload_sink = NULL;
+        return TRUE;
+    }
+
+    if (provider->offload_sink == sink_provider)
+        return TRUE;
+
+    DetachUnboundGPU(pScreen);
+    AttachOffloadGPU(sink_provider->pScreen, pScreen);
+
+    provider->offload_sink = sink_provider;
+    return TRUE;
+}
+
+static Bool
+xf86RandR14ProviderSetProperty(ScreenPtr pScreen,
+                             RRProviderPtr randr_provider,
+                             Atom property, RRPropertyValuePtr value)
+{
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+    xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+
+    /* If we don't have any property handler, then we don't care what the
+     * user is setting properties to.
+     */
+    if (config->provider_funcs->set_property == NULL)
+        return TRUE;
+
+    /*
+     * This function gets called even when vtSema is FALSE, as
+     * drivers will need to remember the correct value to apply
+     * when the VT switch occurs
+     */
+    return config->provider_funcs->set_property(pScrn, property, value);
+}
+
+static Bool
+xf86RandR14ProviderGetProperty(ScreenPtr pScreen,
+                               RRProviderPtr randr_provider, Atom property)
+{
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+    xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+
+    if (config->provider_funcs->get_property == NULL)
+        return TRUE;
+
+    /* Should be safe even w/o vtSema */
+    return config->provider_funcs->get_property(pScrn, property);
+}
+
+static Bool
+xf86CrtcSetScanoutPixmap(RRCrtcPtr randr_crtc, PixmapPtr pixmap)
+{
+    xf86CrtcPtr crtc = randr_crtc->devPrivate;
+    if (!crtc->funcs->set_scanout_pixmap)
+        return FALSE;
+    return crtc->funcs->set_scanout_pixmap(crtc, pixmap);
+}
+
+static void
+xf86RandR13ConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, int *x, int *y)
+{
+    XF86RandRInfoPtr randrp = XF86RANDRINFO(screen);
+
+    if (randrp->panning)
+        return;
+
+    if (randrp->orig_ConstrainCursorHarder) {
+        screen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder;
+        screen->ConstrainCursorHarder(dev, screen, mode, x, y);
+        screen->ConstrainCursorHarder = xf86RandR13ConstrainCursorHarder;
+    }
+}
+
+static Bool
 xf86RandR12Init12(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     rrScrPrivPtr rp = rrGetScrPriv(pScreen);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
     int i;
@@ -1770,12 +1907,24 @@ xf86RandR12Init12(ScreenPtr pScreen)
 #endif
     rp->rrModeDestroy = xf86RandR12ModeDestroy;
     rp->rrSetConfig = NULL;
+
+    rp->rrProviderSetOutputSource = xf86RandR14ProviderSetOutputSource;
+    rp->rrProviderSetOffloadSink = xf86RandR14ProviderSetOffloadSink;
+
+    rp->rrProviderSetProperty = xf86RandR14ProviderSetProperty;
+    rp->rrProviderGetProperty = xf86RandR14ProviderGetProperty;
+    rp->rrCrtcSetScanoutPixmap = xf86CrtcSetScanoutPixmap;
+
     pScrn->PointerMoved = xf86RandR12PointerMoved;
     pScrn->ChangeGamma = xf86RandR12ChangeGamma;
 
     randrp->orig_EnterVT = pScrn->EnterVT;
     pScrn->EnterVT = xf86RandR12EnterVT;
 
+    randrp->panning = FALSE;
+    randrp->orig_ConstrainCursorHarder = pScreen->ConstrainCursorHarder;
+    pScreen->ConstrainCursorHarder = xf86RandR13ConstrainCursorHarder;
+
     if (!xf86RandR12CreateObjects12(pScreen))
         return FALSE;
 
index cbc8687..a393747 100644 (file)
 
 /* borrowed from composite extension, move to Render and publish? */
 
-static VisualPtr
-compGetWindowVisual(WindowPtr pWin)
-{
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-    VisualID vid = wVisual(pWin);
-    int i;
-
-    for (i = 0; i < pScreen->numVisuals; i++)
-        if (pScreen->visuals[i].vid == vid)
-            return &pScreen->visuals[i];
-    return 0;
-}
-
-static PictFormatPtr
-compWindowFormat(WindowPtr pWin)
-{
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-
-    return PictureMatchVisual(pScreen, pWin->drawable.depth,
-                              compGetWindowVisual(pWin));
-}
-
 #define F(x)   IntToxFixed(x)
 
 #define toF(x) ((float) (x) / 65536.0f)
@@ -79,7 +57,7 @@ xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region)
     ScreenPtr screen = scrn->pScreen;
     WindowPtr root = screen->root;
     PixmapPtr dst_pixmap = crtc->rotatedPixmap;
-    PictFormatPtr format = compWindowFormat(screen->root);
+    PictFormatPtr format = PictureWindowFormat(screen->root);
     int error;
     PicturePtr src, dst;
     int n = RegionNumRects(region);
@@ -144,7 +122,7 @@ xf86CrtcDamageShadow(xf86CrtcPtr crtc)
     ScrnInfoPtr pScrn = crtc->scrn;
     BoxRec damage_box;
     RegionRec damage_region;
-    ScreenPtr pScreen = pScrn->pScreen;
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
 
     damage_box.x1 = 0;
     damage_box.x2 = crtc->mode.HDisplay;
@@ -174,7 +152,7 @@ xf86CrtcDamageShadow(xf86CrtcPtr crtc)
 static void
 xf86RotatePrepare(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
     int c;
 
@@ -204,7 +182,7 @@ xf86RotatePrepare(ScreenPtr pScreen)
 static Bool
 xf86RotateRedisplay(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
     DamagePtr damage = xf86_config->rotation_damage;
     RegionPtr region;
@@ -250,17 +228,16 @@ xf86RotateRedisplay(ScreenPtr pScreen)
 }
 
 static void
-xf86RotateBlockHandler(int screenNum, pointer blockData,
+xf86RotateBlockHandler(ScreenPtr pScreen,
                        pointer pTimeout, pointer pReadmask)
 {
-    ScreenPtr pScreen = screenInfo.screens[screenNum];
-    ScrnInfoPtr pScrn = xf86Screens[screenNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
     Bool rotation_active;
 
     rotation_active = xf86RotateRedisplay(pScreen);
     pScreen->BlockHandler = xf86_config->BlockHandler;
-    (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
+    (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
     /* cannot avoid re-wrapping until all wrapping is audited */
     xf86_config->BlockHandler = pScreen->BlockHandler;
     pScreen->BlockHandler = xf86RotateBlockHandler;
@@ -270,7 +247,7 @@ void
 xf86RotateDestroy(xf86CrtcPtr crtc)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
-    ScreenPtr pScreen = pScrn->pScreen;
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
     int c;
 
@@ -328,7 +305,7 @@ xf86RotateFreeShadow(ScrnInfoPtr pScrn)
 void
 xf86RotateCloseScreen(ScreenPtr screen)
 {
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     int c;
 
@@ -345,6 +322,12 @@ xf86CrtcFitsScreen(xf86CrtcPtr crtc, struct pict_f_transform *crtc_to_fb)
     /* When called before PreInit, the driver is
      * presumably doing load detect
      */
+    if (pScrn->is_gpu) {
+       ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
+       if (pScreen->current_master)
+           pScrn = xf86ScreenToScrn(pScreen->current_master);
+    }
+
     if (pScrn->virtualX == 0 || pScrn->virtualY == 0)
         return TRUE;
 
@@ -370,9 +353,7 @@ xf86CrtcRotate(xf86CrtcPtr crtc)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-
-    /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
-    ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     PictTransform crtc_to_fb;
     struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc;
     xFixed *new_params = NULL;
index a8a4164..b1938cf 100644 (file)
@@ -21,21 +21,19 @@ static struct {
     u_int apmBsd;
     pmEvent xf86;
 } bsdToXF86Array[] = {
-    {
-    APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, {
-    APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, {
-    APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, {
-    APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, {
-    APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, {
-    APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, {
-    APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, {
-    APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, {
-    APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, {
-    APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, {
-    APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME},
+    {APM_STANDBY_REQ, XF86_APM_SYS_STANDBY},
+    {APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND},
+    {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME},
+    {APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME},
+    {APM_BATTERY_LOW, XF86_APM_LOW_BATTERY},
+    {APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE},
+    {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME},
+    {APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND},
+    {APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY},
+    {APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND},
+    {APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME},
 #ifdef APM_CAPABILITY_CHANGE
-    {
-    APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED},
+    {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED},
 #endif
 };
 
index 10251f3..2294385 100644 (file)
@@ -54,21 +54,19 @@ static struct {
     u_int apmBsd;
     pmEvent xf86;
 } bsdToXF86Array[] = {
-    {
-    APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, {
-    APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, {
-    APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, {
-    APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, {
-    APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, {
-    APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, {
-    APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, {
-    APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, {
-    APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, {
-    APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, {
-    APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME},
+    {APM_STANDBY_REQ, XF86_APM_SYS_STANDBY},
+    {APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND},
+    {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME},
+    {APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME},
+    {APM_BATTERY_LOW, XF86_APM_LOW_BATTERY},
+    {APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE},
+    {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME},
+    {APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND},
+    {APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY},
+    {APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND},
+    {APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME},
 #ifdef APM_CAPABILITY_CHANGE
-    {
-    APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED},
+    {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED},
 #endif
 };
 
index b75308a..8260007 100644 (file)
@@ -403,16 +403,16 @@ sparcPromAssignNodes(void)
             int devId;
             char *prefix;
         } procFbPrefixes[] = {
-            {
-            SBUS_DEVICE_BW2, "BWtwo"}, {
-            SBUS_DEVICE_CG14, "CGfourteen"}, {
-            SBUS_DEVICE_CG6, "CGsix"}, {
-            SBUS_DEVICE_CG3, "CGthree"}, {
-            SBUS_DEVICE_FFB, "Creator"}, {
-            SBUS_DEVICE_FFB, "Elite 3D"}, {
-            SBUS_DEVICE_LEO, "Leo"}, {
-            SBUS_DEVICE_TCX, "TCX"}, {
-        0, NULL},};
+            {SBUS_DEVICE_BW2, "BWtwo"},
+            {SBUS_DEVICE_CG14, "CGfourteen"},
+            {SBUS_DEVICE_CG6, "CGsix"},
+            {SBUS_DEVICE_CG3, "CGthree"},
+            {SBUS_DEVICE_FFB, "Creator"},
+            {SBUS_DEVICE_FFB, "Elite 3D"},
+            {SBUS_DEVICE_LEO, "Leo"},
+            {SBUS_DEVICE_TCX, "TCX"},
+            {0, NULL},
+        };
 
         while (fscanf(f, "%d %63s\n", &fbNum, buffer) == 2) {
             for (i = 0; procFbPrefixes[i].devId; i++)
index 36748df..61175b3 100644 (file)
@@ -22,7 +22,7 @@ XORG_CFLAGS += -DHAVE_APM
 endif
 
 liblinux_la_SOURCES = lnx_init.c lnx_video.c \
-                     lnx_agp.c lnx_kmod.c lnx_bell.c \
+                     lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \
                      $(srcdir)/../shared/bios_mmap.c \
                     $(srcdir)/../shared/VTsw_usl.c \
                     $(srcdir)/../shared/posix_tty.c \
index fa58a72..8bca375 100644 (file)
@@ -52,7 +52,6 @@ typedef struct {
     int highMem;
     char *base;
     char *base_high;
-    int screen;
     char *alloc;
 } linuxInt10Priv;
 
@@ -89,15 +88,16 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
     memType cs;
     legacyVGARec vga;
     Bool videoBiosMapped = FALSE;
-
+    ScrnInfoPtr pScrn;
     if (int10Generation != serverGeneration) {
         counter = 0;
         int10Generation = serverGeneration;
     }
 
-    screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
+    pScrn = xf86FindScreenForEntity(entityIndex);
+    screen = pScrn->scrnIndex;
 
-    options = xf86HandleInt10Options(xf86Screens[screen], entityIndex);
+    options = xf86HandleInt10Options(pScrn, entityIndex);
 
     if (int10skip(options)) {
         free(options);
@@ -106,7 +106,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
 
 #if defined DoSubModules
     if (loadedSubModule == INT10_NOT_LOADED)
-        loadedSubModule = int10LinuxLoadSubModule(xf86Screens[screen]);
+        loadedSubModule = int10LinuxLoadSubModule(pScrn);
 
     if (loadedSubModule == INT10_LOAD_FAILED)
         return NULL;
@@ -145,7 +145,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
     }
 
     pInt = (xf86Int10InfoPtr) xnfcalloc(1, sizeof(xf86Int10InfoRec));
-    pInt->scrnIndex = screen;
+    pInt->pScrn = pScrn;
     pInt->entityIndex = entityIndex;
     pInt->dev = xf86GetPciInfoForEntity(entityIndex);
 
@@ -154,7 +154,6 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
     pInt->mem = &linuxMem;
     pagesize = getpagesize();
     pInt->private = (pointer) xnfcalloc(1, sizeof(linuxInt10Priv));
-    ((linuxInt10Priv *) pInt->private)->screen = screen;
     ((linuxInt10Priv *) pInt->private)->alloc =
         (pointer) xnfcalloc(1, ALLOC_ENTRIES(pagesize));
 
@@ -333,28 +332,28 @@ MapCurrentInt10(xf86Int10InfoPtr pInt)
     addr =
         shmat(((linuxInt10Priv *) pInt->private)->lowMem, (char *) 1, SHM_RND);
     if (addr == SHMERRORPTR) {
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot shmat() low memory\n");
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot shmat() low memory\n");
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR,
                    "shmat(low_mem) error: %s\n", strerror(errno));
         return FALSE;
     }
     if (mprotect((void *) 0, V_RAM, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR,
                    "Cannot set EXEC bit on low memory: %s\n", strerror(errno));
 
     if (((linuxInt10Priv *) pInt->private)->highMem >= 0) {
         addr = shmat(((linuxInt10Priv *) pInt->private)->highMem,
                      (char *) HIGH_MEM, 0);
         if (addr == SHMERRORPTR) {
-            xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+            xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR,
                        "Cannot shmat() high memory\n");
-            xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+            xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR,
                        "shmget error: %s\n", strerror(errno));
             return FALSE;
         }
         if (mprotect((void *) HIGH_MEM, HIGH_MEM_SIZE,
                      PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
-            xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+            xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR,
                        "Cannot set EXEC bit on high memory: %s\n",
                        strerror(errno));
     }
@@ -364,13 +363,13 @@ MapCurrentInt10(xf86Int10InfoPtr pInt)
                      PROT_READ | PROT_WRITE | PROT_EXEC,
                      MAP_SHARED | MAP_FIXED, fd, V_BIOS)
                 == MAP_FAILED) {
-                xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot map V_BIOS\n");
+                xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot map V_BIOS\n");
                 close(fd);
                 return FALSE;
             }
         }
         else {
-            xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot open %s\n", DEV_MEM);
+            xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot open %s\n", DEV_MEM);
             return FALSE;
         }
         close(fd);
index 8502b21..1876983 100644 (file)
@@ -210,19 +210,19 @@ vm86_GP_fault(xf86Int10InfoPtr pInt)
         return FALSE;
 
     case 0x0f:
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR,
                    "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8lx\n", X86_CS,
                    X86_EIP);
         goto op0ferr;
 
     default:
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown reason for exception\n");
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "unknown reason for exception\n");
 
  op0ferr:
         dump_registers(pInt);
         stack_trace(pInt);
         dump_code(pInt);
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR, "cannot continue\n");
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "cannot continue\n");
         return FALSE;
     }                           /* end of switch() */
     return TRUE;
@@ -238,7 +238,7 @@ do_vm86(xf86Int10InfoPtr pInt)
     xf86InterceptSignals(NULL);
 
     if (signo >= 0) {
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR,
                    "vm86() syscall generated signal %d.\n", signo);
         dump_registers(pInt);
         dump_code(pInt);
@@ -252,7 +252,7 @@ do_vm86(xf86Int10InfoPtr pInt)
             return 0;
         break;
     case VM86_STI:
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR, "vm86_sti :-((\n");
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "vm86_sti :-((\n");
         dump_registers(pInt);
         dump_code(pInt);
         stack_trace(pInt);
@@ -260,7 +260,7 @@ do_vm86(xf86Int10InfoPtr pInt)
     case VM86_INTx:
         pInt->num = VM86_ARG(retval);
         if (!int_handler(pInt)) {
-            xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+            xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR,
                        "Unknown vm86_int: 0x%X\n\n", VM86_ARG(retval));
             dump_registers(pInt);
             dump_code(pInt);
@@ -275,10 +275,10 @@ do_vm86(xf86Int10InfoPtr pInt)
          * we used to warn here and bail out - but now the sigio stuff
          * always fires signals at us. So we just ignore them for now.
          */
-        xf86DrvMsg(pInt->scrnIndex, X_WARNING, "received signal\n");
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_WARNING, "received signal\n");
         return 0;
     default:
-        xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n",
+        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n",
                    VM86_ARG(retval), VM86_TYPE(retval));
         dump_registers(pInt);
         dump_code(pInt);
index a37331e..3879340 100644 (file)
@@ -42,26 +42,23 @@ static struct {
     apm_event_t apmLinux;
     pmEvent xf86;
 } LinuxToXF86[] = {
-    {
-    APM_SYS_STANDBY, XF86_APM_SYS_STANDBY}, {
-    APM_SYS_SUSPEND, XF86_APM_SYS_SUSPEND}, {
-    APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, {
-    APM_CRITICAL_RESUME, XF86_APM_CRITICAL_RESUME}, {
-    APM_LOW_BATTERY, XF86_APM_LOW_BATTERY}, {
-    APM_POWER_STATUS_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, {
-    APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, {
-    APM_CRITICAL_SUSPEND, XF86_APM_CRITICAL_SUSPEND}, {
-    APM_USER_STANDBY, XF86_APM_USER_STANDBY}, {
-    APM_USER_SUSPEND, XF86_APM_USER_SUSPEND}, {
-    APM_STANDBY_RESUME, XF86_APM_STANDBY_RESUME},
+    {APM_SYS_STANDBY, XF86_APM_SYS_STANDBY},
+    {APM_SYS_SUSPEND, XF86_APM_SYS_SUSPEND},
+    {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME},
+    {APM_CRITICAL_RESUME, XF86_APM_CRITICAL_RESUME},
+    {APM_LOW_BATTERY, XF86_APM_LOW_BATTERY},
+    {APM_POWER_STATUS_CHANGE, XF86_APM_POWER_STATUS_CHANGE},
+    {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME},
+    {APM_CRITICAL_SUSPEND, XF86_APM_CRITICAL_SUSPEND},
+    {APM_USER_STANDBY, XF86_APM_USER_STANDBY},
+    {APM_USER_SUSPEND, XF86_APM_USER_SUSPEND},
+    {APM_STANDBY_RESUME, XF86_APM_STANDBY_RESUME},
 #if defined(APM_CAPABILITY_CHANGED)
-    {
-    APM_CAPABILITY_CHANGED, XF86_CAPABILITY_CHANGED},
+    {APM_CAPABILITY_CHANGED, XF86_CAPABILITY_CHANGED},
 #endif
 #if 0
-    {
-    APM_STANDBY_FAILED, XF86_APM_STANDBY_FAILED}, {
-    APM_SUSPEND_FAILED, XF86_APM_SUSPEND_FAILED}
+    {APM_STANDBY_FAILED, XF86_APM_STANDBY_FAILED},
+    {APM_SUSPEND_FAILED, XF86_APM_SUSPEND_FAILED}
 #endif
 };
 
index c938b87..68c296b 100644 (file)
@@ -238,9 +238,6 @@ xf86OpenConsole(void)
             cfsetispeed(&nTty, 9600);
             cfsetospeed(&nTty, 9600);
             tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
-
-            /* we really should have a InitOSInputDevices() function instead
-             * of Init?$#*&Device(). So I just place it here */
         }
     }
     else {                      /* serverGeneration != 1 */
diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c
new file mode 100644 (file)
index 0000000..76f5583
--- /dev/null
@@ -0,0 +1,179 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#ifdef XSERVER_PLATFORM_BUS
+
+#include <xf86drm.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+/* Linux platform device support */
+#include "xf86_OSproc.h"
+
+#include "xf86.h"
+#include "xf86platformBus.h"
+#include "xf86Bus.h"
+
+#include "hotplug.h"
+
+static Bool
+get_drm_info(struct OdevAttributes *attribs, char *path)
+{
+    drmSetVersion sv;
+    char *buf;
+    int fd;
+
+    fd = open(path, O_RDWR, O_CLOEXEC);
+    if (fd == -1)
+        return FALSE;
+
+    sv.drm_di_major = 1;
+    sv.drm_di_minor = 4;
+    sv.drm_dd_major = -1;       /* Don't care */
+    sv.drm_dd_minor = -1;       /* Don't care */
+    if (drmSetInterfaceVersion(fd, &sv)) {
+        ErrorF("setversion 1.4 failed\n");
+        return FALSE;
+    }
+
+    xf86_add_platform_device(attribs);
+
+    buf = drmGetBusid(fd);
+    xf86_add_platform_device_attrib(xf86_num_platform_devices - 1,
+                                    ODEV_ATTRIB_BUSID, buf);
+    drmFreeBusid(buf);
+    close(fd);
+    return TRUE;
+}
+
+Bool
+xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid)
+{
+    struct OdevAttribute *attrib;
+    const char *syspath = NULL;
+    BusType bustype;
+    const char *id;
+    xorg_list_for_each_entry(attrib, &device->attribs->list, member) {
+        if (attrib->attrib_id == ODEV_ATTRIB_SYSPATH) {
+            syspath = attrib->attrib_name;
+            break;
+        }
+    }
+
+    if (!syspath)
+        return FALSE;
+
+    bustype = StringToBusType(busid, &id);
+    if (bustype == BUS_PCI) {
+        struct pci_device *pPci = device->pdev;
+        if (xf86ComparePciBusString(busid,
+                                    ((pPci->domain << 8)
+                                     | pPci->bus),
+                                    pPci->dev, pPci->func)) {
+            return TRUE;
+        }
+    }
+    else if (bustype == BUS_PLATFORM) {
+        /* match on the minimum string */
+        int len = strlen(id);
+
+        if (strlen(syspath) < strlen(id))
+            len = strlen(syspath);
+
+        if (strncmp(id, syspath, len))
+            return FALSE;
+        return TRUE;
+    }
+    return FALSE;
+}
+
+void
+xf86PlatformDeviceProbe(struct OdevAttributes *attribs)
+{
+    struct OdevAttribute *attrib;
+    int i;
+    char *path = NULL;
+    Bool ret;
+
+    xorg_list_for_each_entry(attrib, &attribs->list, member) {
+        if (attrib->attrib_id == ODEV_ATTRIB_PATH) {
+            path = attrib->attrib_name;
+            break;
+        }
+    }
+    if (!path)
+        goto out_free;
+
+    for (i = 0; i < xf86_num_platform_devices; i++) {
+        char *dpath;
+        dpath = xf86_get_platform_attrib(i, ODEV_ATTRIB_PATH);
+
+        if (!strcmp(path, dpath))
+            break;
+    }
+
+    if (i != xf86_num_platform_devices)
+        goto out_free;
+
+    LogMessage(X_INFO, "config/udev: Adding drm device (%s)\n",
+               path);
+
+    ret = get_drm_info(attribs, path);
+    if (ret == FALSE)
+        goto out_free;
+
+    return;
+
+out_free:
+    config_odev_free_attribute_list(attribs);
+}
+
+void NewGPUDeviceRequest(struct OdevAttributes *attribs)
+{
+    int old_num = xf86_num_platform_devices;
+    int ret;
+    xf86PlatformDeviceProbe(attribs);
+
+    if (old_num == xf86_num_platform_devices)
+        return;
+
+    ret = xf86platformAddDevice(xf86_num_platform_devices-1);
+    if (ret == -1)
+        xf86_remove_platform_device(xf86_num_platform_devices-1);
+
+    ErrorF("xf86: found device %d\n", xf86_num_platform_devices);
+    return;
+}
+
+void DeleteGPUDeviceRequest(struct OdevAttributes *attribs)
+{
+    struct OdevAttribute *attrib;
+    int index;
+    char *syspath = NULL;
+
+    xorg_list_for_each_entry(attrib, &attribs->list, member) {
+        if (attrib->attrib_id == ODEV_ATTRIB_SYSPATH) {
+            syspath = attrib->attrib_name;
+            break;
+        }
+    }
+
+    for (index = 0; index < xf86_num_platform_devices; index++) {
+        char *dspath;
+        dspath = xf86_get_platform_attrib(index, ODEV_ATTRIB_SYSPATH);
+        if (!strcmp(syspath, dspath))
+            break;
+    }
+
+    if (index == xf86_num_platform_devices)
+        goto out;
+
+    ErrorF("xf86: remove device %d %s\n", index, syspath);
+
+    xf86platformRemoveDevice(index);
+out:
+    config_odev_free_attribute_list(attribs);
+}
+
+#endif
diff --git a/hw/xfree86/os-support/shared/platform_noop.c b/hw/xfree86/os-support/shared/platform_noop.c
new file mode 100644 (file)
index 0000000..199ae5e
--- /dev/null
@@ -0,0 +1,23 @@
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#ifdef XSERVER_PLATFORM_BUS
+/* noop platform device support */
+#include "xf86_OSproc.h"
+
+#include "xf86.h"
+#include "xf86platformBus.h"
+
+Bool
+xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid)
+{
+    return FALSE;
+}
+
+void xf86PlatformDeviceProbe(struct OdevAttributes *attribs)
+{
+
+}
+#endif
index 12ae8a4..f3c153b 100644 (file)
@@ -99,6 +99,8 @@ xf86SIGIO(int sig)
     int save_errno = errno;     /* do not clobber the global errno */
     int r;
 
+    inSignalContext = TRUE;
+
     ready = xf86SigIOMask;
     to.tv_sec = 0;
     to.tv_usec = 0;
@@ -114,6 +116,8 @@ xf86SIGIO(int sig)
     }
     /* restore global errno */
     errno = save_errno;
+
+    inSignalContext = FALSE;
 }
 
 static int
@@ -132,7 +136,6 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
     struct sigaction sa;
     struct sigaction osa;
     int i;
-    int blocked;
     int installed = FALSE;
 
     if (!xf86Info.useSIGIO)
@@ -142,7 +145,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
         if (!xf86SigIOFuncs[i].f) {
             if (xf86IsPipe(fd))
                 return 0;
-            blocked = xf86BlockSIGIO();
+            OsBlockSIGIO();
 #ifdef O_ASYNC
             if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
                 xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
@@ -170,7 +173,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
             }
 #endif
             if (!installed) {
-                xf86UnblockSIGIO(blocked);
+                OsReleaseSIGIO();
                 return 0;
             }
             sigemptyset(&sa.sa_mask);
@@ -186,7 +189,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
             if (fd >= xf86SigIOMaxFd)
                 xf86SigIOMaxFd = fd + 1;
             FD_SET(fd, &xf86SigIOMask);
-            xf86UnblockSIGIO(blocked);
+            OsReleaseSIGIO();
             return 1;
         }
         /* Allow overwriting of the closure and callback */
@@ -259,26 +262,13 @@ xf86RemoveSIGIOHandler(int fd)
 int
 xf86BlockSIGIO(void)
 {
-    sigset_t set, old;
-    int ret;
-
-    sigemptyset(&set);
-    sigaddset(&set, SIGIO);
-    sigprocmask(SIG_BLOCK, &set, &old);
-    ret = sigismember(&old, SIGIO);
-    return ret;
+    return OsBlockSIGIO();
 }
 
 void
 xf86UnblockSIGIO(int wasset)
 {
-    sigset_t set;
-
-    if (!wasset) {
-        sigemptyset(&set);
-        sigaddset(&set, SIGIO);
-        sigprocmask(SIG_UNBLOCK, &set, NULL);
-    }
+    OsReleaseSIGIO();
 }
 
 void
index a7717d8..514fc2f 100644 (file)
@@ -157,19 +157,6 @@ checkMtrrOption(VidMapPtr vp)
 }
 
 void
-xf86MakeNewMapping(int ScreenNum, int Flags, unsigned long Base,
-                   unsigned long Size, pointer Vbase)
-{
-    VidMapPtr vp;
-    MappingPtr mp;
-
-    vp = getVidMapRec(ScreenNum);
-    mp = newMapping(vp);
-    mp->size = Size;
-    mp->virtBase = Vbase;
-}
-
-void
 xf86InitVidMem(void)
 {
     if (!vidMemInfo.initialised) {
index 4ff6464..b6a1432 100644 (file)
@@ -97,21 +97,19 @@ static struct {
     u_int apmBsd;
     pmEvent xf86;
 } sunToXF86Array[] = {
-    {
-    APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, {
-    APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, {
-    APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, {
-    APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, {
-    APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, {
-    APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, {
-    APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, {
-    APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, {
-    APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, {
-    APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, {
-    APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME},
+    {APM_STANDBY_REQ, XF86_APM_SYS_STANDBY},
+    {APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND},
+    {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME},
+    {APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME},
+    {APM_BATTERY_LOW, XF86_APM_LOW_BATTERY},
+    {APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE},
+    {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME},
+    {APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND},
+    {APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY},
+    {APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND},
+    {APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME},
 #ifdef APM_CAPABILITY_CHANGE
-    {
-    APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED},
+    {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED},
 #endif
 };
 
index 9161e18..e931b09 100644 (file)
 /**************************************************************************/
 /* Linux or Glibc-based system                                            */
 /**************************************************************************/
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__CYGWIN__)
 #include <sys/ioctl.h>
 #include <signal.h>
 #include <stdlib.h>
index e171146..ea2b16e 100644 (file)
@@ -215,12 +215,16 @@ extern _X_EXPORT int xf86ProcessArgument(int, char **, int);
 extern _X_EXPORT void xf86UseMsg(void);
 extern _X_EXPORT PMClose xf86OSPMOpen(void);
 
-extern _X_EXPORT _X_DEPRECATED void xf86MakeNewMapping(int, int, unsigned long,
-                                                       unsigned long, pointer);
 extern _X_EXPORT void xf86InitVidMem(void);
 
 #endif                          /* XF86_OS_PRIVS */
 
+#ifdef XSERVER_PLATFORM_BUS
+#include "hotplug.h"
+void
+xf86PlatformDeviceProbe(struct OdevAttributes *attribs);
+#endif
+
 _XFUNCPROTOEND
 #endif                          /* NO_OSLIB_PROTOTYPES */
 #endif                          /* _XF86_OSPROC_H */
index f27b56f..bb1ba88 100644 (file)
@@ -52,8 +52,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index d8152c0..0d3e47a 100644 (file)
@@ -51,8 +51,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index 29a60a2..2461476 100644 (file)
@@ -51,8 +51,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index 6e00734..ff2b9ac 100644 (file)
@@ -52,8 +52,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index 8493685..de6a816 100644 (file)
@@ -23,8 +23,6 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index bd33d6d..cbd8d24 100644 (file)
@@ -52,8 +52,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index 1c458ae..87ddfc6 100644 (file)
@@ -52,8 +52,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index b237dfb..36b4ebe 100644 (file)
@@ -52,8 +52,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index cdbc09c..ff748d9 100644 (file)
@@ -52,8 +52,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index 71778d8..f294ec4 100644 (file)
@@ -52,8 +52,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index b4e2165..9b7695c 100644 (file)
@@ -52,8 +52,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index fc1f1e5..68d611a 100644 (file)
@@ -52,8 +52,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index eef873e..6545bcd 100644 (file)
@@ -52,8 +52,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index 795da61..f852b83 100644 (file)
@@ -51,8 +51,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index c001c3d..9c706a0 100644 (file)
@@ -51,8 +51,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-/* View/edit this file with tab stops set to 4 */
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
index 3c37805..346af4c 100644 (file)
@@ -1,19 +1,12 @@
 noinst_LTLIBRARIES = libramdac.la
 
 libramdac_la_SOURCES = xf86RamDac.c xf86RamDacCmap.c \
-                      xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c \
-                     xf86BitOrder.c
+                      xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c
 
 sdk_HEADERS = BT.h IBM.h TI.h xf86Cursor.h xf86RamDac.h
 
-DISTCLEANFILES = xf86BitOrder.c
 EXTRA_DIST = BTPriv.h IBMPriv.h TIPriv.h xf86CursorPriv.h xf86RamDacPriv.h \
        CURSOR.NOTES
 
-AM_CFLAGS = -DXAAReverseBitOrder=xf86ReverseBitOrder -DRAMDAC_MODULE \
-            $(DIX_CFLAGS) $(XORG_CFLAGS)
+AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
 INCLUDES = $(XORG_INCS)
-
-xf86BitOrder.c:
-       $(AM_V_GEN)echo "#define XAAReverseBitOrder xf86ReverseBitOrder" > $@
-       $(AM_V_GEN)echo "#include \"$(srcdir)/../xaa/xaaBitOrder.c\"" >> $@
diff --git a/hw/xfree86/ramdac/xf86BitOrder.c b/hw/xfree86/ramdac/xf86BitOrder.c
deleted file mode 100644 (file)
index 713934d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define XAAReverseBitOrder xf86ReverseBitOrder
-#include "./../xaa/xaaBitOrder.c"
index 678d2be..8d48a75 100644 (file)
@@ -43,19 +43,19 @@ static miPointerSpriteFuncRec xf86CursorSpriteFuncs = {
 static void xf86CursorInstallColormap(ColormapPtr);
 static void xf86CursorRecolorCursor(DeviceIntPtr pDev, ScreenPtr, CursorPtr,
                                     Bool);
-static Bool xf86CursorCloseScreen(int, ScreenPtr);
+static Bool xf86CursorCloseScreen(ScreenPtr);
 static void xf86CursorQueryBestSize(int, unsigned short *, unsigned short *,
                                     ScreenPtr);
 
 /* ScrnInfoRec functions */
 
-static void xf86CursorEnableDisableFBAccess(int, Bool);
-static Bool xf86CursorSwitchMode(int, DisplayModePtr, int);
+static void xf86CursorEnableDisableFBAccess(ScrnInfoPtr, Bool);
+static Bool xf86CursorSwitchMode(ScrnInfoPtr, DisplayModePtr);
 
 Bool
 xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CursorScreenPtr ScreenPriv;
     miPointerScreenPtr PointPriv;
 
@@ -118,9 +118,9 @@ xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
 /***** Screen functions *****/
 
 static Bool
-xf86CursorCloseScreen(int i, ScreenPtr pScreen)
+xf86CursorCloseScreen(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     miPointerScreenPtr PointPriv =
         (miPointerScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                               miPointerScreenKey);
@@ -149,7 +149,7 @@ xf86CursorCloseScreen(int i, ScreenPtr pScreen)
     free(ScreenPriv->transparentData);
     free(ScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
@@ -203,11 +203,11 @@ xf86CursorRecolorCursor(DeviceIntPtr pDev,
 /***** ScrnInfoRec functions *********/
 
 static void
-xf86CursorEnableDisableFBAccess(int index, Bool enable)
+xf86CursorEnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable)
 {
     DeviceIntPtr pDev = inputInfo.pointer;
 
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     xf86CursorScreenPtr ScreenPriv =
         (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                                xf86CursorScreenKey);
@@ -223,7 +223,7 @@ xf86CursorEnableDisableFBAccess(int index, Bool enable)
     }
 
     if (ScreenPriv->EnableDisableFBAccess)
-        (*ScreenPriv->EnableDisableFBAccess) (index, enable);
+        (*ScreenPriv->EnableDisableFBAccess) (pScrn, enable);
 
     if (enable && ScreenPriv->SavedCursor) {
         /*
@@ -237,10 +237,10 @@ xf86CursorEnableDisableFBAccess(int index, Bool enable)
 }
 
 static Bool
-xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
+xf86CursorSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
 {
     Bool ret;
-    ScreenPtr pScreen = screenInfo.screens[index];
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     xf86CursorScreenPtr ScreenPriv =
         (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                                xf86CursorScreenKey);
@@ -250,7 +250,7 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
         ScreenPriv->isUp = FALSE;
     }
 
-    ret = (*ScreenPriv->SwitchMode) (index, mode, flags);
+    ret = (*ScreenPriv->SwitchMode) (pScrn, mode);
 
     /*
      * Cannot restore cursor here because the new frame[XY][01] haven't been
@@ -336,28 +336,19 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
         if (!infoPtr->pScrn->vtSema)
             ScreenPriv->SavedCursor = pCurs;
 
-        if (infoPtr->pScrn->vtSema && (ScreenPriv->ForceHWCursorCount || ((
+        if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) &&
+            (ScreenPriv->ForceHWCursorCount ||
+             ((
 #ifdef ARGB_CURSOR
-                                                                              pCurs->
-                                                                              bits->
-                                                                              argb
-                                                                              &&
-                                                                              infoPtr->
-                                                                              UseHWCursorARGB
-                                                                              &&
-                                                                              (*infoPtr->
-                                                                               UseHWCursorARGB)
-                                                                              (pScreen,
-                                                                               pCurs))
-                                                                          ||
-                                                                          (pCurs->
-                                                                           bits->
-                                                                           argb
-                                                                           == 0
-                                                                           &&
+               pCurs->bits->argb &&
+               infoPtr->UseHWCursorARGB &&
+               (*infoPtr->UseHWCursorARGB)(pScreen, pCurs)) ||
+              (pCurs->bits->argb == 0 &&
 #endif
-                                                                           (pCurs->bits->height <= infoPtr->MaxHeight) && (pCurs->bits->width <= infoPtr->MaxWidth) && (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, pCurs)))))) {
-
+               (pCurs->bits->height <= infoPtr->MaxHeight) &&
+               (pCurs->bits->width <= infoPtr->MaxWidth) &&
+               (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, pCurs)))))) {
+            
             if (ScreenPriv->SWCursor)   /* remove the SW cursor */
                 (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen,
                                                        NullCursor, x, y);
index 062b2eb..04be141 100644 (file)
@@ -26,7 +26,7 @@ typedef struct {
     miPointerSpriteFuncPtr spriteFuncs;
     Bool PalettedCursor;
     ColormapPtr pInstalledMap;
-    Bool (*SwitchMode) (int, DisplayModePtr, int);
+    Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr);
     xf86EnableDisableFBAccessProc *EnableDisableFBAccess;
     CursorPtr SavedCursor;
 
@@ -43,8 +43,6 @@ void xf86MoveCursor(ScreenPtr pScreen, int x, int y);
 void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed);
 Bool xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr);
 
-CARD32 xf86ReverseBitOrder(CARD32 data);
-
 extern _X_EXPORT DevPrivateKeyRec xf86CursorScreenKeyRec;
 
 #define xf86CursorScreenKey (&xf86CursorScreenKeyRec)
index 9572149..197abff 100644 (file)
 
 #include "servermd.h"
 
+static CARD32
+xf86ReverseBitOrder(CARD32 v)
+{
+    return (((0x01010101 & v) << 7) | ((0x02020202 & v) << 5) |
+            ((0x04040404 & v) << 3) | ((0x08080808 & v) << 1) |
+            ((0x10101010 & v) >> 1) | ((0x20202020 & v) >> 3) |
+            ((0x40404040 & v) >> 5) | ((0x80808080 & v) >> 7));
+}
+
 #if BITMAP_SCANLINE_PAD == 64
 
 #if 1
@@ -105,7 +114,7 @@ xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
         infoPtr->RealizeCursor = RealizeCursorInterleave0;
     }
 
-    infoPtr->pScrn = xf86Screens[pScreen->myNum];
+    infoPtr->pScrn = xf86ScreenToScrn(pScreen);
 
     return TRUE;
 }
index 7a903d8..fa7a866 100644 (file)
@@ -59,7 +59,7 @@ Bool
 RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits,
                       unsigned int flags)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     RamDacRecPtr hwp = RAMDACSCRPTR(pScrn);
 
     if (hwp->LoadPalette == NULL)
index 40ea7c8..07372ad 100755 (executable)
@@ -46,10 +46,10 @@ cat > sdksyms.c << EOF
 #include "misyncstr.h"
 
 /* Xext/Makefile.am -- half is module, half is builtin */
-/*
+#ifdef XV
 #include "xvdix.h"
 #include "xvmcext.h"
- */
+#endif
 #include "geext.h"
 #include "geint.h"
 #ifdef MITSHM
@@ -95,11 +95,9 @@ cat > sdksyms.c << EOF
 
 
 /* hw/xfree86/dri2/Makefile.am -- module */
-/*
 #if DRI2
 # include "dri2.h"
 #endif
- */
 
 
 /* hw/xfree86/vgahw/Makefile.am -- module */
@@ -135,12 +133,9 @@ cat > sdksyms.c << EOF
 # include "xf86xvmc.h"
 # include "xf86xvpriv.h"
 #endif
-/* XF86VidMode code is in libextmod module */
-/*
 #if XF86VIDMODE
 # include "vidmodeproc.h"
 #endif
- */
 #include "xorgVersion.h"
 #if defined(__sparc__) || defined(__sparc)
 # include "xf86sbusBus.h"
@@ -181,18 +176,10 @@ cat > sdksyms.c << EOF
 #endif
 
 
-/* hw/xfree86/xaa/Makefile.am -- module */
-/*
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaarop.h"
- */
-
-
 /* hw/xfree86/dixmods/extmod/Makefile.am -- module */
-/*
+#ifdef XFreeXDGA
 #include "dgaproc.h"
- */
+#endif
 
 
 /* hw/xfree86/parser/Makefile.am */
@@ -208,13 +195,11 @@ cat > sdksyms.c << EOF
 
 
 /* hw/xfree86/dri/Makefile.am -- module */
-/*
 #if XF86DRI
 # include "dri.h"
 # include "sarea.h"
 # include "dristruct.h"
 #endif
- */
 
 
 /* mi/Makefile.am */
@@ -241,9 +226,9 @@ cat > sdksyms.c << EOF
 
 
 /* dbe/Makefile.am -- module */
-/*
+#ifdef DBE
 #include "dbestruct.h"
- */
+#endif
 
 
 /* exa/Makefile.am -- module */
@@ -251,6 +236,9 @@ cat > sdksyms.c << EOF
 #include "exa.h"
  */
 
+#ifdef COMPOSITE
+#include "compositeext.h"
+#endif
 
 /* xfixes/Makefile.am */
 #include "xfixes.h"
@@ -276,7 +264,6 @@ cat > sdksyms.c << EOF
 #include "dixstruct.h"
 #include "exevents.h"
 #include "extension.h"
-#include "extinit.h"
 #include "extnsionst.h"
 #include "gc.h"
 #include "gcstruct.h"
@@ -324,8 +311,8 @@ topdir=$1
 shift
 LC_ALL=C
 export LC_ALL
-${CPP:-cpp} "$@" -DXorgLoader sdksyms.c > /dev/null || exit $?
-${CPP:-cpp} "$@" -DXorgLoader sdksyms.c | ${AWK:-awk} -v topdir=$topdir '
+${CPP:-cpp} "$@" sdksyms.c > /dev/null || exit $?
+${CPP:-cpp} "$@" sdksyms.c | ${AWK:-awk} -v topdir=$topdir '
 BEGIN {
     sdk = 0;
     print("/*");
index 39c6610..5756fca 100644 (file)
@@ -1,6 +1,7 @@
 module_LTLIBRARIES = libshadowfb.la
-libshadowfb_la_LDFLAGS = -module -avoid-version
+libshadowfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libshadowfb_la_SOURCES = sfbmodule.c shadow.c
+libshadowfb_la_LIBADD = $(PIXMAN_LIBS)
 
 sdk_HEADERS = shadowfb.h
 
index 714dd14..6145017 100644 (file)
 
 #include "picturestr.h"
 
-static Bool ShadowCloseScreen(int i, ScreenPtr pScreen);
+static Bool ShadowCloseScreen(ScreenPtr pScreen);
 static void ShadowCopyWindow(WindowPtr pWin,
                              DDXPointRec ptOldOrg, RegionPtr prgn);
 static Bool ShadowCreateGC(GCPtr pGC);
 
-static Bool ShadowEnterVT(int index, int flags);
-static void ShadowLeaveVT(int index, int flags);
+static Bool ShadowEnterVT(ScrnInfoPtr pScrn);
+static void ShadowLeaveVT(ScrnInfoPtr pScrn);
 
 static void ShadowComposite(CARD8 op,
                             PicturePtr pSrc,
@@ -56,8 +56,8 @@ typedef struct {
     CreateGCProcPtr CreateGC;
     ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
     CompositeProcPtr Composite;
-    Bool (*EnterVT) (int, int);
-    void (*LeaveVT) (int, int);
+    Bool (*EnterVT) (ScrnInfoPtr);
+    void (*LeaveVT) (ScrnInfoPtr);
     Bool vtSema;
 } ShadowScreenRec, *ShadowScreenPtr;
 
@@ -136,7 +136,7 @@ ShadowFBInit2(ScreenPtr pScreen,
               RefreshAreaFuncPtr preRefreshArea,
               RefreshAreaFuncPtr postRefreshArea)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     ShadowScreenPtr pPriv;
     PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
 
@@ -192,14 +192,13 @@ ShadowFBInit(ScreenPtr pScreen, RefreshAreaFuncPtr refreshArea)
 /**********************************************************/
 
 static Bool
-ShadowEnterVT(int index, int flags)
+ShadowEnterVT(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[index];
     Bool ret;
     ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen);
 
     pScrn->EnterVT = pPriv->EnterVT;
-    ret = (*pPriv->EnterVT) (index, flags);
+    ret = (*pPriv->EnterVT) (pScrn);
     pPriv->EnterVT = pScrn->EnterVT;
     pScrn->EnterVT = ShadowEnterVT;
     if (ret) {
@@ -211,15 +210,14 @@ ShadowEnterVT(int index, int flags)
 }
 
 static void
-ShadowLeaveVT(int index, int flags)
+ShadowLeaveVT(ScrnInfoPtr pScrn)
 {
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(xf86Screens[index]->pScreen);
+    ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen);
 
     pPriv->vtSema = FALSE;
 
     pScrn->LeaveVT = pPriv->LeaveVT;
-    (*pPriv->LeaveVT) (index, flags);
+    (*pPriv->LeaveVT) (pScrn);
     pPriv->LeaveVT = pScrn->LeaveVT;
     pScrn->LeaveVT = ShadowLeaveVT;
 }
@@ -227,9 +225,9 @@ ShadowLeaveVT(int index, int flags)
 /**********************************************************/
 
 static Bool
-ShadowCloseScreen(int i, ScreenPtr pScreen)
+ShadowCloseScreen(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
     PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
 
@@ -247,7 +245,7 @@ ShadowCloseScreen(int i, ScreenPtr pScreen)
 
     free((pointer) pPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
index f5075f5..8d70ead 100644 (file)
@@ -12,15 +12,15 @@ cvt - calculate VESA CVT mode lines
 .I Cvt
 is a utility for calculating VESA Coordinated Video Timing modes.  Given the
 desired horizontal and vertical resolutions, a modeline adhering to the CVT
-standard is printed. This modeline can be included in __xservername__
-.B __xconfigfile__(__filemansuffix__)
+standard is printed. This modeline can be included in Xorg
+.B xorg.conf(__filemansuffix__)
 .
 
 .SH OPTIONS
 .TP 8
 .BR refresh
-Provide a vertical refresh rate in kHz.  The CVT standard prefers either 50.0,
-60.0, 75.0 or 85.0kHz.  The default is 60.0kHz.
+Provide a vertical refresh rate in Hz.  The CVT standard prefers either 50.0,
+60.0, 75.0 or 85.0Hz.  The default is 60.0Hz.
 .TP 8
 .BR \-v | \-\-verbose
 Warn verbosely when a given mode does not completely correspond with CVT
@@ -31,7 +31,7 @@ Create a mode with reduced blanking.  This allows for higher frequency signals,
 with a lower or equal dotclock. Not for Cathode Ray Tube based displays though.
 
 .SH "SEE ALSO"
-__xconfigfile__(__filemansuffix__), gtf(__appmansuffix__)
+xorg.conf(__filemansuffix__), gtf(__appmansuffix__)
 .SH AUTHOR
 Luc Verhaegen.
 .PP
index 8e83650..004d2f0 100644 (file)
@@ -14,8 +14,8 @@ gtf - calculate VESA GTF mode lines
 is a utility for calculating VESA GTF modes.  Given the desired
 horizontal and vertical resolutions and refresh rate (in Hz), the parameters
 for a matching VESA GTF mode are printed out.  Two output formats are
-supported: mode lines suitable for the __xservername__
-.B __xconfigfile__(__filemansuffix__)
+supported: mode lines suitable for the Xorg
+.B xorg.conf(__filemansuffix__)
 file, and mode parameters suitable for the Linux
 .B fbset(8)
 utility.
@@ -27,14 +27,14 @@ Enable verbose printouts  This shows a trace for each step of the
 computation.
 .TP 8
 .BR \-x | \-\-xorgmode
-Print the mode parameters as __xservername__-style mode lines.  This is the
+Print the mode parameters as Xorg-style mode lines.  This is the
 default format.
 .TP 8
 .BR \-f | \-\-fbset
 Print the mode parameters in a format suitable for
 .BR fbset(8) .
 .SH "SEE ALSO"
-__xconfigfile__(__filemansuffix__), cvt(__appmansuffix__)
+xorg.conf(__filemansuffix__), cvt(__appmansuffix__)
 .SH AUTHOR
 Andy Ritger.
 .PP
index 4b794e6..0b24faf 100644 (file)
@@ -1,6 +1,9 @@
 module_LTLIBRARIES = libvbe.la
-libvbe_la_LDFLAGS = -module -avoid-version
+libvbe_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libvbe_la_SOURCES = vbe.c vbeModes.c vbe_module.c
+if NO_UNDEFINED
+libvbe_la_LIBADD = ../int10/libint10.la
+endif
 
 sdk_HEADERS = vbe.h vbeModes.h
 
index bbb60e3..97a9bcf 100644 (file)
@@ -179,7 +179,7 @@ static Bool
 vbeProbeDDC(vbeInfoPtr pVbe)
 {
     const char *ddc_level;
-    int screen = pVbe->pInt10->scrnIndex;
+    int screen = pVbe->pInt10->pScrn->scrnIndex;
 
     if (pVbe->ddc == DDC_NONE)
         return FALSE;
@@ -262,7 +262,8 @@ vbeReadEDID(vbeInfoPtr pVbe)
     unsigned char *tmp = NULL;
     Bool novbe = FALSE;
     Bool noddc = FALSE;
-    int screen = pVbe->pInt10->scrnIndex;
+    ScrnInfoPtr pScrn = pVbe->pInt10->pScrn;
+    int screen = pScrn->scrnIndex;
     OptionInfoPtr options;
 
     if (!page)
@@ -270,7 +271,7 @@ vbeReadEDID(vbeInfoPtr pVbe)
 
     options = xnfalloc(sizeof(VBEOptions));
     (void) memcpy(options, VBEOptions, sizeof(VBEOptions));
-    xf86ProcessOptions(screen, xf86Screens[screen]->options, options);
+    xf86ProcessOptions(screen, pScrn->options, options);
     xf86GetOptValBool(options, VBEOPT_NOVBE, &novbe);
     xf86GetOptValBool(options, VBEOPT_NODDC, &noddc);
     free(options);
@@ -330,7 +331,7 @@ vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule)
 
     if (!(pModule = pDDCModule)) {
         pModule =
-            xf86LoadSubModule(xf86Screens[pVbe->pInt10->scrnIndex], "ddc");
+            xf86LoadSubModule(pVbe->pInt10->pScrn, "ddc");
         if (!pModule)
             return NULL;
     }
@@ -340,7 +341,7 @@ vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule)
     if (!DDC_data)
         return NULL;
 
-    pMonitor = xf86InterpretEDID(pVbe->pInt10->scrnIndex, DDC_data);
+    pMonitor = xf86InterpretEDID(pVbe->pInt10->pScrn->scrnIndex, DDC_data);
 
     if (!pDDCModule)
         xf86UnloadSubModule(pModule);
@@ -598,7 +599,7 @@ VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction function,
      */
 
     if ((pVbe->version & 0xff00) > 0x100) {
-        int screen = pVbe->pInt10->scrnIndex;
+        int screen = pVbe->pInt10->pScrn->scrnIndex;
 
         if (function == MODE_QUERY || (function == MODE_SAVE && !*memory)) {
             /* Query amount of memory to save state */
@@ -904,7 +905,7 @@ VBEBuildVbeModeList(vbeInfoPtr pVbe, VbeInfoBlock * vbe)
         m->n = id;
         m->next = ModeList;
 
-        xf86DrvMsgVerb(pVbe->pInt10->scrnIndex, X_PROBED, 3,
+        xf86DrvMsgVerb(pVbe->pInt10->pScrn->scrnIndex, X_PROBED, 3,
                        "BIOS reported VESA mode 0x%x: x:%i y:%i bpp:%i\n",
                        m->n, m->width, m->height, m->bpp);
 
@@ -1026,23 +1027,22 @@ VBEDPMSSet(vbeInfoPtr pVbe, int mode)
 }
 
 void
-VBEInterpretPanelID(int scrnIndex, struct vbePanelID *data)
+VBEInterpretPanelID(ScrnInfoPtr pScrn, struct vbePanelID *data)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     DisplayModePtr mode;
     const float PANEL_HZ = 60.0;
 
     if (!data)
         return;
 
-    xf86DrvMsg(scrnIndex, X_INFO, "PanelID returned panel resolution %dx%d\n",
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PanelID returned panel resolution %dx%d\n",
                data->hsize, data->vsize);
 
     if (pScrn->monitor->nHsync || pScrn->monitor->nVrefresh)
         return;
 
     if (data->hsize < 320 || data->vsize < 240) {
-        xf86DrvMsg(scrnIndex, X_INFO, "...which I refuse to believe\n");
+        xf86DrvMsg(pScrn->scrnIndex, X_INFO, "...which I refuse to believe\n");
         return;
     }
 
@@ -1069,7 +1069,7 @@ VBEReadPanelID(vbeInfoPtr pVbe)
     int RealOff = pVbe->real_mode_base;
     pointer page = pVbe->memory;
     void *tmp = NULL;
-    int screen = pVbe->pInt10->scrnIndex;
+    int screen = pVbe->pInt10->pScrn->scrnIndex;
 
     pVbe->pInt10->ax = 0x4F11;
     pVbe->pInt10->bx = 0x01;
index 81be0ff..3907c53 100644 (file)
@@ -350,7 +350,7 @@ struct vbePanelID {
     char reserved[14];
 };
 
-extern _X_EXPORT void VBEInterpretPanelID(int scrnIndex,
+extern _X_EXPORT void VBEInterpretPanelID(ScrnInfoPtr pScrn,
                                           struct vbePanelID *data);
 extern _X_EXPORT struct vbePanelID *VBEReadPanelID(vbeInfoPtr pVbe);
 
index 0cfabc5..e7a0d02 100644 (file)
@@ -81,11 +81,8 @@ xColorItem *pdefs;
     xColorItem directDefs[256];
     Bool new_overscan = FALSE;
     Bool writeColormap;
-
-    /* This can get called before the ScrnInfoRec is installed so we
-       can't rely on getting it with XF86SCRNINFO() */
     int scrnIndex = pmap->pScreen->myNum;
-    ScrnInfoPtr scrninfp = xf86Screens[scrnIndex];
+    ScrnInfoPtr scrninfp = xf86ScreenToScrn(pmap->pScreen);
     vgaHWPtr hwp = VGAHWPTR(scrninfp);
 
     unsigned char overscan = hwp->ModeReg.Attribute[OVERSCAN];
@@ -100,7 +97,7 @@ xColorItem *pdefs;
     }
 
     writeColormap = scrninfp->vtSema;
-    if (DGAAvailable(scrnIndex)) {
+    if (DGAScreenAvailable(pmap->pScreen)) {
         writeColormap = writeColormap ||
             (DGAGetDirectMode(scrnIndex) &&
              !(DGAGetFlags(scrnIndex) & XF86DGADirectColormap)) ||
index e044682..a64f4f8 100644 (file)
@@ -651,7 +651,7 @@ vgaHWSaveScreen(ScreenPtr pScreen, int mode)
     Bool on;
 
     if (pScreen != NULL)
-        pScrn = xf86Screens[pScreen->myNum];
+        pScrn = xf86ScreenToScrn(pScreen);
 
     on = xf86IsUnblank(mode);
 
@@ -1873,7 +1873,7 @@ vgaHWSetOverscan(ScrnInfoPtr pScrn, int overscan)
 Bool
 vgaHWHandleColormaps(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
     if (pScrn->depth > 1 && pScrn->depth <= 8) {
         return xf86HandleColormaps(pScreen, 1 << pScrn->depth,
diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am
deleted file mode 100644 (file)
index 78d9348..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-LSB_FIRST = l-xaaBitmap.c l-xaaStipple.c l-xaaTEGlyph.c
-LSB_3_FIRST = l3-xaaBitmap.c l3-xaaStipple.c
-MSB_FIRST = m-xaaBitmap.c m-xaaStipple.c m-xaaTEGlyph.c
-MSB_3_FIRST = m3-xaaBitmap.c m3-xaaStipple.c
-LSB_FIXED = lf-xaaBitmap.c lf-xaaStipple.c lf-xaaTEGlyph.c
-LSB_3_FIXED = lf3-xaaBitmap.c lf3-xaaStipple.c
-MSB_FIXED = mf-xaaBitmap.c mf-xaaStipple.c mf-xaaTEGlyph.c
-MSB_3_FIXED = mf3-xaaBitmap.c mf3-xaaStipple.c
-POLYSEG = s-xaaLine.c s-xaaDashLine.c
-
-if XAA
-
-libxaa_la_LDFLAGS = -module -avoid-version
-if COMPOSITE
-libxaa_la_LIBADD = $(top_builddir)/miext/cw/libcw.la
-endif
-
-module_LTLIBRARIES = libxaa.la
-libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \
-                   xaaBitBlt.c xaaCpyArea.c xaaGCmisc.c xaaCpyWin.c \
-                   xaaCpyPlane.c xaaFillRect.c xaaTEText.c xaaNonTEText.c \
-                   xaaPCache.c xaaSpans.c xaaROP.c xaaImage.c \
-                   xaaRect.c xaaLineMisc.c xaaBitOrder.c \
-                   xaaFillPoly.c xaaWideLine.c xaaTables.c xaaFillArc.c \
-                   xaaLine.c xaaDashLine.c xaaOverlay.c xaaOffscreen.c \
-                   xaaOverlayDF.c xaaStateChange.c xaaPict.c $(POLYSEG) \
-                   $(LSB_FIRST) $(MSB_FIRST) $(LSB_FIXED) $(MSB_FIXED) \
-                   $(LSB_3_FIRST) $(MSB_3_FIRST) $(LSB_3_FIXED) $(MSB_3_FIXED)
-${POLYSEG}:
-       $(AM_V_GEN)echo "#define POLYSEGMENT" > $@
-       $(AM_V_GEN)echo '#include "$(srcdir)/${@:s-%=%}"' >> $@
-${LSB_FIRST}:
-       $(AM_V_GEN)echo "#define LSBFIRST" > $@
-       $(AM_V_GEN)echo '#include "$(srcdir)/${@:l-%=%}"' >> $@
-${LSB_3_FIRST}:
-       $(AM_V_GEN)echo "#define LSBFIRST" > $@
-       $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@
-       $(AM_V_GEN)echo '#include "$(srcdir)/${@:l3-%=%}"' >> $@
-${LSB_FIXED}:
-       $(AM_V_GEN)echo "#define LSBFIRST" > $@
-       $(AM_V_GEN)echo "#define FIXEDBASE" >> $@
-       $(AM_V_GEN)echo '#include "$(srcdir)/${@:lf-%=%}"' >> $@
-${LSB_3_FIXED}:
-       $(AM_V_GEN)echo "#define LSBFIRST" > $@
-       $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@
-       $(AM_V_GEN)echo "#define FIXEDBASE" >> $@
-       $(AM_V_GEN)echo '#include "$(srcdir)/${@:lf3-%=%}"' >> $@
-${MSB_FIRST}:
-       $(AM_V_GEN)echo "#define MSBFIRST" > $@
-       $(AM_V_GEN)echo '#include "$(srcdir)/${@:m-%=%}"' >> $@
-${MSB_3_FIRST}:
-       $(AM_V_GEN)echo "#define MSBFIRST" > $@
-       $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@
-       $(AM_V_GEN)echo '#include "$(srcdir)/${@:m3-%=%}"' >> $@
-${MSB_FIXED}:
-       $(AM_V_GEN)echo "#define MSBFIRST" > $@
-       $(AM_V_GEN)echo "#define FIXEDBASE" >> $@
-       $(AM_V_GEN)echo '#include "$(srcdir)/${@:mf-%=%}"' >> $@
-${MSB_3_FIXED}:
-       $(AM_V_GEN)echo "#define MSBFIRST" > $@
-       $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@
-       $(AM_V_GEN)echo "#define FIXEDBASE" >> $@
-       $(AM_V_GEN)echo '#include "$(srcdir)/${@:mf3-%=%}"' >> $@
-
-endif # XAA
-
-DISTCLEANFILES = $(POLYSEG) \
-       $(LSB_FIRST) $(LSB_FIXED) $(MSB_FIRST) $(MSB_FIXED) \
-       $(LSB_3_FIRST) $(LSB_3_FIXED) $(MSB_3_FIRST) $(MSB_3_FIXED)
-
-sdk_HEADERS = xaa.h xaalocal.h xaarop.h
-EXTRA_DIST = xaacexp.h xaawrap.h xaaLine.c xaaDashLine.c \
-             xaaStipple.c xaaTEGlyph.c xaaNonTEGlyph.c xaaBitmap.c \
-             XAA.HOWTO
-
-INCLUDES = $(XORG_INCS) -I$(srcdir)/../../../miext/cw
-
-AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
diff --git a/hw/xfree86/xaa/XAA.HOWTO b/hw/xfree86/xaa/XAA.HOWTO
deleted file mode 100644 (file)
index cbd71c1..0000000
+++ /dev/null
@@ -1,1427 +0,0 @@
-
-
-                          XAA.HOWTO
-
-  This file describes how to add basic XAA support to a chipset driver.
-
-0)  What is XAA
-1)  XAA Initialization and Shutdown
-2)  The Primitives
-  2.0  Generic Flags
-  2.1  Screen to Screen Copies
-  2.2  Solid Fills
-  2.3  Solid Lines
-  2.4  Dashed Lines
-  2.5  Color Expand Fills
-    2.5.1 Screen to Screen Color Expansion
-    2.5.2 CPU to Screen Color Expansion
-      2.5.2.1 The Direct Method
-      2.5.2.2 The Indirect Method
-  2.6  8x8 Mono Pattern Fills
-  2.7  8x8 Color Pattern Fills
-  2.8  Image Writes
-    2.8.1 The Direct Method
-    2.8.2 The Indirect Method
-  2.9 Clipping
-3)  The Pixmap Cache
-4)  Offscreen Pixmaps
-
-/********************************************************************/
-
-0) WHAT IS XAA
-       
-   XAA (the XFree86 Acceleration Architecture) is a device dependent
-layer that encapsulates the unaccelerated framebuffer rendering layer,
-intercepting rendering commands sent to it from higher levels of the
-server.  For rendering tasks where hardware acceleration is not 
-possible, XAA allows the requests to proceed to the software rendering
-code.  Otherwise, XAA breaks the sometimes complicated X primitives
-into simpler primitives more suitable for hardware acceleration and
-will use accelerated functions exported by the chipset driver to 
-render these.
-
-   XAA provides a simple, easy to use driver interface that allows
-the driver to communicate its acceleration capabilities and restrictions
-back to XAA.  XAA will use the information provided by the driver
-to determine whether or not acceleration will be possible for a
-particular X primitive.
-
-
-
-1) XAA INITIALIZATION AND SHUTDOWN
-
-   All relevant prototypes and defines are in xaa.h.
-
-   To Initialize the XAA layer, the driver should allocate an XAAInfoRec
-via XAACreateInfoRec(), fill it out as described in this document
-and pass it to XAAInit().  XAAInit() must be called _after_ the 
-framebuffer initialization (usually cfb?ScreenInit or similar) since 
-it is "wrapping" that layer.  XAAInit() should be called _before_ the 
-cursor initialization (usually miDCInitialize) since the cursor
-layer needs to "wrap" all the rendering code including XAA.
-
-   When shutting down, the driver should free the XAAInfoRec
-structure in its CloseScreen function via XAADestroyInfoRec().
-The prototypes for the functions mentioned above are as follows:
-
-   XAAInfoRecPtr XAACreateInfoRec(void);
-   Bool XAAInit(ScreenPtr, XAAInfoRecPtr);
-   void XAADestroyInfoRec(XAAInfoRec);
-
-   The driver informs XAA of it's acceleration capablities by
-filling out an XAAInfoRec structure and passing it to XAAInit().
-The XAAInfoRec structure contains many fields, most of which are
-function pointers and flags.  Each primitive will typically have
-two functions and a set of flags associated with it, but it may
-have more.  These two functions are the "SetupFor" and "Subsequent" 
-functions.  The "SetupFor" function tells the driver that the 
-hardware should be initialized for a particular type of graphics 
-operation.  After the "SetupFor" function, one or more calls to the 
-"Subsequent" function will be made to indicate that an instance
-of the particular primitive should be rendered by the hardware.
-The details of each instance (width, height, etc...) are given
-with each "Subsequent" function.   The set of flags associated
-with each primitive lets the driver tell XAA what its hardware
-limitations are (eg. It doesn't support a planemask, it can only
-do one of the raster-ops, etc...).
-
-  Of the XAAInfoRec fields, one is required.  This is the
-Sync function.  XAA initialization will fail if this function
-is not provided.
-
-void Sync(ScrnInfoPtr pScrn)                   /* Required */
-
-   Sync will be called when XAA needs to be certain that all
-   graphics coprocessor operations are finished, such as when
-   the framebuffer must be written to or read from directly
-   and it must be certain that the accelerator will not be
-   overwriting the area of interest.
-
-   One needs to make certain that the Sync function not only
-   waits for the accelerator fifo to empty, but that it waits for
-   the rendering of that last operation to complete.
-
-   It is guaranteed that no direct framebuffer access will
-   occur after a "SetupFor" or "Subsequent" function without
-   the Sync function being called first.
-
-
-
-2)  THE PRIMITIVES
-
-2.0  Generic Flags
-
-  Each primitive type has a set of flags associated with it which
-allow the driver to tell XAA what the hardware limitations are.
-The common ones are as follows:
-
-/* Foreground, Background, rop and planemask restrictions */
-
-   GXCOPY_ONLY
-
-     This indicates that the accelerator only supports GXcopy
-     for the particular primitive.
-
-   ROP_NEEDS_SOURCE
-
-     This indicates that the accelerator doesn't supports a
-     particular primitive with rops that don't involve the source.
-     These rops are GXclear, GXnoop, GXinvert and GXset. If neither
-     this flag nor GXCOPY_ONLY is defined, it is assumed that the
-     accelerator supports all 16 raster operations (rops) for that
-     primitive.
-
-   NO_PLANEMASK
-
-     This indicates that the accelerator does not support a hardware
-     write planemask for the particular primitive.
-
-   RGB_EQUAL
-
-     This indicates that the particular primitive requires the red, 
-     green and blue bytes of the foreground color (and background color,
-     if applicable) to be equal. This is useful for 24bpp when a graphics
-     coprocessor is used in 8bpp mode, which is not uncommon in older
-     hardware since some have no support for or only limited support for 
-     acceleration at 24bpp. This way, many operations will be accelerated 
-     for the common case of "grayscale" colors.  This flag should only
-     be used in 24bpp.
-
-  In addition to the common ones listed above which are possible for
-nearly all primitives, each primitive may have its own flags specific
-to that primitive.  If such flags exist they are documented in the
-descriptions of those primitives below.
-
-
-
-2.1  Screen to Screen Copies
-
-   The SetupFor and Subsequent ScreenToScreenCopy functions provide
-   an interface for copying rectangular areas from video memory to
-   video memory.  To accelerate this primitive the driver should
-   provide both the SetupFor and Subsequent functions and indicate
-   the hardware restrictions via the ScreenToScreenCopyFlags.  The
-   NO_PLANEMASK, GXCOPY_ONLY and ROP_NEEDS_SOURCE flags as described
-   in Section 2.0 are valid as well as the following:
-
-    NO_TRANSPARENCY
-     
-      This indicates that the accelerator does not support skipping
-      of color keyed pixels when copying from the source to the destination.
-
-    TRANSPARENCY_GXCOPY_ONLY
-
-      This indicates that the accelerator supports skipping of color keyed
-      pixels only when the rop is GXcopy.
-
-    ONLY_LEFT_TO_RIGHT_BITBLT
-
-      This indicates that the hardware only accepts blitting when the
-      x direction is positive.
-
-    ONLY_TWO_BITBLT_DIRECTIONS
-
-      This indicates that the hardware can only cope with blitting when
-      the direction of x is the same as the direction in y.
-
-
-void SetupForScreenToScreenCopy( ScrnInfoPtr pScrn,
-                       int xdir, int ydir,
-                       int rop,
-                       unsigned int planemask,
-                       int trans_color )
-
-    When this is called, SubsequentScreenToScreenCopy will be called
-    one or more times directly after.  If ydir is 1, then the accelerator
-    should copy starting from the top (minimum y) of the source and
-    proceed downward.  If ydir is -1, then the accelerator should copy
-    starting from the bottom of the source (maximum y) and proceed
-    upward.  If xdir is 1, then the accelerator should copy each
-    y scanline starting from the leftmost pixel of the source.  If
-    xdir is -1, it should start from the rightmost pixel.  
-       If trans_color is not -1 then trans_color indicates that the
-    accelerator should not copy pixels with the color trans_color
-    from the source to the destination, but should skip them. 
-    Trans_color is always -1 if the NO_TRANSPARENCY flag is set.
-
-void SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn,
-                       int x1, int y1,
-                       int x2, int y2,
-                       int width, int height)
-
-    Copy a rectangle "width" x "height" from the source (x1,y1) to the 
-    destination (x2,y2) using the parameters passed by the last
-    SetupForScreenToScreenCopy call. (x1,y1) and (x2,y2) always denote 
-    the upper left hand corners of the source and destination regardless 
-    of which xdir and ydir values are given by SetupForScreenToScreenCopy.  
-
-
-
-2.2 Solid Fills
-
-   The SetupFor and Subsequent SolidFill(Rect/Trap) functions provide
-   an interface for filling rectangular areas of the screen with a
-   foreground color.  To accelerate this primitive the driver should
-   provide both the SetupForSolidFill and SubsequentSolidFillRect 
-   functions and indicate the hardware restrictions via the SolidFillFlags.
-   The driver may optionally provide a SubsequentSolidFillTrap if
-   it is capable of rendering the primitive correctly.  
-   The GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags
-   as described in Section 2.0 are valid.
-
-  
-void SetupForSolidFill(ScrnInfoPtr pScrn, 
-                       int color, int rop, unsigned int planemask)
-
-    SetupForSolidFill indicates that any combination of the following 
-    may follow it.
-
-       SubsequentSolidFillRect
-       SubsequentSolidFillTrap
-
-
-void SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
-
-     Fill a rectangle of dimensions "w" by "h" with origin at (x,y) 
-     using the color, rop and planemask given by the last 
-     SetupForSolidFill call.
-
-void SubsequentSolidFillTrap(ScrnInfoPtr pScrn, int y, int h, 
-       int left, int dxL, int dyL, int eL,
-       int right, int dxR, int dyR, int eR)
-
-     These parameters describe a trapezoid via a version of
-     Bresenham's parameters. "y" is the top line. "h" is the
-     number of spans to be filled in the positive Y direction.
-     "left" and "right" indicate the starting X values of the
-     left and right edges.  dy/dx describes the edge slope.
-     These are not the deltas between the beginning and ending
-     points on an edge.  They merely describe the slope. "e" is
-     the initial error term.  It's the relationships between dx,
-     dy and e that define the edge.
-       If your engine does not do bresenham trapezoids or does
-     not allow the programmer to specify the error term then
-     you are not expected to be able to accelerate them.
-
-
-2.3  Solid Lines
-
-    XAA provides an interface for drawing thin lines.  In order to
-    draw X lines correctly a high degree of accuracy is required.
-    This usually limits line acceleration to hardware which has a
-    Bresenham line engine, though depending on the algorithm used,
-    other line engines may come close if they accept 16 bit line 
-    deltas.  XAA has both a Bresenham line interface and a two-point
-    line interface for drawing lines of arbitrary orientation.  
-    Additionally there is a SubsequentSolidHorVertLine which will
-    be used for all horizontal and vertical lines.  Horizontal and
-    vertical lines are handled separately since hardware that doesn't
-    have a line engine (or has one that is unusable due to precision
-    problems) can usually draw these lines by some other method such
-    as drawing them as thin rectangles.  Even for hardware that can
-    draw arbitrary lines via the Bresenham or two-point interfaces,
-    the SubsequentSolidHorVertLine is used for horizontal and vertical
-    lines since most hardware is able to render the horizontal lines
-    and sometimes the vertical lines faster by other methods (Hint:
-    try rendering horizontal lines as flattened rectangles).  If you have 
-    not provided a SubsequentSolidHorVertLine but you have provided 
-    Bresenham or two-point lines, a SubsequentSolidHorVertLine function 
-    will be supplied for you.
-
-    The flags field associated with Solid Lines is SolidLineFlags and 
-    the GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags as
-    described in Section 2.0 are valid restrictions.  
-
-    Some line engines have line biases hardcoded to comply with
-    Microsoft line biasing rules.  A tell-tale sign of this is the
-    hardware lines not matching the software lines in the zeroth and
-    fourth octants.  The driver can set the flag:
-       
-       MICROSOFT_ZERO_LINE_BIAS
-
-    in the AccelInfoRec.Flags field to adjust the software lines to
-    match the hardware lines.   This is in the generic flags field
-    rather than the SolidLineFlags since this flag applies to all
-    software zero-width lines on the screen and not just the solid ones.
-
-
-void SetupForSolidLine(ScrnInfoPtr pScrn, 
-                       int color, int rop, unsigned int planemask)
-
-    SetupForSolidLine indicates that any combination of the following 
-    may follow it.
-
-       SubsequentSolidBresenhamLine
-       SubsequentSolidTwoPointLine
-        SubsequentSolidHorVertLine     
-
-
-void SubsequentSolidHorVertLine( ScrnInfoPtr pScrn,
-                               int x, int y, int len, int dir )
-
-    All vertical and horizontal solid thin lines are rendered with
-    this function.  The line starts at coordinate (x,y) and extends
-    "len" pixels inclusive.  In the direction indicated by "dir."
-    The direction is either DEGREES_O or DEGREES_270.  That is, it
-    always extends to the right or down.
-
-
-
-void SubsequentSolidTwoPointLine(ScrnInfoPtr pScrn,
-               int x1, int y1, int x2, int y2, int flags)
-
-    Draw a line from (x1,y1) to (x2,y2).  If the flags field contains
-    the flag OMIT_LAST, the last pixel should not be drawn.  Otherwise,
-    the pixel at (x2,y2) should be drawn.
-
-    If you use the TwoPoint line interface there is a good possibility
-    that your line engine has hard-coded line biases that do not match
-    the default X zero-width lines.  If so, you may need to set the
-    MICROSOFT_ZERO_LINE_BIAS flag described above.  Note that since
-    any vertex in the 16-bit signed coordinate system is valid, your
-    line engine is expected to handle 16-bit values if you have hardware
-    line clipping enabled.  If your engine cannot handle 16-bit values,
-    you should not use hardware line clipping.
-
-
-void SubsequentSolidBresenhamLine(ScrnInfoPtr pScrn,
-        int x, int y, int major, int minor, int err, int len, int octant)
-
-    "X" and "y" are the starting point of the line.  "Major" and "minor" 
-    are the major and minor step constants.  "Err" is the initial error
-    term.  "Len" is the number of pixels to be drawn (inclusive). "Octant"
-    can be any combination of the following flags OR'd together:
-
-      Y_MAJOR          Y is the major axis (X otherwise)
-      X_DECREASING     The line is drawn from right to left
-      Y_DECREASING     The line is drawn from bottom to top
-         
-    The major, minor and err terms are the "raw" Bresenham parameters
-    consistent with a line engine that does:
-
-       e = err;
-       while(len--) {
-          DRAW_POINT(x,y);
-          e += minor;
-          if(e >= 0) {
-               e -= major;
-               TAKE_ONE_STEP_ALONG_MINOR_AXIS;
-          }
-          TAKE_ONE_STEP_ALONG_MAJOR_AXIS;
-       }
-
-    IBM 8514 style Bresenham line interfaces require their parameters
-    modified in the following way:
-
-       Axial = minor;
-       Diagonal = minor - major;
-       Error = minor + err;
-
-SolidBresenhamLineErrorTermBits
-
-    This field allows the driver to tell XAA how many bits large its
-    Bresenham parameter registers are.  Many engines have registers that
-    only accept 12 or 13 bit Bresenham parameters, and the parameters
-    for clipped lines may overflow these if they are not scaled down.
-    If this field is not set, XAA will assume the engine can accomodate
-    16 bit parameters, otherwise, it will scale the parameters to the
-    size specified.
-
-
-2.4  Dashed Lines
-
-    The same degree of accuracy required by the solid lines is required
-    for drawing dashed lines as well.  The dash pattern itself is a
-    buffer of binary data where ones are expanded into the foreground
-    color and zeros either correspond to the background color or
-    indicate transparency depending on whether or not DoubleDash or
-    OnOffDashes are being drawn.  
-
-    The flags field associated with dashed Lines is DashedLineFlags and 
-    the GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags as
-    described in Section 2.0 are valid restrictions.  Additionally, the
-    following flags are valid:
-
-      NO_TRANSPARENCY
-
-       This indicates that the driver cannot support dashed lines
-       with transparent backgrounds (OnOffDashes).
-
-      TRANSPARENCY_ONLY
-
-       This indicates that the driver cannot support dashes with
-       both a foreground and background color (DoubleDashes).
-
-      LINE_PATTERN_POWER_OF_2_ONLY
-
-       This indicates that only patterns with a power of 2 length
-       can be accelerated.
-
-      LINE_PATTERN_LSBFIRST_MSBJUSTIFIED
-      LINE_PATTERN_LSBFIRST_LSBJUSTIFIED
-      LINE_PATTERN_MSBFIRST_MSBJUSTIFIED
-      LINE_PATTERN_MSBFIRST_LSBJUSTIFIED
-
-       These describe how the line pattern should be packed.
-       The pattern buffer is DWORD padded.  LSBFIRST indicates
-       that the pattern runs from the LSB end to the MSB end.
-       MSBFIRST indicates that the pattern runs from the MSB end
-       to the LSB end.  When the pattern does not completely fill
-       the DWORD padded buffer, the pattern will be justified 
-       towards the MSB or LSB end based on the flags above.
-
-
-    The following field indicates the maximum length dash pattern that
-    should be accelerated.
-
-       int DashPatternMaxLength
-
-
-void SetupForDashedLine(ScrnInfoPtr pScrn,
-               int fg, int bg, int rop, unsigned int planemask,
-               int length, unsigned char *pattern)
-
-    
-    SetupForDashedLine indicates that any combination of the following 
-    may follow it.
-
-       SubsequentDashedBresenhamLine
-       SubsequentDashedTwoPointLine
-
-    If "bg" is -1, then the background (pixels corresponding to clear
-    bits in the pattern) should remain unmodified. "Bg" indicates the
-    background color otherwise.  "Length" indicates the length of
-    the pattern in bits and "pattern" points to the DWORD padded buffer
-    holding the pattern which has been packed according to the flags
-    set above.  
-
-    
-void SubsequentDashedTwoPointLine( ScrnInfoPtr pScrn,
-        int x1, int y1, int x2, int y2, int flags, int phase)
-
-void SubsequentDashedBresenhamLine(ScrnInfoPtr pScrn,
-        int x1, int y1, int major, int minor, int err, int len, int octant,
-        int phase)
-  
-    These are the same as the SubsequentSolidTwoPointLine and
-    SubsequentBresenhamLine functions except for the addition
-    of the "phase" field which indicates the offset into the dash 
-    pattern that the pixel at (x1,y1) corresponds to.
-
-    As with the SubsequentBresenhamLine, there is an
-       int DashedBresenhamLineErrorTermBits 
-   
-    field which indicates the size of the error term registers
-    used with dashed lines.  This is usually the same value as
-    the field for the solid lines (because it's usually the same
-    register).
-       
-      
-
-2.5   Color Expansion Fills
-
-    When filling a color expansion rectangle, the accelerator
-    paints each pixel depending on whether or not a bit in a
-    corresponding bitmap is set or clear. Opaque expansions are 
-    when a set bit corresponds to the foreground color and a clear 
-    bit corresponds to the background color.  A transparent expansion
-    is when a set bit corresponds to the foreground color and a
-    clear bit indicates that the pixel should remain unmodified.
-   
-    The graphics accelerator usually has access to the source 
-    bitmap in one of two ways: 1) the bitmap data is sent serially
-    to the accelerator by the CPU through some memory mapped aperture
-    or 2) the accelerator reads the source bitmap out of offscreen
-    video memory.  Some types of primitives are better suited towards 
-    one method or the other.  Type 2 is useful for reusable patterns
-    such as stipples which can be cached in offscreen memory.  The
-    aperature method can be used for stippling but the CPU must pass
-    the data across the bus each time a stippled fill is to be performed.  
-    For expanding 1bpp client pixmaps or text strings to the screen,
-    the aperature method is usually superior because the intermediate
-    copy in offscreen memory needed by the second method would only be 
-    used once.  Unfortunately, many accelerators can only do one of these
-    methods and not both.  
-
-    XAA provides both ScreenToScreen and CPUToScreen color expansion 
-    interfaces for doing color expansion fills.  The ScreenToScreen
-    functions can only be used with hardware that supports reading
-    of source bitmaps from offscreen video memory, and these are only
-    used for cacheable patterns such as stipples.  There are two
-    variants of the CPUToScreen routines - a direct method intended
-    for hardware that has a transfer aperature, and an indirect method
-    intended for hardware without transfer aperatures or hardware
-    with unusual transfer requirements.  Hardware that can only expand
-    bitmaps from video memory should supply ScreenToScreen routines
-    but also ScanlineCPUToScreen (indirect) routines to optimize transfers 
-    of non-cacheable data.  Hardware that can only accept source bitmaps
-    through an aperature should supply CPUToScreen (or ScanlineCPUToScreen) 
-    routines. Hardware that can do both should provide both ScreenToScreen 
-    and CPUToScreen routines.
-
-    For both ScreenToScreen and CPUToScreen interfaces, the GXCOPY_ONLY,
-    ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags described in
-    Section 2.0 are valid as well as the following:
-
-    /* bit order requirements (one of these must be set) */
-   
-    BIT_ORDER_IN_BYTE_LSBFIRST
-
-      This indicates that least significant bit in each byte of the source
-      data corresponds to the leftmost of that block of 8 pixels.  This
-      is the prefered format.
-
-    BIT_ORDER_IN_BYTE_MSBFIRST    
-
-      This indicates that most significant bit in each byte of the source
-      data corresponds to the leftmost of that block of 8 pixels.
-
-    /* transparency restrictions */
-
-    NO_TRANSPARENCY
-
-      This indicates that the accelerator cannot do a transparent expansion.
-
-    TRANSPARENCY_ONLY
-
-      This indicates that the accelerator cannot do an opaque expansion.
-      In cases where where the background needs to be filled, XAA will
-      render the primitive in two passes when using the CPUToScreen
-      interface, but will not do so with the ScreenToScreen interface 
-      since that would require caching of two patterns.  Some 
-      ScreenToScreen hardware may be able to render two passes at the
-      driver level and remove the TRANSPARENCY_ONLY restriction if
-      it can render pixels corresponding to the zero bits.
-
-
-
-2.5.1  Screen To Screen Color Expansion
-
-    The ScreenToScreenColorExpandFill routines provide an interface
-    for doing expansion blits from source patterns stored in offscreen
-    video memory.
-
-    void SetupForScreenToScreenColorExpandFill (ScrnInfoPtr pScrn,
-                               int fg, int bg, 
-                               int rop, unsigned int planemask)
-
-
-    Ones in the source bitmap will correspond to the fg color.
-    Zeros in the source bitmap will correspond to the bg color
-    unless bg = -1.  In that case the pixels corresponding to the
-    zeros in the bitmap shall be left unmodified by the accelerator.
-
-    For hardware that doesn't allow an easy implementation of skipleft, the
-    driver can replace CacheMonoStipple function with one that stores multiple
-    rotated copies of the stipple and select between them. In this case the
-    driver should set CacheColorExpandDensity to tell XAA how many copies of
-    the pattern are stored in the width of a cache slot. For instance if the
-    hardware can specify the starting address in bytes, then 8 rotated copies
-    of the stipple are needed and CacheColorExpandDensity should be set to 8.
-
-    void SubsequentScreenToScreenColorExpandFill( ScrnInfoPtr pScrn,
-                               int x, int y, int w, int h,
-                               int srcx, int srcy, int offset )
-
-   
-    Fill a rectangle "w" x "h" at location (x,y).  The source pitch
-    between scanlines is the framebuffer pitch (pScrn->displayWidth
-    pixels) and srcx and srcy indicate the start of the source pattern 
-    in units of framebuffer pixels. "Offset" indicates the bit offset
-    into the pattern that corresponds to the pixel being painted at
-    "x" on the screen.  Some hardware accepts source coordinates in
-    units of bits which makes implementation of the offset trivial.
-    In that case, the bit address of the source bit corresponding to
-    the pixel painted at (x,y) would be:
-       
-     (srcy * pScrn->displayWidth + srcx) * pScrn->bitsPerPixel + offset
-
-    It should be noted that the offset assumes LSBFIRST hardware.  
-    For MSBFIRST hardware, the driver may need to implement the 
-    offset by bliting only from byte boundaries and hardware clipping.
-
-
-
-2.5.2  CPU To Screen Color Expansion
-
-
-    The CPUToScreenColorExpandFill routines provide an interface for 
-    doing expansion blits from source patterns stored in system memory.
-    There are two varieties of this primitive, a CPUToScreenColorExpandFill
-    and a ScanlineCPUToScreenColorExpandFill.  With the 
-    CPUToScreenColorExpandFill method, the source data is sent serially
-    through a memory mapped aperature.  With the Scanline version, the
-    data is rendered scanline at a time into intermediate buffers with
-    a call to SubsequentColorExpandScanline following each scanline.
-
-    These two methods have separate flags fields, the
-    CPUToScreenColorExpandFillFlags and ScanlineCPUToScreenColorExpandFillFlags
-    respectively.  Flags specific to one method or the other are described 
-    in sections 2.5.2.1 and 2.5.2.2 but for both cases the bit order and
-    transparency restrictions listed at the beginning of section 2.5 are 
-    valid as well as the following:
-    
-    /* clipping  (optional) */
-    
-    LEFT_EDGE_CLIPPING
-      This indicates that the accelerator supports omission of up to
-      31 pixels on the left edge of the rectangle to be filled.  This
-      is beneficial since it allows transfer of the source bitmap to
-      always occur from DWORD boundaries. 
-
-    LEFT_EDGE_CLIPPING_NEGATIVE_X
-
-      This flag indicates that the accelerator can render color expansion
-      rectangles even if the value of x origin is negative (off of
-      the screen on the left edge).
-
-    /* misc */
-
-    TRIPLE_BITS_24BPP
-
-      When enabled (must be in 24bpp mode), color expansion functions
-      are expected to require three times the amount of bits to be
-      transferred so that 24bpp grayscale colors can be used with color
-      expansion in 8bpp coprocessor mode. Each bit is expanded to 3
-      bits when writing the monochrome data.
-
-
- 2.5.1 The Direct Method 
-
-
-    Using the direct method of color expansion XAA will send all
-    bitmap data to the accelerator serially through an memory mapped
-    transfer window defined by the following two fields:
-
-      unsigned char *ColorExpandBase
-
-        This indicates the memory address of the beginning of the aperture.
-
-      int ColorExpandRange
-
-        This indicates the size in bytes of the aperture.
-
-    The driver should specify how the transfered data should be padded.
-    There are options for both the padding of each Y scanline and for the
-    total transfer to the aperature.
-    One of the following two flags must be set:
-
-      CPU_TRANSFER_PAD_DWORD
-
-        This indicates that the total transfer (sum of all scanlines) sent
-        to the aperature must be DWORD padded.  This is the default behavior.
-
-      CPU_TRANSFER_PAD_QWORD 
-
-       This indicates that the total transfer (sum of all scanlines) sent
-       to the aperature must be QWORD padded.  With this set, XAA will send
-        an extra DWORD to the aperature when needed to ensure that only
-        an even number of DWORDs are sent.
-
-    And then there are the flags for padding of each scanline:
-
-      SCANLINE_PAD_DWORD
-
-       This indicates that each Y scanline should be DWORD padded.
-        This is the only option available and is the default.
-
-    Finally, there is the CPU_TRANSFER_BASE_FIXED flag which indicates
-    that the aperture is a single register rather than a range of
-    registers, and XAA should write all of the data to the first DWORD.
-    If the ColorExpandRange is not large enough to accomodate scanlines
-    the width of the screen, this option will be forced. That is, the
-    ColorExpandRange must be:
-
-        ((virtualX + 31)/32) * 4   bytes or more.
-
-        ((virtualX + 62)/32 * 4) if LEFT_EDGE_CLIPPING_NEGATIVE_X is set.
-  
-    If the TRIPLE_BITS_24BPP flag is set, the required area should be 
-    multiplied by three.
-     
-    
-void SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
-                       int fg, int bg,
-                       int rop,
-                       unsigned int planemask)
-
-  
-     Ones in the source bitmap will correspond to the fg color.
-     Zeros in the source bitmap will correspond to the bg color
-     unless bg = -1.  In that case the pixels corresponding to the
-     zeros in the bitmap shall be left unmodified by the accelerator.
-
-
-void SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
-                       int x, int y, int w, int h,
-                       int skipleft )
-
-     When this function is called, the accelerator should be setup
-     to fill a rectangle of dimension "w" by "h" with origin at (x,y)
-     in the fill style prescribed by the last call to 
-     SetupForCPUToScreenColorExpandFill.  XAA will pass the data to 
-     the aperture immediately after this function is called.  If the 
-     skipleft is non-zero (and LEFT_EDGE_CLIPPING has been enabled), then 
-     the accelerator _should_not_ render skipleft pixels on the leftmost
-     edge of the rectangle.  Some engines have an alignment feature
-     like this built in, some others can do this using a clipping
-     window.
-
-     It can be arranged for XAA to call Sync() after it is through 
-     calling the Subsequent function by setting SYNC_AFTER_COLOR_EXPAND 
-     in the  CPUToScreenColorExpandFillFlags.  This can provide the driver 
-     with an oportunity to reset a clipping window if needed.
-
-    
-2.5.2  The Indirect Method 
-
-     Using the indirect method, XAA will render the bitmap data scanline
-     at a time to one or more buffers.  These buffers may be memory
-     mapped apertures or just intermediate storage.
-
-     int NumScanlineColorExpandBuffers
-
-       This indicates the number of buffers available.
-
-     unsigned char **ScanlineColorExpandBuffers
-
-       This is an array of pointers to the memory locations of each buffer.
-       Each buffer is expected to be large enough to accommodate scanlines
-       the width of the screen.  That is:
-
-        ((virtualX + 31)/32) * 4   bytes or more.
-
-        ((virtualX + 62)/32 * 4) if LEFT_EDGE_CLIPPING_NEGATIVE_X is set.
-  
-     Scanlines are always DWORD padded.
-     If the TRIPLE_BITS_24BPP flag is set, the required area should be 
-     multiplied by three.
-
-
-void SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
-                       int fg, int bg,
-                       int rop,
-                       unsigned int planemask)
-     Ones in the source bitmap will correspond to the fg color.
-     Zeros in the source bitmap will correspond to the bg color
-     unless bg = -1.  In that case the pixels corresponding to the
-     zeros in the bitmap shall be left unmodified by the accelerator.
-
-     
-void SubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
-                       int x, int y, int w, int h,
-                       int skipleft )
-
-void SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
-
-
-    When SubsequentScanlineCPUToScreenColorExpandFill is called, XAA 
-    will begin transfering the source data scanline at a time, calling  
-    SubsequentColorExpandScanline after each scanline.  If more than
-    one buffer is available, XAA will cycle through the buffers.
-    Subsequent scanlines will use the next buffer and go back to the
-    buffer 0 again when the last buffer is reached.  The index into
-    the ScanlineColorExpandBuffers array is presented as "bufno"
-    with each SubsequentColorExpandScanline call.
-
-    The skipleft field is the same as for the direct method.
-
-    The indirect method can be use to send the source data directly 
-    to a memory mapped aperture represented by a single color expand
-    buffer, scanline at a time, but more commonly it is used to place 
-    the data into offscreen video memory so that the accelerator can 
-    blit it to the visible screen from there.  In the case where the
-    accelerator permits rendering into offscreen video memory while
-    the accelerator is active, several buffers can be used so that
-    XAA can be placing source data into the next buffer while the
-    accelerator is blitting the current buffer.  For cases where
-    the accelerator requires some special manipulation of the source
-    data first, the buffers can be in system memory.  The CPU can
-    manipulate these buffers and then send the data to the accelerator.
-
-
-
-2.6   8x8 Mono Pattern Fills
-
-    XAA provides support for two types of 8x8 hardware patterns -
-    "Mono" patterns and "Color" patterns.  Mono pattern data is
-    64 bits of color expansion data with ones indicating the
-    foreground color and zeros indicating the background color.
-    The source bitmaps for the 8x8 mono patterns can be presented
-    to the graphics accelerator in one of two ways.  They can be
-    passed as two DWORDS to the 8x8 mono pattern functions or
-    they can be cached in offscreen memory and their locations
-    passed to the 8x8 mono pattern functions.  In addition to the
-    GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags
-    defined in Section 2.0, the following are defined for the
-    Mono8x8PatternFillFlags:
-
-    HARDWARE_PATTERN_PROGRAMMED_BITS
-
-      This indicates that the 8x8 patterns should be packed into two
-      DWORDS and passed to the 8x8 mono pattern functions.  The default
-      behavior is to cache the patterns in offscreen video memory and
-      pass the locations of these patterns to the functions instead.
-      The pixmap cache must be enabled for the default behavior (8x8 
-      pattern caching) to work.  See Section 3 for how to enable the
-      pixmap cache. The pixmap cache is not necessary for 
-      HARDWARE_PATTERN_PROGRAMMED_BITS.
-
-    HARDWARE_PATTERN_PROGRAMMED_ORIGIN
-
-      If the hardware supports programmable pattern offsets then
-      this option should be set. See the table below for further
-      infomation.
-
-    HARDWARE_PATTERN_SCREEN_ORIGIN
-
-      Some hardware wants the pattern offset specified with respect to the
-      upper left-hand corner of the primitive being drawn.  Other hardware 
-      needs the option HARDWARE_PATTERN_SCREEN_ORIGIN set to indicate that 
-      all pattern offsets should be referenced to the upper left-hand 
-      corner of the screen.  HARDWARE_PATTERN_SCREEN_ORIGIN is preferable 
-      since this is more natural for the X-Window system and offsets will 
-      have to be recalculated for each Subsequent function otherwise.
-
-    BIT_ORDER_IN_BYTE_MSBFIRST
-    BIT_ORDER_IN_BYTE_LSBFIRST
-
-      As with other color expansion routines this indicates whether the
-      most or the least significant bit in each byte from the pattern is 
-      the leftmost on the screen.
-
-    TRANSPARENCY_ONLY
-    NO_TRANSPARENCY
-
-      This means the same thing as for the color expansion rect routines
-      except that for TRANSPARENCY_ONLY XAA will not render the primitive
-      in two passes since this is more easily handled by the driver.
-      It is recommended that TRANSPARENCY_ONLY hardware handle rendering
-      of opaque patterns in two passes (the background can be filled as
-      a rectangle in GXcopy) in the Subsequent function so that the
-      TRANSPARENCY_ONLY restriction can be removed. 
-
-
-
-    Additional information about cached patterns...
-    For the case where HARDWARE_PATTERN_PROGRAMMED_BITS is not set and 
-    the pattern must be cached in offscreen memory, the first pattern
-    starts at the cache slot boundary which is set by the 
-    CachePixelGranularity field used to configure the pixmap cache.
-    One should ensure that the CachePixelGranularity reflects any 
-    alignment restrictions that the accelerator may put on 8x8 pattern 
-    storage locations.  When HARDWARE_PATTERN_PROGRAMMED_ORIGIN is set 
-    there is only one pattern stored.  When this flag is not set,
-    all 64 pre-rotated copies of the pattern are cached in offscreen memory.
-    The MonoPatternPitch field can be used to specify the X position pixel
-    granularity that each of these patterns must align on.  If the
-    MonoPatternPitch is not supplied, the patterns will be densely packed
-    within the cache slot.  The behavior of the default XAA 8x8 pattern
-    caching mechanism to store all 8x8 patterns linearly in video memory.
-    If the accelerator needs the patterns stored in a more unusual fashion,
-    the driver will need to provide its own 8x8 mono pattern caching 
-    routines for XAA to use. 
-
-    The following table describes the meanings of the "patx" and "paty"
-    fields in both the SetupFor and Subsequent functions.
-
-    With HARDWARE_PATTERN_SCREEN_ORIGIN
-    -----------------------------------
-
-    HARDWARE_PATTERN_PROGRAMMED_BITS and HARDWARE_PATTERN_PROGRAMMED_ORIGIN
-
-       SetupFor: patx and paty are the first and second DWORDS of the
-                 8x8 mono pattern.
-
-       Subsequent: patx and paty are the x,y offset into that pattern.
-                   All Subsequent calls will have the same offset in 
-                   the case of HARDWARE_PATTERN_SCREEN_ORIGIN so only
-                   the offset specified by the first Subsequent call 
-                   after a SetupFor call will need to be observed.
-
-    HARDWARE_PATTERN_PROGRAMMED_BITS only
-
-       SetupFor: patx and paty hold the first and second DWORDS of
-                 the 8x8 mono pattern pre-rotated to match the desired
-                 offset.
-
-       Subsequent: These just hold the same patterns and can be ignored.
-
-    HARDWARE_PATTERN_PROGRAMMED_ORIGIN only
-
-       SetupFor: patx and paty hold the x,y coordinates of the offscreen
-                 memory location where the 8x8 pattern is stored.  The
-                 bits are stored linearly in memory at that location.
-
-       Subsequent: patx and paty hold the offset into the pattern.
-                   All Subsequent calls will have the same offset in 
-                   the case of HARDWARE_PATTERN_SCREEN_ORIGIN so only
-                   the offset specified by the first Subsequent call 
-                   after a SetupFor call will need to be observed.
-
-    Neither programmed bits or origin
-
-       SetupFor: patx and paty hold the x,y coordinates of the offscreen       
-                 memory location where the pre-rotated 8x8 pattern is
-                 stored.
-
-       Subsequent: patx and paty are the same as in the SetupFor function
-                   and can be ignored.
-                 
-
-    Without HARDWARE_PATTERN_SCREEN_ORIGIN
-    -------------------------------------- 
-
-    HARDWARE_PATTERN_PROGRAMMED_BITS and HARDWARE_PATTERN_PROGRAMMED_ORIGIN
-
-       SetupFor: patx and paty are the first and second DWORDS of the
-                 8x8 mono pattern.
-
-       Subsequent: patx and paty are the x,y offset into that pattern.
-
-    HARDWARE_PATTERN_PROGRAMMED_BITS only
-
-       SetupFor: patx and paty holds the first and second DWORDS of
-                 the unrotated 8x8 mono pattern.  This can be ignored. 
-
-       Subsequent: patx and paty hold the rotated 8x8 pattern to be 
-                   rendered.
-
-    HARDWARE_PATTERN_PROGRAMMED_ORIGIN only
-
-       SetupFor: patx and paty hold the x,y coordinates of the offscreen
-                 memory location where the 8x8 pattern is stored.  The
-                 bits are stored linearly in memory at that location.
-
-       Subsequent: patx and paty hold the offset into the pattern.
-
-    Neither programmed bits or origin
-
-       SetupFor: patx and paty hold the x,y coordinates of the offscreen       
-                 memory location where the unrotated 8x8 pattern is
-                 stored.  This can be ignored.
-
-       Subsequent: patx and paty hold the x,y coordinates of the
-                   rotated 8x8 pattern to be rendered.
-
-
-
-void SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
-        int fg, int bg, int rop, unsigned int planemask)
-
-    SetupForMono8x8PatternFill indicates that any combination of the 
-    following  may follow it.
-
-       SubsequentMono8x8PatternFillRect
-       SubsequentMono8x8PatternFillTrap
-
-    The fg, bg, rop and planemask fields have the same meaning as the
-    ones used for the other color expansion routines.  Patx's and paty's
-    meaning can be determined from the table above.
-
-void SubsequentMono8x8PatternFillRect( ScrnInfoPtr pScrn,
-               int patx, int paty, int x, int y, int w, int h)
-
-     Fill a rectangle of dimensions "w" by "h" with origin at (x,y) 
-     using the parameters give by the last SetupForMono8x8PatternFill
-     call.  The meanings of patx and paty can be determined by the
-     table above.
-
-void SubsequentMono8x8PatternFillTrap( ScrnInfoPtr pScrn,
-                          int patx, int paty, int y, int h, 
-                          int left, int dxL, int dyL, int eL,
-                          int right, int dxR, int dyR, int eR )
-
-     The meanings of patx and paty can be determined by the table above.
-     The rest of the fields have the same meanings as those in the 
-     SubsequentSolidFillTrap function. 
-
-
-
-2.7   8x8 Color Pattern Fills
-  
-    8x8 color pattern data is 64 pixels of full color data that
-    is stored linearly in offscreen video memory.  8x8 color patterns 
-    are useful as a substitute for 8x8 mono patterns when tiling,
-    doing opaque stipples, or in the case where transperency is
-    supported, regular stipples.  8x8 color pattern fills also have
-    the additional benefit of being able to tile full color 8x8
-    patterns instead of just 2 color ones like the mono patterns.
-    However, full color 8x8 patterns aren't used very often in the
-    X Window system so you might consider passing this primitive
-    by if you already can do mono patterns, especially if they 
-    require alot of cache area.  Color8x8PatternFillFlags is
-    the flags field for this primitive and the GXCOPY_ONLY,
-    ROP_NEEDS_SOURCE and NO_PLANEMASK flags as described in
-    Section 2.0 are valid as well as the following:
-
-
-    HARDWARE_PATTERN_PROGRAMMED_ORIGIN
-
-      If the hardware supports programmable pattern offsets then
-      this option should be set.  
-
-    HARDWARE_PATTERN_SCREEN_ORIGIN
-
-      Some hardware wants the pattern offset specified with respect to the
-      upper left-hand corner of the primitive being drawn.  Other hardware 
-      needs the option HARDWARE_PATTERN_SCREEN_ORIGIN set to indicate that 
-      all pattern offsets should be referenced to the upper left-hand 
-      corner of the screen.  HARDWARE_PATTERN_SCREEN_ORIGIN is preferable 
-      since this is more natural for the X-Window system and offsets will 
-      have to be recalculated for each Subsequent function otherwise.
-
-    NO_TRANSPARENCY
-    TRANSPARENCY_GXCOPY_ONLY
-
-      These mean the same as for the ScreenToScreenCopy functions.
-
-
-    The following table describes the meanings of patx and paty passed
-    to the SetupFor and Subsequent fields:
-
-    HARDWARE_PATTERN_PROGRAMMED_ORIGIN && HARDWARE_PATTERN_SCREEN_ORIGIN
-       
-       SetupFor: patx and paty hold the x,y location of the unrotated 
-                 pattern.
-
-       Subsequent: patx and paty hold the pattern offset.  For the case
-                   of HARDWARE_PATTERN_SCREEN_ORIGIN all Subsequent calls
-                   have the same offset so only the first call will need
-                   to be observed.
-
-    
-    HARDWARE_PATTERN_PROGRAMMED_ORIGIN only
-
-       SetupFor: patx and paty hold the x,y location of the unrotated
-                 pattern.
-
-       Subsequent: patx and paty hold the pattern offset. 
-
-    HARDWARE_PATTERN_SCREEN_ORIGIN
-
-       SetupFor: patx and paty hold the x,y location of the rotated pattern.
-
-       Subsequent: patx and paty hold the same location as the SetupFor
-                   function so these can be ignored.
-
-    neither flag
-
-       SetupFor: patx and paty hold the x,y location of the unrotated
-                 pattern.  This can be ignored.
-
-       Subsequent: patx and paty hold the x,y location of the rotated
-                   pattern.
-
-    Additional information about cached patterns...
-    All 8x8 color patterns are cached in offscreen video memory so
-    the pixmap cache must be enabled to use them. The first pattern
-    starts at the cache slot boundary which is set by the 
-    CachePixelGranularity field used to configure the pixmap cache.
-    One should ensure that the CachePixelGranularity reflects any 
-    alignment restrictions that the accelerator may put on 8x8 pattern 
-    storage locations.  When HARDWARE_PATTERN_PROGRAMMED_ORIGIN is set 
-    there is only one pattern stored.  When this flag is not set,
-    all 64 rotations off the pattern are accessible but it is assumed
-    that the accelerator is capable of accessing data stored on 8
-    pixel boundaries.  If the accelerator has stricter alignment 
-    requirements than this the dirver will need to provide its own 
-    8x8 color pattern caching routines. 
-
-
-void SetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
-               int rop, unsigned int planemask, int trans_color)
-
-    SetupForColor8x8PatternFill indicates that any combination of the 
-    following  may follow it.
-
-       SubsequentColor8x8PatternFillRect
-       SubsequentColor8x8PatternFillTrap       (not implemented yet)
-
-    For the meanings of patx and paty, see the table above.  Trans_color
-    means the same as for the ScreenToScreenCopy functions.
-
-
-void SubsequentColor8x8PatternFillRect( ScrnInfoPtr pScrn,
-               int patx, int paty, int x, int y, int w, int h)
-
-     Fill a rectangle of dimensions "w" by "h" with origin at (x,y) 
-     using the parameters give by the last SetupForColor8x8PatternFill
-     call.  The meanings of patx and paty can be determined by the
-     table above.
-
-void SubsequentColor8x8PatternFillTrap( ScrnInfoPtr pScrn,
-                          int patx, int paty, int y, int h, 
-                          int left, int dxL, int dyL, int eL,
-                          int right, int dxR, int dyR, int eR )
-
-    For the meanings of patx and paty, see the table above. 
-    The rest of the fields have the same meanings as those in the 
-    SubsequentSolidFillTrap function. 
-
-
-
-2.8  Image Writes
-
-    XAA provides a mechanism for transfering full color pixel data from
-    system memory to video memory through the accelerator.  This is 
-    useful for dealing with alignment issues and performing raster ops
-    on the data when writing it to the framebuffer.  As with color
-    expansion rectangles, there is a direct and indirect method.  The
-    direct method sends all data through a memory mapped aperature.
-    The indirect method sends the data to an intermediated buffer scanline 
-    at a time.
-
-    The direct and indirect methods have separate flags fields, the
-    ImageWriteFlags and ScanlineImageWriteFlags respectively.
-    Flags specific to one method or the other are described in sections 
-    2.8.1 and 2.8.2 but for both cases the GXCOPY_ONLY, ROP_NEEDS_SOURCE
-    and NO_PLANEMASK flags described in Section 2.0 are valid as well as
-    the following:
-
-    NO_GXCOPY
-
-      In order to have accelerated image transfers faster than the 
-      software versions for GXcopy, the engine needs to support clipping,
-      be using the direct method and have a large enough image transfer
-      range so that CPU_TRANSFER_BASE_FIXED doesn't need to be set.
-      If these are not supported, then it is unlikely that transfering
-      the data through the accelerator will be of any advantage for the
-      simple case of GXcopy.  In fact, it may be much slower.  For such
-      cases it's probably best to set the NO_GXCOPY flag so that 
-      Image writes will only be used for the more complicated rops.
-
-    /* transparency restrictions */
-
-    NO_TRANSPARENCY
-     
-      This indicates that the accelerator does not support skipping
-      of color keyed pixels when copying from the source to the destination.
-
-    TRANSPARENCY_GXCOPY_ONLY
-
-      This indicates that the accelerator supports skipping of color keyed
-      pixels only when the rop is GXcopy.
-
-    /* clipping  (optional) */
-    
-    LEFT_EDGE_CLIPPING
-      This indicates that the accelerator supports omission of up to
-      3 pixels on the left edge of the rectangle to be filled.  This
-      is beneficial since it allows transfer from the source pixmap to
-      always occur from DWORD boundaries. 
-
-    LEFT_EDGE_CLIPPING_NEGATIVE_X
-
-      This flag indicates that the accelerator can fill areas with
-      image write data even if the value of x origin is negative (off of
-      the screen on the left edge).
-
-
-2.8.1 The Direct Method
-
-    Using the direct method of ImageWrite XAA will send all
-    bitmap data to the accelerator serially through an memory mapped
-    transfer window defined by the following two fields:
-
-      unsigned char *ImageWriteBase
-
-        This indicates the memory address of the beginning of the aperture.
-
-      int ImageWriteRange
-
-        This indicates the size in bytes of the aperture.
-
-    The driver should specify how the transfered data should be padded.
-    There are options for both the padding of each Y scanline and for the
-    total transfer to the aperature.
-    One of the following two flags must be set:
-
-      CPU_TRANSFER_PAD_DWORD
-
-        This indicates that the total transfer (sum of all scanlines) sent
-        to the aperature must be DWORD padded.  This is the default behavior.
-
-      CPU_TRANSFER_PAD_QWORD 
-
-       This indicates that the total transfer (sum of all scanlines) sent
-       to the aperature must be QWORD padded.  With this set, XAA will send
-        an extra DWORD to the aperature when needed to ensure that only
-        an even number of DWORDs are sent.
-
-    And then there are the flags for padding of each scanline:
-
-      SCANLINE_PAD_DWORD
-
-       This indicates that each Y scanline should be DWORD padded.
-        This is the only option available and is the default.
-
-    Finally, there is the CPU_TRANSFER_BASE_FIXED flag which indicates
-    that the aperture is a single register rather than a range of
-    registers, and XAA should write all of the data to the first DWORD.
-    XAA will automatically select CPU_TRANSFER_BASE_FIXED if the 
-    ImageWriteRange is not large enough to accomodate an entire scanline.   
-
-
-void SetupForImageWrite(ScrnInfoPtr pScrn, int rop, unsigned int planemask,
-                               int trans_color, int bpp, int depth)
-
-     If trans_color is not -1 then trans_color indicates the transparency
-     color key and pixels with color trans_color passed through the 
-     aperature should not be transfered to the screen but should be 
-     skipped.  Bpp and depth indicate the bits per pixel and depth of
-     the source pixmap.  Trans_color is always -1 if the NO_TRANSPARENCY
-     flag is set.
-
-
-void SubsequentImageWriteRect(ScrnInfoPtr pScrn, 
-                               int x, int y, int w, int h, int skipleft)
-
-     
-     Data passed through the aperature should be copied to a rectangle
-     of width "w" and height "h" with origin (x,y).  If LEFT_EDGE_CLIPPING
-     has been enabled, skipleft will correspond to the number of pixels
-     on the left edge that should not be drawn.  Skipleft is zero 
-     otherwise.
-
-     It can be arranged for XAA to call Sync() after it is through 
-     calling the Subsequent functions by setting SYNC_AFTER_IMAGE_WRITE 
-     in the  ImageWriteFlags.  This can provide the driver with an
-     oportunity to reset a clipping window if needed.
-
-2.8.2  The Indirect Method
-
-     Using the indirect method, XAA will render the pixel data scanline
-     at a time to one or more buffers.  These buffers may be memory
-     mapped apertures or just intermediate storage.
-
-     int NumScanlineImageWriteBuffers
-
-       This indicates the number of buffers available.
-
-     unsigned char **ScanlineImageWriteBuffers
-
-       This is an array of pointers to the memory locations of each buffer.
-       Each buffer is expected to be large enough to accommodate scanlines
-       the width of the screen.  That is:
-
-         pScrn->VirtualX * pScreen->bitsPerPixel/8   bytes or more.
-
-       If LEFT_EDGE_CLIPPING_NEGATIVE_X is set, add an additional 4
-       bytes to that requirement in 8 and 16bpp, 12 bytes in 24bpp.
-  
-     Scanlines are always DWORD padded.
-
-void SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop, 
-                               unsigned int planemask, int trans_color, 
-                               int bpp, int depth)
-
-     If trans_color is not -1 then trans_color indicates the transparency
-     color key and pixels with color trans_color in the buffer should not 
-     be transfered to the screen but should be skipped.  Bpp and depth 
-     indicate the bits per pixel and depth of the source bitmap.  
-     Trans_color is always -1 if the NO_TRANSPARENCY flag is set.
-
-
-void SubsequentImageWriteRect(ScrnInfoPtr pScrn, 
-                               int x, int y, int w, int h, int skipleft)
-
-     
-void SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno)
-
-
-    When SubsequentImageWriteRect is called, XAA will begin
-    transfering the source data scanline at a time, calling  
-    SubsequentImageWriteScanline after each scanline.  If more than
-    one buffer is available, XAA will cycle through the buffers.
-    Subsequent scanlines will use the next buffer and go back to the
-    buffer 0 again when the last buffer is reached.  The index into
-    the ScanlineImageWriteBuffers array is presented as "bufno"
-    with each SubsequentImageWriteScanline call.
-
-    The skipleft field is the same as for the direct method.
-
-    The indirect method can be use to send the source data directly 
-    to a memory mapped aperture represented by a single image write
-    buffer, scanline at a time, but more commonly it is used to place 
-    the data into offscreen video memory so that the accelerator can 
-    blit it to the visible screen from there.  In the case where the
-    accelerator permits rendering into offscreen video memory while
-    the accelerator is active, several buffers can be used so that
-    XAA can be placing source data into the next buffer while the
-    accelerator is blitting the current buffer.  For cases where
-    the accelerator requires some special manipulation of the source
-    data first, the buffers can be in system memory.  The CPU can
-    manipulate these buffers and then send the data to the accelerator.
-
-
-2.9 Clipping
-
-    XAA supports hardware clipping rectangles.  To use clipping
-    in this way it is expected that the graphics accelerator can
-    clip primitives with verticies anywhere in the 16 bit signed 
-    coordinate system. 
-
-void SetClippingRectangle ( ScrnInfoPtr pScrn,
-                       int left, int top, int right, int bottom)
-
-void DisableClipping (ScrnInfoPtr pScrn)
-
-    When SetClippingRectangle is called, all hardware rendering
-    following it should be clipped to the rectangle specified
-    until DisableClipping is called.
-
-    The ClippingFlags field indicates which operations this sort
-    of Set/Disable pairing can be used with.  Any of the following
-    flags may be OR'd together.
-
-       HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND
-       HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
-       HARDWARE_CLIP_MONO_8x8_FILL
-       HARDWARE_CLIP_COLOR_8x8_FILL
-       HARDWARE_CLIP_SOLID_FILL
-       HARDWARE_CLIP_DASHED_LINE
-       HARDWARE_CLIP_SOLID_LINE
-
-
-
-3)  XAA PIXMAP CACHE
-
-   /* NOTE:  XAA has no knowledge of framebuffer particulars so until
-       the framebuffer is able to render into offscreen memory, usage
-       of the pixmap cache requires that the driver provide ImageWrite
-       routines or a WritePixmap or WritePixmapToCache replacement so
-       that patterns can even be placed in the cache.
-
-      ADDENDUM: XAA can now load the pixmap cache without requiring
-       that the driver supply an ImageWrite function, but this can
-       only be done on linear framebuffers.  If you have a linear
-       framebuffer, set LINEAR_FRAMEBUFFER in the XAAInfoRec.Flags
-       field and XAA will then be able to upload pixmaps into the
-       cache without the driver providing functions to do so.
-   */
-
-
-   The XAA pixmap cache provides a mechanism for caching of patterns
-   in offscreen video memory so that tiled fills and in some cases
-   stippling can be done by blitting the source patterns from offscreen
-   video memory. The pixmap cache also provides the mechanism for caching 
-   of 8x8 color and mono hardware patterns.  Any unused offscreen video
-   memory gets used for the pixmap cache and that information is 
-   provided by the XFree86 Offscreen Memory Manager. XAA registers a 
-   callback with the manager so that it can be informed of any changes 
-   in the offscreen memory configuration.  The driver writer does not 
-   need to deal with any of this since it is all automatic.  The driver 
-   merely needs to initialize the Offscreen Memory Manager as described 
-   in the DESIGN document and set the PIXMAP_CACHE flag in the 
-   XAAInfoRec.Flags field.  The Offscreen Memory Manager initialization 
-   must occur before XAA is initialized or else pixmap cache 
-   initialization will fail.  
-
-   PixmapCacheFlags is an XAAInfoRec field which allows the driver to
-   control pixmap cache behavior to some extent.  Currently only one
-   flag is defined:
-
-   DO_NOT_BLIT_STIPPLES
-
-     This indicates that the stippling should not be done by blitting
-     from the pixmap cache.  This does not apply to 8x8 pattern fills. 
-
-
-   CachePixelGranularity is an optional field.  If the hardware requires
-   that a 8x8 patterns have some particular pixel alignment it should
-   be reflected in this field.  Ignoring this field or setting it to
-   zero or one means there are no alignment issues.
-
-
-4)  OFFSCREEN PIXMAPS
-
-   XAA has the ability to store pixmap drawables in offscreen video 
-   memory and render into them with full hardware acceleration.  Placement
-   of pixmaps in the cache is done automatically on a first-come basis and 
-   only if there is room.  To enable this feature, set the OFFSCREEN_PIXMAPS
-   flag in the XAAInfoRec.Flags field.  This is only available when a
-   ScreenToScreenCopy function is provided, when the Offscreen memory 
-   manager has been initialized and when the LINEAR_FRAMEBUFFER flag is
-   also set.
-
-   int maxOffPixWidth
-   int maxOffPixHeight
-
-       These two fields allow the driver to limit the maximum dimensions
-     of an offscreen pixmap.  If one of these is not set, it is assumed
-     that there is no limit on that dimension.  Note that if an offscreen
-     pixmap with a particular dimension is allowed, then your driver will be
-     expected to render primitives as large as that pixmap.  
-
-$XFree86: xc/programs/Xserver/hw/xfree86/xaa/XAA.HOWTO,v 1.12 2000/04/12 14:44:42 tsi Exp $
diff --git a/hw/xfree86/xaa/l-xaaBitmap.c b/hw/xfree86/xaa/l-xaaBitmap.c
deleted file mode 100644 (file)
index 4b20dee..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define LSBFIRST
-#include "./xaaBitmap.c"
diff --git a/hw/xfree86/xaa/l-xaaStipple.c b/hw/xfree86/xaa/l-xaaStipple.c
deleted file mode 100644 (file)
index 91c52c7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define LSBFIRST
-#include "./xaaStipple.c"
diff --git a/hw/xfree86/xaa/l-xaaTEGlyph.c b/hw/xfree86/xaa/l-xaaTEGlyph.c
deleted file mode 100644 (file)
index e58359c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define LSBFIRST
-#include "./xaaTEGlyph.c"
diff --git a/hw/xfree86/xaa/l3-xaaBitmap.c b/hw/xfree86/xaa/l3-xaaBitmap.c
deleted file mode 100644 (file)
index 0c1fd55..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define LSBFIRST
-#define TRIPLE_BITS
-#include "./xaaBitmap.c"
diff --git a/hw/xfree86/xaa/l3-xaaStipple.c b/hw/xfree86/xaa/l3-xaaStipple.c
deleted file mode 100644 (file)
index 9a182c6..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define LSBFIRST
-#define TRIPLE_BITS
-#include "./xaaStipple.c"
diff --git a/hw/xfree86/xaa/lf-xaaBitmap.c b/hw/xfree86/xaa/lf-xaaBitmap.c
deleted file mode 100644 (file)
index 031407b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define LSBFIRST
-#define FIXEDBASE
-#include "./xaaBitmap.c"
diff --git a/hw/xfree86/xaa/lf-xaaStipple.c b/hw/xfree86/xaa/lf-xaaStipple.c
deleted file mode 100644 (file)
index d912658..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define LSBFIRST
-#define FIXEDBASE
-#include "./xaaStipple.c"
diff --git a/hw/xfree86/xaa/lf-xaaTEGlyph.c b/hw/xfree86/xaa/lf-xaaTEGlyph.c
deleted file mode 100644 (file)
index c578603..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define LSBFIRST
-#define FIXEDBASE
-#include "./xaaTEGlyph.c"
diff --git a/hw/xfree86/xaa/lf3-xaaBitmap.c b/hw/xfree86/xaa/lf3-xaaBitmap.c
deleted file mode 100644 (file)
index 0607a73..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define LSBFIRST
-#define TRIPLE_BITS
-#define FIXEDBASE
-#include "./xaaBitmap.c"
diff --git a/hw/xfree86/xaa/lf3-xaaStipple.c b/hw/xfree86/xaa/lf3-xaaStipple.c
deleted file mode 100644 (file)
index af1698b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define LSBFIRST
-#define TRIPLE_BITS
-#define FIXEDBASE
-#include "./xaaStipple.c"
diff --git a/hw/xfree86/xaa/m-xaaBitmap.c b/hw/xfree86/xaa/m-xaaBitmap.c
deleted file mode 100644 (file)
index d0e3cb3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define MSBFIRST
-#include "./xaaBitmap.c"
diff --git a/hw/xfree86/xaa/m-xaaStipple.c b/hw/xfree86/xaa/m-xaaStipple.c
deleted file mode 100644 (file)
index 1ba7899..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define MSBFIRST
-#include "./xaaStipple.c"
diff --git a/hw/xfree86/xaa/m-xaaTEGlyph.c b/hw/xfree86/xaa/m-xaaTEGlyph.c
deleted file mode 100644 (file)
index 521390c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define MSBFIRST
-#include "./xaaTEGlyph.c"
diff --git a/hw/xfree86/xaa/m3-xaaBitmap.c b/hw/xfree86/xaa/m3-xaaBitmap.c
deleted file mode 100644 (file)
index 7b4ce81..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define MSBFIRST
-#define TRIPLE_BITS
-#include "./xaaBitmap.c"
diff --git a/hw/xfree86/xaa/m3-xaaStipple.c b/hw/xfree86/xaa/m3-xaaStipple.c
deleted file mode 100644 (file)
index eb2c83e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define MSBFIRST
-#define TRIPLE_BITS
-#include "./xaaStipple.c"
diff --git a/hw/xfree86/xaa/mf-xaaBitmap.c b/hw/xfree86/xaa/mf-xaaBitmap.c
deleted file mode 100644 (file)
index 36075e6..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define MSBFIRST
-#define FIXEDBASE
-#include "./xaaBitmap.c"
diff --git a/hw/xfree86/xaa/mf-xaaStipple.c b/hw/xfree86/xaa/mf-xaaStipple.c
deleted file mode 100644 (file)
index 41b469c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define MSBFIRST
-#define FIXEDBASE
-#include "./xaaStipple.c"
diff --git a/hw/xfree86/xaa/mf-xaaTEGlyph.c b/hw/xfree86/xaa/mf-xaaTEGlyph.c
deleted file mode 100644 (file)
index 3fd657b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define MSBFIRST
-#define FIXEDBASE
-#include "./xaaTEGlyph.c"
diff --git a/hw/xfree86/xaa/mf3-xaaBitmap.c b/hw/xfree86/xaa/mf3-xaaBitmap.c
deleted file mode 100644 (file)
index 630775c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define MSBFIRST
-#define TRIPLE_BITS
-#define FIXEDBASE
-#include "./xaaBitmap.c"
diff --git a/hw/xfree86/xaa/mf3-xaaStipple.c b/hw/xfree86/xaa/mf3-xaaStipple.c
deleted file mode 100644 (file)
index c9a86d0..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define MSBFIRST
-#define TRIPLE_BITS
-#define FIXEDBASE
-#include "./xaaStipple.c"
diff --git a/hw/xfree86/xaa/s-xaaDashLine.c b/hw/xfree86/xaa/s-xaaDashLine.c
deleted file mode 100644 (file)
index 5ad3deb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define POLYSEGMENT
-#include "./xaaDashLine.c"
diff --git a/hw/xfree86/xaa/s-xaaLine.c b/hw/xfree86/xaa/s-xaaLine.c
deleted file mode 100644 (file)
index 12a37f4..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define POLYSEGMENT
-#include "./xaaLine.c"
diff --git a/hw/xfree86/xaa/xaa.h b/hw/xfree86/xaa/xaa.h
deleted file mode 100644 (file)
index b530037..0000000
+++ /dev/null
@@ -1,1038 +0,0 @@
-
-#ifndef _XAA_H
-#define _XAA_H
-
-#define XAA_VERSION_MAJOR   1
-#define XAA_VERSION_MINOR   2
-#define XAA_VERSION_RELEASE 1
-
-/*
-
-   ******** OPERATION SPECIFIC FLAGS *********
-
-   **** solid/dashed line flags ****
----------               --------
-23           LINE_PATTERN_LSBFIRST_MSBJUSTIFIED
-22           LINE_PATTERN_LSBFIRST_LSBJUSTIFIED
-21           LINE_PATTERN_MSBFIRST_MSBJUSTIFIED
-20           LINE_PATTERN_MSBFIRST_LSBJUSTIFIED
-19           LINE_PATTERN_POWER_OF_2_ONLY
-18           LINE_LIMIT_COORDS
-17                         .
-16                         .
----------               -------
-
-   **** screen to screen copy flags ****
-
----------               --------
-23           ONLY_LEFT_TO_RIGHT_BITBLT
-22           ONLY_TWO_BITBLT_DIRECTIONS
-21                         .
-20                         .
-19                         .
-18                         .
-17                         .
-16                         .
----------               -------
-
-   ****  clipping flags ****
-
----------               --------
-23                         .
-22           HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND
-21           HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
-20           HARDWARE_CLIP_MONO_8x8_FILL
-19           HARDWARE_CLIP_COLOR_8x8_FILL    
-18           HARDWARE_CLIP_SOLID_FILL
-17           HARDWARE_CLIP_DASHED_LINE
-16           HARDWARE_CLIP_SOLID_LINE
----------               -------
-
-   ****  hardware pattern flags ****
-
----------               --------
-23                         .
-22                         .
-21           HARDWARE_PATTERN_SCREEN_ORIGIN
-20                         .
-19                         .
-18                         .
-17           HARDWARE_PATTERN_PROGRAMMED_ORIGIN
-16           HARDWARE_PATTERN_PROGRAMMED_BITS
----------               -------
-
-   ****  write pixmap flags ****
-
----------               --------
-23                         .
-22                         .
-21                         .
-20                         .
-19                         .
-18                         .
-17                         .
-16           CONVERT_32BPP_TO_24BPP
----------               -------
-
-   ******** GENERIC FLAGS *********
-
----------               -------
-15           SYNC_AFTER_COLOR_EXPAND
-14           CPU_TRANSFER_PAD_QWORD
-13                         .
-12           LEFT_EDGE_CLIPPING_NEGATIVE_X
-11          LEFT_EDGE_CLIPPING
-10          CPU_TRANSFER_BASE_FIXED
- 9           BIT_ORDER_IN_BYTE_MSBFIRST           
- 8           TRANSPARENCY_GXCOPY_ONLY
----------               -------
- 7           NO_TRANSPARENCY
- 6           TRANSPARENCY_ONLY
- 5           ROP_NEEDS_SOURCE
- 4           TRIPLE_BITS_24BPP
- 3           RGB_EQUAL
- 2           NO_PLANEMASK
- 1           NO_GXCOPY
- 0           GXCOPY_ONLY
----------               -------
-
-
-*/
-
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "regionstr.h"
-#include "xf86fbman.h"
-
-#include "picturestr.h"
-
-/* Flags */
-#define PIXMAP_CACHE                   0x00000001
-#define MICROSOFT_ZERO_LINE_BIAS       0x00000002
-#define OFFSCREEN_PIXMAPS              0x00000004
-#define LINEAR_FRAMEBUFFER             0x00000008
-
-/* GC fg, bg, and planemask restrictions */
-#define GXCOPY_ONLY                    0x00000001
-#define NO_GXCOPY                      0x00000002
-#define NO_PLANEMASK                   0x00000004
-#define RGB_EQUAL                      0x00000008
-#define TRIPLE_BITS_24BPP              0x00000010
-#define ROP_NEEDS_SOURCE               0x00000020
-
-/* transparency restrictions */
-#define TRANSPARENCY_ONLY              0x00000040
-#define NO_TRANSPARENCY                        0x00000080
-#define TRANSPARENCY_GXCOPY_ONLY       0x00000100
-
-/* bit order restrictions */
-#define BIT_ORDER_IN_BYTE_MSBFIRST     0x00000200
-#define BIT_ORDER_IN_BYTE_LSBFIRST     0x00000000
-
-/* transfer base restriction */
-#define CPU_TRANSFER_BASE_FIXED                0x00000400
-
-/* skipleft restrictions */
-#define LEFT_EDGE_CLIPPING             0x00000800
-#define LEFT_EDGE_CLIPPING_NEGATIVE_X  0x00001000
-
-/* data padding */
-#define CPU_TRANSFER_PAD_DWORD         0x00000000
-#define CPU_TRANSFER_PAD_QWORD         0x00004000
-#define SCANLINE_PAD_DWORD             0x00000000
-
-#define SYNC_AFTER_COLOR_EXPAND                0x00008000
-#define SYNC_AFTER_IMAGE_WRITE         SYNC_AFTER_COLOR_EXPAND
-
-/* hardware pattern */
-#define HARDWARE_PATTERN_PROGRAMMED_BITS       0x00010000
-#define HARDWARE_PATTERN_PROGRAMMED_ORIGIN     0x00020000
-#define HARDWARE_PATTERN_SCREEN_ORIGIN         0x00200000
-
-/* copyarea flags */
-#define ONLY_TWO_BITBLT_DIRECTIONS     0x00400000
-#define ONLY_LEFT_TO_RIGHT_BITBLT      0x00800000
-
-/* line flags */
-#define LINE_PATTERN_LSBFIRST_MSBJUSTIFIED     0x00800000
-#define LINE_PATTERN_LSBFIRST_LSBJUSTIFIED     0x00400000
-#define LINE_PATTERN_MSBFIRST_MSBJUSTIFIED     0x00200000
-#define LINE_PATTERN_MSBFIRST_LSBJUSTIFIED     0x00100000
-#define LINE_PATTERN_POWER_OF_2_ONLY           0x00080000
-#define LINE_LIMIT_COORDS                      0x00040000
-
-/* clipping flags */
-#define HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND    0x00400000
-#define HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY            0x00200000
-#define HARDWARE_CLIP_MONO_8x8_FILL                    0x00100000
-#define HARDWARE_CLIP_COLOR_8x8_FILL                   0x00080000
-#define HARDWARE_CLIP_SOLID_FILL                       0x00040000
-#define HARDWARE_CLIP_DASHED_LINE                      0x00020000
-#define HARDWARE_CLIP_SOLID_LINE                       0x00010000
-
-#define HARDWARE_CLIP_LINE                             0x00000000
-
-/* image write flags */
-#define CONVERT_32BPP_TO_24BPP                 0x00010000
-
-/* pixmap cache flags */
-#define CACHE_MONO_8x8                 0x00000001
-#define CACHE_COLOR_8x8                        0x00000002
-#define DO_NOT_BLIT_STIPPLES           0x00000004
-#define DO_NOT_TILE_MONO_DATA          0x00000008
-#define DO_NOT_TILE_COLOR_DATA         0x00000010
-
-#define DEGREES_0      0
-#define DEGREES_90     1
-#define DEGREES_180    2
-#define DEGREES_270    3
-
-#define OMIT_LAST      1
-
-/* render flags */
-
-#define XAA_RENDER_POWER_OF_2_TILE_ONLY        0x00000008
-#define XAA_RENDER_NO_SRC_ALPHA                0x00000004
-#define XAA_RENDER_IMPRECISE_ONLY      0x00000002
-#define XAA_RENDER_NO_TILE             0x00000001
-
-#define XAA_RENDER_REPEAT              0x00000001
-
-typedef void (*ValidateGCProcPtr) (GCPtr pGC,
-                                   unsigned long changes, DrawablePtr pDraw);
-
-typedef struct {
-    unsigned char *bits;
-    int width;
-    int height;
-    int yoff;
-    int srcwidth;
-    int start;
-    int end;
-} NonTEGlyphInfo, *NonTEGlyphPtr;
-
-typedef struct {
-    int x;
-    int y;
-    int w;
-    int h;
-    int orig_w;
-    int orig_h;
-    unsigned long serialNumber;
-    int pat0;
-    int pat1;
-    int fg;
-    int bg;
-    int trans_color;
-    DDXPointPtr offsets;
-    DevUnion devPrivate;
-} XAACacheInfoRec, *XAACacheInfoPtr;
-
-typedef struct _PixmapLink {
-    PixmapPtr pPix;
-    struct _PixmapLink *next;
-    FBAreaPtr area;
-} PixmapLink, *PixmapLinkPtr;
-
-typedef struct _XAAInfoRec {
-    ScrnInfoPtr pScrn;
-    int Flags;
-
-    void (*Sync) (ScrnInfoPtr pScrn);
-
-    /* Restore Accel State is a driver callback that is used
-     * when another screen on the same device has been active.
-     * This allows multihead on a single device to work.
-     * If The entityProp has IS_SHARED_ACCEL defined then this
-     * function is required.
-     */
-
-    void (*RestoreAccelState) (ScrnInfoPtr pScrn);
-
-   /***************** Low Level *****************/
-
-/* Blits */
-    void (*SetupForScreenToScreenCopy) (ScrnInfoPtr pScrn,
-                                        int xdir, int ydir,
-                                        int rop,
-                                        unsigned int planemask,
-                                        int trans_color);
-    int ScreenToScreenCopyFlags;
-
-    void (*SubsequentScreenToScreenCopy) (ScrnInfoPtr pScrn,
-                                          int xsrc, int ysrc,
-                                          int xdst, int ydst, int w, int h);
-
-/* Solid fills */
-    void (*SetupForSolidFill) (ScrnInfoPtr pScrn,
-                               int color, int rop, unsigned int planemask);
-    int SolidFillFlags;
-
-    void (*SubsequentSolidFillRect) (ScrnInfoPtr pScrn,
-                                     int x, int y, int w, int h);
-
-    void (*SubsequentSolidFillTrap) (ScrnInfoPtr pScrn,
-                                     int y, int h,
-                                     int left, int dxL, int dyL, int eL,
-                                     int right, int dxR, int dyR, int eR);
-
-/* Solid lines */
-
-    void (*SetupForSolidLine) (ScrnInfoPtr pScrn,
-                               int color, int rop, unsigned int planemask);
-    int SolidLineFlags;
-
-    void (*SubsequentSolidTwoPointLine) (ScrnInfoPtr pScrn,
-                                         int xa, int ya, int xb, int yb,
-                                         int flags);
-
-    void (*SubsequentSolidBresenhamLine) (ScrnInfoPtr pScrn,
-                                          int x, int y, int absmaj, int absmin,
-                                          int err, int len, int octant);
-    int SolidBresenhamLineErrorTermBits;
-
-    void (*SubsequentSolidHorVertLine) (ScrnInfoPtr pScrn,
-                                        int x, int y, int len, int dir);
-
-/* Dashed lines */
-
-    void (*SetupForDashedLine) (ScrnInfoPtr pScrn,
-                                int fg, int bg,
-                                int rop,
-                                unsigned int planemask,
-                                int length, unsigned char *pattern);
-    int DashedLineFlags;
-    int DashPatternMaxLength;
-
-    void (*SubsequentDashedTwoPointLine) (ScrnInfoPtr pScrn,
-                                          int xa, int ya, int xb, int yb,
-                                          int flags, int phase);
-
-    void (*SubsequentDashedBresenhamLine) (ScrnInfoPtr pScrn,
-                                           int x, int y, int absmaj, int absmin,
-                                           int err, int len, int flags,
-                                           int phase);
-    int DashedBresenhamLineErrorTermBits;
-
-/* Clipper */
-
-    void (*SetClippingRectangle) (ScrnInfoPtr pScrn,
-                                  int left, int top, int right, int bottom);
-    int ClippingFlags;
-
-    void (*DisableClipping) (ScrnInfoPtr pScrn);
-
-/* 8x8 mono pattern fills */
-    void (*SetupForMono8x8PatternFill) (ScrnInfoPtr pScrn,
-                                        int patx, int paty,
-                                        int fg, int bg,
-                                        int rop, unsigned int planemask);
-    int Mono8x8PatternFillFlags;
-
-    void (*SubsequentMono8x8PatternFillRect) (ScrnInfoPtr pScrn,
-                                              int patx, int paty,
-                                              int x, int y, int w, int h);
-
-    void (*SubsequentMono8x8PatternFillTrap) (ScrnInfoPtr pScrn,
-                                              int patx, int paty,
-                                              int y, int h,
-                                              int left, int dxL, int dyL,
-                                              int eL, int right, int dxR,
-                                              int dyR, int eR);
-
-/* 8x8 color pattern fills */
-
-    void (*SetupForColor8x8PatternFill) (ScrnInfoPtr pScrn,
-                                         int patx, int paty,
-                                         int rop,
-                                         unsigned int planemask,
-                                         int transparency_color);
-    int Color8x8PatternFillFlags;
-
-    void (*SubsequentColor8x8PatternFillRect) (ScrnInfoPtr pScrn,
-                                               int patx, int paty,
-                                               int x, int y, int w, int h);
-
-    void (*SubsequentColor8x8PatternFillTrap) (ScrnInfoPtr pScrn,
-                                               int patx, int paty,
-                                               int y, int h,
-                                               int left, int dxL, int dyL,
-                                               int eL, int right, int dxR,
-                                               int dyR, int eR);
-
-/* Color expansion */
-
-    void (*SetupForCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn,
-                                                int fg, int bg,
-                                                int rop,
-                                                unsigned int planemask);
-    int CPUToScreenColorExpandFillFlags;
-
-    void (*SubsequentCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn,
-                                                  int x, int y, int w, int h,
-                                                  int skipleft);
-
-    unsigned char *ColorExpandBase;
-    int ColorExpandRange;
-
-/* Scanline color expansion  */
-
-    void (*SetupForScanlineCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn,
-                                                        int fg, int bg,
-                                                        int rop,
-                                                        unsigned int planemask);
-    int ScanlineCPUToScreenColorExpandFillFlags;
-
-    void (*SubsequentScanlineCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn,
-                                                          int x, int y, int w,
-                                                          int h, int skipleft);
-
-    void (*SubsequentColorExpandScanline) (ScrnInfoPtr pScrn, int bufno);
-
-    int NumScanlineColorExpandBuffers;
-    unsigned char **ScanlineColorExpandBuffers;
-
-/* Screen to screen color expansion */
-
-    void (*SetupForScreenToScreenColorExpandFill) (ScrnInfoPtr pScrn,
-                                                   int fg, int bg,
-                                                   int rop,
-                                                   unsigned int planemask);
-    int ScreenToScreenColorExpandFillFlags;
-
-    void (*SubsequentScreenToScreenColorExpandFill) (ScrnInfoPtr pScrn,
-                                                     int x, int y, int w, int h,
-                                                     int srcx, int srcy,
-                                                     int skipleft);
-
-/*  Image transfers */
-
-    void (*SetupForImageWrite) (ScrnInfoPtr pScrn,
-                                int rop,
-                                unsigned int planemask,
-                                int transparency_color, int bpp, int depth);
-    int ImageWriteFlags;
-
-    void (*SubsequentImageWriteRect) (ScrnInfoPtr pScrn,
-                                      int x, int y, int w, int h, int skipleft);
-    unsigned char *ImageWriteBase;
-    int ImageWriteRange;
-
-/*  Scanline Image transfers */
-
-    void (*SetupForScanlineImageWrite) (ScrnInfoPtr pScrn,
-                                        int rop,
-                                        unsigned int planemask,
-                                        int transparency_color,
-                                        int bpp, int depth);
-    int ScanlineImageWriteFlags;
-
-    void (*SubsequentScanlineImageWriteRect) (ScrnInfoPtr pScrn,
-                                              int x, int y, int w, int h,
-                                              int skipleft);
-
-    void (*SubsequentImageWriteScanline) (ScrnInfoPtr pScrn, int bufno);
-
-    int NumScanlineImageWriteBuffers;
-    unsigned char **ScanlineImageWriteBuffers;
-
-    /* Image Reads - OBSOLETE AND NOT USED */
-
-    void (*SetupForImageRead) (ScrnInfoPtr pScrn, int bpp, int depth);
-    int ImageReadFlags;
-
-    unsigned char *ImageReadBase;
-    int ImageReadRange;
-
-    void (*SubsequentImageReadRect) (ScrnInfoPtr pScrn,
-                                     int x, int y, int w, int h);
-
-   /***************** Mid Level *****************/
-    void (*ScreenToScreenBitBlt) (ScrnInfoPtr pScrn,
-                                  int nbox,
-                                  DDXPointPtr pptSrc,
-                                  BoxPtr pbox,
-                                  int xdir, int ydir,
-                                  int alu, unsigned int planmask);
-    int ScreenToScreenBitBltFlags;
-
-    void (*WriteBitmap) (ScrnInfoPtr pScrn,
-                         int x, int y, int w, int h,
-                         unsigned char *src,
-                         int srcwidth,
-                         int skipleft,
-                         int fg, int bg, int rop, unsigned int planemask);
-    int WriteBitmapFlags;
-
-    void (*FillSolidRects) (ScrnInfoPtr pScrn,
-                            int fg, int rop,
-                            unsigned int planemask, int nBox, BoxPtr pBox);
-    int FillSolidRectsFlags;
-
-    void (*FillMono8x8PatternRects) (ScrnInfoPtr pScrn,
-                                     int fg, int bg, int rop,
-                                     unsigned int planemask,
-                                     int nBox,
-                                     BoxPtr pBox,
-                                     int pat0, int pat1, int xorg, int yorg);
-    int FillMono8x8PatternRectsFlags;
-
-    void (*FillColor8x8PatternRects) (ScrnInfoPtr pScrn,
-                                      int rop,
-                                      unsigned int planemask,
-                                      int nBox,
-                                      BoxPtr pBox,
-                                      int xorg, int yorg,
-                                      XAACacheInfoPtr pCache);
-    int FillColor8x8PatternRectsFlags;
-
-    void (*FillCacheBltRects) (ScrnInfoPtr pScrn,
-                               int rop,
-                               unsigned int planemask,
-                               int nBox,
-                               BoxPtr pBox,
-                               int xorg, int yorg, XAACacheInfoPtr pCache);
-    int FillCacheBltRectsFlags;
-
-    void (*FillColorExpandRects) (ScrnInfoPtr pScrn,
-                                  int fg, int bg, int rop,
-                                  unsigned int planemask,
-                                  int nBox,
-                                  BoxPtr pBox,
-                                  int xorg, int yorg, PixmapPtr pPix);
-    int FillColorExpandRectsFlags;
-
-    void (*FillCacheExpandRects) (ScrnInfoPtr pScrn,
-                                  int fg, int bg, int rop,
-                                  unsigned int planemask,
-                                  int nBox,
-                                  BoxPtr pBox,
-                                  int xorg, int yorg, PixmapPtr pPix);
-    int FillCacheExpandRectsFlags;
-
-    void (*FillImageWriteRects) (ScrnInfoPtr pScrn,
-                                 int rop,
-                                 unsigned int planemask,
-                                 int nBox,
-                                 BoxPtr pBox,
-                                 int xorg, int yorg, PixmapPtr pPix);
-    int FillImageWriteRectsFlags;
-
-    void (*FillSolidSpans) (ScrnInfoPtr pScrn,
-                            int fg, int rop,
-                            unsigned int planemask,
-                            int n,
-                            DDXPointPtr points, int *widths, int fSorted);
-    int FillSolidSpansFlags;
-
-    void (*FillMono8x8PatternSpans) (ScrnInfoPtr pScrn,
-                                     int fg, int bg, int rop,
-                                     unsigned int planemask,
-                                     int n,
-                                     DDXPointPtr points,
-                                     int *widths,
-                                     int fSorted,
-                                     int pat0, int pat1, int xorg, int yorg);
-    int FillMono8x8PatternSpansFlags;
-
-    void (*FillColor8x8PatternSpans) (ScrnInfoPtr pScrn,
-                                      int rop,
-                                      unsigned int planemask,
-                                      int n,
-                                      DDXPointPtr points,
-                                      int *widths,
-                                      int fSorted,
-                                      XAACacheInfoPtr pCache,
-                                      int xorg, int yorg);
-    int FillColor8x8PatternSpansFlags;
-
-    void (*FillCacheBltSpans) (ScrnInfoPtr pScrn,
-                               int rop,
-                               unsigned int planemask,
-                               int n,
-                               DDXPointPtr points,
-                               int *widths,
-                               int fSorted,
-                               XAACacheInfoPtr pCache, int xorg, int yorg);
-    int FillCacheBltSpansFlags;
-
-    void (*FillColorExpandSpans) (ScrnInfoPtr pScrn,
-                                  int fg, int bg, int rop,
-                                  unsigned int planemask,
-                                  int n,
-                                  DDXPointPtr points,
-                                  int *widths,
-                                  int fSorted,
-                                  int xorg, int yorg, PixmapPtr pPix);
-    int FillColorExpandSpansFlags;
-
-    void (*FillCacheExpandSpans) (ScrnInfoPtr pScrn,
-                                  int fg, int bg, int rop,
-                                  unsigned int planemask,
-                                  int n,
-                                  DDXPointPtr ppt,
-                                  int *pwidth,
-                                  int fSorted,
-                                  int xorg, int yorg, PixmapPtr pPix);
-    int FillCacheExpandSpansFlags;
-
-    void (*TEGlyphRenderer) (ScrnInfoPtr pScrn,
-                             int x, int y, int w, int h, int skipleft,
-                             int startline, unsigned int **glyphs,
-                             int glyphWidth, int fg, int bg, int rop,
-                             unsigned planemask);
-    int TEGlyphRendererFlags;
-
-    void (*NonTEGlyphRenderer) (ScrnInfoPtr pScrn,
-                                int x, int y, int n,
-                                NonTEGlyphPtr glyphs,
-                                BoxPtr pbox,
-                                int fg, int rop, unsigned int planemask);
-    int NonTEGlyphRendererFlags;
-
-    void (*WritePixmap) (ScrnInfoPtr pScrn,
-                         int x, int y, int w, int h,
-                         unsigned char *src,
-                         int srcwidth,
-                         int rop,
-                         unsigned int planemask,
-                         int transparency_color, int bpp, int depth);
-    int WritePixmapFlags;
-
-    void (*ReadPixmap) (ScrnInfoPtr pScrn,
-                        int x, int y, int w, int h,
-                        unsigned char *dst, int dstwidth, int bpp, int depth);
-    int ReadPixmapFlags;
-
-   /***************** GC Level *****************/
-    RegionPtr (*CopyArea) (DrawablePtr pSrcDrawable,
-                           DrawablePtr pDstDrawable,
-                           GC * pGC,
-                           int srcx, int srcy,
-                           int width, int height, int dstx, int dsty);
-    int CopyAreaFlags;
-
-    RegionPtr (*CopyPlane) (DrawablePtr pSrc,
-                            DrawablePtr pDst,
-                            GCPtr pGC,
-                            int srcx, int srcy,
-                            int width, int height,
-                            int dstx, int dsty, unsigned long bitPlane);
-    int CopyPlaneFlags;
-
-    void (*PushPixelsSolid) (GCPtr pGC,
-                             PixmapPtr pBitMap,
-                             DrawablePtr pDrawable,
-                             int dx, int dy, int xOrg, int yOrg);
-    int PushPixelsFlags;
-
-   /** PolyFillRect **/
-
-    void (*PolyFillRectSolid) (DrawablePtr pDraw,
-                               GCPtr pGC, int nrectFill, xRectangle *prectInit);
-    int PolyFillRectSolidFlags;
-
-    void (*PolyFillRectStippled) (DrawablePtr pDraw,
-                                  GCPtr pGC,
-                                  int nrectFill, xRectangle *prectInit);
-    int PolyFillRectStippledFlags;
-
-    void (*PolyFillRectOpaqueStippled) (DrawablePtr pDraw,
-                                        GCPtr pGC,
-                                        int nrectFill, xRectangle *prectInit);
-    int PolyFillRectOpaqueStippledFlags;
-
-    void (*PolyFillRectTiled) (DrawablePtr pDraw,
-                               GCPtr pGC, int nrectFill, xRectangle *prectInit);
-    int PolyFillRectTiledFlags;
-
-   /** FillSpans **/
-
-    void (*FillSpansSolid) (DrawablePtr pDraw,
-                            GCPtr pGC,
-                            int nInit,
-                            DDXPointPtr ppt, int *pwidth, int fSorted);
-    int FillSpansSolidFlags;
-
-    void (*FillSpansStippled) (DrawablePtr pDraw,
-                               GCPtr pGC,
-                               int nInit,
-                               DDXPointPtr ppt, int *pwidth, int fSorted);
-    int FillSpansStippledFlags;
-
-    void (*FillSpansOpaqueStippled) (DrawablePtr pDraw,
-                                     GCPtr pGC,
-                                     int nInit,
-                                     DDXPointPtr ppt, int *pwidth, int fSorted);
-    int FillSpansOpaqueStippledFlags;
-
-    void (*FillSpansTiled) (DrawablePtr pDraw,
-                            GCPtr pGC,
-                            int nInit,
-                            DDXPointPtr ppt, int *pwidth, int fSorted);
-    int FillSpansTiledFlags;
-
-    int (*PolyText8TE) (DrawablePtr pDraw,
-                        GCPtr pGC, int x, int y, int count, char *chars);
-    int PolyText8TEFlags;
-
-    int (*PolyText16TE) (DrawablePtr pDraw,
-                         GCPtr pGC,
-                         int x, int y, int count, unsigned short *chars);
-    int PolyText16TEFlags;
-
-    void (*ImageText8TE) (DrawablePtr pDraw,
-                          GCPtr pGC, int x, int y, int count, char *chars);
-    int ImageText8TEFlags;
-
-    void (*ImageText16TE) (DrawablePtr pDraw,
-                           GCPtr pGC,
-                           int x, int y, int count, unsigned short *chars);
-    int ImageText16TEFlags;
-
-    void (*ImageGlyphBltTE) (DrawablePtr pDrawable,
-                             GCPtr pGC,
-                             int xInit, int yInit,
-                             unsigned int nglyph,
-                             CharInfoPtr * ppci, pointer pglyphBase);
-    int ImageGlyphBltTEFlags;
-
-    void (*PolyGlyphBltTE) (DrawablePtr pDrawable,
-                            GCPtr pGC,
-                            int xInit, int yInit,
-                            unsigned int nglyph,
-                            CharInfoPtr * ppci, pointer pglyphBase);
-    int PolyGlyphBltTEFlags;
-
-    int (*PolyText8NonTE) (DrawablePtr pDraw,
-                           GCPtr pGC, int x, int y, int count, char *chars);
-    int PolyText8NonTEFlags;
-
-    int (*PolyText16NonTE) (DrawablePtr pDraw,
-                            GCPtr pGC,
-                            int x, int y, int count, unsigned short *chars);
-    int PolyText16NonTEFlags;
-
-    void (*ImageText8NonTE) (DrawablePtr pDraw,
-                             GCPtr pGC, int x, int y, int count, char *chars);
-    int ImageText8NonTEFlags;
-
-    void (*ImageText16NonTE) (DrawablePtr pDraw,
-                              GCPtr pGC,
-                              int x, int y, int count, unsigned short *chars);
-    int ImageText16NonTEFlags;
-
-    void (*ImageGlyphBltNonTE) (DrawablePtr pDrawable,
-                                GCPtr pGC,
-                                int xInit, int yInit,
-                                unsigned int nglyph,
-                                CharInfoPtr * ppci, pointer pglyphBase);
-    int ImageGlyphBltNonTEFlags;
-
-    void (*PolyGlyphBltNonTE) (DrawablePtr pDrawable,
-                               GCPtr pGC,
-                               int xInit, int yInit,
-                               unsigned int nglyph,
-                               CharInfoPtr * ppci, pointer pglyphBase);
-    int PolyGlyphBltNonTEFlags;
-
-    void (*PolyRectangleThinSolid) (DrawablePtr pDrawable,
-                                    GCPtr pGC,
-                                    int nRectsInit, xRectangle *pRectsInit);
-    int PolyRectangleThinSolidFlags;
-
-    void (*PolylinesWideSolid) (DrawablePtr pDrawable,
-                                GCPtr pGC, int mode, int npt, DDXPointPtr pPts);
-    int PolylinesWideSolidFlags;
-
-    void (*PolylinesThinSolid) (DrawablePtr pDrawable,
-                                GCPtr pGC, int mode, int npt, DDXPointPtr pPts);
-    int PolylinesThinSolidFlags;
-
-    void (*PolySegmentThinSolid) (DrawablePtr pDrawable,
-                                  GCPtr pGC, int nseg, xSegment * pSeg);
-    int PolySegmentThinSolidFlags;
-
-    void (*PolylinesThinDashed) (DrawablePtr pDrawable,
-                                 GCPtr pGC,
-                                 int mode, int npt, DDXPointPtr pPts);
-    int PolylinesThinDashedFlags;
-
-    void (*PolySegmentThinDashed) (DrawablePtr pDrawable,
-                                   GCPtr pGC, int nseg, xSegment * pSeg);
-    int PolySegmentThinDashedFlags;
-
-    void (*FillPolygonSolid) (DrawablePtr pDrawable,
-                              GCPtr pGC,
-                              int shape,
-                              int mode, int count, DDXPointPtr ptsIn);
-    int FillPolygonSolidFlags;
-
-    void (*FillPolygonStippled) (DrawablePtr pDrawable,
-                                 GCPtr pGC,
-                                 int shape,
-                                 int mode, int count, DDXPointPtr ptsIn);
-    int FillPolygonStippledFlags;
-
-    void (*FillPolygonOpaqueStippled) (DrawablePtr pDrawable,
-                                       GCPtr pGC,
-                                       int shape,
-                                       int mode, int count, DDXPointPtr ptsIn);
-    int FillPolygonOpaqueStippledFlags;
-
-    void (*FillPolygonTiled) (DrawablePtr pDrawable,
-                              GCPtr pGC,
-                              int shape,
-                              int mode, int count, DDXPointPtr ptsIn);
-    int FillPolygonTiledFlags;
-
-    void (*PolyFillArcSolid) (DrawablePtr pDraw,
-                              GCPtr pGC, int narcs, xArc * parcs);
-    int PolyFillArcSolidFlags;
-
-    void (*PutImage) (DrawablePtr pDraw,
-                      GCPtr pGC,
-                      int depth,
-                      int x,
-                      int y,
-                      int w, int h, int leftPad, int format, char *pImage);
-    int PutImageFlags;
-
-    /* Validation masks */
-
-    unsigned long FillSpansMask;
-    ValidateGCProcPtr ValidateFillSpans;
-    unsigned long SetSpansMask;
-    ValidateGCProcPtr ValidateSetSpans;
-    unsigned long PutImageMask;
-    ValidateGCProcPtr ValidatePutImage;
-    unsigned long CopyAreaMask;
-    ValidateGCProcPtr ValidateCopyArea;
-    unsigned long CopyPlaneMask;
-    ValidateGCProcPtr ValidateCopyPlane;
-    unsigned long PolyPointMask;
-    ValidateGCProcPtr ValidatePolyPoint;
-    unsigned long PolylinesMask;
-    ValidateGCProcPtr ValidatePolylines;
-    unsigned long PolySegmentMask;
-    ValidateGCProcPtr ValidatePolySegment;
-    unsigned long PolyRectangleMask;
-    ValidateGCProcPtr ValidatePolyRectangle;
-    unsigned long PolyArcMask;
-    ValidateGCProcPtr ValidatePolyArc;
-    unsigned long FillPolygonMask;
-    ValidateGCProcPtr ValidateFillPolygon;
-    unsigned long PolyFillRectMask;
-    ValidateGCProcPtr ValidatePolyFillRect;
-    unsigned long PolyFillArcMask;
-    ValidateGCProcPtr ValidatePolyFillArc;
-    unsigned long PolyText8Mask;
-    ValidateGCProcPtr ValidatePolyText8;
-    unsigned long PolyText16Mask;
-    ValidateGCProcPtr ValidatePolyText16;
-    unsigned long ImageText8Mask;
-    ValidateGCProcPtr ValidateImageText8;
-    unsigned long ImageText16Mask;
-    ValidateGCProcPtr ValidateImageText16;
-    unsigned long PolyGlyphBltMask;
-    ValidateGCProcPtr ValidatePolyGlyphBlt;
-    unsigned long ImageGlyphBltMask;
-    ValidateGCProcPtr ValidateImageGlyphBlt;
-    unsigned long PushPixelsMask;
-    ValidateGCProcPtr ValidatePushPixels;
-
-    void (*ComputeDash) (GCPtr pGC);
-
-    /* Pixmap Cache */
-
-    int PixmapCacheFlags;
-    Bool UsingPixmapCache;
-    Bool CanDoMono8x8;
-    Bool CanDoColor8x8;
-
-    void (*InitPixmapCache) (ScreenPtr pScreen, RegionPtr areas, pointer data);
-    void (*ClosePixmapCache) (ScreenPtr pScreen);
-
-    int (*StippledFillChooser) (GCPtr pGC);
-    int (*OpaqueStippledFillChooser) (GCPtr pGC);
-    int (*TiledFillChooser) (GCPtr pGC);
-
-    int CachePixelGranularity;
-    int MaxCacheableTileWidth;
-    int MaxCacheableTileHeight;
-    int MaxCacheableStippleWidth;
-    int MaxCacheableStippleHeight;
-
-     XAACacheInfoPtr(*CacheTile) (ScrnInfoPtr Scrn, PixmapPtr pPix);
-     XAACacheInfoPtr(*CacheStipple) (ScrnInfoPtr Scrn, PixmapPtr pPix,
-                                     int fg, int bg);
-     XAACacheInfoPtr(*CacheMonoStipple) (ScrnInfoPtr Scrn, PixmapPtr pPix);
-     XAACacheInfoPtr(*CacheMono8x8Pattern) (ScrnInfoPtr Scrn, int pat0,
-                                            int pat1);
-     XAACacheInfoPtr(*CacheColor8x8Pattern) (ScrnInfoPtr Scrn, PixmapPtr pPix,
-                                             int fg, int bg);
-
-    int MonoPatternPitch;
-    int CacheWidthMono8x8Pattern;
-    int CacheHeightMono8x8Pattern;
-
-    int ColorPatternPitch;
-    int CacheWidthColor8x8Pattern;
-    int CacheHeightColor8x8Pattern;
-
-    int CacheColorExpandDensity;
-
-    void (*WriteBitmapToCache) (ScrnInfoPtr pScrn,
-                                int x, int y, int w, int h,
-                                unsigned char *src,
-                                int srcwidth, int fg, int bg);
-    void (*WritePixmapToCache) (ScrnInfoPtr pScrn,
-                                int x, int y, int w, int h,
-                                unsigned char *src,
-                                int srcwidth, int bpp, int depth);
-    void (*WriteMono8x8PatternToCache) (ScrnInfoPtr pScrn,
-                                        XAACacheInfoPtr pCache);
-    void (*WriteColor8x8PatternToCache) (ScrnInfoPtr pScrn,
-                                         PixmapPtr pPix,
-                                         XAACacheInfoPtr pCache);
-
-    char *PixmapCachePrivate;
-
-    /* Miscellaneous */
-
-    GC ScratchGC;
-    int PreAllocSize;
-    unsigned char *PreAllocMem;
-
-    CharInfoPtr CharInfo[255];
-    NonTEGlyphInfo GlyphInfo[255];
-
-    unsigned int FullPlanemask; /* deprecated */
-
-    PixmapLinkPtr OffscreenPixmaps;
-    int maxOffPixWidth;
-    int maxOffPixHeight;
-
-    XAACacheInfoRec ScratchCacheInfoRec;
-
-    BoxPtr ClipBox;
-
-    Bool NeedToSync;
-
-    char *dgaSaves;
-
-    /* These can be supplied to override the defaults */
-
-    GetImageProcPtr GetImage;
-    GetSpansProcPtr GetSpans;
-    CopyWindowProcPtr CopyWindow;
-
-    unsigned int offscreenDepths;
-    Bool offscreenDepthsInitialized;
-
-    CARD32 FullPlanemasks[32];
-
-    Bool (*Composite) (CARD8 op,
-                       PicturePtr pSrc,
-                       PicturePtr pMask,
-                       PicturePtr pDst,
-                       INT16 xSrc,
-                       INT16 ySrc,
-                       INT16 xMask,
-                       INT16 yMask,
-                       INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
-
-    Bool (*Glyphs) (CARD8 op,
-                    PicturePtr pSrc,
-                    PicturePtr pDst,
-                    PictFormatPtr maskFormat,
-                    INT16 xSrc,
-                    INT16 ySrc,
-                    int nlist, GlyphListPtr list, GlyphPtr * glyphs);
-
-    /* The old SetupForCPUToScreenAlphaTexture function is no longer used because
-     * it doesn't pass in enough information to write a conforming
-     * implementation.  See SetupForCPUToScreenAlphaTexture2.
-     */
-    Bool (*SetupForCPUToScreenAlphaTexture) (ScrnInfoPtr pScrn,
-                                             int op,
-                                             CARD16 red,
-                                             CARD16 green,
-                                             CARD16 blue,
-                                             CARD16 alpha,
-                                             int alphaType,
-                                             CARD8 *alphaPtr,
-                                             int alphaPitch,
-                                             int width, int height, int flags);
-    void (*SubsequentCPUToScreenAlphaTexture) (ScrnInfoPtr pScrn,
-                                               int dstx,
-                                               int dsty,
-                                               int srcx,
-                                               int srcy, int width, int height);
-    int CPUToScreenAlphaTextureFlags;
-    CARD32 *CPUToScreenAlphaTextureFormats;
-
-    /* The old SetupForCPUToScreenTexture function is no longer used because
-     * it doesn't pass in enough information to write a conforming
-     * implementation.  See SetupForCPUToScreenTexture2.
-     */
-    Bool (*SetupForCPUToScreenTexture) (ScrnInfoPtr pScrn,
-                                        int op,
-                                        int texType,
-                                        CARD8 *texPtr,
-                                        int texPitch,
-                                        int width, int height, int flags);
-    void (*SubsequentCPUToScreenTexture) (ScrnInfoPtr pScrn,
-                                          int dstx,
-                                          int dsty,
-                                          int srcx,
-                                          int srcy, int width, int height);
-    int CPUToScreenTextureFlags;
-    CARD32 *CPUToScreenTextureFormats;
-
-    /* these were added for 4.3.0 */
-    BoxRec SolidLineLimits;
-    BoxRec DashedLineLimits;
-
-    /* These were added for X.Org 6.8.0 */
-    Bool (*SetupForCPUToScreenAlphaTexture2) (ScrnInfoPtr pScrn,
-                                              int op,
-                                              CARD16 red,
-                                              CARD16 green,
-                                              CARD16 blue,
-                                              CARD16 alpha,
-                                              CARD32 maskFormat,
-                                              CARD32 dstFormat,
-                                              CARD8 *alphaPtr,
-                                              int alphaPitch,
-                                              int width, int height, int flags);
-    CARD32 *CPUToScreenAlphaTextureDstFormats;
-
-    Bool (*SetupForCPUToScreenTexture2) (ScrnInfoPtr pScrn,
-                                         int op,
-                                         CARD32 srcFormat,
-                                         CARD32 dstFormat,
-                                         CARD8 *texPtr,
-                                         int texPitch,
-                                         int width, int height, int flags);
-    CARD32 *CPUToScreenTextureDstFormats;
-} XAAInfoRec, *XAAInfoRecPtr;
-
-#define SET_SYNC_FLAG(infoRec) (infoRec)->NeedToSync = TRUE
-
-extern _X_EXPORT Bool
- XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec);
-
-extern _X_EXPORT XAAInfoRecPtr XAACreateInfoRec(void);
-
-extern _X_EXPORT void
- XAADestroyInfoRec(XAAInfoRecPtr infoRec);
-
-typedef void (*DepthChangeFuncPtr) (ScrnInfoPtr pScrn, int depth);
-
-extern _X_EXPORT Bool
- XAAInitDualFramebufferOverlay(ScreenPtr pScreen, DepthChangeFuncPtr callback);
-
-#endif                          /* _XAA_H */
diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c
deleted file mode 100644 (file)
index c1595c4..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-
-/* 
-   This is a lighter version of cfbBitBlt.  We calculate the boxes
-   when accelerating pixmap->screen and screen->screen copies. 
-   We also pass the GC to the doBitBlt function so that it has access
-   to the fg and bg so CopyPlane can use this. 
-*/
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "mi.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "xaalocal.h"
-
-RegionPtr
-XAABitBlt(DrawablePtr pSrcDrawable,
-          DrawablePtr pDstDrawable,
-          GC * pGC,
-          int srcx, int srcy,
-          int width, int height,
-          int dstx, int dsty,
-          void (*doBitBlt) (DrawablePtr, DrawablePtr, GCPtr, RegionPtr,
-                            DDXPointPtr), unsigned long bitPlane)
-{
-
-    RegionPtr prgnSrcClip = NULL;       /* may be a new region, or just a copy */
-    RegionPtr prgnExposed;
-    Bool freeSrcClip = FALSE;
-    RegionRec rgnDst;
-    DDXPointPtr pptSrc, ppt;
-    DDXPointRec origDest;
-    BoxPtr pbox;
-    BoxRec fastBox;
-    int i, dx, dy, numRects;
-    xRectangle origSource;
-    int fastClip = 0;           /* for fast clipping with pixmap source */
-    int fastExpose = 0;         /* for fast exposures with pixmap source */
-
-    origSource.x = srcx;
-    origSource.y = srcy;
-    origSource.width = width;
-    origSource.height = height;
-    origDest.x = dstx;
-    origDest.y = dsty;
-
-    if (pSrcDrawable->pScreen->SourceValidate) {
-        (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy,
-                                                  width, height,
-                                                  pGC->subWindowMode);
-    }
-
-    srcx += pSrcDrawable->x;
-    srcy += pSrcDrawable->y;
-
-    /* clip the source */
-    if (pSrcDrawable->type == DRAWABLE_PIXMAP) {
-        if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE))
-            prgnSrcClip = pGC->pCompositeClip;
-        else
-            fastClip = 1;
-    }
-    else {                      /* Window */
-        if (pGC->subWindowMode == IncludeInferiors) {
-            if (!((WindowPtr) pSrcDrawable)->parent) {
-                /*
-                 * special case bitblt from root window in
-                 * IncludeInferiors mode; just like from a pixmap
-                 */
-                fastClip = 1;
-            }
-            else if ((pSrcDrawable == pDstDrawable) &&
-                     (pGC->clientClipType == CT_NONE)) {
-                prgnSrcClip = pGC->pCompositeClip;
-            }
-            else {
-                prgnSrcClip = NotClippedByChildren((WindowPtr) pSrcDrawable);
-                freeSrcClip = TRUE;
-            }
-        }
-        else {
-            prgnSrcClip = &((WindowPtr) pSrcDrawable)->clipList;
-        }
-    }
-
-    fastBox.x1 = srcx;
-    fastBox.y1 = srcy;
-    fastBox.x2 = srcx + width;
-    fastBox.y2 = srcy + height;
-
-    /* Don't create a source region if we are doing a fast clip */
-    if (fastClip) {
-        fastExpose = 1;
-        /*
-         * clip the source; if regions extend beyond the source size,
-         * make sure exposure events get sent
-         */
-        if (fastBox.x1 < pSrcDrawable->x) {
-            fastBox.x1 = pSrcDrawable->x;
-            fastExpose = 0;
-        }
-        if (fastBox.y1 < pSrcDrawable->y) {
-            fastBox.y1 = pSrcDrawable->y;
-            fastExpose = 0;
-        }
-        if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width) {
-            fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
-            fastExpose = 0;
-        }
-        if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height) {
-            fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
-            fastExpose = 0;
-        }
-    }
-    else {
-        RegionInit(&rgnDst, &fastBox, 1);
-        RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip);
-    }
-
-    dstx += pDstDrawable->x;
-    dsty += pDstDrawable->y;
-
-    if (pDstDrawable->type == DRAWABLE_WINDOW) {
-        if (!((WindowPtr) pDstDrawable)->realized) {
-            if (!fastClip)
-                RegionUninit(&rgnDst);
-            if (freeSrcClip)
-                RegionDestroy(prgnSrcClip);
-            return NULL;
-        }
-    }
-
-    dx = srcx - dstx;
-    dy = srcy - dsty;
-
-    /* Translate and clip the dst to the destination composite clip */
-    if (fastClip) {
-        RegionPtr cclip;
-
-        /* Translate the region directly */
-        fastBox.x1 -= dx;
-        fastBox.x2 -= dx;
-        fastBox.y1 -= dy;
-        fastBox.y2 -= dy;
-
-        /* If the destination composite clip is one rectangle we can
-           do the clip directly.  Otherwise we have to create a full
-           blown region and call intersect */
-
-        cclip = pGC->pCompositeClip;
-        if (RegionNumRects(cclip) == 1) {
-            BoxPtr pBox = RegionRects(cclip);
-
-            if (fastBox.x1 < pBox->x1)
-                fastBox.x1 = pBox->x1;
-            if (fastBox.x2 > pBox->x2)
-                fastBox.x2 = pBox->x2;
-            if (fastBox.y1 < pBox->y1)
-                fastBox.y1 = pBox->y1;
-            if (fastBox.y2 > pBox->y2)
-                fastBox.y2 = pBox->y2;
-
-            /* Check to see if the region is empty */
-            if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
-                RegionNull(&rgnDst);
-            }
-            else {
-                RegionInit(&rgnDst, &fastBox, 1);
-            }
-        }
-        else {
-            /* We must turn off fastClip now, since we must create
-               a full blown region.  It is intersected with the
-               composite clip below. */
-            fastClip = 0;
-            RegionInit(&rgnDst, &fastBox, 1);
-        }
-    }
-    else {
-        RegionTranslate(&rgnDst, -dx, -dy);
-    }
-
-    if (!fastClip) {
-        RegionIntersect(&rgnDst, &rgnDst, pGC->pCompositeClip);
-    }
-
-    /* Do bit blitting */
-    numRects = RegionNumRects(&rgnDst);
-    if (numRects && width && height) {
-        if (!(pptSrc = (DDXPointPtr) malloc(numRects * sizeof(DDXPointRec)))) {
-            RegionUninit(&rgnDst);
-            if (freeSrcClip)
-                RegionDestroy(prgnSrcClip);
-            return NULL;
-        }
-        pbox = RegionRects(&rgnDst);
-        ppt = pptSrc;
-        for (i = numRects; --i >= 0; pbox++, ppt++) {
-            ppt->x = pbox->x1 + dx;
-            ppt->y = pbox->y1 + dy;
-        }
-
-        (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC, &rgnDst, pptSrc);
-        free(pptSrc);
-    }
-
-    prgnExposed = NULL;
-    if (pGC->fExpose) {
-        /* Pixmap sources generate a NoExposed (we return NULL to do this) */
-        if (!fastExpose)
-            prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
-                                            origSource.x, origSource.y,
-                                            (int) origSource.width,
-                                            (int) origSource.height,
-                                            origDest.x, origDest.y, bitPlane);
-    }
-    RegionUninit(&rgnDst);
-    if (freeSrcClip)
-        RegionDestroy(prgnSrcClip);
-    return prgnExposed;
-}
diff --git a/hw/xfree86/xaa/xaaBitOrder.c b/hw/xfree86/xaa/xaaBitOrder.c
deleted file mode 100644 (file)
index 3d9b980..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/Xmd.h>
-#include "xaalocal.h"
-
-CARD32
-XAAReverseBitOrder(CARD32 v)
-{
-    return (((0x01010101 & v) << 7) | ((0x02020202 & v) << 5) |
-            ((0x04040404 & v) << 3) | ((0x08080808 & v) << 1) |
-            ((0x10101010 & v) >> 1) | ((0x20202020 & v) >> 3) |
-            ((0x40404040 & v) >> 5) | ((0x80808080 & v) >> 7));
-}
diff --git a/hw/xfree86/xaa/xaaBitmap.c b/hw/xfree86/xaa/xaaBitmap.c
deleted file mode 100644 (file)
index 45d5a09..0000000
+++ /dev/null
@@ -1,477 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaacexp.h"
-#include "xf86.h"
-
-/********** byte swapping ***************/
-
-#ifdef FIXEDBASE
-#define DEST(i)        *dest
-#define RETURN(i)      return(dest)
-#else
-#define DEST(i)        dest[i]
-#define RETURN(i)      return(dest + i)
-#endif
-
-#ifdef MSBFIRST
-#define SOURCE(i)      SWAP_BITS_IN_BYTES(src[i])
-#else
-#define SOURCE(i)      src[i]
-#endif
-
-typedef CARD32 *(*BitmapScanlineProcPtr) (CARD32 *, CARD32 *, int, int);
-
-#ifdef TRIPLE_BITS
-static CARD32 *
-BitmapScanline(CARD32 *src, CARD32 *base, int count, int skipleft)
-{
-    CARD32 bits;
-
-    while (count >= 3) {
-        bits = *src;
-        WRITE_BITS3(bits);
-        src++;
-        count -= 3;
-    }
-    if (count == 2) {
-        bits = *src;
-        WRITE_BITS2(bits);
-    }
-    else if (count == 1) {
-        bits = *src;
-        WRITE_BITS1(bits);
-    }
-
-    return base;
-}
-
-static CARD32 *
-BitmapScanline_Inverted(CARD32 *src, CARD32 *base, int count, int skipleft)
-{
-    CARD32 bits;
-
-    while (count >= 3) {
-        bits = ~(*src);
-        WRITE_BITS3(bits);
-        src++;
-        count -= 3;
-    }
-    if (count == 2) {
-        bits = ~(*src);
-        WRITE_BITS2(bits);
-    }
-    else if (count == 1) {
-        bits = ~(*src);
-        WRITE_BITS1(bits);
-    }
-
-    return base;
-}
-
-static CARD32 *
-BitmapScanline_Shifted(CARD32 *src, CARD32 *base, int count, int skipleft)
-{
-    CARD32 bits;
-
-    while (count >= 3) {
-        bits = SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft));
-        WRITE_BITS3(bits);
-        src++;
-        count -= 3;
-    }
-    if (count == 2) {
-        bits = SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft));
-        WRITE_BITS2(bits);
-    }
-    else if (count == 1) {
-        bits = SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft));
-        WRITE_BITS1(bits);
-    }
-
-    return base;
-}
-
-static CARD32 *
-BitmapScanline_Shifted_Inverted(CARD32 *src, CARD32 *base,
-                                int count, int skipleft)
-{
-    CARD32 bits;
-
-    while (count >= 3) {
-        bits =
-            ~(SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft)));
-        WRITE_BITS3(bits);
-        src++;
-        count -= 3;
-    }
-    if (count == 2) {
-        bits =
-            ~(SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft)));
-        WRITE_BITS2(bits);
-    }
-    else if (count == 1) {
-        bits =
-            ~(SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft)));
-        WRITE_BITS1(bits);
-    }
-
-    return base;
-}
-
-#define BitmapScanline_Shifted_Careful BitmapScanline_Shifted
-#define BitmapScanline_Shifted_Inverted_Careful BitmapScanline_Shifted_Inverted
-
-#else
-static CARD32 *
-BitmapScanline(CARD32 *src, CARD32 *dest, int count, int skipleft)
-{
-    while (count >= 4) {
-        DEST(0) = SOURCE(0);
-        DEST(1) = SOURCE(1);
-        DEST(2) = SOURCE(2);
-        DEST(3) = SOURCE(3);
-        count -= 4;
-        src += 4;
-#ifndef FIXEDBASE
-        dest += 4;
-#endif
-    }
-
-    if (!count)
-        return dest;
-    DEST(0) = SOURCE(0);
-    if (count == 1)
-        RETURN(1);
-    DEST(1) = SOURCE(1);
-    if (count == 2)
-        RETURN(2);
-    DEST(2) = SOURCE(2);
-    RETURN(3);
-}
-
-static CARD32 *
-BitmapScanline_Inverted(CARD32 *src, CARD32 *dest, int count, int skipleft)
-{
-    while (count >= 4) {
-        DEST(0) = ~SOURCE(0);
-        DEST(1) = ~SOURCE(1);
-        DEST(2) = ~SOURCE(2);
-        DEST(3) = ~SOURCE(3);
-        count -= 4;
-        src += 4;
-#ifndef FIXEDBASE
-        dest += 4;
-#endif
-    }
-
-    if (!count)
-        return dest;
-    DEST(0) = ~SOURCE(0);
-    if (count == 1)
-        RETURN(1);
-    DEST(1) = ~SOURCE(1);
-    if (count == 2)
-        RETURN(2);
-    DEST(2) = ~SOURCE(2);
-    RETURN(3);
-}
-
-static CARD32 *
-BitmapScanline_Shifted(CARD32 *bits, CARD32 *base, int count, int skipleft)
-{
-    while (count--) {
-        register CARD32 tmp = SHIFT_R(*bits, skipleft) |
-            SHIFT_L(*(bits + 1), (32 - skipleft));
-        WRITE_BITS(tmp);
-        bits++;
-    }
-    return base;
-}
-
-static CARD32 *
-BitmapScanline_Shifted_Inverted(CARD32 *bits, CARD32 *base,
-                                int count, int skipleft)
-{
-    while (count--) {
-        register CARD32 tmp = ~(SHIFT_R(*bits, skipleft) |
-                                SHIFT_L(*(bits + 1), (32 - skipleft)));
-        WRITE_BITS(tmp);
-        bits++;
-    }
-    return base;
-}
-
-static CARD32 *
-BitmapScanline_Shifted_Careful(CARD32 *bits, CARD32 *base,
-                               int count, int skipleft)
-{
-    register CARD32 tmp;
-
-    while (--count) {
-        tmp = SHIFT_R(*bits, skipleft) | SHIFT_L(*(bits + 1), (32 - skipleft));
-        WRITE_BITS(tmp);
-        bits++;
-    }
-    tmp = SHIFT_R(*bits, skipleft);
-    WRITE_BITS(tmp);
-
-    return base;
-}
-
-static CARD32 *
-BitmapScanline_Shifted_Inverted_Careful(CARD32 *bits, CARD32 *base,
-                                        int count, int skipleft)
-{
-    register CARD32 tmp;
-
-    while (--count) {
-        tmp =
-            ~(SHIFT_R(*bits, skipleft) | SHIFT_L(*(bits + 1), (32 - skipleft)));
-        WRITE_BITS(tmp);
-        bits++;
-    }
-    tmp = ~(SHIFT_R(*bits, skipleft));
-    WRITE_BITS(tmp);
-    return base;
-}
-
-#endif
-
-/*  
-    When the accelerator is TRANSPARENCY_ONLY, WriteBitmap can do
-    the fill in two passes, inverting the source on the second pass.  
-    For GXcopy we can fill the backing rectangle as a solid rect and
-    avoid the invert.
-*/
-
-void
-#ifdef TRIPLE_BITS
- EXPNAME(XAAWriteBitmapColorExpand3) (
-#else
- EXPNAME(XAAWriteBitmapColorExpand) (
-#endif
-                                        ScrnInfoPtr pScrn,
-                                        int x, int y, int w, int H,
-                                        unsigned char *src,
-                                        int srcwidth,
-                                        int skipleft,
-                                        int fg, int bg,
-                                        int rop, unsigned int planemask) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    CARD32 *base;
-    unsigned char *srcp = src;
-    int SecondPassColor = -1;
-    int shift = 0, dwords;
-    BitmapScanlineProcPtr firstFunc;
-    BitmapScanlineProcPtr secondFunc;
-    int flag;
-    int h = H;
-
-#ifdef TRIPLE_BITS
-    if ((bg != -1) &&
-        ((infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) ||
-         ((infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) &&
-          (!CHECK_RGB_EQUAL(bg))))) {
-#else
-    if ((bg != -1) &&
-        (infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
-        if ((rop == GXcopy) && infoRec->SetupForSolidFill) {
-            (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask);
-            (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h);
-        }
-        else
-            SecondPassColor = bg;
-        bg = -1;
-    }
-
-#ifdef TRIPLE_BITS
-    if (skipleft) {
-#else
-    if (skipleft &&
-        (!(infoRec->CPUToScreenColorExpandFillFlags & LEFT_EDGE_CLIPPING) ||
-         (!(infoRec->
-            CPUToScreenColorExpandFillFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
-          (skipleft > x)))) {
-#endif
-        if ((skipleft + ((w + 31) & ~31)) > ((skipleft + w + 31) & ~31)) {
-            /* don't read past the end */
-            firstFunc = BitmapScanline_Shifted_Careful;
-            secondFunc = BitmapScanline_Shifted_Inverted_Careful;
-        }
-        else {
-            firstFunc = BitmapScanline_Shifted;
-            secondFunc = BitmapScanline_Shifted_Inverted;
-        }
-        shift = skipleft;
-        skipleft = 0;
-    }
-    else {
-        firstFunc = BitmapScanline;
-        secondFunc = BitmapScanline_Inverted;
-        w += skipleft;
-        x -= skipleft;
-    }
-
-#ifdef TRIPLE_BITS
-    dwords = (3 * w + 31) >> 5;
-#else
-    dwords = (w + 31) >> 5;
-#endif
-
- SECOND_PASS:
-
-    flag = (infoRec->CPUToScreenColorExpandFillFlags
-            & CPU_TRANSFER_PAD_QWORD) && ((dwords * h) & 0x01);
-    (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                    planemask);
-    (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, x, y, w, h,
-                                                      skipleft);
-
-    base = (CARD32 *) infoRec->ColorExpandBase;
-
-#ifndef FIXEDBASE
-    if ((dwords * h) <= infoRec->ColorExpandRange)
-        while (h--) {
-            base = (*firstFunc) ((CARD32 *) srcp, base, dwords, shift);
-            srcp += srcwidth;
-        }
-    else
-#endif
-        while (h--) {
-            (*firstFunc) ((CARD32 *) srcp, base, dwords, shift);
-            srcp += srcwidth;
-        }
-
-    if (flag) {
-        base = (CARD32 *) infoRec->ColorExpandBase;
-        base[0] = 0x00000000;
-    }
-
-    if (SecondPassColor != -1) {
-        h = H;                  /* Reset height */
-        fg = SecondPassColor;
-        SecondPassColor = -1;
-        firstFunc = secondFunc;
-        srcp = src;
-        goto SECOND_PASS;
-    }
-
-    if (infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
-        (*infoRec->Sync) (pScrn);
-    else
-        SET_SYNC_FLAG(infoRec);
-}
-
-#ifndef FIXEDBASE
-
-void
-#ifdef TRIPLE_BITS
- EXPNAME(XAAWriteBitmapScanlineColorExpand3) (
-#else
- EXPNAME(XAAWriteBitmapScanlineColorExpand) (
-#endif
-                                                ScrnInfoPtr pScrn,
-                                                int x, int y, int w, int h,
-                                                unsigned char *src,
-                                                int srcwidth,
-                                                int skipleft,
-                                                int fg, int bg,
-                                                int rop,
-                                                unsigned int planemask) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    CARD32 *base;
-    unsigned char *srcp = src;
-    int SecondPassColor = -1;
-    int shift = 0, dwords, bufferNo;
-    BitmapScanlineProcPtr firstFunc;
-    BitmapScanlineProcPtr secondFunc;
-
-#ifdef TRIPLE_BITS
-    if ((bg != -1) &&
-        ((infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)
-         || ((infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) &&
-             (!CHECK_RGB_EQUAL(bg))))) {
-#else
-    if ((bg != -1) &&
-        (infoRec->
-         ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
-        if ((rop == GXcopy) && infoRec->SetupForSolidFill) {
-            (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask);
-            (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h);
-        }
-        else
-            SecondPassColor = bg;
-        bg = -1;
-    }
-
-#ifdef TRIPLE_BITS
-    if (skipleft) {
-#else
-    if (skipleft &&
-        (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-           LEFT_EDGE_CLIPPING) ||
-         (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-            LEFT_EDGE_CLIPPING_NEGATIVE_X) && (skipleft > x)))) {
-#endif
-        if ((skipleft + ((w + 31) & ~31)) > ((skipleft + w + 31) & ~31)) {
-            /* don't read past the end */
-            firstFunc = BitmapScanline_Shifted_Careful;
-            secondFunc = BitmapScanline_Shifted_Inverted_Careful;
-        }
-        else {
-            firstFunc = BitmapScanline_Shifted;
-            secondFunc = BitmapScanline_Shifted_Inverted;
-        }
-        shift = skipleft;
-        skipleft = 0;
-    }
-    else {
-        firstFunc = BitmapScanline;
-        secondFunc = BitmapScanline_Inverted;
-        w += skipleft;
-        x -= skipleft;
-    }
-
-#ifdef TRIPLE_BITS
-    dwords = (3 * w + 31) >> 5;
-#else
-    dwords = (w + 31) >> 5;
-#endif
-
- SECOND_PASS:
-
-    (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                            planemask);
-    (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, x, y, w, h,
-                                                              skipleft);
-
-    bufferNo = 0;
-
-    while (h--) {
-        base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo];
-        (*firstFunc) ((CARD32 *) srcp, base, dwords, shift);
-        (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++);
-        srcp += srcwidth;
-        if (bufferNo >= infoRec->NumScanlineColorExpandBuffers)
-            bufferNo = 0;
-    }
-
-    if (SecondPassColor != -1) {
-        fg = SecondPassColor;
-        SecondPassColor = -1;
-        firstFunc = secondFunc;
-        srcp = src;
-        goto SECOND_PASS;
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-#endif
diff --git a/hw/xfree86/xaa/xaaCpyArea.c b/hw/xfree86/xaa/xaaCpyArea.c
deleted file mode 100644 (file)
index 0b11b81..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "migc.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-
-/*
-  Written mostly by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
- */
-
-RegionPtr
-XAACopyArea(DrawablePtr pSrcDrawable,
-            DrawablePtr pDstDrawable,
-            GC * pGC,
-            int srcx, int srcy, int width, int height, int dstx, int dsty)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    if (pDstDrawable->type == DRAWABLE_WINDOW) {
-        if ((pSrcDrawable->type == DRAWABLE_WINDOW) ||
-            IS_OFFSCREEN_PIXMAP(pSrcDrawable)) {
-            if (infoRec->ScreenToScreenBitBlt &&
-                CHECK_ROP(pGC, infoRec->ScreenToScreenBitBltFlags) &&
-                CHECK_ROPSRC(pGC, infoRec->ScreenToScreenBitBltFlags) &&
-                CHECK_PLANEMASK(pGC, infoRec->ScreenToScreenBitBltFlags))
-                return (XAABitBlt(pSrcDrawable, pDstDrawable,
-                                  pGC, srcx, srcy, width, height, dstx, dsty,
-                                  XAADoBitBlt, 0L));
-        }
-        else {
-            if (infoRec->WritePixmap &&
-                ((pDstDrawable->bitsPerPixel == pSrcDrawable->bitsPerPixel) ||
-                 ((pDstDrawable->bitsPerPixel == 24) &&
-                  (pSrcDrawable->bitsPerPixel == 32) &&
-                  (infoRec->WritePixmapFlags & CONVERT_32BPP_TO_24BPP))) &&
-                CHECK_ROP(pGC, infoRec->WritePixmapFlags) &&
-                CHECK_ROPSRC(pGC, infoRec->WritePixmapFlags) &&
-                CHECK_PLANEMASK(pGC, infoRec->WritePixmapFlags) &&
-                CHECK_NO_GXCOPY(pGC, infoRec->WritePixmapFlags))
-                return (XAABitBlt(pSrcDrawable, pDstDrawable,
-                                  pGC, srcx, srcy, width, height, dstx, dsty,
-                                  XAADoImageWrite, 0L));
-        }
-    }
-    else if (IS_OFFSCREEN_PIXMAP(pDstDrawable)) {
-        if ((pSrcDrawable->type == DRAWABLE_WINDOW) ||
-            IS_OFFSCREEN_PIXMAP(pSrcDrawable)) {
-            if (infoRec->ScreenToScreenBitBlt &&
-                CHECK_ROP(pGC, infoRec->ScreenToScreenBitBltFlags) &&
-                CHECK_ROPSRC(pGC, infoRec->ScreenToScreenBitBltFlags) &&
-                CHECK_PLANEMASK(pGC, infoRec->ScreenToScreenBitBltFlags))
-                return (XAABitBlt(pSrcDrawable, pDstDrawable,
-                                  pGC, srcx, srcy, width, height, dstx, dsty,
-                                  XAADoBitBlt, 0L));
-        }
-    }
-
-    return (XAAFallbackOps.CopyArea(pSrcDrawable, pDstDrawable, pGC,
-                                    srcx, srcy, width, height, dstx, dsty));
-}
-
-void
-XAADoBitBlt(DrawablePtr pSrc,
-            DrawablePtr pDst, GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc)
-{
-    int nbox, careful;
-    BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
-    DDXPointPtr pptTmp, pptNew1, pptNew2;
-    int xdir, ydir;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    /* XXX we have to err on the side of safety when both are windows,
-     * because we don't know if IncludeInferiors is being used.
-     */
-    careful = ((pSrc == pDst) ||
-               ((pSrc->type == DRAWABLE_WINDOW) &&
-                (pDst->type == DRAWABLE_WINDOW)));
-
-    pbox = RegionRects(prgnDst);
-    nbox = RegionNumRects(prgnDst);
-
-    pboxNew1 = NULL;
-    pptNew1 = NULL;
-    pboxNew2 = NULL;
-    pptNew2 = NULL;
-    if (careful && (pptSrc->y < pbox->y1)) {
-        /* walk source botttom to top */
-        ydir = -1;
-
-        if (nbox > 1) {
-            /* keep ordering in each band, reverse order of bands */
-            pboxNew1 = (BoxPtr) malloc(sizeof(BoxRec) * nbox);
-            if (!pboxNew1)
-                return;
-            pptNew1 = (DDXPointPtr) malloc(sizeof(DDXPointRec) * nbox);
-            if (!pptNew1) {
-                free(pboxNew1);
-                return;
-            }
-            pboxBase = pboxNext = pbox + nbox - 1;
-            while (pboxBase >= pbox) {
-                while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1))
-                    pboxNext--;
-                pboxTmp = pboxNext + 1;
-                pptTmp = pptSrc + (pboxTmp - pbox);
-                while (pboxTmp <= pboxBase) {
-                    *pboxNew1++ = *pboxTmp++;
-                    *pptNew1++ = *pptTmp++;
-                }
-                pboxBase = pboxNext;
-            }
-            pboxNew1 -= nbox;
-            pbox = pboxNew1;
-            pptNew1 -= nbox;
-            pptSrc = pptNew1;
-        }
-    }
-    else {
-        /* walk source top to bottom */
-        ydir = 1;
-    }
-
-    if (careful && (pptSrc->x < pbox->x1)) {
-        /* walk source right to left */
-        xdir = -1;
-
-        if (nbox > 1) {
-            /* reverse order of rects in each band */
-            pboxNew2 = (BoxPtr) malloc(sizeof(BoxRec) * nbox);
-            pptNew2 = (DDXPointPtr) malloc(sizeof(DDXPointRec) * nbox);
-            if (!pboxNew2 || !pptNew2) {
-                free(pptNew2);
-                free(pboxNew2);
-                if (pboxNew1) {
-                    free(pptNew1);
-                    free(pboxNew1);
-                }
-                return;
-            }
-            pboxBase = pboxNext = pbox;
-            while (pboxBase < pbox + nbox) {
-                while ((pboxNext < pbox + nbox) &&
-                       (pboxNext->y1 == pboxBase->y1))
-                    pboxNext++;
-                pboxTmp = pboxNext;
-                pptTmp = pptSrc + (pboxTmp - pbox);
-                while (pboxTmp != pboxBase) {
-                    *pboxNew2++ = *--pboxTmp;
-                    *pptNew2++ = *--pptTmp;
-                }
-                pboxBase = pboxNext;
-            }
-            pboxNew2 -= nbox;
-            pbox = pboxNew2;
-            pptNew2 -= nbox;
-            pptSrc = pptNew2;
-        }
-    }
-    else {
-        /* walk source left to right */
-        xdir = 1;
-    }
-
-    (*infoRec->ScreenToScreenBitBlt) (infoRec->pScrn, nbox, pptSrc, pbox,
-                                      xdir, ydir, pGC->alu, pGC->planemask);
-
-    if (pboxNew2) {
-        free(pptNew2);
-        free(pboxNew2);
-    }
-    if (pboxNew1) {
-        free(pptNew1);
-        free(pboxNew1);
-    }
-
-}
-
-void
-XAADoImageWrite(DrawablePtr pSrc,
-                DrawablePtr pDst,
-                GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc)
-{
-    int srcwidth;
-    unsigned char *psrcBase;    /* start of image */
-    unsigned char *srcPntr;     /* index into the image */
-    BoxPtr pbox = RegionRects(prgnDst);
-    int nbox = RegionNumRects(prgnDst);
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int Bpp = pSrc->bitsPerPixel >> 3;
-
-    psrcBase = (unsigned char *) ((PixmapPtr) pSrc)->devPrivate.ptr;
-    srcwidth = (int) ((PixmapPtr) pSrc)->devKind;
-
-    for (; nbox; pbox++, pptSrc++, nbox--) {
-        srcPntr = psrcBase + (pptSrc->y * srcwidth) + (pptSrc->x * Bpp);
-
-        (*infoRec->WritePixmap) (infoRec->pScrn, pbox->x1, pbox->y1,
-                                 pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
-                                 srcPntr, srcwidth, pGC->alu, pGC->planemask,
-                                 -1, pSrc->bitsPerPixel, pSrc->depth);
-    }
-}
-
-void
-XAADoImageRead(DrawablePtr pSrc,
-               DrawablePtr pDst,
-               GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc)
-{
-    int dstwidth;
-    unsigned char *pdstBase;    /* start of image */
-    unsigned char *dstPntr;     /* index into the image */
-    BoxPtr pbox = RegionRects(prgnDst);
-    int nbox = RegionNumRects(prgnDst);
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int Bpp = pSrc->bitsPerPixel >> 3;  /* wouldn't get here unless both
-                                           src and dst have same bpp */
-
-    pdstBase = (unsigned char *) ((PixmapPtr) pDst)->devPrivate.ptr;
-    dstwidth = (int) ((PixmapPtr) pDst)->devKind;
-
-    for (; nbox; pbox++, pptSrc++, nbox--) {
-        dstPntr = pdstBase + (pbox->y1 * dstwidth) + (pbox->x1 * Bpp);
-
-        (*infoRec->ReadPixmap) (infoRec->pScrn, pptSrc->x, pptSrc->y,
-                                pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
-                                dstPntr, dstwidth, pSrc->bitsPerPixel,
-                                pSrc->depth);
-    }
-}
-
-void
-XAAScreenToScreenBitBlt(ScrnInfoPtr pScrn,
-                        int nbox,
-                        DDXPointPtr pptSrc,
-                        BoxPtr pbox,
-                        int xdir, int ydir, int alu, unsigned int planemask)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int dirsetup;
-
-    if ((!(infoRec->CopyAreaFlags & ONLY_TWO_BITBLT_DIRECTIONS)
-         || (xdir == ydir)) &&
-        (!(infoRec->CopyAreaFlags & ONLY_LEFT_TO_RIGHT_BITBLT)
-         || (xdir == 1))) {
-        (*infoRec->SetupForScreenToScreenCopy) (pScrn,
-                                                xdir, ydir, alu, planemask, -1);
-        for (; nbox; pbox++, pptSrc++, nbox--)
-            (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pptSrc->x,
-                                                      pptSrc->y, pbox->x1,
-                                                      pbox->y1,
-                                                      pbox->x2 - pbox->x1,
-                                                      pbox->y2 - pbox->y1);
-        SET_SYNC_FLAG(infoRec);
-        return;
-    }
-
-    if (infoRec->CopyAreaFlags & ONLY_LEFT_TO_RIGHT_BITBLT) {
-        /*
-         * This is the case of a chip that only supports xdir = 1,
-         * with ydir = 1 or ydir = -1, but we have xdir = -1.
-         */
-        (*infoRec->SetupForScreenToScreenCopy) (pScrn,
-                                                1, ydir, alu, planemask, -1);
-        for (; nbox; pbox++, pptSrc++, nbox--)
-            if (pptSrc->y != pbox->y1 || pptSrc->x >= pbox->x1)
-                /* No problem. Do a xdir = 1 blit instead. */
-                (*infoRec->SubsequentScreenToScreenCopy) (pScrn,
-                                                          pptSrc->x, pptSrc->y,
-                                                          pbox->x1, pbox->y1,
-                                                          pbox->x2 - pbox->x1,
-                                                          pbox->y2 - pbox->y1);
-            else {
-                /*
-                 * This is the difficult case. Needs striping into
-                 * non-overlapping horizontal chunks.
-                 */
-                int stripeWidth, w, fullStripes, extra, i;
-
-                stripeWidth = 16;
-                w = pbox->x2 - pbox->x1;
-                if (pbox->x1 - pptSrc->x < stripeWidth)
-                    stripeWidth = pbox->x1 - pptSrc->x;
-                fullStripes = w / stripeWidth;
-                extra = w % stripeWidth;
-
-                /* First, take care of the little bit on the far right */
-                if (extra)
-                    (*infoRec->SubsequentScreenToScreenCopy) (pScrn,
-                                                              pptSrc->x +
-                                                              fullStripes *
-                                                              stripeWidth,
-                                                              pptSrc->y,
-                                                              pbox->x1 +
-                                                              fullStripes *
-                                                              stripeWidth,
-                                                              pbox->y1, extra,
-                                                              pbox->y2 -
-                                                              pbox->y1);
-
-                /* Now, take care of the rest of the blit */
-                for (i = fullStripes - 1; i >= 0; i--)
-                    (*infoRec->SubsequentScreenToScreenCopy) (pScrn,
-                                                              pptSrc->x +
-                                                              i * stripeWidth,
-                                                              pptSrc->y,
-                                                              pbox->x1 +
-                                                              i * stripeWidth,
-                                                              pbox->y1,
-                                                              stripeWidth,
-                                                              pbox->y2 -
-                                                              pbox->y1);
-            }
-        SET_SYNC_FLAG(infoRec);
-        return;
-    }
-
-    /*
-     * Now the case of a chip that only supports xdir = ydir = 1 or
-     * xdir = ydir = -1, but we have xdir != ydir.
-     */
-    dirsetup = 0;               /* No direction set up yet. */
-    for (; nbox; pbox++, pptSrc++, nbox--) {
-        if (xdir == 1 && pptSrc->y != pbox->y1) {
-            /* Do a xdir = ydir = -1 blit instead. */
-            if (dirsetup != -1) {
-                (*infoRec->SetupForScreenToScreenCopy) (pScrn,
-                                                        -1, -1, alu, planemask,
-                                                        -1);
-                dirsetup = -1;
-            }
-            (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pptSrc->x,
-                                                      pptSrc->y, pbox->x1,
-                                                      pbox->y1,
-                                                      pbox->x2 - pbox->x1,
-                                                      pbox->y2 - pbox->y1);
-        }
-        else if (xdir == -1 && pptSrc->y != pbox->y1) {
-            /* Do a xdir = ydir = 1 blit instead. */
-            if (dirsetup != 1) {
-                (*infoRec->SetupForScreenToScreenCopy) (pScrn,
-                                                        1, 1, alu, planemask,
-                                                        -1);
-                dirsetup = 1;
-            }
-            (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pptSrc->x,
-                                                      pptSrc->y, pbox->x1,
-                                                      pbox->y1,
-                                                      pbox->x2 - pbox->x1,
-                                                      pbox->y2 - pbox->y1);
-        }
-        else if (xdir == 1) {
-            /*
-             * xdir = 1, ydir = -1.
-             * Perform line-by-line xdir = ydir = 1 blits, going up.
-             */
-            int i;
-
-            if (dirsetup != 1) {
-                (*infoRec->SetupForScreenToScreenCopy) (pScrn,
-                                                        1, 1, alu, planemask,
-                                                        -1);
-                dirsetup = 1;
-            }
-            for (i = pbox->y2 - pbox->y1 - 1; i >= 0; i--)
-                (*infoRec->SubsequentScreenToScreenCopy) (pScrn,
-                                                          pptSrc->x,
-                                                          pptSrc->y + i,
-                                                          pbox->x1,
-                                                          pbox->y1 + i,
-                                                          pbox->x2 - pbox->x1,
-                                                          1);
-        }
-        else {
-            /*
-             * xdir = -1, ydir = 1.
-             * Perform line-by-line xdir = ydir = -1 blits, going down.
-             */
-            int i;
-
-            if (dirsetup != -1) {
-                (*infoRec->SetupForScreenToScreenCopy) (pScrn,
-                                                        -1, -1, alu, planemask,
-                                                        -1);
-                dirsetup = -1;
-            }
-            for (i = 0; i < pbox->y2 - pbox->y1; i++)
-                (*infoRec->SubsequentScreenToScreenCopy) (pScrn,
-                                                          pptSrc->x,
-                                                          pptSrc->y + i,
-                                                          pbox->x1,
-                                                          pbox->y1 + i,
-                                                          pbox->x2 - pbox->x1,
-                                                          1);
-        }
-    }                           /* next box */
-    SET_SYNC_FLAG(infoRec);
-}
diff --git a/hw/xfree86/xaa/xaaCpyPlane.c b/hw/xfree86/xaa/xaaCpyPlane.c
deleted file mode 100644 (file)
index b9197e4..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-
-/*
-   A CopyPlane function that handles bitmap->screen copies and
-   sends anything else to the Fallback.
-
-   Also, a PushPixels for solid fill styles.
-
-   Written by Mark Vojkovich (markv@valinux.com)
-
-*/
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <string.h>
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "servermd.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "mi.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-
-static void XAACopyPlane1toNColorExpand(DrawablePtr pSrc, DrawablePtr pDst,
-                                        GCPtr pGC, RegionPtr rgnDst,
-                                        DDXPointPtr pptSrc);
-static void XAACopyPlaneNtoNColorExpand(DrawablePtr pSrc, DrawablePtr pDst,
-                                        GCPtr pGC, RegionPtr rgnDst,
-                                        DDXPointPtr pptSrc);
-
-static unsigned long TmpBitPlane;
-
-RegionPtr
-XAACopyPlaneColorExpansion(DrawablePtr pSrc,
-                           DrawablePtr pDst,
-                           GCPtr pGC,
-                           int srcx, int srcy,
-                           int width, int height,
-                           int dstx, int dsty, unsigned long bitPlane)
-{
-    if ((pSrc->type == DRAWABLE_PIXMAP) && !XAA_DEPTH_BUG(pGC)) {
-        if (pSrc->bitsPerPixel == 1) {
-            return (XAABitBlt(pSrc, pDst, pGC, srcx, srcy,
-                              width, height, dstx, dsty,
-                              XAACopyPlane1toNColorExpand, bitPlane));
-        }
-        else if (bitPlane < (1 << pDst->depth)) {
-            TmpBitPlane = bitPlane;
-            return (XAABitBlt(pSrc, pDst, pGC, srcx, srcy,
-                              width, height, dstx, dsty,
-                              XAACopyPlaneNtoNColorExpand, bitPlane));
-        }
-    }
-
-    return (XAAFallbackOps.CopyPlane(pSrc, pDst, pGC, srcx, srcy,
-                                     width, height, dstx, dsty, bitPlane));
-}
-
-static void
-XAACopyPlane1toNColorExpand(DrawablePtr pSrc,
-                            DrawablePtr pDst,
-                            GCPtr pGC, RegionPtr rgnDst, DDXPointPtr pptSrc)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    BoxPtr pbox = RegionRects(rgnDst);
-    int numrects = RegionNumRects(rgnDst);
-    unsigned char *src = ((PixmapPtr) pSrc)->devPrivate.ptr;
-    int srcwidth = ((PixmapPtr) pSrc)->devKind;
-
-    while (numrects--) {
-        (*infoRec->WriteBitmap) (infoRec->pScrn, pbox->x1, pbox->y1,
-                                 pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
-                                 src + (srcwidth * pptSrc->y) +
-                                 ((pptSrc->x >> 5) << 2), srcwidth,
-                                 pptSrc->x & 31, pGC->fgPixel, pGC->bgPixel,
-                                 pGC->alu, pGC->planemask);
-        pbox++;
-        pptSrc++;
-    }
-}
-
-static void
-XAACopyPlaneNtoNColorExpand(DrawablePtr pSrc,
-                            DrawablePtr pDst,
-                            GCPtr pGC, RegionPtr rgnDst, DDXPointPtr pptSrc)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    BoxPtr pbox = RegionRects(rgnDst);
-    int numrects = RegionNumRects(rgnDst);
-    unsigned char *src = ((PixmapPtr) pSrc)->devPrivate.ptr;
-    unsigned char *data, *srcPtr, *dataPtr;
-    int srcwidth = ((PixmapPtr) pSrc)->devKind;
-    int pitch, width, height, h, i, index, offset;
-    int Bpp = pSrc->bitsPerPixel >> 3;
-    unsigned long mask = TmpBitPlane;
-
-    if (TmpBitPlane < (1 << 8)) {
-        offset = 0;
-    }
-    else if (TmpBitPlane < (1 << 16)) {
-        offset = 1;
-        mask >>= 8;
-    }
-    else if (TmpBitPlane < (1 << 24)) {
-        offset = 2;
-        mask >>= 16;
-    }
-    else {
-        offset = 3;
-        mask >>= 24;
-    }
-
-    if (IS_OFFSCREEN_PIXMAP(pSrc))
-        SYNC_CHECK(pSrc);
-
-    while (numrects--) {
-        width = pbox->x2 - pbox->x1;
-        h = height = pbox->y2 - pbox->y1;
-        pitch = BitmapBytePad(width);
-
-        if (!(data = calloc(height, pitch)))
-            goto ALLOC_FAILED;
-
-        dataPtr = data;
-        srcPtr = ((pptSrc->y) * srcwidth) + src + ((pptSrc->x) * Bpp) + offset;
-
-        while (h--) {
-            for (i = index = 0; i < width; i++, index += Bpp) {
-                if (mask & srcPtr[index])
-                    dataPtr[i >> 3] |= (1 << (i & 7));
-            }
-            dataPtr += pitch;
-            srcPtr += srcwidth;
-        }
-
-        (*infoRec->WriteBitmap) (infoRec->pScrn,
-                                 pbox->x1, pbox->y1, width, height, data, pitch,
-                                 0, pGC->fgPixel, pGC->bgPixel, pGC->alu,
-                                 pGC->planemask);
-
-        free(data);
-
- ALLOC_FAILED:
-
-        pbox++;
-        pptSrc++;
-    }
-}
-
-void
-XAAPushPixelsSolidColorExpansion(GCPtr pGC,
-                                 PixmapPtr pBitMap,
-                                 DrawablePtr pDraw,
-                                 int dx, int dy, int xOrg, int yOrg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int MaxBoxes = RegionNumRects(pGC->pCompositeClip);
-    BoxPtr pbox, pClipBoxes;
-    int nboxes, srcx, srcy;
-    xRectangle TheRect;
-    unsigned char *src = pBitMap->devPrivate.ptr;
-    int srcwidth = pBitMap->devKind;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    TheRect.x = xOrg;
-    TheRect.y = yOrg;
-    TheRect.width = dx;
-    TheRect.height = dy;
-
-    if (MaxBoxes > (infoRec->PreAllocSize / sizeof(BoxRec))) {
-        pClipBoxes = malloc(MaxBoxes * sizeof(BoxRec));
-        if (!pClipBoxes)
-            return;
-    }
-    else
-        pClipBoxes = (BoxPtr) infoRec->PreAllocMem;
-
-    nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect);
-    pbox = pClipBoxes;
-
-    while (nboxes--) {
-        srcx = pbox->x1 - xOrg;
-        srcy = pbox->y1 - yOrg;
-        (*infoRec->WriteBitmap) (infoRec->pScrn, pbox->x1, pbox->y1,
-                                 pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
-                                 src + (srcwidth * srcy) + ((srcx >> 5) << 2),
-                                 srcwidth, srcx & 31,
-                                 pGC->fgPixel, -1, pGC->alu, pGC->planemask);
-        pbox++;
-    }
-
-    if (pClipBoxes != (BoxPtr) infoRec->PreAllocMem)
-        free(pClipBoxes);
-}
diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c
deleted file mode 100644 (file)
index e851f4a..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "xaawrap.h"
-
-/*
-    Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
-*/
-
-void
-XAACopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-{
-    DDXPointPtr pptSrc, ppt;
-    RegionRec rgnDst;
-    BoxPtr pbox;
-    int dx, dy, nbox;
-    WindowPtr pwinRoot;
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
-
-    if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) {
-        XAA_SCREEN_PROLOGUE(pScreen, CopyWindow);
-        if (infoRec->pScrn->vtSema && infoRec->NeedToSync) {
-            (*infoRec->Sync) (infoRec->pScrn);
-            infoRec->NeedToSync = FALSE;
-        }
-        (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
-        XAA_SCREEN_EPILOGUE(pScreen, CopyWindow, XAACopyWindow);
-        return;
-    }
-
-    pwinRoot = pScreen->root;
-
-    RegionNull(&rgnDst);
-
-    dx = ptOldOrg.x - pWin->drawable.x;
-    dy = ptOldOrg.y - pWin->drawable.y;
-    RegionTranslate(prgnSrc, -dx, -dy);
-    RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
-
-    pbox = RegionRects(&rgnDst);
-    nbox = RegionNumRects(&rgnDst);
-    if (!nbox || !(pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec)))) {
-        RegionUninit(&rgnDst);
-        return;
-    }
-    ppt = pptSrc;
-
-    while (nbox--) {
-        ppt->x = pbox->x1 + dx;
-        ppt->y = pbox->y1 + dy;
-        ppt++;
-        pbox++;
-    }
-
-    infoRec->ScratchGC.planemask = ~0L;
-    infoRec->ScratchGC.alu = GXcopy;
-
-    XAADoBitBlt((DrawablePtr) pwinRoot, (DrawablePtr) pwinRoot,
-                &(infoRec->ScratchGC), &rgnDst, pptSrc);
-
-    free(pptSrc);
-    RegionUninit(&rgnDst);
-}
diff --git a/hw/xfree86/xaa/xaaDashLine.c b/hw/xfree86/xaa/xaaDashLine.c
deleted file mode 100644 (file)
index c7e52cd..0000000
+++ /dev/null
@@ -1,353 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <stdlib.h>
-
-#include <X11/X.h>
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "miline.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-void
-#ifdef POLYSEGMENT
- XAAPolySegmentDashed(DrawablePtr pDrawable,
-                      GCPtr pGC, int nseg, xSegment * pSeg
-#else
-XAAPolyLinesDashed(DrawablePtr pDrawable, GCPtr pGC, int mode,  /* Origin or Previous */
-                   int npt,     /* number of points */
-                   DDXPointPtr pptInit
-#endif
-    )
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAAGCPtr pGCPriv = (XAAGCPtr) dixLookupPrivate(&pGC->devPrivates,
-                                                   XAAGetGCKey());
-    BoxPtr pboxInit = RegionRects(pGC->pCompositeClip);
-    int nboxInit = RegionNumRects(pGC->pCompositeClip);
-    unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
-    int xorg = pDrawable->x;
-    int yorg = pDrawable->y;
-    int nbox;
-    BoxPtr pbox;
-
-#ifndef POLYSEGMENT
-    DDXPointPtr ppt;
-#endif
-    unsigned int oc1, oc2;
-    int dmin, dmaj, e, octant;
-    int x1, x2, y1, y2, tmp, len, offset;
-    int PatternLength, PatternOffset;
-
-    if (!nboxInit)
-        return;
-
-    if (infoRec->DashedLineFlags & LINE_LIMIT_COORDS) {
-        int minValX = infoRec->DashedLineLimits.x1;
-        int maxValX = infoRec->DashedLineLimits.x2;
-        int minValY = infoRec->DashedLineLimits.y1;
-        int maxValY = infoRec->DashedLineLimits.y2;
-
-#ifdef POLYSEGMENT
-        int n = nseg;
-        xSegment *s = pSeg;
-
-        while (n--)
-#else
-        int n = npt;
-        int xorgtmp = xorg;
-        int yorgtmp = yorg;
-
-        ppt = pptInit;
-        x2 = ppt->x + xorgtmp;
-        y2 = ppt->y + yorgtmp;
-        while (--n)
-#endif
-        {
-#ifdef POLYSEGMENT
-            x1 = s->x1 + xorg;
-            y1 = s->y1 + yorg;
-            x2 = s->x2 + xorg;
-            y2 = s->y2 + yorg;
-            s++;
-#else
-            x1 = x2;
-            y1 = y2;
-            ++ppt;
-            if (mode == CoordModePrevious) {
-                xorgtmp = x1;
-                yorgtmp = y1;
-            }
-            x2 = ppt->x + xorgtmp;
-            y2 = ppt->y + yorgtmp;
-#endif
-            if (x1 > maxValX || x1 < minValX ||
-                x2 > maxValX || x2 < minValX ||
-                y1 > maxValY || y1 < minValY || y2 > maxValY || y2 < minValY) {
-#ifdef POLYSEGMENT
-                XAAFallbackOps.PolySegment(pDrawable, pGC, nseg, pSeg);
-#else
-                XAAFallbackOps.Polylines(pDrawable, pGC, mode, npt, pptInit);
-#endif
-                return;
-            }
-        }
-    }
-
-    PatternLength = pGCPriv->DashLength;
-    PatternOffset = pGC->dashOffset % PatternLength;
-
-    (*infoRec->SetupForDashedLine) (infoRec->pScrn, pGC->fgPixel,
-                                    (pGC->lineStyle ==
-                                     LineDoubleDash) ? pGC->bgPixel : -1,
-                                    pGC->alu, pGC->planemask, PatternLength,
-                                    pGCPriv->DashPattern);
-
-#ifdef POLYSEGMENT
-    while (nseg--)
-#else
-    ppt = pptInit;
-    x2 = ppt->x + xorg;
-    y2 = ppt->y + yorg;
-    while (--npt)
-#endif
-    {
-        nbox = nboxInit;
-        pbox = pboxInit;
-
-#ifdef POLYSEGMENT
-        x1 = pSeg->x1 + xorg;
-        y1 = pSeg->y1 + yorg;
-        x2 = pSeg->x2 + xorg;
-        y2 = pSeg->y2 + yorg;
-        pSeg++;
-#else
-        x1 = x2;
-        y1 = y2;
-        ++ppt;
-        if (mode == CoordModePrevious) {
-            xorg = x1;
-            yorg = y1;
-        }
-        x2 = ppt->x + xorg;
-        y2 = ppt->y + yorg;
-#endif
-
-        if (infoRec->SubsequentDashedBresenhamLine) {
-            if ((dmaj = x2 - x1) < 0) {
-                dmaj = -dmaj;
-                octant = XDECREASING;
-            }
-            else
-                octant = 0;
-
-            if ((dmin = y2 - y1) < 0) {
-                dmin = -dmin;
-                octant |= YDECREASING;
-            }
-
-            if (dmin >= dmaj) {
-                tmp = dmin;
-                dmin = dmaj;
-                dmaj = tmp;
-                octant |= YMAJOR;
-            }
-
-            e = -dmaj - ((bias >> octant) & 1);
-            len = dmaj;
-            dmin <<= 1;
-            dmaj <<= 1;
-        }
-        else {                  /* Muffle compiler */
-            dmin = dmaj = e = octant = len = 0;
-        }
-
-        while (nbox--) {
-            oc1 = oc2 = 0;
-            OUTCODES(oc1, x1, y1, pbox);
-            OUTCODES(oc2, x2, y2, pbox);
-            if (!(oc1 | oc2)) { /* uncliped */
-                if (infoRec->SubsequentDashedTwoPointLine) {
-                    (*infoRec->SubsequentDashedTwoPointLine) (infoRec->pScrn,
-                                                              x1, y1, x2, y2,
-#ifdef POLYSEGMENT
-                                                              (pGC->capStyle !=
-                                                               CapNotLast) ? 0 :
-#endif
-                                                              OMIT_LAST,
-                                                              PatternOffset);
-                }
-                else {
-                    (*infoRec->SubsequentDashedBresenhamLine) (infoRec->pScrn,
-                                                               x1, y1, dmaj,
-                                                               dmin, e,
-#ifdef POLYSEGMENT
-                                                               (pGC->capStyle !=
-                                                                CapNotLast)
-                                                               ? (len + 1) :
-#endif
-                                                               len, octant,
-                                                               PatternOffset);
-                }
-                break;
-            }
-            else if (oc1 & oc2) {       /* completely clipped */
-                pbox++;
-            }
-            else if (infoRec->ClippingFlags & HARDWARE_CLIP_DASHED_LINE) {
-                (*infoRec->SetClippingRectangle) (infoRec->pScrn,
-                                                  pbox->x1, pbox->y1,
-                                                  pbox->x2 - 1, pbox->y2 - 1);
-
-                if (infoRec->SubsequentDashedBresenhamLine) {
-                    (*infoRec->SubsequentDashedBresenhamLine) (infoRec->pScrn,
-                                                               x1, y1, dmaj,
-                                                               dmin, e,
-#ifdef POLYSEGMENT
-                                                               (pGC->capStyle !=
-                                                                CapNotLast)
-                                                               ? (len + 1) :
-#endif
-                                                               len, octant,
-                                                               PatternOffset);
-                }
-                else {
-                    (*infoRec->SubsequentDashedTwoPointLine) (infoRec->pScrn,
-                                                              x1, y1, x2, y2,
-#ifdef POLYSEGMENT
-                                                              (pGC->capStyle !=
-                                                               CapNotLast) ? 0 :
-#endif
-                                                              OMIT_LAST,
-                                                              PatternOffset);
-                }
-                (*infoRec->DisableClipping) (infoRec->pScrn);
-                pbox++;
-            }
-            else {
-                int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
-                int clip1 = 0, clip2 = 0;
-                int err, adx, ady;
-
-                if (octant & YMAJOR) {
-                    ady = dmaj >> 1;
-                    adx = dmin >> 1;
-                }
-                else {
-                    ady = dmin >> 1;
-                    adx = dmaj >> 1;
-                }
-
-                if (miZeroClipLine(pbox->x1, pbox->y1,
-                                   pbox->x2 - 1, pbox->y2 - 1,
-                                   &new_x1, &new_y1, &new_x2, &new_y2,
-                                   adx, ady, &clip1, &clip2,
-                                   octant, bias, oc1, oc2) == -1) {
-                    pbox++;
-                    continue;
-                }
-
-                if (octant & YMAJOR)
-                    len = abs(new_y2 - new_y1);
-                else
-                    len = abs(new_x2 - new_x1);
-#ifdef POLYSEGMENT
-                if (clip2 != 0 || pGC->capStyle != CapNotLast)
-                    len++;
-#else
-                len += (clip2 != 0);
-#endif
-                if (len) {
-                    int abserr, clipdx, clipdy;
-
-                    /* unwind bresenham error term to first point */
-                    if (clip1) {
-                        clipdx = abs(new_x1 - x1);
-                        clipdy = abs(new_y1 - y1);
-
-                        if (octant & YMAJOR)
-                            err = e + clipdy * dmin - clipdx * dmaj;
-                        else
-                            err = e + clipdx * dmin - clipdy * dmaj;
-                    }
-                    else
-                        err = e;
-
-#define range infoRec->DashedBresenhamLineErrorTermBits
-                    abserr = abs(err);
-                    while ((abserr & range) || (dmaj & range) || (dmin & range)) {
-                        dmin >>= 1;
-                        dmaj >>= 1;
-                        abserr >>= 1;
-                        err /= 2;
-                    }
-
-                    if (octant & YMAJOR)
-                        offset = abs(new_y1 - y1);
-                    else
-                        offset = abs(new_x1 - x1);
-
-                    offset += PatternOffset;
-                    offset %= PatternLength;
-
-                    (*infoRec->SubsequentDashedBresenhamLine) (infoRec->pScrn,
-                                                               new_x1, new_y1,
-                                                               dmaj, dmin, err,
-                                                               len, octant,
-                                                               offset);
-                }
-                pbox++;
-            }
-        }                       /* while (nbox--) */
-#ifndef POLYSEGMENT
-        len = abs(y2 - y1);
-        tmp = abs(x2 - x1);
-        PatternOffset += (len > tmp) ? len : tmp;
-        PatternOffset %= PatternLength;
-#endif
-    }                           /* while (nline--) */
-
-#ifndef POLYSEGMENT
-    /* paint the last point if the end style isn't CapNotLast.
-       (Assume that a projecting, butt, or round cap that is one
-       pixel wide is the same as the single pixel of the endpoint.)
-     */
-
-    if ((pGC->capStyle != CapNotLast) &&
-        ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
-         (ppt->y + yorg != pptInit->y + pDrawable->y) ||
-         (ppt == pptInit + 1))) {
-        nbox = nboxInit;
-        pbox = pboxInit;
-        while (nbox--) {
-            if ((x2 >= pbox->x1) && (y2 >= pbox->y1) &&
-                (x2 < pbox->x2) && (y2 < pbox->y2)) {
-                if (infoRec->SubsequentDashedTwoPointLine) {
-                    (*infoRec->SubsequentDashedTwoPointLine) (infoRec->pScrn,
-                                                              x2, y2, x2, y2, 0,
-                                                              PatternOffset);
-                }
-                else {
-                    (*infoRec->SubsequentDashedBresenhamLine) (infoRec->pScrn,
-                                                               x2, y2, 2, 0, -1,
-                                                               1, 0,
-                                                               PatternOffset);
-                }
-                break;
-            }
-            else
-                pbox++;
-        }
-    }
-#endif
-
-    SET_SYNC_FLAG(infoRec);
-}
diff --git a/hw/xfree86/xaa/xaaFallback.c b/hw/xfree86/xaa/xaaFallback.c
deleted file mode 100644 (file)
index f7604ef..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "xaawrap.h"
-
-static void
-XAAFillSpansFallback(DrawablePtr pDraw,
-                     GC * pGC,
-                     int nInit,
-                     DDXPointPtr pptInit, int *pwidthInit, int fSorted)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->FillSpans) (pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAASetSpansFallback(DrawablePtr pDraw,
-                    GCPtr pGC,
-                    char *pcharsrc,
-                    register DDXPointPtr ppt,
-                    int *pwidth, int nspans, int fSorted)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->SetSpans) (pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPutImageFallback(DrawablePtr pDraw,
-                    GCPtr pGC,
-                    int depth,
-                    int x, int y, int w, int h,
-                    int leftPad, int format, char *pImage)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->PutImage) (pDraw, pGC, depth, x, y, w, h,
-                           leftPad, format, pImage);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static RegionPtr
-XAACopyAreaFallback(DrawablePtr pSrc,
-                    DrawablePtr pDst,
-                    GC * pGC,
-                    int srcx, int srcy,
-                    int width, int height, int dstx, int dsty)
-{
-    RegionPtr ret;
-
-    XAA_GC_OP_PROLOGUE(pGC);
-    if ((pSrc->type == DRAWABLE_WINDOW) || (pDst->type == DRAWABLE_WINDOW) ||
-        IS_OFFSCREEN_PIXMAP(pSrc) || IS_OFFSCREEN_PIXMAP(pDst)) {
-        SYNC_CHECK(pGC);
-    }
-    ret = (*pGC->ops->CopyArea) (pSrc, pDst,
-                                 pGC, srcx, srcy, width, height, dstx, dsty);
-    XAA_GC_OP_EPILOGUE(pGC);
-    return ret;
-}
-
-static RegionPtr
-XAACopyPlaneFallback(DrawablePtr pSrc,
-                     DrawablePtr pDst,
-                     GCPtr pGC,
-                     int srcx, int srcy,
-                     int width, int height,
-                     int dstx, int dsty, unsigned long bitPlane)
-{
-    RegionPtr ret;
-
-    XAA_GC_OP_PROLOGUE(pGC);
-    if ((pSrc->type == DRAWABLE_WINDOW) || (pDst->type == DRAWABLE_WINDOW) ||
-        IS_OFFSCREEN_PIXMAP(pSrc) || IS_OFFSCREEN_PIXMAP(pDst)) {
-        SYNC_CHECK(pGC);
-    }
-    ret = (*pGC->ops->CopyPlane) (pSrc, pDst,
-                                  pGC, srcx, srcy, width, height, dstx, dsty,
-                                  bitPlane);
-    XAA_GC_OP_EPILOGUE(pGC);
-    return ret;
-}
-
-static void
-XAAPolyPointFallback(DrawablePtr pDraw,
-                     GCPtr pGC, int mode, int npt, xPoint * pptInit)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->PolyPoint) (pDraw, pGC, mode, npt, pptInit);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolylinesFallback(DrawablePtr pDraw,
-                     GCPtr pGC, int mode, int npt, DDXPointPtr pptInit)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->Polylines) (pDraw, pGC, mode, npt, pptInit);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolySegmentFallback(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment * pSeg)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->PolySegment) (pDraw, pGC, nseg, pSeg);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyRectangleFallback(DrawablePtr pDraw,
-                         GCPtr pGC, int nRectsInit, xRectangle *pRectsInit)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->PolyRectangle) (pDraw, pGC, nRectsInit, pRectsInit);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyArcFallback(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->PolyArc) (pDraw, pGC, narcs, parcs);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAFillPolygonFallback(DrawablePtr pDraw,
-                       GCPtr pGC,
-                       int shape, int mode, int count, DDXPointPtr ptsIn)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyFillRectFallback(DrawablePtr pDraw,
-                        GCPtr pGC, int nrectFill, xRectangle *prectInit)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->PolyFillRect) (pDraw, pGC, nrectFill, prectInit);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyFillArcFallback(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, parcs);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static int
-XAAPolyText8Fallback(DrawablePtr pDraw,
-                     GCPtr pGC, int x, int y, int count, char *chars)
-{
-    int ret;
-
-    XAA_GC_OP_PROLOGUE(pGC);
-    SYNC_CHECK(pGC);
-    ret = (*pGC->ops->PolyText8) (pDraw, pGC, x, y, count, chars);
-    XAA_GC_OP_EPILOGUE(pGC);
-    return ret;
-}
-
-static int
-XAAPolyText16Fallback(DrawablePtr pDraw,
-                      GCPtr pGC, int x, int y, int count, unsigned short *chars)
-{
-    int ret;
-
-    XAA_GC_OP_PROLOGUE(pGC);
-    SYNC_CHECK(pGC);
-    ret = (*pGC->ops->PolyText16) (pDraw, pGC, x, y, count, chars);
-    XAA_GC_OP_EPILOGUE(pGC);
-    return ret;
-}
-
-static void
-XAAImageText8Fallback(DrawablePtr pDraw,
-                      GCPtr pGC, int x, int y, int count, char *chars)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->ImageText8) (pDraw, pGC, x, y, count, chars);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAImageText16Fallback(DrawablePtr pDraw,
-                       GCPtr pGC,
-                       int x, int y, int count, unsigned short *chars)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->ImageText16) (pDraw, pGC, x, y, count, chars);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAImageGlyphBltFallback(DrawablePtr pDraw,
-                         GCPtr pGC,
-                         int xInit, int yInit,
-                         unsigned int nglyph,
-                         CharInfoPtr * ppci, pointer pglyphBase)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->ImageGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph, ppci,
-                                pglyphBase);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyGlyphBltFallback(DrawablePtr pDraw,
-                        GCPtr pGC,
-                        int xInit, int yInit,
-                        unsigned int nglyph,
-                        CharInfoPtr * ppci, pointer pglyphBase)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->PolyGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph, ppci,
-                               pglyphBase);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPushPixelsFallback(GCPtr pGC,
-                      PixmapPtr pBitMap,
-                      DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg)
-{
-    XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
-    (*pGC->ops->PushPixels) (pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
-    XAA_GC_OP_EPILOGUE(pGC);
-}
-
-GCOps XAAFallbackOps = {
-    XAAFillSpansFallback, XAASetSpansFallback,
-    XAAPutImageFallback, XAACopyAreaFallback,
-    XAACopyPlaneFallback, XAAPolyPointFallback,
-    XAAPolylinesFallback, XAAPolySegmentFallback,
-    XAAPolyRectangleFallback, XAAPolyArcFallback,
-    XAAFillPolygonFallback, XAAPolyFillRectFallback,
-    XAAPolyFillArcFallback, XAAPolyText8Fallback,
-    XAAPolyText16Fallback, XAAImageText8Fallback,
-    XAAImageText16Fallback, XAAImageGlyphBltFallback,
-    XAAPolyGlyphBltFallback, XAAPushPixelsFallback,
-};
-
-GCOps *
-XAAGetFallbackOps(void)
-{
-    return &XAAFallbackOps;
-}
diff --git a/hw/xfree86/xaa/xaaFillArc.c b/hw/xfree86/xaa/xaaFillArc.c
deleted file mode 100644 (file)
index fb7e720..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright 1996  The XFree86 Project
- *
- * 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 
- * HARM HANEMAAYER 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.
- * 
- * Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
- */
-
-/*
- * Filled solid arcs, based on cfbfillarc.c.
- *
- * Fill arc using calls to low-level span fill. Because the math for
- * each span can be done concurrently with the drawing of the span
- * with a graphics coprocessor operation, this is faster than just
- * using miPolyFillArc, which first calculates all the spans and then
- * calls FillSpans.
- *
- * Clipped arcs are dispatched to FillSpans.
- */
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <limits.h>
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "mifillarc.h"
-#include "mi.h"
-
-/*
- * This is based on the integer-math versions from mi. Perhaps on a
- * Pentium, the floating-point (double)-math version is faster.
- */
-
-static void
-XAAFillEllipseSolid(DrawablePtr pDraw, GCPtr pGC, xArc * arc)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    register int x, y, e;
-    int yk, xk, ym, xm, dx, dy, xorg, yorg;
-    int slw;
-    miFillArcRec info;
-
-    (*infoRec->SetupForSolidFill) (infoRec->pScrn, pGC->fgPixel, pGC->alu,
-                                   pGC->planemask);
-
-    miFillArcSetup(arc, &info);
-    MIFILLARCSETUP();
-    if (pGC->miTranslate) {
-        xorg += pDraw->x;
-        yorg += pDraw->y;
-    }
-    while (y > 0) {
-        MIFILLARCSTEP(slw);
-        if (slw > 0) {
-            (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn, xorg - x,
-                                                 yorg - y, slw, 1);
-            if (miFillArcLower(slw))
-                (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn,
-                                                     xorg - x, yorg + y + dy,
-                                                     slw, 1);
-        }
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-#define ADDSPAN(l,r) \
-    if (r >= l) \
-       (*infoRec->SubsequentSolidFillRect)( \
-           infoRec->pScrn, l, ya, r - l + 1, 1);
-
-#define ADDSLICESPANS(flip) \
-    if (!flip) \
-    { \
-       ADDSPAN(xl, xr); \
-    } \
-    else \
-    { \
-       xc = xorg - x; \
-       ADDSPAN(xc, xr); \
-       xc += slw - 1; \
-       ADDSPAN(xl, xc); \
-    }
-
-static void
-XAAFillArcSliceSolid(DrawablePtr pDraw, GCPtr pGC, xArc * arc)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
-    register int x, y, e;
-    miFillArcRec info;
-    miArcSliceRec slice;
-    int ya, xl, xr, xc;
-
-    (*infoRec->SetupForSolidFill) (infoRec->pScrn, pGC->fgPixel, pGC->alu,
-                                   pGC->planemask);
-
-    miFillArcSetup(arc, &info);
-    miFillArcSliceSetup(arc, &slice, pGC);
-    MIFILLARCSETUP();
-    slw = arc->height;
-    if (slice.flip_top || slice.flip_bot)
-        slw += (arc->height >> 1) + 1;
-    if (pGC->miTranslate) {
-        xorg += pDraw->x;
-        yorg += pDraw->y;
-        slice.edge1.x += pDraw->x;
-        slice.edge2.x += pDraw->x;
-    }
-    while (y > 0) {
-        MIFILLARCSTEP(slw);
-        MIARCSLICESTEP(slice.edge1);
-        MIARCSLICESTEP(slice.edge2);
-        if (miFillSliceUpper(slice)) {
-            ya = yorg - y;
-            MIARCSLICEUPPER(xl, xr, slice, slw);
-
-            ADDSLICESPANS(slice.flip_top);
-        }
-        if (miFillSliceLower(slice)) {
-            ya = yorg + y + dy;
-            MIARCSLICELOWER(xl, xr, slice, slw);
-            ADDSLICESPANS(slice.flip_bot);
-        }
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
-{
-    register xArc *arc;
-    register int i;
-    int x2, y2;
-    BoxRec box;
-    RegionPtr cclip;
-
-    cclip = pGC->pCompositeClip;
-
-    if (!RegionNumRects(cclip))
-        return;
-
-    for (arc = parcs, i = narcs; --i >= 0; arc++) {
-        if (miFillArcEmpty(arc))
-            continue;
-        if (miCanFillArc(arc)) {
-            box.x1 = arc->x + pDraw->x;
-            box.y1 = arc->y + pDraw->y;
-            /*
-             * Because box.x2 and box.y2 get truncated to 16 bits, and the
-             * RECT_IN_REGION test treats the resulting number as a signed
-             * integer, the RECT_IN_REGION test alone can go the wrong way.
-             * This can result in a server crash because the rendering
-             * routines in this file deal directly with cpu addresses
-             * of pixels to be stored, and do not clip or otherwise check
-             * that all such addresses are within their respective pixmaps.
-             * So we only allow the RECT_IN_REGION test to be used for
-             * values that can be expressed correctly in a signed short.
-             */
-            x2 = box.x1 + (int) arc->width + 1;
-            box.x2 = x2;
-            y2 = box.y1 + (int) arc->height + 1;
-            box.y2 = y2;
-            if ((x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) &&
-                (RegionContainsRect(cclip, &box) == rgnIN)) {
-                if ((arc->angle2 >= FULLCIRCLE) || (arc->angle2 <= -FULLCIRCLE))
-                    XAAFillEllipseSolid(pDraw, pGC, arc);
-                else
-                    XAAFillArcSliceSolid(pDraw, pGC, arc);
-                continue;
-            }
-        }
-        miPolyFillArc(pDraw, pGC, 1, arc);
-    }
-}
diff --git a/hw/xfree86/xaa/xaaFillPoly.c b/hw/xfree86/xaa/xaaFillPoly.c
deleted file mode 100644 (file)
index 0cdedf5..0000000
+++ /dev/null
@@ -1,991 +0,0 @@
-
-/*
- * Copyright 1996  The XFree86 Project
- *
- * 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 
- * HARM HANEMAAYER 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.
- * 
- */
-
-/*
- * Written by Mark Vojkovich.  Loosly based on an original version
- * written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net) which
- * only did solid rectangles and didn't have trapezoid support.
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "micoord.h"
-
-#include "xaa.h"
-#include "xaalocal.h"
-
-#define POLY_USE_MI            0
-#define POLY_FULLY_CLIPPED     1
-#define POLY_IS_EASY           2
-
-#define Setup(c,x,vertex,dx,dy,e,sign,step,DX) {\
-    x = intToX(vertex); \
-    if ((dy = intToY(c) - y)) { \
-       DX = dx = intToX(c) - x; \
-       step = 0; \
-       if (dx >= 0) \
-       { \
-           e = 0; \
-           sign = 1; \
-           if (dx >= dy) {\
-               step = dx / dy; \
-               dx %= dy; \
-           } \
-       } \
-       else \
-       { \
-           e = 1 - dy; \
-           sign = -1; \
-           dx = -dx; \
-           if (dx >= dy) { \
-               step = - (dx / dy); \
-               dx %= dy; \
-           } \
-       } \
-    } \
-    x += origin; \
-    vertex = c; \
-}
-
-#define Step(x,dx,dy,e,sign,step) {\
-    x += step; \
-    if ((e += dx) > 0) \
-    { \
-       x += sign; \
-       e -= dy; \
-    } \
-}
-
-#define FixError(x, dx, dy, e, sign, step, h)  {       \
-          e += (h) * dx;                               \
-          x += (h) * step;                             \
-          if(e > 0) {                                  \
-               x += e * sign/dy;                       \
-               e %= dy;                                \
-               if(e) {                                 \
-                  x += sign;                           \
-                  e -= dy;                             \
-               }                                       \
-          }                                            \
-}
-
-/*
-   XAAIsEasyPoly -
-
-   Checks CoordModeOrigin one rect polygons to see if we need
-   to use Mi.
-   Returns: POLY_USE_MI, POLY_FULLY_CLIPPED or POLY_IS_EASY
-       as well as the pointer to the "top" point and the y
-       extents.
-*/
-
-int
-XAAIsEasyPolygon(DDXPointPtr ptsIn, int count, BoxPtr extents, int origin, DDXPointPtr * topPoint,      /* return */
-                 int *topY, int *bottomY,       /* return */
-                 int shape)
-{
-    int c = 0, vertex1, vertex2;
-
-    *topY = 32767;
-    *bottomY = 0;
-
-    origin -= (origin & 0x8000) << 1;
-    vertex1 = extents->x1 - origin;
-    vertex2 = extents->x2 - origin /* - 0x00010001 */ ;
-    /* I think this was an error in cfb ^ */
-
-    if (shape == Convex) {
-        while (count--) {
-            c = *((int *) ptsIn);
-            if (((c - vertex1) | (vertex2 - c)) & 0x80008000)
-                return POLY_USE_MI;
-
-            c = intToY(c);
-            if (c < *topY) {
-                *topY = c;
-                *topPoint = ptsIn;
-            }
-            ptsIn++;
-            if (c > *bottomY)
-                *bottomY = c;
-        }
-    }
-    else {
-        int yFlip = 0;
-        int dx2, dx1, x1, x2;
-
-        x2 = x1 = -1;
-        dx2 = dx1 = 1;
-
-        while (count--) {
-            c = *((int *) ptsIn);
-            if (((c - vertex1) | (vertex2 - c)) & 0x80008000)
-                return POLY_USE_MI;
-            c = intToY(c);
-            if (c < *topY) {
-                *topY = c;
-                *topPoint = ptsIn;
-            }
-            ptsIn++;
-            if (c > *bottomY)
-                *bottomY = c;
-            if (c == x1)
-                continue;
-            if (dx1 > 0) {
-                if (x2 < 0)
-                    x2 = c;
-                else
-                    dx2 = dx1 = (c - x1) >> 31;
-            }
-            else if ((c - x1) >> 31 != dx1) {
-                dx1 = ~dx1;
-                yFlip++;
-            }
-            x1 = c;
-        }
-        x1 = (x2 - c) >> 31;
-        if (x1 != dx1)
-            yFlip++;
-        if (x1 != dx2)
-            yFlip++;
-        if (yFlip != 2) {
-            if (*topY == *bottomY)
-                return POLY_FULLY_CLIPPED;
-            else
-                return POLY_USE_MI;
-        }
-    }
-    if (*topY == *bottomY)
-        return POLY_FULLY_CLIPPED;
-
-    return POLY_IS_EASY;
-}
-
-void
-XAAFillPolygonSolid(DrawablePtr pDraw,
-                    GCPtr pGC,
-                    int shape, int mode, int count, DDXPointPtr ptsIn)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int origin, vertex1, vertex2;
-    int *vertex1p, *vertex2p, *endp;
-    int x1 = 0, x2 = 0;
-    int dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0;
-    int DX1 = 0, DX2 = 0, e1 = 0, e2 = 0;
-    int step1 = 0, step2 = 0, sign1 = 0, sign2 = 0;
-    int c, y, maxy, h, yoffset;
-    DDXPointPtr topPoint;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    if (mode == CoordModePrevious) {
-        register DDXPointPtr ppt = ptsIn + 1;
-
-        for (origin = 1; origin < count; origin++, ppt++) {
-            ppt->x += (ppt - 1)->x;
-            ppt->y += (ppt - 1)->y;
-        }
-        mode = CoordModeOrigin;
-    }
-
-    if (RegionNumRects(pGC->pCompositeClip) != 1) {
-        miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn);
-        return;
-    }
-
-    origin = coordToInt(pDraw->x, pDraw->y);
-
-    switch (XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents,
-                             origin, &topPoint, &y, &maxy, shape)) {
-    case POLY_USE_MI:
-        miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn);
-    case POLY_FULLY_CLIPPED:
-        return;
-    }
-
-    endp = (int *) ptsIn + count;
-    vertex2p = vertex1p = (int *) topPoint;
-    origin = pDraw->x;
-    yoffset = pDraw->y;
-    vertex2 = vertex1 = *vertex2p++;
-    if (vertex2p == endp)
-        vertex2p = (int *) ptsIn;
-
-    (*infoRec->SetupForSolidFill) (infoRec->pScrn, pGC->fgPixel, pGC->alu,
-                                   pGC->planemask);
-
-    while (1) {
-        if (y == intToY(vertex1)) {
-            do {
-                if (vertex1p == (int *) ptsIn)
-                    vertex1p = endp;
-                c = *--vertex1p;
-                Setup(c, x1, vertex1, dx1, dy1, e1, sign1, step1, DX1)
-            } while (y >= intToY(vertex1));
-            h = dy1;
-        }
-        else {
-            Step(x1, dx1, dy1, e1, sign1, step1)
-                h = intToY(vertex1) - y;
-        }
-        if (y == intToY(vertex2)) {
-            do {
-                c = *vertex2p++;
-                if (vertex2p == endp)
-                    vertex2p = (int *) ptsIn;
-                Setup(c, x2, vertex2, dx2, dy2, e2, sign2, step2, DX2)
-            } while (y >= intToY(vertex2));
-            if (dy2 < h)
-                h = dy2;
-        }
-        else {
-            Step(x2, dx2, dy2, e2, sign2, step2)
-                if ((c = (intToY(vertex2) - y)) < h)
-                h = c;
-        }
-
-        /* fill spans for this segment */
-        if (DX1 | DX2) {
-            if (infoRec->SubsequentSolidFillTrap && (h > 6)) {
-                if (x1 == x2) {
-                    while (x1 == x2) {
-                        y++;
-                        if (!--h)
-                            break;
-                        Step(x1, dx1, dy1, e1, sign1, step1)
-                            Step(x2, dx2, dy2, e2, sign2, step2)
-                    }
-                    if (y == maxy)
-                        break;
-                    if (!h)
-                        continue;
-                }
-
-                if (x1 < x2)
-                    (*infoRec->SubsequentSolidFillTrap) (infoRec->pScrn,
-                                                         y + yoffset, h,
-                                                         x1, DX1, dy1, e1,
-                                                         x2 - 1, DX2, dy2, e2);
-                else
-                    (*infoRec->SubsequentSolidFillTrap) (infoRec->pScrn,
-                                                         y + yoffset, h,
-                                                         x2, DX2, dy2, e2,
-                                                         x1 - 1, DX1, dy1, e1);
-                y += h;
-                if (--h) {
-                    FixError(x1, dx1, dy1, e1, sign1, step1, h);
-                    FixError(x2, dx2, dy2, e2, sign2, step2, h);
-                    h = 0;
-                }
-            }
-            else {
-                while (1) {
-                    if (x2 > x1)
-                        (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn,
-                                                             x1, y + yoffset,
-                                                             x2 - x1, 1);
-                    else if (x1 > x2)
-                        (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn,
-                                                             x2, y + yoffset,
-                                                             x1 - x2, 1);
-                    y++;
-                    if (!--h)
-                        break;
-                    Step(x1, dx1, dy1, e1, sign1, step1)
-                        Step(x2, dx2, dy2, e2, sign2, step2)
-                }
-            }
-        }
-        else {
-            if (x2 > x1)
-                (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn,
-                                                     x1, y + yoffset, x2 - x1,
-                                                     h);
-            else if (x1 > x2)
-                (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn,
-                                                     x2, y + yoffset, x1 - x2,
-                                                     h);
-
-            y += h;
-            h = 0;
-        }
-        if (y == maxy)
-            break;
-    }
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAFillPolygonHelper(ScrnInfoPtr pScrn,
-                     DDXPointPtr ptsIn,
-                     int count,
-                     DDXPointPtr topPoint,
-                     int y,
-                     int maxy,
-                     int origin,
-                     RectFuncPtr RectFunc,
-                     TrapFuncPtr TrapFunc,
-                     int xorg, int yorg, XAACacheInfoPtr pCache)
-{
-    int *vertex1p, *vertex2p, *endp;
-    int vertex1, vertex2;
-    int x1 = 0, x2 = 0;
-    int dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0;
-    int DX1 = 0, DX2 = 0, e1 = 0, e2 = 0;
-    int step1 = 0, step2 = 0, sign1 = 0, sign2 = 0;
-    int c, h, yoffset;
-
-    endp = (int *) ptsIn + count;
-    vertex2p = vertex1p = (int *) topPoint;
-    yoffset = intToY(origin);
-    origin = intToX(origin);
-    vertex2 = vertex1 = *vertex2p++;
-    if (vertex2p == endp)
-        vertex2p = (int *) ptsIn;
-
-    while (1) {
-        if (y == intToY(vertex1)) {
-            do {
-                if (vertex1p == (int *) ptsIn)
-                    vertex1p = endp;
-                c = *--vertex1p;
-                Setup(c, x1, vertex1, dx1, dy1, e1, sign1, step1, DX1)
-            } while (y >= intToY(vertex1));
-            h = dy1;
-        }
-        else {
-            Step(x1, dx1, dy1, e1, sign1, step1)
-                h = intToY(vertex1) - y;
-        }
-        if (y == intToY(vertex2)) {
-            do {
-                c = *vertex2p++;
-                if (vertex2p == endp)
-                    vertex2p = (int *) ptsIn;
-                Setup(c, x2, vertex2, dx2, dy2, e2, sign2, step2, DX2)
-            } while (y >= intToY(vertex2));
-            if (dy2 < h)
-                h = dy2;
-        }
-        else {
-            Step(x2, dx2, dy2, e2, sign2, step2)
-                if ((c = (intToY(vertex2) - y)) < h)
-                h = c;
-        }
-
-        /* fill spans for this segment */
-        if (DX1 | DX2) {
-            if (TrapFunc && (h > 6)) {
-                if (x1 == x2) {
-                    while (x1 == x2) {
-                        y++;
-                        if (!--h)
-                            break;
-                        Step(x1, dx1, dy1, e1, sign1, step1)
-                            Step(x2, dx2, dy2, e2, sign2, step2)
-                    }
-                    if (y == maxy)
-                        break;
-                    if (!h)
-                        continue;
-                }
-
-                if (x1 < x2)
-                    (*TrapFunc) (pScrn, y + yoffset, h,
-                                 x1, DX1, dy1, e1,
-                                 x2 - 1, DX2, dy2, e2, xorg, yorg, pCache);
-                else
-                    (*TrapFunc) (pScrn, y + yoffset, h,
-                                 x2, DX2, dy2, e2,
-                                 x1 - 1, DX1, dy1, e1, xorg, yorg, pCache);
-                y += h;
-                if (--h) {
-                    FixError(x1, dx1, dy1, e1, sign1, step1, h);
-                    FixError(x2, dx2, dy2, e2, sign2, step2, h);
-                    h = 0;
-                }
-            }
-            else {
-                while (1) {
-                    if (x2 > x1)
-                        (*RectFunc) (pScrn,
-                                     x1, y + yoffset, x2 - x1, 1, xorg, yorg,
-                                     pCache);
-                    else if (x1 > x2)
-                        (*RectFunc) (pScrn,
-                                     x2, y + yoffset, x1 - x2, 1, xorg, yorg,
-                                     pCache);
-                    y++;
-                    if (!--h)
-                        break;
-                    Step(x1, dx1, dy1, e1, sign1, step1)
-                        Step(x2, dx2, dy2, e2, sign2, step2)
-                }
-            }
-        }
-        else {
-            if (x2 > x1)
-                (*RectFunc) (pScrn,
-                             x1, y + yoffset, x2 - x1, h, xorg, yorg, pCache);
-            else if (x1 > x2)
-                (*RectFunc) (pScrn,
-                             x2, y + yoffset, x1 - x2, h, xorg, yorg, pCache);
-
-            y += h;
-            h = 0;
-        }
-        if (y == maxy)
-            break;
-    }
-}
-
-        /*****************\
-       |  Solid Helpers  |
-       \*****************/
-
-static void
-SolidTrapHelper(ScrnInfoPtr pScrn,
-                int y, int h,
-                int x1, int dx1, int dy1, int e1,
-                int x2, int dx2, int dy2, int e2,
-                int xorg, int yorg, XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    (*infoRec->SubsequentSolidFillTrap) (pScrn,
-                                         y, h, x1, dx1, dy1, e1, x2, dx2, dy2,
-                                         e2);
-}
-
-static void
-SolidRectHelper(ScrnInfoPtr pScrn,
-                int x, int y, int w, int h,
-                int xorg, int yorg, XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h);
-}
-
-        /*********************\
-       |  Mono 8x8 Patterns  |
-       \*********************/
-
-static void
-Mono8x8PatternTrapHelper_ScreenOrigin(ScrnInfoPtr pScrn,
-                                      int y, int h,
-                                      int x1, int dx1, int dy1, int e1,
-                                      int x2, int dx2, int dy2, int e2,
-                                      int xorg, int yorg,
-                                      XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    (*infoRec->SubsequentMono8x8PatternFillTrap) (pScrn, xorg, yorg,
-                                                  y, h, x1, dx1, dy1, e1, x2,
-                                                  dx2, dy2, e2);
-}
-
-static void
-Mono8x8PatternRectHelper_ScreenOrigin(ScrnInfoPtr pScrn,
-                                      int x, int y, int w, int h,
-                                      int xorg, int yorg,
-                                      XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, xorg, yorg,
-                                                  x, y, w, h);
-}
-
-static void
-Mono8x8PatternRectHelper(ScrnInfoPtr pScrn,
-                         int x, int y, int w, int h,
-                         int xorg, int yorg, XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    xorg = (x - xorg) & 0x07;
-    yorg = (y - yorg) & 0x07;
-
-    if (!(infoRec->Mono8x8PatternFillFlags &
-          HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-        if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) {
-            int patx = pCache->pat0;
-            int paty = pCache->pat1;
-
-            XAARotateMonoPattern(&patx, &paty, xorg, yorg,
-                                 (infoRec->Mono8x8PatternFillFlags &
-                                  BIT_ORDER_IN_BYTE_MSBFIRST));
-            xorg = patx;
-            yorg = paty;
-        }
-        else {
-            int slot = (yorg << 3) + xorg;
-
-            xorg = pCache->x + pCache->offsets[slot].x;
-            yorg = pCache->y + pCache->offsets[slot].y;
-        }
-    }
-
-    (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, xorg, yorg,
-                                                  x, y, w, h);
-}
-
-        /****************\
-       |  Cache Expand  |
-       \****************/
-
-static void
-CacheExpandRectHelper(ScrnInfoPtr pScrn,
-                      int X, int Y, int Width, int Height,
-                      int xorg, int yorg, XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int x, phaseY, phaseX, skipleft, w, blit_w, blit_h;
-    int cacheWidth;
-
-    cacheWidth = (pCache->w * pScrn->bitsPerPixel) /
-        infoRec->CacheColorExpandDensity;
-
-    phaseY = (Y - yorg) % pCache->orig_h;
-    if (phaseY < 0)
-        phaseY += pCache->orig_h;
-    phaseX = (X - xorg) % pCache->orig_w;
-    if (phaseX < 0)
-        phaseX += pCache->orig_w;
-
-    while (1) {
-        w = Width;
-        skipleft = phaseX;
-        x = X;
-        blit_h = pCache->h - phaseY;
-        if (blit_h > Height)
-            blit_h = Height;
-
-        while (1) {
-            blit_w = cacheWidth - skipleft;
-            if (blit_w > w)
-                blit_w = w;
-            (*infoRec->SubsequentScreenToScreenColorExpandFill) (pScrn, x, Y,
-                                                                 blit_w, blit_h,
-                                                                 pCache->x,
-                                                                 pCache->y +
-                                                                 phaseY,
-                                                                 skipleft);
-            w -= blit_w;
-            if (!w)
-                break;
-            x += blit_w;
-            skipleft = (skipleft + blit_w) % pCache->orig_w;
-        }
-        Height -= blit_h;
-        if (!Height)
-            break;
-        Y += blit_h;
-        phaseY = (phaseY + blit_h) % pCache->orig_h;
-    }
-}
-
-        /**************\
-       |  Cache Blit  |
-       \**************/
-
-static void
-CacheBltRectHelper(ScrnInfoPtr pScrn,
-                   int X, int Y, int Width, int Height,
-                   int xorg, int yorg, XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int x, phaseY, phaseX, skipleft, w, blit_w, blit_h;
-
-    phaseY = (Y - yorg) % pCache->orig_h;
-    if (phaseY < 0)
-        phaseY += pCache->orig_h;
-    phaseX = (X - xorg) % pCache->orig_w;
-    if (phaseX < 0)
-        phaseX += pCache->orig_w;
-
-    while (1) {
-        w = Width;
-        skipleft = phaseX;
-        x = X;
-        blit_h = pCache->h - phaseY;
-        if (blit_h > Height)
-            blit_h = Height;
-
-        while (1) {
-            blit_w = pCache->w - skipleft;
-            if (blit_w > w)
-                blit_w = w;
-            (*infoRec->SubsequentScreenToScreenCopy) (pScrn,
-                                                      pCache->x + skipleft,
-                                                      pCache->y + phaseY, x, Y,
-                                                      blit_w, blit_h);
-            w -= blit_w;
-            if (!w)
-                break;
-            x += blit_w;
-            skipleft = (skipleft + blit_w) % pCache->orig_w;
-        }
-        Height -= blit_h;
-        if (!Height)
-            break;
-        Y += blit_h;
-        phaseY = (phaseY + blit_h) % pCache->orig_h;
-    }
-}
-
-        /**********************\
-       |   Stippled Polygons  |
-       \**********************/
-
-void
-XAAFillPolygonStippled(DrawablePtr pDraw,
-                       GCPtr pGC,
-                       int shape, int mode, int count, DDXPointPtr ptsIn)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
-    int origin, type, patx, paty, fg, bg;
-    int y, maxy, xorg, yorg;
-    DDXPointPtr topPoint;
-    XAACacheInfoPtr pCache = NULL;
-    RectFuncPtr RectFunc = NULL;
-    TrapFuncPtr TrapFunc = NULL;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    if (mode == CoordModePrevious) {
-        register DDXPointPtr ppt = ptsIn + 1;
-
-        for (origin = 1; origin < count; origin++, ppt++) {
-            ppt->x += (ppt - 1)->x;
-            ppt->y += (ppt - 1)->y;
-        }
-        mode = CoordModeOrigin;
-    }
-
-    if (RegionNumRects(pGC->pCompositeClip) != 1) {
-        miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn);
-        return;
-    }
-
-    if (pGC->fillStyle == FillStippled) {
-        type = (*infoRec->StippledFillChooser) (pGC);
-        fg = pGC->fgPixel;
-        bg = -1;
-    }
-    else {
-        type = (*infoRec->OpaqueStippledFillChooser) (pGC);
-        fg = pGC->fgPixel;
-        bg = pGC->bgPixel;
-    }
-
-    if (!type) {
-        (*XAAFallbackOps.FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn);
-        return;
-    }
-
-    if ((type == DO_COLOR_EXPAND) || (type == DO_COLOR_8x8)) {
-        miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn);
-        return;
-    }
-
-    origin = pDraw->x;
-
-    switch (XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents,
-                             origin, &topPoint, &y, &maxy, shape)) {
-    case POLY_USE_MI:
-        miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn);
-    case POLY_FULLY_CLIPPED:
-        return;
-    }
-
-    xorg = (pDraw->x + pGC->patOrg.x);
-    yorg = (pDraw->y + pGC->patOrg.y);
-
-    if ((fg == bg) && (bg != -1) && infoRec->SetupForSolidFill) {
-
-        (*infoRec->SetupForSolidFill) (infoRec->pScrn, fg,
-                                       pGC->alu, pGC->planemask);
-
-        RectFunc = SolidRectHelper;
-        TrapFunc = infoRec->SubsequentSolidFillTrap ? SolidTrapHelper : NULL;
-    }
-    else
-        switch (type) {
-        case DO_MONO_8x8:
-            patx = pPriv->pattern0;
-            paty = pPriv->pattern1;
-            if (infoRec->Mono8x8PatternFillFlags &
-                HARDWARE_PATTERN_SCREEN_ORIGIN) {
-                xorg = (-xorg) & 0x07;
-                yorg = (-yorg) & 0x07;
-                if (infoRec->Mono8x8PatternFillFlags &
-                    HARDWARE_PATTERN_PROGRAMMED_BITS) {
-                    if (!(infoRec->Mono8x8PatternFillFlags &
-                          HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-                        XAARotateMonoPattern(&patx, &paty, xorg, yorg,
-                                             (infoRec->Mono8x8PatternFillFlags &
-                                              BIT_ORDER_IN_BYTE_MSBFIRST));
-                        xorg = patx;
-                        yorg = paty;
-                    }
-                }
-                else {
-                    XAACacheInfoPtr pCache =
-                        (*infoRec->CacheMono8x8Pattern) (infoRec->pScrn, patx,
-                                                         paty);
-                    patx = pCache->x;
-                    paty = pCache->y;
-                    if (!(infoRec->Mono8x8PatternFillFlags &
-                          HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-                        int slot = (yorg << 3) + xorg;
-
-                        patx += pCache->offsets[slot].x;
-                        paty += pCache->offsets[slot].y;
-                        xorg = patx;
-                        yorg = paty;
-                    }
-                }
-                RectFunc = Mono8x8PatternRectHelper_ScreenOrigin;
-                if (infoRec->SubsequentMono8x8PatternFillTrap)
-                    TrapFunc = Mono8x8PatternTrapHelper_ScreenOrigin;
-            }
-            else {              /* !HARDWARE_PATTERN_SCREEN_ORIGIN */
-                if (!(infoRec->Mono8x8PatternFillFlags &
-                      HARDWARE_PATTERN_PROGRAMMED_BITS)) {
-                    pCache =
-                        (*infoRec->CacheMono8x8Pattern) (infoRec->pScrn, patx,
-                                                         paty);
-                    patx = pCache->x;
-                    paty = pCache->y;
-                }
-                else {
-                    pCache = &(infoRec->ScratchCacheInfoRec);
-                    pCache->pat0 = patx;
-                    pCache->pat1 = paty;
-                }
-                RectFunc = Mono8x8PatternRectHelper;
-            }
-
-            (*infoRec->SetupForMono8x8PatternFill) (infoRec->pScrn,
-                                                    patx, paty, fg, bg,
-                                                    pGC->alu, pGC->planemask);
-            break;
-        case DO_CACHE_EXPAND:
-            pCache =
-                (*infoRec->CacheMonoStipple) (infoRec->pScrn, pGC->stipple);
-
-            (*infoRec->SetupForScreenToScreenColorExpandFill) (infoRec->pScrn,
-                                                               fg, bg, pGC->alu,
-                                                               pGC->planemask);
-
-            RectFunc = CacheExpandRectHelper;
-            break;
-        case DO_CACHE_BLT:
-            pCache = (*infoRec->CacheStipple) (infoRec->pScrn, pGC->stipple,
-                                               fg, bg);
-            (*infoRec->SetupForScreenToScreenCopy) (infoRec->pScrn, 1, 1,
-                                                    pGC->alu, pGC->planemask,
-                                                    pCache->trans_color);
-
-            RectFunc = CacheBltRectHelper;
-            break;
-        default:
-            return;
-        }
-
-    XAAFillPolygonHelper(infoRec->pScrn, ptsIn, count, topPoint,
-                         y, maxy, origin, RectFunc, TrapFunc, xorg, yorg,
-                         pCache);
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-        /*******************\
-       |   Tiled Polygons  |
-       \*******************/
-
-void
-XAAFillPolygonTiled(DrawablePtr pDraw,
-                    GCPtr pGC,
-                    int shape, int mode, int count, DDXPointPtr ptsIn)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-    int origin, type, patx, paty;
-    int y, maxy, xorg, yorg;
-    DDXPointPtr topPoint;
-    XAACacheInfoPtr pCache = NULL;
-    RectFuncPtr RectFunc = NULL;
-    TrapFuncPtr TrapFunc = NULL;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    if (mode == CoordModePrevious) {
-        register DDXPointPtr ppt = ptsIn + 1;
-
-        for (origin = 1; origin < count; origin++, ppt++) {
-            ppt->x += (ppt - 1)->x;
-            ppt->y += (ppt - 1)->y;
-        }
-        mode = CoordModeOrigin;
-    }
-
-    if (RegionNumRects(pGC->pCompositeClip) != 1) {
-        miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn);
-        return;
-    }
-
-    type = (*infoRec->TiledFillChooser) (pGC);
-
-    if (!type || (type == DO_IMAGE_WRITE)) {
-        (*XAAFallbackOps.FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn);
-        return;
-    }
-
-    if (type == DO_COLOR_8x8) {
-        miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn);
-        return;
-    }
-
-    origin = pDraw->x;
-
-    switch (XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents,
-                             origin, &topPoint, &y, &maxy, shape)) {
-    case POLY_USE_MI:
-        miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn);
-    case POLY_FULLY_CLIPPED:
-        return;
-    }
-
-    xorg = (pDraw->x + pGC->patOrg.x);
-    yorg = (pDraw->y + pGC->patOrg.y);
-
-    switch (type) {
-    case DO_MONO_8x8:
-        patx = pPriv->pattern0;
-        paty = pPriv->pattern1;
-        if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) {
-            xorg = (-xorg) & 0x07;
-            yorg = (-yorg) & 0x07;
-            if (infoRec->Mono8x8PatternFillFlags &
-                HARDWARE_PATTERN_PROGRAMMED_BITS) {
-                if (!(infoRec->Mono8x8PatternFillFlags &
-                      HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-                    XAARotateMonoPattern(&patx, &paty, xorg, yorg,
-                                         (infoRec->Mono8x8PatternFillFlags &
-                                          BIT_ORDER_IN_BYTE_MSBFIRST));
-                    xorg = patx;
-                    yorg = paty;
-                }
-            }
-            else {
-                XAACacheInfoPtr pCache =
-                    (*infoRec->CacheMono8x8Pattern) (infoRec->pScrn, patx,
-                                                     paty);
-                patx = pCache->x;
-                paty = pCache->y;
-                if (!(infoRec->Mono8x8PatternFillFlags &
-                      HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-                    int slot = (yorg << 3) + xorg;
-
-                    patx += pCache->offsets[slot].x;
-                    paty += pCache->offsets[slot].y;
-                    xorg = patx;
-                    yorg = paty;
-                }
-            }
-            RectFunc = Mono8x8PatternRectHelper_ScreenOrigin;
-            if (infoRec->SubsequentMono8x8PatternFillTrap)
-                TrapFunc = Mono8x8PatternTrapHelper_ScreenOrigin;
-        }
-        else {                  /* !HARDWARE_PATTERN_SCREEN_ORIGIN */
-            if (!(infoRec->Mono8x8PatternFillFlags &
-                  HARDWARE_PATTERN_PROGRAMMED_BITS)) {
-                pCache =
-                    (*infoRec->CacheMono8x8Pattern) (infoRec->pScrn, patx,
-                                                     paty);
-                patx = pCache->x;
-                paty = pCache->y;
-            }
-            else {
-                pCache = &(infoRec->ScratchCacheInfoRec);
-                pCache->pat0 = patx;
-                pCache->pat1 = paty;
-            }
-            RectFunc = Mono8x8PatternRectHelper;
-        }
-
-        (*infoRec->SetupForMono8x8PatternFill) (infoRec->pScrn,
-                                                patx, paty, pPriv->fg,
-                                                pPriv->bg, pGC->alu,
-                                                pGC->planemask);
-        break;
-    case DO_CACHE_BLT:
-        pCache = (*infoRec->CacheTile) (infoRec->pScrn, pGC->tile.pixmap);
-        (*infoRec->SetupForScreenToScreenCopy) (infoRec->pScrn, 1, 1,
-                                                pGC->alu, pGC->planemask, -1);
-
-        RectFunc = CacheBltRectHelper;
-        break;
-    case DO_PIXMAP_COPY:
-        pCache = &(infoRec->ScratchCacheInfoRec);
-        pCache->x = pPriv->offscreenArea->box.x1;
-        pCache->y = pPriv->offscreenArea->box.y1;
-        pCache->w = pCache->orig_w = pPriv->offscreenArea->box.x2 - pCache->x;
-        pCache->h = pCache->orig_h = pPriv->offscreenArea->box.y2 - pCache->y;
-
-        (*infoRec->SetupForScreenToScreenCopy) (infoRec->pScrn, 1, 1,
-                                                pGC->alu, pGC->planemask, -1);
-
-        RectFunc = CacheBltRectHelper;
-        break;
-    default:
-        return;
-    }
-
-    XAAFillPolygonHelper(infoRec->pScrn, ptsIn, count, topPoint,
-                         y, maxy, origin, RectFunc, TrapFunc, xorg, yorg,
-                         pCache);
-
-    SET_SYNC_FLAG(infoRec);
-}
diff --git a/hw/xfree86/xaa/xaaFillRect.c b/hw/xfree86/xaa/xaaFillRect.c
deleted file mode 100644 (file)
index ec0fb9d..0000000
+++ /dev/null
@@ -1,1101 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-static void XAARenderSolidRects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderColor8x8Rects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderMono8x8Rects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderColorExpandRects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderCacheExpandRects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderCacheBltRects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderImageWriteRects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderPixmapCopyRects(GCPtr, int, BoxPtr, int, int);
-
-void
-XAAPolyFillRect(DrawablePtr pDraw, GCPtr pGC, int nrectFill,    /* number of rectangles to fill */
-                xRectangle *prectInit   /* Pointer to first rectangle to fill */
-    )
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int xorg = pDraw->x;
-    int yorg = pDraw->y;
-    int type = 0;
-    ClipAndRenderRectsFunc function;
-
-    if ((nrectFill <= 0) || !pGC->planemask)
-        return;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    switch (pGC->fillStyle) {
-    case FillSolid:
-        type = DO_SOLID;
-        break;
-    case FillStippled:
-        type = (*infoRec->StippledFillChooser) (pGC);
-        break;
-    case FillOpaqueStippled:
-        if ((pGC->fgPixel == pGC->bgPixel) && infoRec->FillSolidRects &&
-            CHECK_PLANEMASK(pGC, infoRec->FillSolidRectsFlags) &&
-            CHECK_ROP(pGC, infoRec->FillSolidRectsFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->FillSolidRectsFlags) &&
-            CHECK_FG(pGC, infoRec->FillSolidRectsFlags))
-            type = DO_SOLID;
-        else
-            type = (*infoRec->OpaqueStippledFillChooser) (pGC);
-        break;
-    case FillTiled:
-        type = (*infoRec->TiledFillChooser) (pGC);
-        break;
-    }
-
-    switch (type) {
-    case DO_SOLID:
-        function = XAARenderSolidRects;
-        break;
-    case DO_COLOR_8x8:
-        function = XAARenderColor8x8Rects;
-        break;
-    case DO_MONO_8x8:
-        function = XAARenderMono8x8Rects;
-        break;
-    case DO_CACHE_BLT:
-        function = XAARenderCacheBltRects;
-        break;
-    case DO_COLOR_EXPAND:
-        function = XAARenderColorExpandRects;
-        break;
-    case DO_CACHE_EXPAND:
-        function = XAARenderCacheExpandRects;
-        break;
-    case DO_IMAGE_WRITE:
-        function = XAARenderImageWriteRects;
-        break;
-    case DO_PIXMAP_COPY:
-        function = XAARenderPixmapCopyRects;
-        break;
-    default:
-        (*XAAFallbackOps.PolyFillRect) (pDraw, pGC, nrectFill, prectInit);
-        return;
-    }
-
-    if (xorg | yorg) {
-        int n = nrectFill;
-        xRectangle *prect = prectInit;
-
-        while (n--) {
-            prect->x += xorg;
-            prect->y += yorg;
-            prect++;
-        }
-    }
-
-    XAAClipAndRenderRects(pGC, function, nrectFill, prectInit, xorg, yorg);
-}
-
-        /*********************\
-       |     Solid Rects     |
-       \*********************/
-
-static void
-XAARenderSolidRects(GCPtr pGC,
-                    int nboxes, BoxPtr pClipBoxes, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    (*infoRec->FillSolidRects) (infoRec->pScrn,
-                                pGC->fgPixel, pGC->alu, pGC->planemask, nboxes,
-                                pClipBoxes);
-}
-
-        /************************\
-       |     Mono 8x8 Rects     |
-       \************************/
-
-static void
-XAARenderMono8x8Rects(GCPtr pGC,
-                      int nboxes, BoxPtr pClipBoxes, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAAPixmapPtr pPriv;
-    int fg, bg;
-
-    switch (pGC->fillStyle) {
-    case FillStippled:
-        pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
-        fg = pGC->fgPixel;
-        bg = -1;
-        break;
-    case FillOpaqueStippled:
-        pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
-        fg = pGC->fgPixel;
-        bg = pGC->bgPixel;
-        break;
-    case FillTiled:
-        pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-        fg = pPriv->fg;
-        bg = pPriv->bg;
-        break;
-    default:                   /* Muffle compiler */
-        pPriv = NULL;           /* Kaboom */
-        fg = -1;
-        bg = -1;
-        break;
-    }
-
-    (*infoRec->FillMono8x8PatternRects) (infoRec->pScrn,
-                                         fg, bg, pGC->alu, pGC->planemask,
-                                         nboxes, pClipBoxes, pPriv->pattern0,
-                                         pPriv->pattern1,
-                                         (xorg + pGC->patOrg.x),
-                                         (yorg + pGC->patOrg.y));
-}
-
-        /*************************\
-       |     Color 8x8 Rects     |
-       \*************************/
-
-static void
-XAARenderColor8x8Rects(GCPtr pGC,
-                       int nboxes, BoxPtr pClipBoxes, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAACacheInfoPtr pCache;
-    PixmapPtr pPix;
-    int fg, bg;
-
-    switch (pGC->fillStyle) {
-    case FillStippled:
-        pPix = pGC->stipple;
-        fg = pGC->fgPixel;
-        bg = -1;
-        break;
-    case FillOpaqueStippled:
-        pPix = pGC->stipple;
-        fg = pGC->fgPixel;
-        bg = pGC->bgPixel;
-        break;
-    case FillTiled:
-        pPix = pGC->tile.pixmap;
-        fg = -1;
-        bg = -1;
-        break;
-    default:                   /* Muffle compiler */
-        pPix = NULL;
-        fg = -1;
-        bg = -1;
-        break;
-    }
-
-    pCache = (*infoRec->CacheColor8x8Pattern) (infoRec->pScrn, pPix, fg, bg);
-    (*infoRec->FillColor8x8PatternRects) (infoRec->pScrn,
-                                          pGC->alu, pGC->planemask, nboxes,
-                                          pClipBoxes, (xorg + pGC->patOrg.x),
-                                          (yorg + pGC->patOrg.y), pCache);
-}
-
-        /****************************\
-       |     Color Expand Rects     |
-       \****************************/
-
-static void
-XAARenderColorExpandRects(GCPtr pGC,
-                          int nboxes, BoxPtr pClipBoxes, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int fg, bg;
-
-    switch (pGC->fillStyle) {
-    case FillStippled:
-        fg = pGC->fgPixel;
-        bg = -1;
-        break;
-    case FillOpaqueStippled:
-        fg = pGC->fgPixel;
-        bg = pGC->bgPixel;
-        break;
-    default:                   /* Muffle compiler */
-        fg = -1;
-        bg = -1;
-        break;
-    }
-
-    (*infoRec->FillColorExpandRects) (infoRec->pScrn, fg, bg,
-                                      pGC->alu, pGC->planemask, nboxes,
-                                      pClipBoxes, (xorg + pGC->patOrg.x),
-                                      (yorg + pGC->patOrg.y), pGC->stipple);
-}
-
-        /*************************\
-       |     Cache Blt Rects     |
-       \*************************/
-
-static void
-XAARenderCacheBltRects(GCPtr pGC,
-                       int nboxes, BoxPtr pClipBoxes, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAACacheInfoPtr pCache;
-
-    switch (pGC->fillStyle) {
-    case FillStippled:
-        pCache = (*infoRec->CacheStipple) (infoRec->pScrn, pGC->stipple,
-                                           pGC->fgPixel, -1);
-        break;
-    case FillOpaqueStippled:
-        pCache = (*infoRec->CacheStipple) (infoRec->pScrn, pGC->stipple,
-                                           pGC->fgPixel, pGC->bgPixel);
-        break;
-    case FillTiled:
-        pCache = (*infoRec->CacheTile) (infoRec->pScrn, pGC->tile.pixmap);
-        break;
-    default:                   /* Muffle compiler */
-        pCache = NULL;
-        break;
-    }
-
-    (*infoRec->FillCacheBltRects) (infoRec->pScrn, pGC->alu,
-                                   pGC->planemask, nboxes, pClipBoxes,
-                                   (xorg + pGC->patOrg.x),
-                                   (yorg + pGC->patOrg.y), pCache);
-}
-
-        /****************************\
-       |     Cache Expand Rects     |
-       \****************************/
-
-static void
-XAARenderCacheExpandRects(GCPtr pGC,
-                          int nboxes, BoxPtr pClipBoxes, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int fg, bg;
-
-    switch (pGC->fillStyle) {
-    case FillStippled:
-        fg = pGC->fgPixel;
-        bg = -1;
-        break;
-    case FillOpaqueStippled:
-        fg = pGC->fgPixel;
-        bg = pGC->bgPixel;
-        break;
-    default:                   /* Muffle compiler */
-        fg = -1;
-        bg = -1;
-        break;
-    }
-
-    (*infoRec->FillCacheExpandRects) (infoRec->pScrn, fg, bg,
-                                      pGC->alu, pGC->planemask, nboxes,
-                                      pClipBoxes, (xorg + pGC->patOrg.x),
-                                      (yorg + pGC->patOrg.y), pGC->stipple);
-}
-
-        /***************************\
-       |     Image Write Rects     |
-       \***************************/
-
-static void
-XAARenderImageWriteRects(GCPtr pGC,
-                         int nboxes, BoxPtr pClipBoxes, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    (*infoRec->FillImageWriteRects) (infoRec->pScrn, pGC->alu,
-                                     pGC->planemask, nboxes, pClipBoxes,
-                                     (xorg + pGC->patOrg.x),
-                                     (yorg + pGC->patOrg.y), pGC->tile.pixmap);
-}
-
-        /***************************\
-       |     Pixmap Copy Rects     |
-       \***************************/
-
-static void
-XAARenderPixmapCopyRects(GCPtr pGC,
-                         int nboxes, BoxPtr pClipBoxes, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec);
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-
-    pCache->x = pPriv->offscreenArea->box.x1;
-    pCache->y = pPriv->offscreenArea->box.y1;
-    pCache->w = pCache->orig_w = pPriv->offscreenArea->box.x2 - pCache->x;
-    pCache->h = pCache->orig_h = pPriv->offscreenArea->box.y2 - pCache->y;
-    pCache->trans_color = -1;
-
-    (*infoRec->FillCacheBltRects) (infoRec->pScrn, pGC->alu,
-                                   pGC->planemask, nboxes, pClipBoxes,
-                                   (xorg + pGC->patOrg.x),
-                                   (yorg + pGC->patOrg.y), pCache);
-}
-
-        /************\
-       |   Solid    |
-       \************/
-
-void
-XAAFillSolidRects(ScrnInfoPtr pScrn, int fg, int rop, unsigned int planemask, int nBox, /* number of rectangles to fill */
-                  BoxPtr pBox   /* Pointer to first rectangle to fill */
-    )
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    (*infoRec->SetupForSolidFill) (pScrn, fg, rop, planemask);
-    while (nBox--) {
-        (*infoRec->SubsequentSolidFillRect) (pScrn, pBox->x1, pBox->y1,
-                                             pBox->x2 - pBox->x1,
-                                             pBox->y2 - pBox->y1);
-        pBox++;
-    }
-    SET_SYNC_FLAG(infoRec);
-}
-
-        /*********************\
-       |  8x8 Mono Patterns  |
-       \*********************/
-
-void
-XAAFillMono8x8PatternRectsScreenOrigin(ScrnInfoPtr pScrn,
-                                       int fg, int bg, int rop,
-                                       unsigned int planemask,
-                                       int nBox,
-                                       BoxPtr pBox,
-                                       int pattern0, int pattern1,
-                                       int xorigin, int yorigin)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int patx = pattern0, paty = pattern1;
-    int xorg = (-xorigin) & 0x07;
-    int yorg = (-yorigin) & 0x07;
-
-    if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) {
-        if (!(infoRec->Mono8x8PatternFillFlags &
-              HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-            XAARotateMonoPattern(&patx, &paty, xorg, yorg,
-                                 (infoRec->Mono8x8PatternFillFlags &
-                                  BIT_ORDER_IN_BYTE_MSBFIRST));
-            xorg = patx;
-            yorg = paty;
-        }
-    }
-    else {
-        XAACacheInfoPtr pCache =
-            (*infoRec->CacheMono8x8Pattern) (pScrn, pattern0, pattern1);
-        patx = pCache->x;
-        paty = pCache->y;
-        if (!(infoRec->Mono8x8PatternFillFlags &
-              HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-            int slot = (yorg << 3) + xorg;
-
-            patx += pCache->offsets[slot].x;
-            paty += pCache->offsets[slot].y;
-            xorg = patx;
-            yorg = paty;
-        }
-    }
-
-    (*infoRec->SetupForMono8x8PatternFill) (pScrn, patx, paty,
-                                            fg, bg, rop, planemask);
-
-    while (nBox--) {
-        (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn,
-                                                      xorg, yorg, pBox->x1,
-                                                      pBox->y1,
-                                                      pBox->x2 - pBox->x1,
-                                                      pBox->y2 - pBox->y1);
-        pBox++;
-    }
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAFillMono8x8PatternRects(ScrnInfoPtr pScrn,
-                           int fg, int bg, int rop,
-                           unsigned int planemask,
-                           int nBox,
-                           BoxPtr pBox,
-                           int pattern0, int pattern1, int xorigin, int yorigin)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int patx = pattern0, paty = pattern1;
-    int xorg, yorg;
-    XAACacheInfoPtr pCache = NULL;
-
-    if (!(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS)) {
-        pCache = (*infoRec->CacheMono8x8Pattern) (pScrn, pattern0, pattern1);
-        patx = pCache->x;
-        paty = pCache->y;
-    }
-
-    (*infoRec->SetupForMono8x8PatternFill) (pScrn, patx, paty,
-                                            fg, bg, rop, planemask);
-
-    while (nBox--) {
-        xorg = (pBox->x1 - xorigin) & 0x07;
-        yorg = (pBox->y1 - yorigin) & 0x07;
-
-        if (!(infoRec->Mono8x8PatternFillFlags &
-              HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-            if (infoRec->Mono8x8PatternFillFlags &
-                HARDWARE_PATTERN_PROGRAMMED_BITS) {
-                patx = pattern0;
-                paty = pattern1;
-                XAARotateMonoPattern(&patx, &paty, xorg, yorg,
-                                     (infoRec->Mono8x8PatternFillFlags &
-                                      BIT_ORDER_IN_BYTE_MSBFIRST));
-                xorg = patx;
-                yorg = paty;
-            }
-            else {
-                int slot = (yorg << 3) + xorg;
-
-                xorg = patx + pCache->offsets[slot].x;
-                yorg = paty + pCache->offsets[slot].y;
-            }
-        }
-
-        (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn,
-                                                      xorg, yorg, pBox->x1,
-                                                      pBox->y1,
-                                                      pBox->x2 - pBox->x1,
-                                                      pBox->y2 - pBox->y1);
-        pBox++;
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-        /**********************\
-       |  8x8 Color Patterns  |
-       \**********************/
-
-void
-XAAFillColor8x8PatternRectsScreenOrigin(ScrnInfoPtr pScrn,
-                                        int rop,
-                                        unsigned int planemask,
-                                        int nBox,
-                                        BoxPtr pBox,
-                                        int xorigin, int yorigin,
-                                        XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int patx = pCache->x, paty = pCache->y;
-    int xorg = (-xorigin) & 0x07;
-    int yorg = (-yorigin) & 0x07;
-
-    if (!(infoRec->Color8x8PatternFillFlags &
-          HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-        int slot = (yorg << 3) + xorg;
-
-        paty += pCache->offsets[slot].y;
-        patx += pCache->offsets[slot].x;
-        xorg = patx;
-        yorg = paty;
-    }
-
-    (*infoRec->SetupForColor8x8PatternFill) (pScrn, patx, paty,
-                                             rop, planemask,
-                                             pCache->trans_color);
-
-    while (nBox--) {
-        (*infoRec->SubsequentColor8x8PatternFillRect) (pScrn,
-                                                       xorg, yorg, pBox->x1,
-                                                       pBox->y1,
-                                                       pBox->x2 - pBox->x1,
-                                                       pBox->y2 - pBox->y1);
-        pBox++;
-    }
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAFillColor8x8PatternRects(ScrnInfoPtr pScrn,
-                            int rop,
-                            unsigned int planemask,
-                            int nBox,
-                            BoxPtr pBox,
-                            int xorigin, int yorigin, XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int xorg, yorg;
-
-    (*infoRec->SetupForColor8x8PatternFill) (pScrn, pCache->x, pCache->y,
-                                             rop, planemask,
-                                             pCache->trans_color);
-
-    while (nBox--) {
-        xorg = (pBox->x1 - xorigin) & 0x07;
-        yorg = (pBox->y1 - yorigin) & 0x07;
-
-        if (!(infoRec->Color8x8PatternFillFlags &
-              HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-            int slot = (yorg << 3) + xorg;
-
-            yorg = pCache->y + pCache->offsets[slot].y;
-            xorg = pCache->x + pCache->offsets[slot].x;
-        }
-
-        (*infoRec->SubsequentColor8x8PatternFillRect) (pScrn,
-                                                       xorg, yorg, pBox->x1,
-                                                       pBox->y1,
-                                                       pBox->x2 - pBox->x1,
-                                                       pBox->y2 - pBox->y1);
-        pBox++;
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-        /***************\
-       |  Cache Blits  |
-       \***************/
-
-void
-XAAFillCacheBltRects(ScrnInfoPtr pScrn,
-                     int rop,
-                     unsigned int planemask,
-                     int nBox,
-                     BoxPtr pBox, int xorg, int yorg, XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int x, y, phaseY, phaseX, skipleft, height, width, w, blit_w, blit_h;
-
-    (*infoRec->SetupForScreenToScreenCopy) (pScrn, 1, 1, rop, planemask,
-                                            pCache->trans_color);
-
-    while (nBox--) {
-        y = pBox->y1;
-        phaseY = (y - yorg) % pCache->orig_h;
-        if (phaseY < 0)
-            phaseY += pCache->orig_h;
-        phaseX = (pBox->x1 - xorg) % pCache->orig_w;
-        if (phaseX < 0)
-            phaseX += pCache->orig_w;
-        height = pBox->y2 - y;
-        width = pBox->x2 - pBox->x1;
-
-#if 0
-        if (rop == GXcopy) {
-            while (1) {
-                w = width;
-                skipleft = phaseX;
-                x = pBox->x1;
-                blit_h = pCache->h - phaseY;
-                if (blit_h > height)
-                    blit_h = height;
-
-                while (1) {
-                    blit_w = pCache->w - skipleft;
-                    if (blit_w > w)
-                        blit_w = w;
-                    (*infoRec->SubsequentScreenToScreenCopy) (pScrn,
-                                                              pCache->x +
-                                                              skipleft,
-                                                              pCache->y +
-                                                              phaseY, x, y,
-                                                              blit_w, blit_h);
-                    w -= blit_w;
-                    if (!w)
-                        break;
-                    x += blit_w;
-                    skipleft = (skipleft + blit_w) % pCache->orig_w;
-                    if (blit_w >= pCache->orig_w)
-                        break;
-                }
-
-                /* Expand horizontally */
-                if (w) {
-                    skipleft -= phaseX;
-                    if (skipleft < 0)
-                        skipleft += pCache->orig_w;
-                    blit_w = x - pBox->x1 - skipleft;
-                    while (w) {
-                        if (blit_w > w)
-                            blit_w = w;
-                        (*infoRec->SubsequentScreenToScreenCopy) (pScrn,
-                                                                  pBox->x1 +
-                                                                  skipleft, y,
-                                                                  x, y, blit_w,
-                                                                  blit_h);
-                        w -= blit_w;
-                        x += blit_w;
-                        blit_w <<= 1;
-                    }
-                }
-
-                height -= blit_h;
-                if (!height)
-                    break;
-                y += blit_h;
-                phaseY = (phaseY + blit_h) % pCache->orig_h;
-                if (blit_h >= pCache->orig_h)
-                    break;
-            }
-
-            /* Expand vertically */
-            if (height) {
-                blit_w = pBox->x2 - pBox->x1;
-                phaseY -= (pBox->y1 - yorg) % pCache->orig_h;
-                if (phaseY < 0)
-                    phaseY += pCache->orig_h;
-                blit_h = y - pBox->y1 - phaseY;
-                while (height) {
-                    if (blit_h > height)
-                        blit_h = height;
-                    (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pBox->x1,
-                                                              pBox->y1 + phaseY,
-                                                              pBox->x1, y,
-                                                              blit_w, blit_h);
-                    height -= blit_h;
-                    y += blit_h;
-                    blit_h <<= 1;
-                }
-            }
-        }
-        else
-#endif
-        {
-            while (1) {
-                w = width;
-                skipleft = phaseX;
-                x = pBox->x1;
-                blit_h = pCache->h - phaseY;
-                if (blit_h > height)
-                    blit_h = height;
-
-                while (1) {
-                    blit_w = pCache->w - skipleft;
-                    if (blit_w > w)
-                        blit_w = w;
-                    (*infoRec->SubsequentScreenToScreenCopy) (pScrn,
-                                                              pCache->x +
-                                                              skipleft,
-                                                              pCache->y +
-                                                              phaseY, x, y,
-                                                              blit_w, blit_h);
-                    w -= blit_w;
-                    if (!w)
-                        break;
-                    x += blit_w;
-                    skipleft = (skipleft + blit_w) % pCache->orig_w;
-                }
-                height -= blit_h;
-                if (!height)
-                    break;
-                y += blit_h;
-                phaseY = (phaseY + blit_h) % pCache->orig_h;
-            }
-        }
-        pBox++;
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-        /*******************\
-       |  Cache Expansion  |
-       \*******************/
-
-void
-XAAFillCacheExpandRects(ScrnInfoPtr pScrn,
-                        int fg, int bg, int rop,
-                        unsigned int planemask,
-                        int nBox,
-                        BoxPtr pBox, int xorg, int yorg, PixmapPtr pPix)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int x, y, phaseY, phaseX, skipleft, height, width, w, blit_w, blit_h;
-    int cacheWidth;
-    XAACacheInfoPtr pCache;
-
-    pCache = (*infoRec->CacheMonoStipple) (pScrn, pPix);
-
-    cacheWidth = (pCache->w * pScrn->bitsPerPixel) /
-        infoRec->CacheColorExpandDensity;
-
-    (*infoRec->SetupForScreenToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                       planemask);
-
-    while (nBox--) {
-        y = pBox->y1;
-        phaseY = (y - yorg) % pCache->orig_h;
-        if (phaseY < 0)
-            phaseY += pCache->orig_h;
-        phaseX = (pBox->x1 - xorg) % pCache->orig_w;
-        if (phaseX < 0)
-            phaseX += pCache->orig_w;
-        height = pBox->y2 - y;
-        width = pBox->x2 - pBox->x1;
-
-        while (1) {
-            w = width;
-            skipleft = phaseX;
-            x = pBox->x1;
-            blit_h = pCache->h - phaseY;
-            if (blit_h > height)
-                blit_h = height;
-
-            while (1) {
-                blit_w = cacheWidth - skipleft;
-                if (blit_w > w)
-                    blit_w = w;
-                (*infoRec->SubsequentScreenToScreenColorExpandFill) (pScrn, x,
-                                                                     y, blit_w,
-                                                                     blit_h,
-                                                                     pCache->x,
-                                                                     pCache->y +
-                                                                     phaseY,
-                                                                     skipleft);
-                w -= blit_w;
-                if (!w)
-                    break;
-                x += blit_w;
-                skipleft = (skipleft + blit_w) % pCache->orig_w;
-            }
-            height -= blit_h;
-            if (!height)
-                break;
-            y += blit_h;
-            phaseY = (phaseY + blit_h) % pCache->orig_h;
-        }
-        pBox++;
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-        /******************\
-       |   Image Writes   |
-       \******************/
-
-/*  This requires all LEFT_EDGE clipping.  You get too many problems
-    with reading past the edge of the pattern otherwise */
-
-static void
-WriteColumn(ScrnInfoPtr pScrn,
-            unsigned char *pSrc,
-            int x, int y, int w, int h,
-            int xoff, int yoff, int pHeight, int srcwidth, int Bpp)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    unsigned char *src;
-    Bool PlusOne = FALSE;
-    int skipleft, dwords;
-
-    pSrc += (Bpp * xoff);
-
-    if ((skipleft = (long) pSrc & 0x03L)) {
-        if (Bpp == 3)
-            skipleft = 4 - skipleft;
-        else
-            skipleft /= Bpp;
-
-        x -= skipleft;
-        w += skipleft;
-
-        if (Bpp == 3)
-            pSrc -= 3 * skipleft;
-        else                    /* is this Alpha friendly ? */
-            pSrc = (unsigned char *) ((long) pSrc & ~0x03L);
-    }
-
-    src = pSrc + (yoff * srcwidth);
-
-    dwords = bytes_to_int32(w * Bpp);
-
-    if ((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) &&
-        ((dwords * h) & 0x01)) {
-        PlusOne = TRUE;
-    }
-
-    (*infoRec->SubsequentImageWriteRect) (pScrn, x, y, w, h, skipleft);
-
-    if (dwords > infoRec->ImageWriteRange) {
-        while (h--) {
-            XAAMoveDWORDS_FixedBase((CARD32 *) infoRec->ImageWriteBase,
-                                    (CARD32 *) src, dwords);
-            src += srcwidth;
-            yoff++;
-            if (yoff >= pHeight) {
-                yoff = 0;
-                src = pSrc;
-            }
-        }
-    }
-    else {
-        if (srcwidth == (dwords << 2)) {
-            int maxLines = infoRec->ImageWriteRange / dwords;
-            int step;
-
-            while (h) {
-                step = pHeight - yoff;
-                if (step > maxLines)
-                    step = maxLines;
-                if (step > h)
-                    step = h;
-
-                XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase,
-                              (CARD32 *) src, dwords * step);
-
-                src += (srcwidth * step);
-                yoff += step;
-                if (yoff >= pHeight) {
-                    yoff = 0;
-                    src = pSrc;
-                }
-                h -= step;
-            }
-        }
-        else {
-            while (h--) {
-                XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase,
-                              (CARD32 *) src, dwords);
-                src += srcwidth;
-                yoff++;
-                if (yoff >= pHeight) {
-                    yoff = 0;
-                    src = pSrc;
-                }
-            }
-        }
-    }
-
-    if (PlusOne) {
-        CARD32 *base = (CARD32 *) infoRec->ImageWriteBase;
-
-        *base = 0x00000000;
-    }
-}
-
-void
-XAAFillImageWriteRects(ScrnInfoPtr pScrn,
-                       int rop,
-                       unsigned int planemask,
-                       int nBox,
-                       BoxPtr pBox, int xorg, int yorg, PixmapPtr pPix)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int x, phaseY, phaseX, height, width, blit_w;
-    int pHeight = pPix->drawable.height;
-    int pWidth = pPix->drawable.width;
-    int Bpp = pPix->drawable.bitsPerPixel >> 3;
-    int srcwidth = pPix->devKind;
-
-    (*infoRec->SetupForImageWrite) (pScrn, rop, planemask, -1,
-                                    pPix->drawable.bitsPerPixel,
-                                    pPix->drawable.depth);
-
-    while (nBox--) {
-        x = pBox->x1;
-        phaseY = (pBox->y1 - yorg) % pHeight;
-        if (phaseY < 0)
-            phaseY += pHeight;
-        phaseX = (x - xorg) % pWidth;
-        if (phaseX < 0)
-            phaseX += pWidth;
-        height = pBox->y2 - pBox->y1;
-        width = pBox->x2 - x;
-
-        while (1) {
-            blit_w = pWidth - phaseX;
-            if (blit_w > width)
-                blit_w = width;
-
-            WriteColumn(pScrn, pPix->devPrivate.ptr, x, pBox->y1,
-                        blit_w, height, phaseX, phaseY, pHeight, srcwidth, Bpp);
-
-            width -= blit_w;
-            if (!width)
-                break;
-            x += blit_w;
-            phaseX = (phaseX + blit_w) % pWidth;
-        }
-        pBox++;
-    }
-
-    if (infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE)
-        (*infoRec->Sync) (pScrn);
-    else
-        SET_SYNC_FLAG(infoRec);
-}
-
-        /*************\
-       |  Utilities  |
-       \*************/
-
-void
-XAAClipAndRenderRects(GCPtr pGC,
-                      ClipAndRenderRectsFunc BoxFunc,
-                      int nrectFill, xRectangle *prect, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int Right, Bottom, MaxBoxes;
-    BoxPtr pextent, pboxClipped, pboxClippedBase;
-
-    MaxBoxes = infoRec->PreAllocSize / sizeof(BoxRec);
-    pboxClippedBase = (BoxPtr) infoRec->PreAllocMem;
-    pboxClipped = pboxClippedBase;
-
-    if (RegionNumRects(pGC->pCompositeClip) == 1) {
-        pextent = RegionRects(pGC->pCompositeClip);
-        while (nrectFill--) {
-            pboxClipped->x1 = max(pextent->x1, prect->x);
-            pboxClipped->y1 = max(pextent->y1, prect->y);
-
-            Right = (int) prect->x + (int) prect->width;
-            pboxClipped->x2 = min(pextent->x2, Right);
-
-            Bottom = (int) prect->y + (int) prect->height;
-            pboxClipped->y2 = min(pextent->y2, Bottom);
-
-            prect++;
-            if ((pboxClipped->x1 < pboxClipped->x2) &&
-                (pboxClipped->y1 < pboxClipped->y2)) {
-                pboxClipped++;
-                if (pboxClipped >= (pboxClippedBase + MaxBoxes)) {
-                    (*BoxFunc) (pGC, MaxBoxes, pboxClippedBase, xorg, yorg);
-                    pboxClipped = pboxClippedBase;
-                }
-            }
-        }
-    }
-    else {
-        pextent = RegionExtents(pGC->pCompositeClip);
-        while (nrectFill--) {
-            int n;
-            BoxRec box, *pbox;
-
-            box.x1 = max(pextent->x1, prect->x);
-            box.y1 = max(pextent->y1, prect->y);
-
-            Right = (int) prect->x + (int) prect->width;
-            box.x2 = min(pextent->x2, Right);
-
-            Bottom = (int) prect->y + (int) prect->height;
-            box.y2 = min(pextent->y2, Bottom);
-
-            prect++;
-
-            if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
-                continue;
-
-            n = RegionNumRects(pGC->pCompositeClip);
-            pbox = RegionRects(pGC->pCompositeClip);
-
-            /* clip the rectangle to each box in the clip region
-               this is logically equivalent to calling Intersect()
-             */
-            while (n--) {
-                pboxClipped->x1 = max(box.x1, pbox->x1);
-                pboxClipped->y1 = max(box.y1, pbox->y1);
-                pboxClipped->x2 = min(box.x2, pbox->x2);
-                pboxClipped->y2 = min(box.y2, pbox->y2);
-                pbox++;
-
-                /* see if clipping left anything */
-                if (pboxClipped->x1 < pboxClipped->x2 &&
-                    pboxClipped->y1 < pboxClipped->y2) {
-                    pboxClipped++;
-                    if (pboxClipped >= (pboxClippedBase + MaxBoxes)) {
-                        (*BoxFunc) (pGC, MaxBoxes, pboxClippedBase, xorg, yorg);
-                        pboxClipped = pboxClippedBase;
-                    }
-                }
-            }
-        }
-    }
-
-    if (pboxClipped != pboxClippedBase)
-        (*BoxFunc) (pGC, pboxClipped - pboxClippedBase, pboxClippedBase,
-                    xorg, yorg);
-}
-
-int
-XAAGetRectClipBoxes(GCPtr pGC,
-                    BoxPtr pboxClippedBase,
-                    int nrectFill, xRectangle *prectInit)
-{
-    int Right, Bottom;
-    BoxPtr pextent, pboxClipped = pboxClippedBase;
-    xRectangle *prect = prectInit;
-    RegionPtr prgnClip = pGC->pCompositeClip;
-
-    if (RegionNumRects(prgnClip) == 1) {
-        pextent = RegionRects(prgnClip);
-        while (nrectFill--) {
-            pboxClipped->x1 = max(pextent->x1, prect->x);
-            pboxClipped->y1 = max(pextent->y1, prect->y);
-
-            Right = (int) prect->x + (int) prect->width;
-            pboxClipped->x2 = min(pextent->x2, Right);
-
-            Bottom = (int) prect->y + (int) prect->height;
-            pboxClipped->y2 = min(pextent->y2, Bottom);
-
-            prect++;
-            if ((pboxClipped->x1 < pboxClipped->x2) &&
-                (pboxClipped->y1 < pboxClipped->y2)) {
-                pboxClipped++;
-            }
-        }
-    }
-    else {
-        pextent = RegionExtents(prgnClip);
-        while (nrectFill--) {
-            int n;
-            BoxRec box, *pbox;
-
-            box.x1 = max(pextent->x1, prect->x);
-            box.y1 = max(pextent->y1, prect->y);
-
-            Right = (int) prect->x + (int) prect->width;
-            box.x2 = min(pextent->x2, Right);
-
-            Bottom = (int) prect->y + (int) prect->height;
-            box.y2 = min(pextent->y2, Bottom);
-
-            prect++;
-
-            if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
-                continue;
-
-            n = RegionNumRects(prgnClip);
-            pbox = RegionRects(prgnClip);
-
-            /* clip the rectangle to each box in the clip region
-               this is logically equivalent to calling Intersect()
-             */
-            while (n--) {
-                pboxClipped->x1 = max(box.x1, pbox->x1);
-                pboxClipped->y1 = max(box.y1, pbox->y1);
-                pboxClipped->x2 = min(box.x2, pbox->x2);
-                pboxClipped->y2 = min(box.y2, pbox->y2);
-                pbox++;
-
-                /* see if clipping left anything */
-                if (pboxClipped->x1 < pboxClipped->x2 &&
-                    pboxClipped->y1 < pboxClipped->y2) {
-                    pboxClipped++;
-                }
-            }
-        }
-    }
-
-    return pboxClipped - pboxClippedBase;
-}
diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c
deleted file mode 100644 (file)
index d55f1e4..0000000
+++ /dev/null
@@ -1,564 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <string.h>
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "migc.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "xaawrap.h"
-
-static void XAAValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-static void XAAChangeGC(GCPtr pGC, unsigned long mask);
-static void XAACopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void XAADestroyGC(GCPtr pGC);
-static void XAAChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
-static void XAADestroyClip(GCPtr pGC);
-static void XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-
-GCFuncs XAAGCFuncs = {
-    XAAValidateGC, XAAChangeGC, XAACopyGC, XAADestroyGC,
-    XAAChangeClip, XAADestroyClip, XAACopyClip
-};
-
-extern GCOps XAAPixmapOps;
-
-Bool
-XAACreateGC(GCPtr pGC)
-{
-    ScreenPtr pScreen = pGC->pScreen;
-    XAAGCPtr pGCPriv = (XAAGCPtr) dixLookupPrivate(&pGC->devPrivates,
-                                                   XAAGetGCKey());
-    Bool ret;
-
-    XAA_SCREEN_PROLOGUE(pScreen, CreateGC);
-
-    if ((ret = (*pScreen->CreateGC) (pGC))) {
-        pGCPriv->wrapOps = NULL;
-        pGCPriv->wrapFuncs = pGC->funcs;
-        pGCPriv->XAAOps = &XAAFallbackOps;
-        pGC->funcs = &XAAGCFuncs;
-    }
-
-    XAA_SCREEN_EPILOGUE(pScreen, CreateGC, XAACreateGC);
-
-    return ret;
-}
-
-static void
-XAAValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    XAA_GC_FUNC_PROLOGUE(pGC);
-
-    (*pGC->funcs->ValidateGC) (pGC, changes, pDraw);
-
-    if ((changes & GCPlaneMask) &&
-        ((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) ==
-         infoRec->FullPlanemasks[pGC->depth - 1])) {
-        pGC->planemask = ~0;
-    }
-
-    if (pGC->depth != 32) {
-        /* 0xffffffff is reserved for transparency */
-        if (pGC->bgPixel == 0xffffffff)
-            pGC->bgPixel = 0x7fffffff;
-        if (pGC->fgPixel == 0xffffffff)
-            pGC->fgPixel = 0x7fffffff;
-    }
-
-    if ((pDraw->type == DRAWABLE_PIXMAP) && !IS_OFFSCREEN_PIXMAP(pDraw)) {
-        pGCPriv->flags = OPS_ARE_PIXMAP;
-        pGCPriv->changes |= changes;
-
-        /* make sure we're not using videomemory pixmaps to render
-           onto system memory drawables */
-
-        if ((pGC->fillStyle == FillTiled) &&
-            IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) &&
-            !OFFSCREEN_PIXMAP_LOCKED(pGC->tile.pixmap)) {
-
-            XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-            FBAreaPtr area = pPriv->offscreenArea;
-
-            XAARemoveAreaCallback(area);        /* clobbers pPriv->offscreenArea */
-            xf86FreeOffscreenArea(area);
-        }
-    }
-    else if (!infoRec->pScrn->vtSema && (pDraw->type == DRAWABLE_WINDOW)) {
-        pGCPriv->flags = 0;
-        pGCPriv->changes |= changes;
-    }
-    else {
-        if (!(pGCPriv->flags & OPS_ARE_ACCEL)) {
-            changes |= pGCPriv->changes;
-            pGCPriv->changes = 0;
-        }
-        pGCPriv->flags = OPS_ARE_ACCEL;
-
-#if 1
-        /* Ugh.  If we can't use the blitter on offscreen pixmaps used
-           as tiles, then we need to move them out as cfb can't handle
-           tiles with non-zero origins */
-
-        if ((pGC->fillStyle == FillTiled) &&
-            IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) &&
-            (DO_PIXMAP_COPY != (*infoRec->TiledFillChooser) (pGC))) {
-
-            XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-            FBAreaPtr area = pPriv->offscreenArea;
-
-            XAARemoveAreaCallback(area);        /* clobbers pPriv->offscreenArea */
-            xf86FreeOffscreenArea(area);
-        }
-#endif
-    }
-
-    XAA_GC_FUNC_EPILOGUE(pGC);
-
-    if (!(pGCPriv->flags & OPS_ARE_ACCEL))
-        return;
-
-    if ((changes & GCTile) && !pGC->tileIsPixel && pGC->tile.pixmap) {
-        XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-
-        if (pixPriv->flags & DIRTY) {
-            pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
-            pGC->tile.pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-        }
-    }
-    if ((changes & GCStipple) && pGC->stipple) {
-        XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
-
-        if (pixPriv->flags & DIRTY) {
-            pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
-            pGC->stipple->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-        }
-    }
-
-    /* If our Ops are still the default ones we need to allocate new ones */
-    if (pGC->ops == &XAAFallbackOps) {
-        if (!(pGCPriv->XAAOps = malloc(sizeof(GCOps)))) {
-            pGCPriv->XAAOps = &XAAFallbackOps;
-            return;
-        }
-        /* make a modifiable copy of the default ops */
-        memcpy(pGCPriv->XAAOps, &XAAFallbackOps, sizeof(GCOps));
-        pGC->ops = pGCPriv->XAAOps;
-        changes = ~0;
-    }
-
-    if (!changes)
-        return;
-
-    if ((changes & GCDashList) && infoRec->ComputeDash)
-        infoRec->ComputeDash(pGC);
-
-    if (changes & infoRec->FillSpansMask)
-        (*infoRec->ValidateFillSpans) (pGC, changes, pDraw);
-
-    if (changes & infoRec->SetSpansMask)
-        (*infoRec->ValidateSetSpans) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PutImageMask)
-        (*infoRec->ValidatePutImage) (pGC, changes, pDraw);
-
-    if (changes & infoRec->CopyAreaMask)
-        (*infoRec->ValidateCopyArea) (pGC, changes, pDraw);
-
-    if (changes & infoRec->CopyPlaneMask)
-        (*infoRec->ValidateCopyPlane) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PolyPointMask)
-        (*infoRec->ValidatePolyPoint) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PolylinesMask)
-        (*infoRec->ValidatePolylines) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PolySegmentMask)
-        (*infoRec->ValidatePolySegment) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PolyRectangleMask)
-        (*infoRec->ValidatePolyRectangle) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PolyArcMask)
-        (*infoRec->ValidatePolyArc) (pGC, changes, pDraw);
-
-    if (changes & infoRec->FillPolygonMask)
-        (*infoRec->ValidateFillPolygon) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PolyFillRectMask)
-        (*infoRec->ValidatePolyFillRect) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PolyFillArcMask)
-        (*infoRec->ValidatePolyFillArc) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PolyGlyphBltMask)
-        (*infoRec->ValidatePolyGlyphBlt) (pGC, changes, pDraw);
-
-    if (changes & infoRec->ImageGlyphBltMask)
-        (*infoRec->ValidateImageGlyphBlt) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PolyText8Mask)
-        (*infoRec->ValidatePolyText8) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PolyText16Mask)
-        (*infoRec->ValidatePolyText16) (pGC, changes, pDraw);
-
-    if (changes & infoRec->ImageText8Mask)
-        (*infoRec->ValidateImageText8) (pGC, changes, pDraw);
-
-    if (changes & infoRec->ImageText16Mask)
-        (*infoRec->ValidateImageText16) (pGC, changes, pDraw);
-
-    if (changes & infoRec->PushPixelsMask)
-        (*infoRec->ValidatePushPixels) (pGC, changes, pDraw);
-}
-
-static void
-XAADestroyGC(GCPtr pGC)
-{
-    XAA_GC_FUNC_PROLOGUE(pGC);
-
-    if (pGCPriv->XAAOps != &XAAFallbackOps)
-        free(pGCPriv->XAAOps);
-
-    free(pGCPriv->DashPattern);
-    pGCPriv->flags = 0;
-
-    (*pGC->funcs->DestroyGC) (pGC);
-    XAA_GC_FUNC_EPILOGUE(pGC);
-}
-
-static void
-XAAChangeGC(GCPtr pGC, unsigned long mask)
-{
-    XAA_GC_FUNC_PROLOGUE(pGC);
-    (*pGC->funcs->ChangeGC) (pGC, mask);
-    XAA_GC_FUNC_EPILOGUE(pGC);
-
-    /* we have to assume that shared memory pixmaps are dirty 
-       because we can't wrap all operations on them */
-
-    if ((mask & GCTile) && !pGC->tileIsPixel &&
-        PIXMAP_IS_SHARED(pGC->tile.pixmap)) {
-        XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-
-        pPixPriv->flags |= DIRTY;
-    }
-
-    if ((mask & GCStipple) && PIXMAP_IS_SHARED(pGC->stipple)) {
-        XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
-
-        pPixPriv->flags |= DIRTY;
-    }
-}
-
-static void
-XAACopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
-{
-    XAA_GC_FUNC_PROLOGUE(pGCDst);
-    (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
-    XAA_GC_FUNC_EPILOGUE(pGCDst);
-}
-
-static void
-XAAChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
-{
-    XAA_GC_FUNC_PROLOGUE(pGC);
-    (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
-    XAA_GC_FUNC_EPILOGUE(pGC);
-}
-
-static void
-XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
-    XAA_GC_FUNC_PROLOGUE(pgcDst);
-    (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc);
-    XAA_GC_FUNC_EPILOGUE(pgcDst);
-}
-
-static void
-XAADestroyClip(GCPtr pGC)
-{
-    XAA_GC_FUNC_PROLOGUE(pGC);
-    (*pGC->funcs->DestroyClip) (pGC);
-    XAA_GC_FUNC_EPILOGUE(pGC);
-}
-
-/**** Pixmap Wrappers ****/
-
-static void
-XAAFillSpansPixmap(DrawablePtr pDraw,
-                   GC * pGC,
-                   int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->FillSpans) (pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAASetSpansPixmap(DrawablePtr pDraw,
-                  GCPtr pGC,
-                  char *pcharsrc,
-                  register DDXPointPtr ppt,
-                  int *pwidth, int nspans, int fSorted)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->SetSpans) (pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPutImagePixmap(DrawablePtr pDraw,
-                  GCPtr pGC,
-                  int depth,
-                  int x, int y, int w, int h,
-                  int leftPad, int format, char *pImage)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->PutImage) (pDraw, pGC, depth, x, y, w, h,
-                           leftPad, format, pImage);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static RegionPtr
-XAACopyAreaPixmap(DrawablePtr pSrc,
-                  DrawablePtr pDst,
-                  GC * pGC,
-                  int srcx, int srcy, int width, int height, int dstx, int dsty)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    RegionPtr ret;
-
-    if (infoRec->pScrn->vtSema &&
-        ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc))) {
-        if (infoRec->ReadPixmap && (pGC->alu == GXcopy) &&
-            (pSrc->bitsPerPixel == pDst->bitsPerPixel) &&
-            ((pGC->planemask & infoRec->FullPlanemasks[pSrc->depth - 1])
-             == infoRec->FullPlanemasks[pSrc->depth - 1])) {
-            XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr) (pDst));
-
-            pixPriv->flags |= DIRTY;
-
-            return (XAABitBlt(pSrc, pDst, pGC,
-                              srcx, srcy, width, height, dstx, dsty,
-                              XAADoImageRead, 0L));
-        }
-        else if (infoRec->NeedToSync) {
-            (*infoRec->Sync) (infoRec->pScrn);
-            infoRec->NeedToSync = FALSE;
-        }
-    }
-
-    {
-        XAA_PIXMAP_OP_PROLOGUE(pGC, pDst);
-        ret = (*pGC->ops->CopyArea) (pSrc, pDst,
-                                     pGC, srcx, srcy, width, height, dstx,
-                                     dsty);
-        XAA_PIXMAP_OP_EPILOGUE(pGC);
-    }
-    return ret;
-}
-
-static RegionPtr
-XAACopyPlanePixmap(DrawablePtr pSrc,
-                   DrawablePtr pDst,
-                   GCPtr pGC,
-                   int srcx, int srcy,
-                   int width, int height,
-                   int dstx, int dsty, unsigned long bitPlane)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    RegionPtr ret;
-
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDst);
-
-    if (infoRec->pScrn->vtSema &&
-        ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc))) {
-        if (infoRec->NeedToSync) {
-            (*infoRec->Sync) (infoRec->pScrn);
-            infoRec->NeedToSync = FALSE;
-        }
-    }
-
-    ret = (*pGC->ops->CopyPlane) (pSrc, pDst,
-                                  pGC, srcx, srcy, width, height, dstx, dsty,
-                                  bitPlane);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-    return ret;
-}
-
-static void
-XAAPolyPointPixmap(DrawablePtr pDraw,
-                   GCPtr pGC, int mode, int npt, xPoint * pptInit)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->PolyPoint) (pDraw, pGC, mode, npt, pptInit);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolylinesPixmap(DrawablePtr pDraw,
-                   GCPtr pGC, int mode, int npt, DDXPointPtr pptInit)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->Polylines) (pDraw, pGC, mode, npt, pptInit);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolySegmentPixmap(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment * pSeg)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->PolySegment) (pDraw, pGC, nseg, pSeg);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyRectanglePixmap(DrawablePtr pDraw,
-                       GCPtr pGC, int nRectsInit, xRectangle *pRectsInit)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->PolyRectangle) (pDraw, pGC, nRectsInit, pRectsInit);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyArcPixmap(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->PolyArc) (pDraw, pGC, narcs, parcs);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAFillPolygonPixmap(DrawablePtr pDraw,
-                     GCPtr pGC,
-                     int shape, int mode, int count, DDXPointPtr ptsIn)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyFillRectPixmap(DrawablePtr pDraw,
-                      GCPtr pGC, int nrectFill, xRectangle *prectInit)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->PolyFillRect) (pDraw, pGC, nrectFill, prectInit);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyFillArcPixmap(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, parcs);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static int
-XAAPolyText8Pixmap(DrawablePtr pDraw,
-                   GCPtr pGC, int x, int y, int count, char *chars)
-{
-    int ret;
-
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    ret = (*pGC->ops->PolyText8) (pDraw, pGC, x, y, count, chars);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-    return ret;
-}
-
-static int
-XAAPolyText16Pixmap(DrawablePtr pDraw,
-                    GCPtr pGC, int x, int y, int count, unsigned short *chars)
-{
-    int ret;
-
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    ret = (*pGC->ops->PolyText16) (pDraw, pGC, x, y, count, chars);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-    return ret;
-}
-
-static void
-XAAImageText8Pixmap(DrawablePtr pDraw,
-                    GCPtr pGC, int x, int y, int count, char *chars)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->ImageText8) (pDraw, pGC, x, y, count, chars);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAImageText16Pixmap(DrawablePtr pDraw,
-                     GCPtr pGC, int x, int y, int count, unsigned short *chars)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->ImageText16) (pDraw, pGC, x, y, count, chars);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAImageGlyphBltPixmap(DrawablePtr pDraw,
-                       GCPtr pGC,
-                       int xInit, int yInit,
-                       unsigned int nglyph,
-                       CharInfoPtr * ppci, pointer pglyphBase)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->ImageGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph,
-                                ppci, pglyphBase);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyGlyphBltPixmap(DrawablePtr pDraw,
-                      GCPtr pGC,
-                      int xInit, int yInit,
-                      unsigned int nglyph,
-                      CharInfoPtr * ppci, pointer pglyphBase)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->PolyGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph,
-                               ppci, pglyphBase);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPushPixelsPixmap(GCPtr pGC,
-                    PixmapPtr pBitMap,
-                    DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg)
-{
-    XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
-    (*pGC->ops->PushPixels) (pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
-    XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-GCOps XAAPixmapOps = {
-    XAAFillSpansPixmap, XAASetSpansPixmap,
-    XAAPutImagePixmap, XAACopyAreaPixmap,
-    XAACopyPlanePixmap, XAAPolyPointPixmap,
-    XAAPolylinesPixmap, XAAPolySegmentPixmap,
-    XAAPolyRectanglePixmap, XAAPolyArcPixmap,
-    XAAFillPolygonPixmap, XAAPolyFillRectPixmap,
-    XAAPolyFillArcPixmap, XAAPolyText8Pixmap,
-    XAAPolyText16Pixmap, XAAImageText8Pixmap,
-    XAAImageText16Pixmap, XAAImageGlyphBltPixmap,
-    XAAPolyGlyphBltPixmap, XAAPushPixelsPixmap,
-};
diff --git a/hw/xfree86/xaa/xaaGCmisc.c b/hw/xfree86/xaa/xaaGCmisc.c
deleted file mode 100644 (file)
index ca69aae..0000000
+++ /dev/null
@@ -1,412 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include <X11/fonts/fontstruct.h>
-#include "dixfontstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "migc.h"
-#include "mi.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-
-void
-XAAValidateCopyArea(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    if (infoRec->CopyArea &&
-        CHECK_PLANEMASK(pGC, infoRec->CopyAreaFlags) &&
-        CHECK_ROP(pGC, infoRec->CopyAreaFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->CopyAreaFlags)
-        )
-        pGC->ops->CopyArea = infoRec->CopyArea;
-    else
-        pGC->ops->CopyArea = XAAFallbackOps.CopyArea;
-}
-
-void
-XAAValidatePutImage(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    if (infoRec->PutImage &&
-        CHECK_PLANEMASK(pGC, infoRec->PutImageFlags) &&
-        CHECK_ROP(pGC, infoRec->PutImageFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->PutImageFlags) &&
-        CHECK_COLORS(pGC, infoRec->PutImageFlags)
-        )
-        pGC->ops->PutImage = infoRec->PutImage;
-    else
-        pGC->ops->PutImage = XAAFallbackOps.PutImage;
-}
-
-void
-XAAValidateCopyPlane(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    if (infoRec->CopyPlane &&
-        CHECK_PLANEMASK(pGC, infoRec->CopyPlaneFlags) &&
-        CHECK_ROP(pGC, infoRec->CopyPlaneFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->CopyPlaneFlags) &&
-        CHECK_COLORS(pGC, infoRec->CopyPlaneFlags)
-        )
-        pGC->ops->CopyPlane = infoRec->CopyPlane;
-    else
-        pGC->ops->CopyPlane = XAAFallbackOps.CopyPlane;
-}
-
-void
-XAAValidatePushPixels(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    if (infoRec->PushPixelsSolid &&
-        (pGC->fillStyle == FillSolid) &&
-        CHECK_PLANEMASK(pGC, infoRec->PushPixelsFlags) &&
-        CHECK_ROP(pGC, infoRec->PushPixelsFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->PushPixelsFlags) &&
-        CHECK_FG(pGC, infoRec->PushPixelsFlags) &&
-        (!(infoRec->PushPixelsFlags & TRANSPARENCY_GXCOPY_ONLY) ||
-         (pGC->alu == GXcopy))
-        )
-        pGC->ops->PushPixels = infoRec->PushPixelsSolid;
-    else
-        pGC->ops->PushPixels = XAAFallbackOps.PushPixels;
-
-}
-
-/* We make the assumption that the FillSpans, PolyFillRect, FillPolygon
-   and PolyFillArc functions are linked in a way that they all have 
-   the same rop/color/planemask restrictions. If the driver provides 
-   a GC level replacement for these, it will need to supply a new 
-   Validate functions if it breaks this assumption */
-
-void
-XAAValidateFillSpans(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    if (pGC->fillStyle != FillTiled)
-        changes &= ~GCTile;
-    if ((pGC->fillStyle == FillTiled) || (pGC->fillStyle == FillSolid))
-        changes &= ~GCStipple;
-    if (!changes)
-        return;
-
-    pGC->ops->FillSpans = XAAFallbackOps.FillSpans;
-    pGC->ops->PolyFillRect = XAAFallbackOps.PolyFillRect;
-    pGC->ops->FillPolygon = XAAFallbackOps.FillPolygon;
-    pGC->ops->PolyFillArc = XAAFallbackOps.PolyFillArc;
-
-    switch (pGC->fillStyle) {
-    case FillSolid:
-        if (infoRec->FillSpansSolid &&
-            CHECK_PLANEMASK(pGC, infoRec->FillSpansSolidFlags) &&
-            CHECK_ROP(pGC, infoRec->FillSpansSolidFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->FillSpansSolidFlags) &&
-            CHECK_FG(pGC, infoRec->FillSpansSolidFlags)
-            ) {
-            pGC->ops->FillSpans = infoRec->FillSpansSolid;
-            pGC->ops->PolyFillRect = infoRec->PolyFillRectSolid;
-            pGC->ops->FillPolygon = infoRec->FillPolygonSolid;
-            pGC->ops->PolyFillArc = infoRec->PolyFillArcSolid;
-        }
-        break;
-        /* The [Stippled/OpaqueStippled/Tiled]FillChooser 
-           functions do the validating */
-    case FillStippled:
-        if (infoRec->FillSpansStippled) {
-            pGC->ops->FillSpans = infoRec->FillSpansStippled;
-            pGC->ops->PolyFillRect = infoRec->PolyFillRectStippled;
-            if (infoRec->FillPolygonStippled)
-                pGC->ops->FillPolygon = infoRec->FillPolygonStippled;
-            else
-                pGC->ops->FillPolygon = miFillPolygon;
-            pGC->ops->PolyFillArc = miPolyFillArc;
-        }
-        break;
-    case FillOpaqueStippled:
-        if (infoRec->FillSpansOpaqueStippled) {
-            pGC->ops->FillSpans = infoRec->FillSpansOpaqueStippled;
-            pGC->ops->PolyFillRect = infoRec->PolyFillRectOpaqueStippled;
-            if (infoRec->FillPolygonOpaqueStippled)
-                pGC->ops->FillPolygon = infoRec->FillPolygonOpaqueStippled;
-            else
-                pGC->ops->FillPolygon = miFillPolygon;
-            pGC->ops->PolyFillArc = miPolyFillArc;
-        }
-        break;
-    case FillTiled:
-        if (infoRec->FillSpansTiled) {
-            pGC->ops->FillSpans = infoRec->FillSpansTiled;
-            pGC->ops->PolyFillRect = infoRec->PolyFillRectTiled;
-            if (infoRec->FillPolygonTiled)
-                pGC->ops->FillPolygon = infoRec->FillPolygonTiled;
-            else
-                pGC->ops->FillPolygon = miFillPolygon;
-            pGC->ops->PolyFillArc = miPolyFillArc;
-        }
-        break;
-    default:
-        return;
-    }
-}
-
-/* We make the assumption that these Text8/16 and GlyphBlt functions
-   are linked in a way that they all have the same rop/color/planemask
-   restrictions. If the driver provides a GC level replacement for
-   these, it will need to supply a new Validate functions if it breaks
-   this assumption */
-
-void
-XAAValidatePolyGlyphBlt(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    Bool BigFont = FALSE;
-
-    pGC->ops->PolyText8 = XAAFallbackOps.PolyText8;
-    pGC->ops->PolyText16 = XAAFallbackOps.PolyText16;
-    pGC->ops->PolyGlyphBlt = XAAFallbackOps.PolyGlyphBlt;
-
-    if (!pGC->font)
-        return;
-    if (pGC->fillStyle != FillSolid)
-        return;
-
-    if ((FONTMAXBOUNDS(pGC->font, rightSideBearing) -
-         FONTMINBOUNDS(pGC->font, leftSideBearing) > 32))
-        BigFont = TRUE;
-
-    /* no funny business */
-    if ((FONTMINBOUNDS(pGC->font, characterWidth) <= 0) ||
-        ((FONTASCENT(pGC->font) + FONTDESCENT(pGC->font)) <= 0))
-        return;
-
-    /* Check for TE Fonts */
-    if (!TERMINALFONT(pGC->font) || BigFont) {
-        if (infoRec->PolyGlyphBltNonTE &&
-            CHECK_PLANEMASK(pGC, infoRec->PolyGlyphBltNonTEFlags) &&
-            CHECK_ROP(pGC, infoRec->PolyGlyphBltNonTEFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->PolyGlyphBltNonTEFlags) &&
-            CHECK_FG(pGC, infoRec->PolyGlyphBltNonTEFlags) &&
-            (!(infoRec->PolyGlyphBltNonTEFlags & TRANSPARENCY_GXCOPY_ONLY) ||
-             (pGC->alu == GXcopy))
-            ) {
-            pGC->ops->PolyText8 = infoRec->PolyText8NonTE;
-            pGC->ops->PolyText16 = infoRec->PolyText16NonTE;
-            pGC->ops->PolyGlyphBlt = infoRec->PolyGlyphBltNonTE;
-        }
-    }
-    else {
-        if (infoRec->PolyGlyphBltTE &&
-            CHECK_PLANEMASK(pGC, infoRec->PolyGlyphBltTEFlags) &&
-            CHECK_ROP(pGC, infoRec->PolyGlyphBltTEFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->PolyGlyphBltNonTEFlags) &&
-            CHECK_FG(pGC, infoRec->PolyGlyphBltTEFlags) &&
-            (!(infoRec->PolyGlyphBltTEFlags & TRANSPARENCY_GXCOPY_ONLY) ||
-             (pGC->alu == GXcopy))
-            ) {
-            pGC->ops->PolyText8 = infoRec->PolyText8TE;
-            pGC->ops->PolyText16 = infoRec->PolyText16TE;
-            pGC->ops->PolyGlyphBlt = infoRec->PolyGlyphBltTE;
-        }
-    }
-}
-
-void
-XAAValidateImageGlyphBlt(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    Bool BigFont = FALSE;
-
-    pGC->ops->ImageText8 = XAAFallbackOps.ImageText8;
-    pGC->ops->ImageText16 = XAAFallbackOps.ImageText16;
-    pGC->ops->ImageGlyphBlt = XAAFallbackOps.ImageGlyphBlt;
-
-    if (!pGC->font)
-        return;
-
-    if ((FONTMAXBOUNDS(pGC->font, rightSideBearing) -
-         FONTMINBOUNDS(pGC->font, leftSideBearing) > 32))
-        BigFont = TRUE;
-
-    /* no funny business */
-    if ((FONTMINBOUNDS(pGC->font, characterWidth) <= 0) ||
-        ((FONTASCENT(pGC->font) + FONTDESCENT(pGC->font)) <= 0))
-        return;
-
-    /* Check for TE Fonts */
-    if (!TERMINALFONT(pGC->font) || BigFont || (pGC->depth == 32)) {
-        if (infoRec->ImageGlyphBltNonTE &&
-            CHECK_PLANEMASK(pGC, infoRec->ImageGlyphBltNonTEFlags) &&
-            CHECK_FG(pGC, infoRec->ImageGlyphBltNonTEFlags) &&
-            infoRec->SetupForSolidFill &&
-            CHECK_PLANEMASK(pGC, infoRec->SolidFillFlags) &&
-            CHECK_BG(pGC, infoRec->SolidFillFlags)) {
-            pGC->ops->ImageText8 = infoRec->ImageText8NonTE;
-            pGC->ops->ImageText16 = infoRec->ImageText16NonTE;
-            pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltNonTE;
-        }
-    }
-    else if (infoRec->ImageGlyphBltTE &&
-             CHECK_PLANEMASK(pGC, infoRec->ImageGlyphBltTEFlags)) {
-        if (!(infoRec->ImageGlyphBltTEFlags & TRANSPARENCY_ONLY) &&
-            CHECK_COLORS(pGC, infoRec->ImageGlyphBltTEFlags)) {
-            pGC->ops->ImageText8 = infoRec->ImageText8TE;
-            pGC->ops->ImageText16 = infoRec->ImageText16TE;
-            pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltTE;
-        }
-        else {
-            if (CHECK_FG(pGC, infoRec->ImageGlyphBltTEFlags) &&
-                infoRec->SetupForSolidFill &&
-                CHECK_PLANEMASK(pGC, infoRec->SolidFillFlags) &&
-                CHECK_BG(pGC, infoRec->SolidFillFlags)) {
-                pGC->ops->ImageText8 = infoRec->ImageText8TE;
-                pGC->ops->ImageText16 = infoRec->ImageText16TE;
-                pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltTE;
-            }
-        }
-    }
-}
-
-void
-XAAValidatePolylines(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAAGCPtr pGCPriv = (XAAGCPtr) dixLookupPrivate(&pGC->devPrivates,
-                                                   XAAGetGCKey());
-
-    if (pGC->lineStyle == LineSolid)
-        changes &= ~GCDashList;
-    if (!changes)
-        return;
-
-    pGC->ops->PolySegment = XAAFallbackOps.PolySegment;
-    pGC->ops->Polylines = XAAFallbackOps.Polylines;
-    pGC->ops->PolyRectangle = XAAFallbackOps.PolyRectangle;
-    pGC->ops->PolyArc = XAAFallbackOps.PolyArc;
-
-    if ((pGC->ops->FillSpans != XAAFallbackOps.FillSpans) &&
-        (pGC->lineWidth > 0)) {
-
-        pGC->ops->PolyArc = miPolyArc;
-        pGC->ops->PolySegment = miPolySegment;
-        pGC->ops->PolyRectangle = miPolyRectangle;
-        if (pGC->lineStyle == LineSolid)
-            pGC->ops->Polylines = miWideLine;
-        else
-            pGC->ops->Polylines = miWideDash;
-    }
-
-    if ((pGC->lineWidth == 0) && (pGC->fillStyle == FillSolid)) {
-
-        if (pGC->lineStyle == LineSolid) {
-
-            if (infoRec->PolyRectangleThinSolid &&
-                CHECK_PLANEMASK(pGC, infoRec->PolyRectangleThinSolidFlags) &&
-                CHECK_ROP(pGC, infoRec->PolyRectangleThinSolidFlags) &&
-                CHECK_ROPSRC(pGC, infoRec->PolyRectangleThinSolidFlags) &&
-                CHECK_FG(pGC, infoRec->PolyRectangleThinSolidFlags)) {
-
-                pGC->ops->PolyRectangle = infoRec->PolyRectangleThinSolid;
-            }
-
-            if (infoRec->PolySegmentThinSolid &&
-                CHECK_PLANEMASK(pGC, infoRec->PolySegmentThinSolidFlags) &&
-                CHECK_ROP(pGC, infoRec->PolySegmentThinSolidFlags) &&
-                CHECK_ROPSRC(pGC, infoRec->PolySegmentThinSolidFlags) &&
-                CHECK_FG(pGC, infoRec->PolySegmentThinSolidFlags)) {
-
-                pGC->ops->PolySegment = infoRec->PolySegmentThinSolid;
-            }
-
-            if (infoRec->PolylinesThinSolid &&
-                CHECK_PLANEMASK(pGC, infoRec->PolylinesThinSolidFlags) &&
-                CHECK_ROP(pGC, infoRec->PolylinesThinSolidFlags) &&
-                CHECK_ROPSRC(pGC, infoRec->PolylinesThinSolidFlags) &&
-                CHECK_FG(pGC, infoRec->PolylinesThinSolidFlags)) {
-
-                pGC->ops->Polylines = infoRec->PolylinesThinSolid;
-            }
-        }
-        else if ((pGC->lineStyle == LineOnOffDash) && pGCPriv->DashPattern) {
-
-            if (infoRec->PolySegmentThinDashed &&
-                !(infoRec->PolySegmentThinDashedFlags & NO_TRANSPARENCY) &&
-                ((pGC->alu == GXcopy) || !(infoRec->PolySegmentThinDashedFlags &
-                                           TRANSPARENCY_GXCOPY_ONLY)) &&
-                CHECK_PLANEMASK(pGC, infoRec->PolySegmentThinDashedFlags) &&
-                CHECK_ROP(pGC, infoRec->PolySegmentThinDashedFlags) &&
-                CHECK_ROPSRC(pGC, infoRec->PolySegmentThinDashedFlags) &&
-                CHECK_FG(pGC, infoRec->PolySegmentThinDashedFlags)) {
-
-                pGC->ops->PolySegment = infoRec->PolySegmentThinDashed;
-            }
-
-            if (infoRec->PolylinesThinDashed &&
-                !(infoRec->PolylinesThinDashedFlags & NO_TRANSPARENCY) &&
-                ((pGC->alu == GXcopy) || !(infoRec->PolylinesThinDashedFlags &
-                                           TRANSPARENCY_GXCOPY_ONLY)) &&
-                CHECK_PLANEMASK(pGC, infoRec->PolylinesThinDashedFlags) &&
-                CHECK_ROP(pGC, infoRec->PolylinesThinDashedFlags) &&
-                CHECK_ROPSRC(pGC, infoRec->PolylinesThinDashedFlags) &&
-                CHECK_FG(pGC, infoRec->PolylinesThinDashedFlags)) {
-
-                pGC->ops->Polylines = infoRec->PolylinesThinDashed;
-            }
-
-            if (pGC->ops->Polylines != XAAFallbackOps.Polylines)
-                pGC->ops->PolyRectangle = miPolyRectangle;
-
-        }
-        else if (pGCPriv->DashPattern && (pGC->depth != 32)) {
-            /* LineDoubleDash */
-            if (infoRec->PolySegmentThinDashed &&
-                !(infoRec->PolySegmentThinDashedFlags & TRANSPARENCY_ONLY) &&
-                CHECK_PLANEMASK(pGC, infoRec->PolySegmentThinDashedFlags) &&
-                CHECK_ROP(pGC, infoRec->PolySegmentThinDashedFlags) &&
-                CHECK_ROPSRC(pGC, infoRec->PolySegmentThinDashedFlags) &&
-                CHECK_COLORS(pGC, infoRec->PolySegmentThinDashedFlags)) {
-
-                pGC->ops->PolySegment = infoRec->PolySegmentThinDashed;
-            }
-
-            if (infoRec->PolylinesThinDashed &&
-                !(infoRec->PolylinesThinDashedFlags & TRANSPARENCY_ONLY) &&
-                CHECK_PLANEMASK(pGC, infoRec->PolylinesThinDashedFlags) &&
-                CHECK_ROP(pGC, infoRec->PolylinesThinDashedFlags) &&
-                CHECK_ROPSRC(pGC, infoRec->PolylinesThinDashedFlags) &&
-                CHECK_COLORS(pGC, infoRec->PolylinesThinDashedFlags)) {
-
-                pGC->ops->Polylines = infoRec->PolylinesThinDashed;
-            }
-
-            if (pGC->ops->Polylines != XAAFallbackOps.Polylines)
-                pGC->ops->PolyRectangle = miPolyRectangle;
-
-        }
-    }
-
-    if (infoRec->PolylinesWideSolid &&
-        (pGC->lineWidth > 0) &&
-        (pGC->fillStyle == FillSolid) &&
-        (pGC->lineStyle == LineSolid) &&
-        CHECK_PLANEMASK(pGC, infoRec->PolylinesWideSolidFlags) &&
-        CHECK_ROP(pGC, infoRec->PolylinesWideSolidFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->PolylinesWideSolidFlags) &&
-        CHECK_FG(pGC, infoRec->PolylinesWideSolidFlags)) {
-
-        pGC->ops->Polylines = infoRec->PolylinesWideSolid;
-    }
-}
diff --git a/hw/xfree86/xaa/xaaImage.c b/hw/xfree86/xaa/xaaImage.c
deleted file mode 100644 (file)
index 4457c9e..0000000
+++ /dev/null
@@ -1,534 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "servermd.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "mi.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-void
-XAAMoveDWORDS_FixedBase(register CARD32 *dest,
-                        register CARD32 *src, register int dwords)
-{
-    while (dwords & ~0x03) {
-        *dest = *src;
-        *dest = *(src + 1);
-        *dest = *(src + 2);
-        *dest = *(src + 3);
-        dwords -= 4;
-        src += 4;
-    }
-
-    if (!dwords)
-        return;
-    *dest = *src;
-    if (dwords == 1)
-        return;
-    *dest = *(src + 1);
-    if (dwords == 2)
-        return;
-    *dest = *(src + 2);
-}
-
-void
-XAAMoveDWORDS(register CARD32 *dest, register CARD32 *src, register int dwords)
-{
-    while (dwords & ~0x03) {
-        *dest = *src;
-        *(dest + 1) = *(src + 1);
-        *(dest + 2) = *(src + 2);
-        *(dest + 3) = *(src + 3);
-        src += 4;
-        dest += 4;
-        dwords -= 4;
-    }
-    if (!dwords)
-        return;
-    *dest = *src;
-    if (dwords == 1)
-        return;
-    *(dest + 1) = *(src + 1);
-    if (dwords == 2)
-        return;
-    *(dest + 2) = *(src + 2);
-}
-
-void
-XAAMoveDWORDS_FixedSrc(register CARD32 *dest,
-                       register CARD32 *src, register int dwords)
-{
-    while (dwords & ~0x03) {
-        *dest = *src;
-        *(dest + 1) = *src;
-        *(dest + 2) = *src;
-        *(dest + 3) = *src;
-        dest += 4;
-        dwords -= 4;
-    }
-    if (!dwords)
-        return;
-    *dest = *src;
-    if (dwords == 1)
-        return;
-    *(dest + 1) = *src;
-    if (dwords == 2)
-        return;
-    *(dest + 2) = *src;
-}
-
-static void
-XAAWritePixmap32To24(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned char *srcInit, int srcwidth,       /* bytes */
-                     int rop, unsigned int planemask, int trans)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int count, dwords = bytes_to_int32(w * 3);
-    CARD32 *src, *dst;
-    Bool PlusOne = FALSE;
-
-    if ((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) &&
-        ((dwords * h) & 0x01)) {
-        PlusOne = TRUE;
-    }
-
-    (*infoRec->SetupForImageWrite) (pScrn, rop, planemask, trans, 24, 24);
-    (*infoRec->SubsequentImageWriteRect) (pScrn, x, y, w, h, 0);
-
-    if (dwords > infoRec->ImageWriteRange) {
-        dst = (CARD32 *) infoRec->ImageWriteBase;
-        while (h--) {
-            src = (CARD32 *) srcInit;
-            count = w;
-
-            while (count >= 4) {
-                *dst = (src[0] & 0x00ffffff) | (src[1] << 24);
-                *dst = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
-                *dst = ((src[2] >> 16) & 0x000000ff) | (src[3] << 8);
-                src += 4;
-                count -= 4;
-            }
-            switch (count) {
-            case 0:
-                break;
-            case 1:
-                *dst = src[0];
-                break;
-            case 2:
-                *dst = (src[0] & 0x00ffffff) | (src[1] << 24);
-                *dst = src[1] >> 8;
-                break;
-            default:
-                *dst = (src[0] & 0x00ffffff) | (src[1] << 24);
-                *dst = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
-                *dst = src[2] >> 16;
-                break;
-            }
-            srcInit += srcwidth;
-        }
-    }
-    else {
-        while (h--) {
-            dst = (CARD32 *) infoRec->ImageWriteBase;
-            src = (CARD32 *) srcInit;
-            count = w;
-
-            while (count >= 4) {
-                dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24);
-                dst[1] = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
-                dst[2] = ((src[2] >> 16) & 0x000000ff) | (src[3] << 8);
-                dst += 3;
-                src += 4;
-                count -= 4;
-            }
-            switch (count) {
-            case 0:
-                break;
-            case 1:
-                dst[0] = src[0];
-                break;
-            case 2:
-                dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24);
-                dst[1] = src[1] >> 8;
-                break;
-            default:
-                dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24);
-                dst[1] = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
-                dst[2] = src[2] >> 16;
-                break;
-            }
-            srcInit += srcwidth;
-        }
-    }
-
-    if (PlusOne) {
-        CARD32 *base = (CARD32 *) infoRec->ImageWriteBase;
-
-        *base = 0x00000000;
-    }
-
-    if (infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE)
-        (*infoRec->Sync) (pScrn);
-    else
-        SET_SYNC_FLAG(infoRec);
-
-}
-
-void
-XAAWritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned char *src, int srcwidth, /* bytes */
-               int rop, unsigned int planemask, int trans, int bpp, int depth)
-{
-    XAAInfoRecPtr infoRec;
-    int dwords, skipleft, Bpp;
-    Bool beCareful, PlusOne;
-
-    if ((bpp == 32) && (pScrn->bitsPerPixel == 24)) {
-        XAAWritePixmap32To24(pScrn, x, y, w, h, src, srcwidth,
-                             rop, planemask, trans);
-        return;
-    }
-
-    infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    beCareful = PlusOne = FALSE;
-    Bpp = bpp >> 3;
-
-    if ((skipleft = (long) src & 0x03L)) {
-        if (!(infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING)) {
-            skipleft = 0;
-            beCareful = TRUE;
-            goto BAD_ALIGNMENT;
-        }
-
-        if (Bpp == 3)
-            skipleft = 4 - skipleft;
-        else
-            skipleft /= Bpp;
-
-        if ((x < skipleft) && !(infoRec->ImageWriteFlags &
-                                LEFT_EDGE_CLIPPING_NEGATIVE_X)) {
-            skipleft = 0;
-            beCareful = TRUE;
-            goto BAD_ALIGNMENT;
-        }
-
-        x -= skipleft;
-        w += skipleft;
-
-        if (Bpp == 3)
-            src -= 3 * skipleft;
-        else                    /* is this Alpha friendly ? */
-            src = (unsigned char *) ((long) src & ~0x03L);
-    }
-
- BAD_ALIGNMENT:
-
-    dwords = bytes_to_int32(w * Bpp);
-
-    if ((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) &&
-        ((dwords * h) & 0x01)) {
-        PlusOne = TRUE;
-    }
-
-    (*infoRec->SetupForImageWrite) (pScrn, rop, planemask, trans, bpp, depth);
-    (*infoRec->SubsequentImageWriteRect) (pScrn, x, y, w, h, skipleft);
-
-    if (beCareful) {
-        /* in cases with bad alignment we have to be careful not
-           to read beyond the end of the source */
-        if (((x * Bpp) + (dwords << 2)) > srcwidth)
-            h--;
-        else
-            beCareful = FALSE;
-    }
-
-    if (dwords > infoRec->ImageWriteRange) {
-        while (h--) {
-            XAAMoveDWORDS_FixedBase((CARD32 *) infoRec->ImageWriteBase,
-                                    (CARD32 *) src, dwords);
-            src += srcwidth;
-        }
-        if (beCareful) {
-            int shift = ((long) src & 0x03L) << 3;
-
-            if (--dwords)
-                XAAMoveDWORDS_FixedBase((CARD32 *) infoRec->ImageWriteBase,
-                                        (CARD32 *) src, dwords);
-            src = (unsigned char *) ((long) (src + (dwords << 2)) & ~0x03L);
-            *((CARD32 *) infoRec->ImageWriteBase) = *((CARD32 *) src) >> shift;
-        }
-    }
-    else {
-        if (srcwidth == (dwords << 2)) {
-            int decrement = infoRec->ImageWriteRange / dwords;
-
-            while (h > decrement) {
-                XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase,
-                              (CARD32 *) src, dwords * decrement);
-                src += (srcwidth * decrement);
-                h -= decrement;
-            }
-            if (h) {
-                XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase,
-                              (CARD32 *) src, dwords * h);
-                if (beCareful)
-                    src += (srcwidth * h);
-            }
-        }
-        else {
-            while (h--) {
-                XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase,
-                              (CARD32 *) src, dwords);
-                src += srcwidth;
-            }
-        }
-
-        if (beCareful) {
-            int shift = ((long) src & 0x03L) << 3;
-
-            if (--dwords)
-                XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase,
-                              (CARD32 *) src, dwords);
-            src = (unsigned char *) ((long) (src + (dwords << 2)) & ~0x03L);
-
-            ((CARD32 *) infoRec->ImageWriteBase)[dwords] =
-                *((CARD32 *) src) >> shift;
-        }
-    }
-
-    if (PlusOne) {
-        CARD32 *base = (CARD32 *) infoRec->ImageWriteBase;
-
-        *base = 0x00000000;
-    }
-
-    if (infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE)
-        (*infoRec->Sync) (pScrn);
-    else
-        SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAWritePixmapScanline(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned char *src, int srcwidth, /* bytes */
-                       int rop,
-                       unsigned int planemask, int trans, int bpp, int depth)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int dwords, skipleft, bufferNo = 0, Bpp = bpp >> 3;
-    Bool beCareful = FALSE;
-    CARD32 *base;
-
-    if ((skipleft = (long) src & 0x03L)) {
-        if (!(infoRec->ScanlineImageWriteFlags & LEFT_EDGE_CLIPPING)) {
-            skipleft = 0;
-            beCareful = TRUE;
-            goto BAD_ALIGNMENT;
-        }
-
-        if (Bpp == 3)
-            skipleft = 4 - skipleft;
-        else
-            skipleft /= Bpp;
-
-        if ((x < skipleft) && !(infoRec->ScanlineImageWriteFlags &
-                                LEFT_EDGE_CLIPPING_NEGATIVE_X)) {
-            skipleft = 0;
-            beCareful = TRUE;
-            goto BAD_ALIGNMENT;
-        }
-
-        x -= skipleft;
-        w += skipleft;
-
-        if (Bpp == 3)
-            src -= 3 * skipleft;
-        else
-            src = (unsigned char *) ((long) src & ~0x03L);
-    }
-
- BAD_ALIGNMENT:
-
-    dwords = bytes_to_int32(w * Bpp);
-
-    (*infoRec->SetupForScanlineImageWrite) (pScrn, rop, planemask, trans, bpp,
-                                            depth);
-    (*infoRec->SubsequentScanlineImageWriteRect) (pScrn, x, y, w, h, skipleft);
-
-    if (beCareful) {
-        /* in cases with bad alignment we have to be careful not
-           to read beyond the end of the source */
-        if (((x * Bpp) + (dwords << 2)) > srcwidth)
-            h--;
-        else
-            beCareful = FALSE;
-    }
-
-    while (h--) {
-        base = (CARD32 *) infoRec->ScanlineImageWriteBuffers[bufferNo];
-        XAAMoveDWORDS(base, (CARD32 *) src, dwords);
-        (*infoRec->SubsequentImageWriteScanline) (pScrn, bufferNo++);
-        src += srcwidth;
-        if (bufferNo >= infoRec->NumScanlineImageWriteBuffers)
-            bufferNo = 0;
-    }
-
-    if (beCareful) {
-        int shift = ((long) src & 0x03L) << 3;
-
-        base = (CARD32 *) infoRec->ScanlineImageWriteBuffers[bufferNo];
-        if (--dwords)
-            XAAMoveDWORDS(base, (CARD32 *) src, dwords);
-        src = (unsigned char *) ((long) (src + (dwords << 2)) & ~0x03L);
-
-        base[dwords] = *((CARD32 *) src) >> shift;
-        (*infoRec->SubsequentImageWriteScanline) (pScrn, bufferNo);
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAPutImage(DrawablePtr pDraw,
-            GCPtr pGC,
-            int depth,
-            int x, int y, int w, int h, int leftPad, int format, char *pImage)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int bpp = BitsPerPixel(depth);
-    Bool depthBug = FALSE;
-
-    if (!w || !h)
-        return;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    depthBug = XAA_DEPTH_BUG(pGC);
-
-    if (((format == ZPixmap) && infoRec->WritePixmap &&
-         ((pDraw->bitsPerPixel == bpp) ||
-          ((pDraw->bitsPerPixel == 24) && (bpp == 32) &&
-           (infoRec->WritePixmapFlags & CONVERT_32BPP_TO_24BPP))) &&
-         CHECK_ROP(pGC, infoRec->WritePixmapFlags) &&
-         CHECK_ROPSRC(pGC, infoRec->WritePixmapFlags) &&
-         CHECK_PLANEMASK(pGC, infoRec->WritePixmapFlags) &&
-         CHECK_NO_GXCOPY(pGC, infoRec->WritePixmapFlags)) ||
-        ((format == XYBitmap) && !depthBug && infoRec->WriteBitmap &&
-         CHECK_ROP(pGC, infoRec->WriteBitmapFlags) &&
-         CHECK_ROPSRC(pGC, infoRec->WriteBitmapFlags) &&
-         CHECK_PLANEMASK(pGC, infoRec->WriteBitmapFlags) &&
-         CHECK_COLORS(pGC, infoRec->WriteBitmapFlags) &&
-         !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)) ||
-        ((format == XYPixmap) && !depthBug && infoRec->WriteBitmap &&
-         CHECK_ROP(pGC, infoRec->WriteBitmapFlags) &&
-         CHECK_ROPSRC(pGC, infoRec->WriteBitmapFlags) &&
-         !(infoRec->WriteBitmapFlags & NO_PLANEMASK) &&
-         !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY))) {
-
-        int MaxBoxes = RegionNumRects(pGC->pCompositeClip);
-        BoxPtr pbox, pClipBoxes;
-        int nboxes, srcx, srcy, srcwidth;
-        xRectangle TheRect;
-
-        TheRect.x = pDraw->x + x;
-        TheRect.y = pDraw->y + y;
-        TheRect.width = w;
-        TheRect.height = h;
-
-        if (MaxBoxes > (infoRec->PreAllocSize / sizeof(BoxRec))) {
-            pClipBoxes = malloc(MaxBoxes * sizeof(BoxRec));
-            if (!pClipBoxes)
-                return;
-        }
-        else
-            pClipBoxes = (BoxPtr) infoRec->PreAllocMem;
-
-        nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect);
-        pbox = pClipBoxes;
-
-        if (format == XYBitmap) {
-            srcwidth = BitmapBytePad(leftPad + w);
-            while (nboxes--) {
-                srcx = pbox->x1 - TheRect.x + leftPad;
-                srcy = pbox->y1 - TheRect.y;
-                (*infoRec->WriteBitmap) (infoRec->pScrn, pbox->x1, pbox->y1,
-                                         pbox->x2 - pbox->x1,
-                                         pbox->y2 - pbox->y1,
-                                         (unsigned char *) pImage +
-                                         (srcwidth * srcy) + ((srcx >> 5) << 2),
-                                         srcwidth, srcx & 31, pGC->fgPixel,
-                                         pGC->bgPixel, pGC->alu,
-                                         pGC->planemask);
-                pbox++;
-            }
-        }
-        else if (format == ZPixmap) {
-            int Bpp = bpp >> 3;
-
-            srcwidth = PixmapBytePad(leftPad + w, depth);
-            while (nboxes--) {
-                srcx = pbox->x1 - TheRect.x + leftPad;
-                srcy = pbox->y1 - TheRect.y;
-                (*infoRec->WritePixmap) (infoRec->pScrn, pbox->x1, pbox->y1,
-                                         pbox->x2 - pbox->x1,
-                                         pbox->y2 - pbox->y1,
-                                         (unsigned char *) pImage +
-                                         (srcwidth * srcy) + (srcx * Bpp),
-                                         srcwidth, pGC->alu, pGC->planemask, -1,
-                                         Bpp << 3, depth);
-                pbox++;
-            }
-        }
-        else {                  /* XYPixmap */
-            int depth = pGC->depth;
-            int numBox, increment;
-            unsigned long i, mask;
-            BoxPtr pntBox;
-
-            srcwidth = BitmapBytePad(w + leftPad);
-            increment = h * srcwidth;
-            i = 1 << (depth - 1);
-            mask = ~0;
-
-            if ((infoRec->pScrn->overlayFlags & OVERLAY_8_32_PLANAR) &&
-                (pGC->depth == 8)) {
-                i = 0x80000000;
-                mask = 0xff000000;
-            }
-
-            for (; i & mask; i >>= 1, pImage += increment) {
-                if (i & pGC->planemask) {
-                    pntBox = pbox;
-                    numBox = nboxes;
-                    while (numBox--) {
-                        srcx = pntBox->x1 - TheRect.x + leftPad;
-                        srcy = pntBox->y1 - TheRect.y;
-                        (*infoRec->WriteBitmap) (infoRec->pScrn,
-                                                 pntBox->x1, pntBox->y1,
-                                                 pntBox->x2 - pntBox->x1,
-                                                 pntBox->y2 - pntBox->y1,
-                                                 (unsigned char *) pImage +
-                                                 (srcwidth * srcy) +
-                                                 ((srcx >> 5) << 2), srcwidth,
-                                                 srcx & 31, ~0, 0, pGC->alu, i);
-                        pntBox++;
-                    }
-                }
-            }
-
-        }
-
-        if (pClipBoxes != (BoxPtr) infoRec->PreAllocMem)
-            free(pClipBoxes);
-    }
-    else
-        XAAFallbackOps.PutImage(pDraw, pGC, depth, x, y, w, h, leftPad,
-                                format, pImage);
-}
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
deleted file mode 100644 (file)
index 661fa90..0000000
+++ /dev/null
@@ -1,637 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "miline.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "xf86fbman.h"
-#include "servermd.h"
-#ifdef COMPOSITE
-#include "cw.h"
-#endif
-
-#define MAX_PREALLOC_MEM       65536   /* MUST be >= 1024 */
-
-#define MIN_OFFPIX_SIZE                (320*200)
-
-static Bool XAACloseScreen(int i, ScreenPtr pScreen);
-static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
-                        unsigned int format, unsigned long planemask,
-                        char *pdstLine);
-static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
-                        int *pwidth, int nspans, char *pdstStart);
-static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
-                                 unsigned usage_hint);
-static Bool XAADestroyPixmap(PixmapPtr pPixmap);
-static Bool XAAEnterVT(int index, int flags);
-static void XAALeaveVT(int index, int flags);
-static int XAASetDGAMode(int index, int num, DGADevicePtr devRet);
-static void XAAEnableDisableFBAccess(int index, Bool enable);
-static Bool XAAChangeWindowAttributes(WindowPtr pWin, unsigned long mask);
-
-static DevPrivateKeyRec XAAScreenKeyRec;
-
-#define XAAScreenKey (&XAAScreenKeyRec)
-static DevPrivateKeyRec XAAGCKeyRec;
-
-#define XAAGCKey (&XAAGCKeyRec)
-static DevPrivateKeyRec XAAPixmapKeyRec;
-
-#define XAAPixmapKey (&XAAPixmapKeyRec)
-
-DevPrivateKey
-XAAGetScreenKey(void)
-{
-    return XAAScreenKey;
-}
-
-DevPrivateKey
-XAAGetGCKey(void)
-{
-    return XAAGCKey;
-}
-
-DevPrivateKey
-XAAGetPixmapKey(void)
-{
-    return XAAPixmapKey;
-}
-
-/* temp kludge */
-static Bool SwitchedOut = FALSE;
-
-XAAInfoRecPtr
-XAACreateInfoRec(void)
-{
-    XAAInfoRecPtr infoRec;
-
-    infoRec = calloc(1, sizeof(XAAInfoRec));
-    if (infoRec)
-        infoRec->CachePixelGranularity = -1;
-
-    return infoRec;
-}
-
-void
-XAADestroyInfoRec(XAAInfoRecPtr infoRec)
-{
-    if (!infoRec)
-        return;
-
-    if (infoRec->ClosePixmapCache)
-        (*infoRec->ClosePixmapCache) (infoRec->pScrn->pScreen);
-
-    free(infoRec->PreAllocMem);
-
-    free(infoRec->PixmapCachePrivate);
-
-    free(infoRec);
-}
-
-Bool
-XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    XAAScreenPtr pScreenPriv;
-    int i;
-    PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-
-    /* Return successfully if no acceleration wanted */
-    if (!infoRec)
-        return TRUE;
-
-    if (!dixRegisterPrivateKey(&XAAGCKeyRec, PRIVATE_GC, sizeof(XAAGCRec)))
-        return FALSE;
-
-    if (!dixRegisterPrivateKey
-        (&XAAPixmapKeyRec, PRIVATE_PIXMAP, sizeof(XAAPixmapRec)))
-        return FALSE;
-
-    if (!dixRegisterPrivateKey(&XAAScreenKeyRec, PRIVATE_SCREEN, 0))
-        return FALSE;
-
-    if (!(pScreenPriv = malloc(sizeof(XAAScreenRec))))
-        return FALSE;
-
-    dixSetPrivate(&pScreen->devPrivates, XAAScreenKey, pScreenPriv);
-
-    if (!xf86FBManagerRunning(pScreen))
-        infoRec->Flags &= ~(PIXMAP_CACHE | OFFSCREEN_PIXMAPS);
-    if (!(infoRec->Flags & LINEAR_FRAMEBUFFER))
-        infoRec->Flags &= ~OFFSCREEN_PIXMAPS;
-
-    if (!infoRec->FullPlanemask) {      /* for backwards compatibility */
-        infoRec->FullPlanemask = (1 << pScrn->depth) - 1;
-        infoRec->FullPlanemasks[pScrn->depth - 1] = infoRec->FullPlanemask;
-    }
-
-    for (i = 0; i < 32; i++) {
-        if (!infoRec->FullPlanemasks[i])        /* keep any set by caller */
-            infoRec->FullPlanemasks[i] = (1 << (i + 1)) - 1;
-    }
-
-    if (!XAAInitAccel(pScreen, infoRec))
-        return FALSE;
-    pScreenPriv->AccelInfoRec = infoRec;
-    infoRec->ScratchGC.pScreen = pScreen;
-
-    if (!infoRec->GetImage)
-        infoRec->GetImage = XAAGetImage;
-    if (!infoRec->GetSpans)
-        infoRec->GetSpans = XAAGetSpans;
-    if (!infoRec->CopyWindow)
-        infoRec->CopyWindow = XAACopyWindow;
-
-    pScreenPriv->CreateGC = pScreen->CreateGC;
-    pScreen->CreateGC = XAACreateGC;
-    pScreenPriv->CloseScreen = pScreen->CloseScreen;
-    pScreen->CloseScreen = XAACloseScreen;
-    pScreenPriv->GetImage = pScreen->GetImage;
-    pScreen->GetImage = infoRec->GetImage;
-    pScreenPriv->GetSpans = pScreen->GetSpans;
-    pScreen->GetSpans = infoRec->GetSpans;
-    pScreenPriv->CopyWindow = pScreen->CopyWindow;
-    pScreen->CopyWindow = infoRec->CopyWindow;
-    pScreenPriv->CreatePixmap = pScreen->CreatePixmap;
-    pScreen->CreatePixmap = XAACreatePixmap;
-    pScreenPriv->DestroyPixmap = pScreen->DestroyPixmap;
-    pScreen->DestroyPixmap = XAADestroyPixmap;
-    pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
-    pScreen->ChangeWindowAttributes = XAAChangeWindowAttributes;
-
-    pScreenPriv->EnterVT = pScrn->EnterVT;
-    pScrn->EnterVT = XAAEnterVT;
-    pScreenPriv->LeaveVT = pScrn->LeaveVT;
-    pScrn->LeaveVT = XAALeaveVT;
-    pScreenPriv->SetDGAMode = pScrn->SetDGAMode;
-    pScrn->SetDGAMode = XAASetDGAMode;
-    pScreenPriv->EnableDisableFBAccess = pScrn->EnableDisableFBAccess;
-    pScrn->EnableDisableFBAccess = XAAEnableDisableFBAccess;
-
-    pScreenPriv->WindowExposures = pScreen->WindowExposures;
-    if (ps) {
-        pScreenPriv->Composite = ps->Composite;
-        ps->Composite = XAAComposite;
-        pScreenPriv->Glyphs = ps->Glyphs;
-        ps->Glyphs = XAAGlyphs;
-    }
-    if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR)
-        XAASetupOverlay8_32Planar(pScreen);
-
-    infoRec->PreAllocMem = malloc(MAX_PREALLOC_MEM);
-    if (infoRec->PreAllocMem)
-        infoRec->PreAllocSize = MAX_PREALLOC_MEM;
-
-    if (infoRec->Flags & PIXMAP_CACHE)
-        xf86RegisterFreeBoxCallback(pScreen, infoRec->InitPixmapCache,
-                                    (pointer) infoRec);
-
-    if (infoRec->Flags & MICROSOFT_ZERO_LINE_BIAS)
-        miSetZeroLineBias(pScreen, OCTANT1 | OCTANT2 | OCTANT3 | OCTANT4);
-
-#ifdef COMPOSITE
-    /* Initialize the composite wrapper.  This needs to happen after the
-     * wrapping above (so it comes before us), but before all other extensions,
-     * so it doesn't confuse them. (particularly damage).
-     */
-    miInitializeCompositeWrapper(pScreen);
-#endif
-
-    return TRUE;
-}
-
-static Bool
-XAACloseScreen(int i, ScreenPtr pScreen)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    XAAScreenPtr pScreenPriv =
-        (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey);
-
-    pScrn->EnterVT = pScreenPriv->EnterVT;
-    pScrn->LeaveVT = pScreenPriv->LeaveVT;
-    pScrn->EnableDisableFBAccess = pScreenPriv->EnableDisableFBAccess;
-
-    pScreen->CreateGC = pScreenPriv->CreateGC;
-    pScreen->CloseScreen = pScreenPriv->CloseScreen;
-    pScreen->GetImage = pScreenPriv->GetImage;
-    pScreen->GetSpans = pScreenPriv->GetSpans;
-    pScreen->CopyWindow = pScreenPriv->CopyWindow;
-    pScreen->WindowExposures = pScreenPriv->WindowExposures;
-    pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
-    pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap;
-    pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
-
-    /* We leave it up to the client to free the XAAInfoRec */
-
-    free((pointer) pScreenPriv);
-
-    return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-static void
-XAAGetImage(DrawablePtr pDraw,
-            int sx, int sy, int w, int h,
-            unsigned int format, unsigned long planemask, char *pdstLine)
-{
-    ScreenPtr pScreen = pDraw->pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    ScrnInfoPtr pScrn = infoRec->pScrn;
-
-    if (pScrn->vtSema &&
-        ((pDraw->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pDraw))) {
-        if (infoRec->ReadPixmap && (format == ZPixmap) &&
-            ((planemask & infoRec->FullPlanemasks[pDraw->depth - 1]) ==
-             infoRec->FullPlanemasks[pDraw->depth - 1]) &&
-            (pDraw->bitsPerPixel == BitsPerPixel(pDraw->depth))) {
-            (*infoRec->ReadPixmap) (pScrn,
-                                    sx + pDraw->x, sy + pDraw->y, w, h,
-                                    (unsigned char *) pdstLine,
-                                    PixmapBytePad(w, pDraw->depth),
-                                    pDraw->bitsPerPixel, pDraw->depth);
-            return;
-        }
-        SYNC_CHECK(pDraw);
-    }
-
-    XAA_SCREEN_PROLOGUE(pScreen, GetImage);
-    (*pScreen->GetImage) (pDraw, sx, sy, w, h, format, planemask, pdstLine);
-    XAA_SCREEN_EPILOGUE(pScreen, GetImage, XAAGetImage);
-}
-
-static void
-XAAGetSpans(DrawablePtr pDraw,
-            int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart)
-{
-    ScreenPtr pScreen = pDraw->pScreen;
-
-    XAA_SCREEN_PROLOGUE(pScreen, GetSpans);
-    if (xf86Screens[pScreen->myNum]->vtSema &&
-        ((pDraw->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pDraw))) {
-        SYNC_CHECK(pDraw);
-    }
-    (*pScreen->GetSpans) (pDraw, wMax, ppt, pwidth, nspans, pdstStart);
-    XAA_SCREEN_EPILOGUE(pScreen, GetSpans, XAAGetSpans);
-}
-
-static int
-XAAPixmapBPP(ScreenPtr pScreen, int depth)
-{
-    PixmapPtr pPix;
-    int bpp;
-    DestroyPixmapProcPtr destroyPixmap;
-
-    XAA_SCREEN_PROLOGUE(pScreen, CreatePixmap);
-    pPix = (*pScreen->CreatePixmap) (pScreen, 1, 1, depth,
-                                     CREATE_PIXMAP_USAGE_SCRATCH);
-    XAA_SCREEN_EPILOGUE(pScreen, CreatePixmap, XAACreatePixmap);
-    if (!pPix)
-        return 0;
-    bpp = pPix->drawable.bitsPerPixel;
-    destroyPixmap = pScreen->DestroyPixmap;
-    XAA_SCREEN_PROLOGUE(pScreen, DestroyPixmap);
-    (*pScreen->DestroyPixmap) (pPix);
-    XAA_SCREEN_EPILOGUE(pScreen, DestroyPixmap, destroyPixmap);
-    return bpp;
-}
-
-static void
-XAAInitializeOffscreenDepths(ScreenPtr pScreen)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    int d, dep;
-
-    infoRec->offscreenDepthsInitialized = TRUE;
-    infoRec->offscreenDepths = 0;
-    if (infoRec->Flags & OFFSCREEN_PIXMAPS) {
-        for (d = 0; d < pScreen->numDepths; d++) {
-            dep = pScreen->allowedDepths[d].depth;
-            if (XAAPixmapBPP(pScreen, dep) == pScrn->bitsPerPixel)
-                infoRec->offscreenDepths |= (1 << (dep - 1));
-        }
-    }
-}
-
-static PixmapPtr
-XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    XAAPixmapPtr pPriv;
-    PixmapPtr pPix = NULL;
-    int size = w * h;
-
-    if (w > 32767 || h > 32767)
-        return NullPixmap;
-
-    if (!infoRec->offscreenDepthsInitialized)
-        XAAInitializeOffscreenDepths(pScreen);
-
-    if (pScrn->vtSema &&
-        (usage_hint != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
-        (infoRec->offscreenDepths & (1 << (depth - 1))) &&
-        (size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
-        (!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
-        (!infoRec->maxOffPixHeight || (h <= infoRec->maxOffPixHeight))) {
-        PixmapLinkPtr pLink;
-        PixmapPtr pScreenPix;
-        FBAreaPtr area;
-        int gran = 0;
-
-        switch (pScrn->bitsPerPixel) {
-        case 24:
-        case 8:
-            gran = 4;
-            break;
-        case 16:
-            gran = 2;
-            break;
-        case 32:
-            gran = 1;
-            break;
-        default:
-            break;
-        }
-
-        if (BITMAP_SCANLINE_PAD == 64)
-            gran *= 2;
-
-        if (!(area = xf86AllocateOffscreenArea(pScreen, w, h, gran, 0,
-                                               XAARemoveAreaCallback, NULL))) {
-            goto BAILOUT;
-        }
-
-        if (!(pLink = malloc(sizeof(PixmapLink)))) {
-            xf86FreeOffscreenArea(area);
-            goto BAILOUT;
-        }
-
-        XAA_SCREEN_PROLOGUE(pScreen, CreatePixmap);
-        pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, usage_hint);
-        XAA_SCREEN_EPILOGUE(pScreen, CreatePixmap, XAACreatePixmap);
-
-        if (!pPix) {
-            free(pLink);
-            xf86FreeOffscreenArea(area);
-            goto BAILOUT;
-        }
-
-        pScreenPix = (*pScreen->GetScreenPixmap) (pScreen);
-
-        pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
-        pPix->drawable.x = area->box.x1;
-        pPix->drawable.y = area->box.y1;
-        pPix->drawable.width = w;
-        pPix->drawable.height = h;
-        pPix->drawable.bitsPerPixel = pScrn->bitsPerPixel;
-        pPix->devKind = pScreenPix->devKind;
-        pPix->devPrivate.ptr = pScreenPix->devPrivate.ptr;
-        area->devPrivate.ptr = pPix;
-
-        pPriv->flags = OFFSCREEN;
-        pPriv->offscreenArea = area;
-        pPriv->freeData = FALSE;
-
-        pLink->next = infoRec->OffscreenPixmaps;
-        pLink->pPix = pPix;
-        infoRec->OffscreenPixmaps = pLink;
-        return pPix;
-    }
- BAILOUT:
-    XAA_SCREEN_PROLOGUE(pScreen, CreatePixmap);
-    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
-    XAA_SCREEN_EPILOGUE(pScreen, CreatePixmap, XAACreatePixmap);
-
-    if (pPix) {
-        pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
-        pPriv->flags = 0;
-        pPriv->offscreenArea = NULL;
-        pPriv->freeData = FALSE;
-        if (!w || !h)           /* either scratch or shared memory */
-            pPriv->flags |= SHARED_PIXMAP;
-    }
-
-    return pPix;
-}
-
-static Bool
-XAADestroyPixmap(PixmapPtr pPix)
-{
-    ScreenPtr pScreen = pPix->drawable.pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
-    Bool ret;
-
-    if (pPix->refcnt == 1) {
-        if (pPriv->flags & OFFSCREEN) {
-            if (pPriv->flags & DGA_PIXMAP)
-                free(pPriv->offscreenArea);
-            else {
-                FBAreaPtr area = pPriv->offscreenArea;
-                PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
-                PixmapLinkPtr prev = NULL;
-
-                while (pLink->pPix != pPix) {
-                    prev = pLink;
-                    pLink = pLink->next;
-                }
-
-                if (prev)
-                    prev->next = pLink->next;
-                else
-                    infoRec->OffscreenPixmaps = pLink->next;
-
-                if (!area)
-                    area = pLink->area;
-
-                xf86FreeOffscreenArea(area);
-                pPriv->offscreenArea = NULL;
-                free(pLink);
-            }
-        }
-
-        if (pPriv->freeData) {  /* pixmaps that were once in video ram */
-            free(pPix->devPrivate.ptr);
-            pPix->devPrivate.ptr = NULL;
-        }
-    }
-
-    XAA_SCREEN_PROLOGUE(pScreen, DestroyPixmap);
-    ret = (*pScreen->DestroyPixmap) (pPix);
-    XAA_SCREEN_EPILOGUE(pScreen, DestroyPixmap, XAADestroyPixmap);
-
-    return ret;
-}
-
-static Bool
-XAAChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
-{
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-    Bool ret;
-
-    XAA_SCREEN_PROLOGUE(pScreen, ChangeWindowAttributes);
-    ret = (*pScreen->ChangeWindowAttributes) (pWin, mask);
-    XAA_SCREEN_EPILOGUE(pScreen, ChangeWindowAttributes,
-                        XAAChangeWindowAttributes);
-
-    /* we have to assume that shared memory pixmaps are dirty
-       because we can't wrap operations on them */
-
-    if ((mask & CWBackPixmap) && (pWin->backgroundState == BackgroundPixmap) &&
-        PIXMAP_IS_SHARED(pWin->background.pixmap)) {
-        XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pWin->background.pixmap);
-
-        pPixPriv->flags |= DIRTY;
-    }
-    if ((mask & CWBorderPixmap) && !(pWin->borderIsPixel) &&
-        PIXMAP_IS_SHARED(pWin->border.pixmap)) {
-        XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pWin->border.pixmap);
-
-        pPixPriv->flags |= DIRTY;
-    }
-
-    return ret;
-}
-
-/*  These two aren't really needed for anything */
-
-static Bool
-XAAEnterVT(int index, int flags)
-{
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    Bool ret;
-    ScreenPtr pScreen = screenInfo.screens[index];
-    XAAScreenPtr pScreenPriv =
-        (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey);
-
-    pScrn->EnterVT = pScreenPriv->EnterVT;
-    ret = ((*pScreenPriv->EnterVT) (index, flags));
-    pScreenPriv->EnterVT = pScrn->EnterVT;
-    pScrn->EnterVT = XAAEnterVT;
-    return ret;
-}
-
-static void
-XAALeaveVT(int index, int flags)
-{
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    ScreenPtr pScreen = screenInfo.screens[index];
-    XAAScreenPtr pScreenPriv =
-        (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey);
-    XAAInfoRecPtr infoRec = pScreenPriv->AccelInfoRec;
-
-    if (infoRec->NeedToSync) {
-        (*infoRec->Sync) (infoRec->pScrn);
-        infoRec->NeedToSync = FALSE;
-    }
-
-    pScrn->LeaveVT = pScreenPriv->LeaveVT;
-    (*pScreenPriv->LeaveVT) (index, flags);
-    pScreenPriv->LeaveVT = pScrn->LeaveVT;
-    pScrn->LeaveVT = XAALeaveVT;
-}
-
-typedef struct {
-    Bool UsingPixmapCache;
-    Bool CanDoColor8x8;
-    Bool CanDoMono8x8;
-} SavedCacheState, *SavedCacheStatePtr;
-
-static int
-XAASetDGAMode(int index, int num, DGADevicePtr devRet)
-{
-    ScreenPtr pScreen = screenInfo.screens[index];
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    XAAScreenPtr pScreenPriv =
-        (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey);
-    int ret;
-
-    if (!num && infoRec->dgaSaves) {    /* restore old pixmap cache state */
-        SavedCacheStatePtr state = (SavedCacheStatePtr) infoRec->dgaSaves;
-
-        infoRec->UsingPixmapCache = state->UsingPixmapCache;
-        infoRec->CanDoColor8x8 = state->CanDoColor8x8;
-        infoRec->CanDoMono8x8 = state->CanDoMono8x8;
-        free(infoRec->dgaSaves);
-        infoRec->dgaSaves = NULL;
-    }
-
-    ret = (*pScreenPriv->SetDGAMode) (index, num, devRet);
-    if (ret != Success)
-        return ret;
-
-    if (num && devRet->pPix) {  /* accelerate this pixmap */
-        XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(devRet->pPix);
-        FBAreaPtr area;
-
-        if ((area = malloc(sizeof(FBArea)))) {
-            area->pScreen = pScreen;
-            area->box.x1 = 0;
-            area->box.x2 = 0;
-            area->box.y1 = devRet->mode->pixmapWidth;
-            area->box.y2 = devRet->mode->pixmapHeight;
-            area->granularity = 0;
-            area->MoveAreaCallback = 0;
-            area->RemoveAreaCallback = 0;
-            area->devPrivate.ptr = 0;
-
-            pixPriv->flags |= OFFSCREEN | DGA_PIXMAP;
-            pixPriv->offscreenArea = area;
-
-            if (!infoRec->dgaSaves) {   /* save pixmap cache state */
-                SavedCacheStatePtr state = malloc(sizeof(SavedCacheState));
-
-                state->UsingPixmapCache = infoRec->UsingPixmapCache;
-                state->CanDoColor8x8 = infoRec->CanDoColor8x8;
-                state->CanDoMono8x8 = infoRec->CanDoMono8x8;
-                infoRec->dgaSaves = (char *) state;
-
-                infoRec->UsingPixmapCache = FALSE;
-                if (infoRec->PixmapCacheFlags & CACHE_MONO_8x8)
-                    infoRec->CanDoMono8x8 = FALSE;
-                if (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8)
-                    infoRec->CanDoColor8x8 = FALSE;
-            }
-        }
-    }
-
-    return ret;
-}
-
-static void
-XAAEnableDisableFBAccess(int index, Bool enable)
-{
-    ScreenPtr pScreen = screenInfo.screens[index];
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    XAAScreenPtr pScreenPriv =
-        (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey);
-
-    if (!enable) {
-        if ((infoRec->Flags & OFFSCREEN_PIXMAPS) && (infoRec->OffscreenPixmaps))
-            XAAMoveOutOffscreenPixmaps(pScreen);
-        if (infoRec->Flags & PIXMAP_CACHE)
-            XAAInvalidatePixmapCache(pScreen);
-        SwitchedOut = TRUE;
-    }
-
-    (*pScreenPriv->EnableDisableFBAccess) (index, enable);
-
-    if (enable) {
-        if ((infoRec->Flags & OFFSCREEN_PIXMAPS) && (infoRec->OffscreenPixmaps))
-            XAAMoveInOffscreenPixmaps(pScreen);
-        SwitchedOut = FALSE;
-    }
-}
diff --git a/hw/xfree86/xaa/xaaInitAccel.c b/hw/xfree86/xaa/xaaInitAccel.c
deleted file mode 100644 (file)
index 2a85a19..0000000
+++ /dev/null
@@ -1,1571 +0,0 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <string.h>
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xf86fbman.h"
-#include "servermd.h"
-
-/*
- * XAA Config options
- */
-
-typedef enum {
-    XAAOPT_SCREEN_TO_SCREEN_COPY,
-    XAAOPT_SOLID_FILL_RECT,
-    XAAOPT_SOLID_FILL_TRAP,
-    XAAOPT_SOLID_TWO_POINT_LINE,
-    XAAOPT_SOLID_BRESENHAM_LINE,
-    XAAOPT_SOLID_HORVERT_LINE,
-    XAAOPT_DASHED_TWO_POINT_LINE,
-    XAAOPT_DASHED_BRESENHAM_LINE,
-    XAAOPT_MONO_8x8_PATTERN_FILL_RECT,
-    XAAOPT_MONO_8x8_PATTERN_FILL_TRAP,
-    XAAOPT_COL_8x8_PATTERN_FILL_RECT,
-    XAAOPT_COL_8x8_PATTERN_FILL_TRAP,
-    XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL,
-    XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL,
-    XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL,
-    XAAOPT_IMAGE_WRITE_RECT,
-    XAAOPT_SCANLINE_IMAGE_WRITE_RECT,
-    XAAOPT_WRITE_BITMAP,
-    XAAOPT_WRITE_PIXMAP,
-    XAAOPT_PIXMAP_CACHE,
-    XAAOPT_OFFSCREEN_PIXMAPS,
-    XAAOPT_HAS_DUMB_INVERTED_OPTION_SENSE
-} XAAOpts;
-
-static const OptionInfoRec XAAOptions[] = {
-    {XAAOPT_SCREEN_TO_SCREEN_COPY, "XaaNoScreenToScreenCopy",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_SOLID_FILL_RECT, "XaaNoSolidFillRect",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_SOLID_FILL_TRAP, "XaaNoSolidFillTrap",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_SOLID_TWO_POINT_LINE, "XaaNoSolidTwoPointLine",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_SOLID_BRESENHAM_LINE, "XaaNoSolidBresenhamLine",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_SOLID_HORVERT_LINE, "XaaNoSolidHorVertLine",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_DASHED_TWO_POINT_LINE, "XaaNoDashedTwoPointLine",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_DASHED_BRESENHAM_LINE, "XaaNoDashedBresenhamLine",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_MONO_8x8_PATTERN_FILL_RECT, "XaaNoMono8x8PatternFillRect",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_MONO_8x8_PATTERN_FILL_TRAP, "XaaNoMono8x8PatternFillTrap",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_COL_8x8_PATTERN_FILL_RECT, "XaaNoColor8x8PatternFillRect",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_COL_8x8_PATTERN_FILL_TRAP, "XaaNoColor8x8PatternFillTrap",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL, "XaaNoCPUToScreenColorExpandFill",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL,
-     "XaaNoScanlineCPUToScreenColorExpandFill",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL, "XaaNoScreenToScreenColorExpandFill",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_IMAGE_WRITE_RECT, "XaaNoImageWriteRect",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_SCANLINE_IMAGE_WRITE_RECT, "XaaNoScanlineImageWriteRect",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_WRITE_BITMAP, "XaaNoWriteBitmap",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_WRITE_PIXMAP, "XaaNoWritePixmap",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_PIXMAP_CACHE, "XaaNoPixmapCache",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_OFFSCREEN_PIXMAPS, "XaaNoOffscreenPixmaps",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {XAAOPT_HAS_DUMB_INVERTED_OPTION_SENSE, "XaaOffscreenPixmaps",
-     OPTV_BOOLEAN, {0}, FALSE},
-    {-1, NULL,
-     OPTV_NONE, {0}, FALSE}
-};
-
-static XF86ModuleVersionInfo xaaVersRec = {
-    "xaa",
-    MODULEVENDORSTRING,
-    MODINFOSTRING1,
-    MODINFOSTRING2,
-    XORG_VERSION_CURRENT,
-    XAA_VERSION_MAJOR,
-    XAA_VERSION_MINOR,
-    XAA_VERSION_RELEASE,
-    ABI_CLASS_VIDEODRV,         /* requires the video driver ABI */
-    ABI_VIDEODRV_VERSION,
-    MOD_CLASS_NONE,
-    {0, 0, 0, 0}
-};
-
-_X_EXPORT XF86ModuleData xaaModuleData = { &xaaVersRec, NULL, NULL };
-
-Bool
-XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
-{
-    int index = pScreen->myNum;
-    ScrnInfoPtr pScrn = xf86Screens[index];
-    Bool HaveScreenToScreenCopy = FALSE;
-    Bool HaveColorExpansion = FALSE;
-    Bool HaveScanlineColorExpansion = FALSE;
-    Bool HaveSolidFillRect = FALSE;
-    Bool HaveMono8x8PatternFillRect = FALSE;
-    Bool HaveColor8x8PatternFillRect = FALSE;
-    Bool HaveSolidFillTrap = FALSE;
-    Bool HaveMono8x8PatternFillTrap = FALSE;
-    Bool HaveColor8x8PatternFillTrap = FALSE;
-    Bool HaveSolidTwoPointLine = FALSE;
-    Bool HaveSolidBresenhamLine = FALSE;
-    Bool HaveSolidHorVertLine = FALSE;
-    Bool HaveDashedTwoPointLine = FALSE;
-    Bool HaveDashedBresenhamLine = FALSE;
-    Bool HaveImageWriteRect = FALSE;
-    Bool HaveScanlineImageWriteRect = FALSE;
-    Bool HaveScreenToScreenColorExpandFill = FALSE;
-    OptionInfoPtr options;
-    int is_shared = 0;
-    int i;
-
-    options = xnfalloc(sizeof(XAAOptions));
-    (void) memcpy(options, XAAOptions, sizeof(XAAOptions));
-    xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
-
-    infoRec->pScrn = pScrn;
-    infoRec->NeedToSync = FALSE;
-
-    /* must have a Sync function */
-    if (!infoRec->Sync)
-        return FALSE;
-    for (i = 0; i < pScrn->numEntities; i++) {
-        if (xf86IsEntityShared(pScrn->entityList[i]))
-            is_shared = 1;
-    }
-
-    /* If this PCI entity has IS_SHARED_ACCEL set in entityProp
-     * then a RestoreAccelState function is required
-     */
-    if (!infoRec->RestoreAccelState && is_shared)
-        return FALSE;
-
-    if (infoRec->RestoreAccelState) {
-        if (!XAAInitStateWrap(pScreen, infoRec))
-            return FALSE;
-    }
-
-    if (serverGeneration == 1)
-        xf86DrvMsg(index, X_INFO,
-                   "Using XFree86 Acceleration Architecture (XAA)\n");
-
-    /************** Low Level *************/
-
-    if (!infoRec->SetClippingRectangle || !infoRec->DisableClipping) {
-        infoRec->ClippingFlags = 0;
-        infoRec->SetClippingRectangle = NULL;
-        infoRec->DisableClipping = NULL;
-    }
-
-    /**** CopyArea ****/
-
-    if (infoRec->SetupForScreenToScreenCopy &&
-        infoRec->SubsequentScreenToScreenCopy &&
-        !xf86ReturnOptValBool(options, XAAOPT_SCREEN_TO_SCREEN_COPY, FALSE)) {
-        HaveScreenToScreenCopy = TRUE;
-    }
-    else {
-        infoRec->ScreenToScreenCopyFlags = 0;
-        infoRec->SetupForScreenToScreenCopy = NULL;
-        infoRec->SubsequentScreenToScreenCopy = NULL;
-    }
-
-    /**** Solid Filled Rects ****/
-
-    if (infoRec->SetupForSolidFill && infoRec->SubsequentSolidFillRect &&
-        !xf86ReturnOptValBool(options, XAAOPT_SOLID_FILL_RECT, FALSE)) {
-        HaveSolidFillRect = TRUE;
-        if (infoRec->SubsequentSolidFillTrap &&
-            !xf86ReturnOptValBool(options, XAAOPT_SOLID_FILL_TRAP, FALSE))
-            HaveSolidFillTrap = TRUE;
-        else
-            infoRec->SubsequentSolidFillTrap = NULL;
-    }
-    else {
-        infoRec->SolidFillFlags = 0;
-        infoRec->SetupForSolidFill = NULL;
-        infoRec->SubsequentSolidFillRect = NULL;
-        infoRec->SubsequentSolidFillTrap = NULL;
-    }
-
-    /**** Solid lines ****/
-
-    if (infoRec->SetupForSolidLine) {
-        if (infoRec->SubsequentSolidTwoPointLine &&
-            !xf86ReturnOptValBool(options, XAAOPT_SOLID_TWO_POINT_LINE, FALSE))
-            HaveSolidTwoPointLine = TRUE;
-        if (infoRec->SubsequentSolidBresenhamLine &&
-            !xf86ReturnOptValBool(options, XAAOPT_SOLID_BRESENHAM_LINE,
-                                  FALSE)) {
-            HaveSolidBresenhamLine = TRUE;
-
-            if (infoRec->SolidBresenhamLineErrorTermBits)
-                infoRec->SolidBresenhamLineErrorTermBits =
-                    ~((1 << infoRec->SolidBresenhamLineErrorTermBits) - 1);
-        }
-
-        if (infoRec->SubsequentSolidHorVertLine &&
-            !xf86ReturnOptValBool(options, XAAOPT_SOLID_HORVERT_LINE, FALSE))
-            HaveSolidHorVertLine = TRUE;
-        else if (HaveSolidTwoPointLine) {
-            infoRec->SubsequentSolidHorVertLine = XAASolidHorVertLineAsTwoPoint;
-            HaveSolidHorVertLine = TRUE;
-        }
-        else if (HaveSolidBresenhamLine) {
-            infoRec->SubsequentSolidHorVertLine =
-                XAASolidHorVertLineAsBresenham;
-            HaveSolidHorVertLine = TRUE;
-        }
-    }
-
-    /* XXX Should this also check for XAAOPT_SOLID_HORVERT_LINE? */
-    if (!HaveSolidTwoPointLine &&
-        !HaveSolidBresenhamLine && !HaveSolidHorVertLine && HaveSolidFillRect) {
-        infoRec->SetupForSolidLine = infoRec->SetupForSolidFill;
-        infoRec->SubsequentSolidHorVertLine = XAASolidHorVertLineAsRects;
-        infoRec->SolidLineFlags = infoRec->SolidFillFlags;
-        HaveSolidHorVertLine = TRUE;
-    }
-
-    if (!HaveSolidTwoPointLine)
-        infoRec->SubsequentSolidTwoPointLine = NULL;
-    if (!HaveSolidBresenhamLine)
-        infoRec->SubsequentSolidBresenhamLine = NULL;
-    if (!HaveSolidHorVertLine)
-        infoRec->SubsequentSolidHorVertLine = NULL;
-
-    /* Disable all if nothing left over */
-    if (!HaveSolidTwoPointLine &&
-        !HaveSolidBresenhamLine && !HaveSolidHorVertLine) {
-        infoRec->SolidLineFlags = 0;
-        infoRec->SetupForSolidLine = NULL;
-    }
-
-    /**** 8x8 Mono Pattern Filled Rects ****/
-
-    if (infoRec->SetupForMono8x8PatternFill &&
-        infoRec->SubsequentMono8x8PatternFillRect &&
-        !xf86ReturnOptValBool(options,
-                              XAAOPT_MONO_8x8_PATTERN_FILL_RECT, FALSE)) {
-        HaveMono8x8PatternFillRect = TRUE;
-        if (infoRec->SubsequentMono8x8PatternFillTrap &&
-            !xf86ReturnOptValBool(options,
-                                  XAAOPT_MONO_8x8_PATTERN_FILL_TRAP, FALSE))
-            HaveMono8x8PatternFillTrap = TRUE;
-
-        if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) {
-            infoRec->CanDoMono8x8 = TRUE;
-        }
-        else {                  /* others require caching */
-            int min_pitch;
-
-            infoRec->PixmapCacheFlags |= CACHE_MONO_8x8;
-
-            switch (pScrn->bitsPerPixel) {
-            case 32:
-                min_pitch = 2;
-                break;
-            case 24:
-                min_pitch = 3;
-                break;
-            case 16:
-                min_pitch = 4;
-                break;
-            default:
-                min_pitch = 8;
-                break;
-            }
-
-            if (min_pitch > infoRec->MonoPatternPitch)
-                infoRec->MonoPatternPitch = min_pitch;
-
-            if (infoRec->Mono8x8PatternFillFlags &
-                HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
-                if (!infoRec->CacheWidthMono8x8Pattern ||
-                    !infoRec->CacheHeightMono8x8Pattern) {
-                    infoRec->CacheWidthMono8x8Pattern =
-                        infoRec->MonoPatternPitch;
-                    infoRec->CacheHeightMono8x8Pattern = 1;
-                }
-            }
-            else {
-                int numPerLine = 128 / infoRec->MonoPatternPitch;
-
-                if (!infoRec->CacheWidthMono8x8Pattern ||
-                    !infoRec->CacheHeightMono8x8Pattern) {
-                    infoRec->CacheWidthMono8x8Pattern =
-                        numPerLine * infoRec->MonoPatternPitch;
-                    infoRec->CacheHeightMono8x8Pattern =
-                        (64 + numPerLine - 1) / numPerLine;
-                }
-            }
-        }
-    }
-    else {
-        infoRec->Mono8x8PatternFillFlags = 0;
-        infoRec->SetupForMono8x8PatternFill = NULL;
-        infoRec->SubsequentMono8x8PatternFillRect = NULL;
-    }
-
-    /**** Dashed lines ****/
-
-    if (infoRec->SetupForDashedLine && infoRec->DashPatternMaxLength) {
-        if (infoRec->SubsequentDashedTwoPointLine &&
-            !xf86ReturnOptValBool(options, XAAOPT_DASHED_TWO_POINT_LINE, FALSE))
-            HaveDashedTwoPointLine = TRUE;
-        if (infoRec->SubsequentDashedBresenhamLine &&
-            !xf86ReturnOptValBool(options, XAAOPT_DASHED_BRESENHAM_LINE,
-                                  FALSE)) {
-            HaveDashedBresenhamLine = TRUE;
-
-            if (infoRec->DashedBresenhamLineErrorTermBits)
-                infoRec->DashedBresenhamLineErrorTermBits =
-                    ~((1 << infoRec->DashedBresenhamLineErrorTermBits) - 1);
-        }
-    }
-
-    if (!HaveDashedTwoPointLine)
-        infoRec->SubsequentDashedTwoPointLine = NULL;
-    if (!HaveDashedBresenhamLine)
-        infoRec->SubsequentDashedBresenhamLine = NULL;
-
-    /* Disable all if nothing left over */
-    if (!HaveDashedTwoPointLine && !HaveDashedBresenhamLine) {
-        infoRec->DashedLineFlags = 0;
-        infoRec->SetupForDashedLine = NULL;
-    }
-
-    /**** 8x8 Color Pattern Filled Rects ****/
-
-    if (infoRec->SetupForColor8x8PatternFill &&
-        infoRec->SubsequentColor8x8PatternFillRect &&
-        !xf86ReturnOptValBool(options, XAAOPT_COL_8x8_PATTERN_FILL_RECT,
-                              FALSE)) {
-        HaveColor8x8PatternFillRect = TRUE;
-        if (infoRec->SubsequentColor8x8PatternFillTrap &&
-            !xf86ReturnOptValBool(options, XAAOPT_COL_8x8_PATTERN_FILL_TRAP,
-                                  FALSE))
-            HaveColor8x8PatternFillTrap = TRUE;
-        else
-            infoRec->SubsequentColor8x8PatternFillTrap = NULL;
-
-        infoRec->PixmapCacheFlags |= CACHE_COLOR_8x8;
-
-        if (infoRec->Color8x8PatternFillFlags &
-            HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
-            if (!infoRec->CacheWidthColor8x8Pattern ||
-                !infoRec->CacheHeightColor8x8Pattern) {
-                infoRec->CacheWidthColor8x8Pattern = 64;
-                infoRec->CacheHeightColor8x8Pattern = 1;
-            }
-        }
-        else {
-            if (!infoRec->CacheWidthColor8x8Pattern ||
-                !infoRec->CacheHeightColor8x8Pattern) {
-                infoRec->CacheWidthColor8x8Pattern = 128;
-                infoRec->CacheHeightColor8x8Pattern = 8;
-            }
-        }
-    }
-    else {
-        infoRec->Color8x8PatternFillFlags = 0;
-        infoRec->SetupForColor8x8PatternFill = NULL;
-        infoRec->SubsequentColor8x8PatternFillRect = NULL;
-        infoRec->SubsequentColor8x8PatternFillTrap = NULL;
-    }
-
-    /**** Color Expansion ****/
-
-    if (infoRec->SetupForCPUToScreenColorExpandFill &&
-        infoRec->ColorExpandBase &&
-        infoRec->SubsequentCPUToScreenColorExpandFill &&
-        !xf86ReturnOptValBool(options, XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL,
-                              FALSE)) {
-        int dwordsNeeded = pScrn->virtualX;
-
-        infoRec->ColorExpandRange >>= 2;        /* convert to DWORDS */
-        HaveColorExpansion = TRUE;
-
-        if (infoRec->CPUToScreenColorExpandFillFlags &
-            LEFT_EDGE_CLIPPING_NEGATIVE_X)
-            dwordsNeeded += 31;
-        dwordsNeeded = (dwordsNeeded + 31) >> 5;
-        if (dwordsNeeded > infoRec->ColorExpandRange)
-            infoRec->CPUToScreenColorExpandFillFlags |= CPU_TRANSFER_BASE_FIXED;
-    }
-    else {
-        infoRec->CPUToScreenColorExpandFillFlags = 0;
-        infoRec->SetupForCPUToScreenColorExpandFill = NULL;
-        infoRec->SubsequentCPUToScreenColorExpandFill = NULL;
-    }
-
-    /**** Scanline Color Expansion ****/
-
-    if (infoRec->SetupForScanlineCPUToScreenColorExpandFill &&
-        infoRec->SubsequentScanlineCPUToScreenColorExpandFill &&
-        infoRec->SubsequentColorExpandScanline &&
-        infoRec->ScanlineColorExpandBuffers &&
-        (infoRec->NumScanlineColorExpandBuffers > 0) &&
-        !xf86ReturnOptValBool(options,
-                              XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL,
-                              FALSE)) {
-        HaveScanlineColorExpansion = TRUE;
-    }
-    else {
-        infoRec->ScanlineCPUToScreenColorExpandFillFlags = 0;
-        infoRec->SetupForScanlineCPUToScreenColorExpandFill = NULL;
-        infoRec->SubsequentScanlineCPUToScreenColorExpandFill = NULL;
-        infoRec->SubsequentColorExpandScanline = NULL;
-    }
-
-    /**** Screen to Screen Color Expansion ****/
-
-    if (infoRec->SetupForScreenToScreenColorExpandFill &&
-        infoRec->SubsequentScreenToScreenColorExpandFill &&
-        !xf86ReturnOptValBool(options, XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL,
-                              FALSE)) {
-        HaveScreenToScreenColorExpandFill = TRUE;
-        if (!infoRec->CacheColorExpandDensity)
-            infoRec->CacheColorExpandDensity = 1;
-    }
-    else {
-        infoRec->ScreenToScreenColorExpandFillFlags = 0;
-        infoRec->SetupForScreenToScreenColorExpandFill = NULL;
-        infoRec->SubsequentScreenToScreenColorExpandFill = NULL;
-    }
-
-    /**** Image Writes ****/
-
-    if (infoRec->SetupForImageWrite && infoRec->ImageWriteBase &&
-        infoRec->SubsequentImageWriteRect &&
-        !xf86ReturnOptValBool(options, XAAOPT_IMAGE_WRITE_RECT, FALSE)) {
-
-        infoRec->ImageWriteRange >>= 2; /* convert to DWORDS */
-        if (infoRec->ImageWriteFlags & CPU_TRANSFER_BASE_FIXED)
-            infoRec->ImageWriteRange = 0;
-        HaveImageWriteRect = TRUE;
-    }
-    else {
-        infoRec->ImageWriteFlags = 0;
-        infoRec->SetupForImageWrite = NULL;
-        infoRec->SubsequentImageWriteRect = NULL;
-    }
-
-    /**** Scanline Image Writes ****/
-
-    if (infoRec->SetupForScanlineImageWrite &&
-        infoRec->SubsequentScanlineImageWriteRect &&
-        infoRec->SubsequentImageWriteScanline &&
-        infoRec->ScanlineImageWriteBuffers &&
-        (infoRec->NumScanlineImageWriteBuffers > 0) &&
-        !xf86ReturnOptValBool(options, XAAOPT_SCANLINE_IMAGE_WRITE_RECT,
-                              FALSE)) {
-        HaveScanlineImageWriteRect = TRUE;
-    }
-    else {
-        infoRec->ScanlineImageWriteFlags = 0;
-        infoRec->SetupForScanlineImageWrite = NULL;
-        infoRec->SubsequentScanlineImageWriteRect = NULL;
-        infoRec->SubsequentImageWriteScanline = NULL;
-    }
-
-#ifndef __i386__
-    /* XAA makes some unaligned accesses when clipping is not available */
-#define CLIP_FLAGS (LEFT_EDGE_CLIPPING | LEFT_EDGE_CLIPPING_NEGATIVE_X)
-    if (HaveImageWriteRect &&
-        ((infoRec->ImageWriteFlags & CLIP_FLAGS) != CLIP_FLAGS)) {
-        HaveImageWriteRect = FALSE;
-    }
-    if (HaveScanlineImageWriteRect &&
-        ((infoRec->ScanlineImageWriteFlags & CLIP_FLAGS) != CLIP_FLAGS)) {
-        HaveScanlineImageWriteRect = FALSE;
-    }
-#endif
-
-    if (serverGeneration == 1) {
-        if (HaveScreenToScreenCopy)
-            xf86ErrorF("\tScreen to screen bit blits\n");
-        if (HaveSolidFillRect)
-            xf86ErrorF("\tSolid filled rectangles\n");
-        if (HaveSolidFillTrap)
-            xf86ErrorF("\tSolid filled trapezoids\n");
-        if (HaveMono8x8PatternFillRect)
-            xf86ErrorF("\t8x8 mono pattern filled rectangles\n");
-        if (HaveMono8x8PatternFillTrap)
-            xf86ErrorF("\t8x8 mono pattern filled trapezoids\n");
-        if (HaveColor8x8PatternFillRect)
-            xf86ErrorF("\t8x8 color pattern filled rectangles\n");
-        if (HaveColor8x8PatternFillTrap)
-            xf86ErrorF("\t8x8 color pattern filled trapezoids\n");
-
-        if (HaveColorExpansion)
-            xf86ErrorF("\tCPU to Screen color expansion\n");
-        else if (HaveScanlineColorExpansion)
-            xf86ErrorF("\tIndirect CPU to Screen color expansion\n");
-
-        if (HaveScreenToScreenColorExpandFill)
-            xf86ErrorF("\tScreen to Screen color expansion\n");
-
-        if (HaveSolidTwoPointLine || HaveSolidBresenhamLine)
-            xf86ErrorF("\tSolid Lines\n");
-        else if (HaveSolidHorVertLine)
-            xf86ErrorF("\tSolid Horizontal and Vertical Lines\n");
-
-        if (HaveDashedTwoPointLine || HaveDashedBresenhamLine)
-            xf86ErrorF("\tDashed Lines\n");
-
-        if (HaveImageWriteRect)
-            xf86ErrorF("\tImage Writes\n");
-        else if (HaveScanlineImageWriteRect)
-            xf86ErrorF("\tScanline Image Writes\n");
-
-    }
-
-#define XAAMSG(s) do { if (serverGeneration == 1) xf86ErrorF(s); } while (0)
-
-    if ((infoRec->Flags & OFFSCREEN_PIXMAPS) && HaveScreenToScreenCopy &&
-        xf86ReturnOptValBool(options,
-                             XAAOPT_HAS_DUMB_INVERTED_OPTION_SENSE, FALSE)) {
-        XAAMSG("\tOffscreen Pixmaps\n");
-    }
-    else {
-        infoRec->Flags &= ~OFFSCREEN_PIXMAPS;
-    }
-
-    /************** Mid Level *************/
-
-    /**** ScreenToScreenBitBlt ****/
-
-    if (infoRec->ScreenToScreenBitBlt) {
-        XAAMSG("\tDriver provided ScreenToScreenBitBlt replacement\n");
-    }
-    else if (HaveScreenToScreenCopy) {
-        infoRec->ScreenToScreenBitBlt = XAAScreenToScreenBitBlt;
-        infoRec->ScreenToScreenBitBltFlags = infoRec->ScreenToScreenCopyFlags;
-    }
-
-    /**** FillSolidRects ****/
-
-    if (infoRec->FillSolidRects) {
-        XAAMSG("\tDriver provided FillSolidRects replacement\n");
-    }
-    else if (HaveSolidFillRect) {
-        infoRec->FillSolidRects = XAAFillSolidRects;
-        infoRec->FillSolidRectsFlags = infoRec->SolidFillFlags;
-    }
-
-    /**** FillSolidSpans ****/
-
-    if (infoRec->FillSolidSpans) {
-        XAAMSG("\tDriver provided FillSolidSpans replacement\n");
-    }
-    else if (HaveSolidFillRect) {
-        infoRec->FillSolidSpans = XAAFillSolidSpans;
-        infoRec->FillSolidSpansFlags = infoRec->SolidFillFlags;
-    }
-
-    /**** FillMono8x8PatternRects ****/
-
-    if (infoRec->FillMono8x8PatternRects) {
-        XAAMSG("\tDriver provided FillMono8x8PatternRects replacement\n");
-    }
-    else if (HaveMono8x8PatternFillRect) {
-        infoRec->FillMono8x8PatternRects =
-            (infoRec->
-             Mono8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
-            XAAFillMono8x8PatternRectsScreenOrigin : XAAFillMono8x8PatternRects;
-
-        infoRec->FillMono8x8PatternRectsFlags =
-            infoRec->Mono8x8PatternFillFlags;
-    }
-
-    /**** FillMono8x8PatternSpans ****/
-
-    if (infoRec->FillMono8x8PatternSpans) {
-        XAAMSG("\tDriver provided FillMono8x8PatternSpans replacement\n");
-    }
-    else if (HaveMono8x8PatternFillRect) {
-        infoRec->FillMono8x8PatternSpans =
-            (infoRec->
-             Mono8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
-            XAAFillMono8x8PatternSpansScreenOrigin : XAAFillMono8x8PatternSpans;
-
-        infoRec->FillMono8x8PatternSpansFlags =
-            infoRec->Mono8x8PatternFillFlags;
-    }
-
-    /**** FillColor8x8Rects ****/
-
-    if (infoRec->FillColor8x8PatternRects) {
-        XAAMSG("\tDriver provided FillColor8x8PatternRects replacement\n");
-    }
-    else if (HaveColor8x8PatternFillRect) {
-        infoRec->FillColor8x8PatternRects =
-            (infoRec->
-             Color8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
-            XAAFillColor8x8PatternRectsScreenOrigin :
-            XAAFillColor8x8PatternRects;
-
-        infoRec->FillColor8x8PatternRectsFlags =
-            infoRec->Color8x8PatternFillFlags;
-    }
-
-    /**** FillColor8x8Spans ****/
-
-    if (infoRec->FillColor8x8PatternSpans) {
-        XAAMSG("\tDriver provided FillColor8x8PatternSpans replacement\n");
-    }
-    else if (HaveColor8x8PatternFillRect) {
-        infoRec->FillColor8x8PatternSpans =
-            (infoRec->
-             Color8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
-            XAAFillColor8x8PatternSpansScreenOrigin :
-            XAAFillColor8x8PatternSpans;
-
-        infoRec->FillColor8x8PatternSpansFlags =
-            infoRec->Color8x8PatternFillFlags;
-    }
-
-    /**** FillCacheBltRects ****/
-
-    if (infoRec->FillCacheBltRects) {
-        XAAMSG("\tDriver provided FillCacheBltRects replacement\n");
-    }
-    else if (HaveScreenToScreenCopy) {
-        infoRec->FillCacheBltRects = XAAFillCacheBltRects;
-        infoRec->FillCacheBltRectsFlags = infoRec->ScreenToScreenCopyFlags;
-    }
-
-    /**** FillCacheBltSpans ****/
-
-    if (infoRec->FillCacheBltSpans) {
-        XAAMSG("\tDriver provided FillCacheBltSpans replacement\n");
-    }
-    else if (HaveScreenToScreenCopy) {
-        infoRec->FillCacheBltSpans = XAAFillCacheBltSpans;
-        infoRec->FillCacheBltSpansFlags = infoRec->ScreenToScreenCopyFlags;
-    }
-
-    /**** FillCacheExpandRects ****/
-
-    if (infoRec->FillCacheExpandRects) {
-        XAAMSG("\tDriver provided FillCacheExpandRects replacement\n");
-    }
-    else if (HaveScreenToScreenColorExpandFill) {
-        infoRec->FillCacheExpandRects = XAAFillCacheExpandRects;
-        infoRec->FillCacheExpandRectsFlags =
-            infoRec->ScreenToScreenColorExpandFillFlags;
-    }
-
-    /**** FillCacheExpandSpans ****/
-
-    if (infoRec->FillCacheExpandSpans) {
-        XAAMSG("\tDriver provided FillCacheExpandSpans replacement\n");
-    }
-    else if (HaveScreenToScreenColorExpandFill) {
-        infoRec->FillCacheExpandSpans = XAAFillCacheExpandSpans;
-        infoRec->FillCacheExpandSpansFlags =
-            infoRec->ScreenToScreenColorExpandFillFlags;
-    }
-
-    /**** FillColorExpandRects ****/
-
-    if (infoRec->FillColorExpandRects) {
-        XAAMSG("\tDriver provided FillColorExpandRects replacement\n");
-    }
-    else if (HaveColorExpansion) {
-        if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) {
-            if (infoRec->CPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST) {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->FillColorExpandRects =
-                        XAAFillColorExpandRects3MSBFirstFixedBase;
-                else
-                    infoRec->FillColorExpandRects =
-                        XAAFillColorExpandRects3MSBFirst;
-            }
-            else {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->FillColorExpandRects =
-                        XAAFillColorExpandRects3LSBFirstFixedBase;
-                else
-                    infoRec->FillColorExpandRects =
-                        XAAFillColorExpandRects3LSBFirst;
-            }
-        }
-        else {
-            if (infoRec->CPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST) {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->FillColorExpandRects =
-                        XAAFillColorExpandRectsMSBFirstFixedBase;
-                else
-                    infoRec->FillColorExpandRects =
-                        XAAFillColorExpandRectsMSBFirst;
-            }
-            else {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->FillColorExpandRects =
-                        XAAFillColorExpandRectsLSBFirstFixedBase;
-                else
-                    infoRec->FillColorExpandRects =
-                        XAAFillColorExpandRectsLSBFirst;
-            }
-        }
-        infoRec->FillColorExpandRectsFlags =
-            infoRec->CPUToScreenColorExpandFillFlags;
-    }
-    else if (HaveScanlineColorExpansion) {
-        if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-            TRIPLE_BITS_24BPP) {
-            if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST)
-                infoRec->FillColorExpandRects =
-                    XAAFillScanlineColorExpandRects3MSBFirst;
-            else
-                infoRec->FillColorExpandRects =
-                    XAAFillScanlineColorExpandRects3LSBFirst;
-        }
-        else {
-            if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST)
-                infoRec->FillColorExpandRects =
-                    XAAFillScanlineColorExpandRectsMSBFirst;
-            else
-                infoRec->FillColorExpandRects =
-                    XAAFillScanlineColorExpandRectsLSBFirst;
-        }
-        infoRec->FillColorExpandRectsFlags =
-            infoRec->ScanlineCPUToScreenColorExpandFillFlags;
-    }
-
-    /**** FillColorExpandSpans ****/
-
-    if (infoRec->FillColorExpandSpans) {
-        XAAMSG("\tDriver provided FillColorExpandSpans replacement\n");
-    }
-    else if (HaveColorExpansion) {
-        if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) {
-            if (infoRec->CPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST) {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->FillColorExpandSpans =
-                        XAAFillColorExpandSpans3MSBFirstFixedBase;
-                else
-                    infoRec->FillColorExpandSpans =
-                        XAAFillColorExpandSpans3MSBFirst;
-            }
-            else {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->FillColorExpandSpans =
-                        XAAFillColorExpandSpans3LSBFirstFixedBase;
-                else
-                    infoRec->FillColorExpandSpans =
-                        XAAFillColorExpandSpans3LSBFirst;
-            }
-        }
-        else {
-            if (infoRec->CPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST) {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->FillColorExpandSpans =
-                        XAAFillColorExpandSpansMSBFirstFixedBase;
-                else
-                    infoRec->FillColorExpandSpans =
-                        XAAFillColorExpandSpansMSBFirst;
-            }
-            else {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->FillColorExpandSpans =
-                        XAAFillColorExpandSpansLSBFirstFixedBase;
-                else
-                    infoRec->FillColorExpandSpans =
-                        XAAFillColorExpandSpansLSBFirst;
-            }
-        }
-        infoRec->FillColorExpandSpansFlags =
-            infoRec->CPUToScreenColorExpandFillFlags;
-    }
-    else if (HaveScanlineColorExpansion) {
-        if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-            TRIPLE_BITS_24BPP) {
-            if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST)
-                infoRec->FillColorExpandSpans =
-                    XAAFillScanlineColorExpandSpans3MSBFirst;
-            else
-                infoRec->FillColorExpandSpans =
-                    XAAFillScanlineColorExpandSpans3LSBFirst;
-        }
-        else {
-            if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST)
-                infoRec->FillColorExpandSpans =
-                    XAAFillScanlineColorExpandSpansMSBFirst;
-            else
-                infoRec->FillColorExpandSpans =
-                    XAAFillScanlineColorExpandSpansLSBFirst;
-        }
-        infoRec->FillColorExpandSpansFlags =
-            infoRec->ScanlineCPUToScreenColorExpandFillFlags;
-    }
-
-    /**** FillImageWriteRects ****/
-
-    if (infoRec->FillImageWriteRects) {
-        XAAMSG("\tDriver provided FillImageWriteRects replacement\n");
-    }
-    else if (HaveImageWriteRect &&
-             (infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
-             (infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING)) {
-        infoRec->FillImageWriteRects = XAAFillImageWriteRects;
-        infoRec->FillImageWriteRectsFlags = infoRec->ImageWriteFlags;
-    }
-
-    /**** WriteBitmap ****/
-
-    if (infoRec->WriteBitmap &&
-        !xf86ReturnOptValBool(options, XAAOPT_WRITE_BITMAP, FALSE)) {
-        XAAMSG("\tDriver provided WriteBitmap replacement\n");
-    }
-    else if (HaveColorExpansion) {
-        if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) {
-            if (infoRec->CPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST) {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->WriteBitmap =
-                        XAAWriteBitmapColorExpand3MSBFirstFixedBase;
-                else
-                    infoRec->WriteBitmap = XAAWriteBitmapColorExpand3MSBFirst;
-            }
-            else {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->WriteBitmap =
-                        XAAWriteBitmapColorExpand3LSBFirstFixedBase;
-                else
-                    infoRec->WriteBitmap = XAAWriteBitmapColorExpand3LSBFirst;
-            }
-        }
-        else {
-            if (infoRec->CPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST) {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->WriteBitmap =
-                        XAAWriteBitmapColorExpandMSBFirstFixedBase;
-                else
-                    infoRec->WriteBitmap = XAAWriteBitmapColorExpandMSBFirst;
-            }
-            else {
-                if (infoRec->CPUToScreenColorExpandFillFlags &
-                    CPU_TRANSFER_BASE_FIXED)
-                    infoRec->WriteBitmap =
-                        XAAWriteBitmapColorExpandLSBFirstFixedBase;
-                else
-                    infoRec->WriteBitmap = XAAWriteBitmapColorExpandLSBFirst;
-            }
-        }
-        infoRec->WriteBitmapFlags = infoRec->CPUToScreenColorExpandFillFlags;
-    }
-    else if (HaveScanlineColorExpansion) {
-        if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-            TRIPLE_BITS_24BPP) {
-            if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST)
-                infoRec->WriteBitmap =
-                    XAAWriteBitmapScanlineColorExpand3MSBFirst;
-            else
-                infoRec->WriteBitmap =
-                    XAAWriteBitmapScanlineColorExpand3LSBFirst;
-        }
-        else {
-            if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
-                BIT_ORDER_IN_BYTE_MSBFIRST)
-                infoRec->WriteBitmap =
-                    XAAWriteBitmapScanlineColorExpandMSBFirst;
-            else
-                infoRec->WriteBitmap =
-                    XAAWriteBitmapScanlineColorExpandLSBFirst;
-        }
-        infoRec->WriteBitmapFlags =
-            infoRec->ScanlineCPUToScreenColorExpandFillFlags;
-    }
-    else
-        infoRec->WriteBitmap = NULL;
-
-    /**** TE Glyphs ****/
-
-    if (infoRec->TEGlyphRenderer) {
-        XAAMSG("\tDriver provided TEGlyphRenderer replacement\n");
-    }
-    else if (HaveColorExpansion) {
-        infoRec->TEGlyphRendererFlags =
-            infoRec->CPUToScreenColorExpandFillFlags;
-
-        if (infoRec->TEGlyphRendererFlags & TRIPLE_BITS_24BPP) {
-            if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
-                if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
-                    infoRec->TEGlyphRenderer =
-                        XAATEGlyphRenderer3MSBFirstFixedBase;
-                else
-                    infoRec->TEGlyphRenderer = XAATEGlyphRenderer3MSBFirst;
-            }
-            else {
-                if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
-                    infoRec->TEGlyphRenderer =
-                        XAATEGlyphRenderer3LSBFirstFixedBase;
-                else
-                    infoRec->TEGlyphRenderer = XAATEGlyphRenderer3LSBFirst;
-            }
-
-            if (!HaveSolidFillRect &&
-                (infoRec->TEGlyphRendererFlags & RGB_EQUAL)) {
-                infoRec->TEGlyphRendererFlags &= ~RGB_EQUAL;
-                XAAMSG("WARNING:  TEGlyphRenderer cannot support RGB_EQUAL"
-                       " without solid fills\n");
-            }
-        }
-        else {
-            if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
-                if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
-                    infoRec->TEGlyphRenderer =
-                        XAATEGlyphRendererMSBFirstFixedBase;
-                else
-                    infoRec->TEGlyphRenderer = XAATEGlyphRendererMSBFirst;
-            }
-            else {
-                if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
-                    infoRec->TEGlyphRenderer =
-                        XAATEGlyphRendererLSBFirstFixedBase;
-                else
-                    infoRec->TEGlyphRenderer = XAATEGlyphRendererLSBFirst;
-            }
-        }
-
-        if (!HaveSolidFillRect &&
-            (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
-            infoRec->TEGlyphRendererFlags &= ~TRANSPARENCY_ONLY;
-            XAAMSG("WARNING:  TEGlyphRenderer cannot support TRANPARENCY_ONLY"
-                   " without solid fills\n");
-        }
-
-    }
-    else if (HaveScanlineColorExpansion) {
-        infoRec->TEGlyphRendererFlags =
-            infoRec->ScanlineCPUToScreenColorExpandFillFlags;
-
-        if (infoRec->TEGlyphRendererFlags & TRIPLE_BITS_24BPP) {
-            if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST)
-                infoRec->TEGlyphRenderer = XAATEGlyphRendererScanline3MSBFirst;
-            else
-                infoRec->TEGlyphRenderer = XAATEGlyphRendererScanline3LSBFirst;
-
-            if (!HaveSolidFillRect &&
-                (infoRec->TEGlyphRendererFlags & RGB_EQUAL)) {
-                infoRec->TEGlyphRendererFlags &= ~RGB_EQUAL;
-                XAAMSG("WARNING:  TEGlyphRenderer cannot support RGB_EQUAL"
-                       " without solid fills\n");
-            }
-        }
-        else {
-            if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST)
-                infoRec->TEGlyphRenderer = XAATEGlyphRendererScanlineMSBFirst;
-            else
-                infoRec->TEGlyphRenderer = XAATEGlyphRendererScanlineLSBFirst;
-        }
-
-        if (!HaveSolidFillRect &&
-            (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
-            infoRec->TEGlyphRendererFlags &= ~TRANSPARENCY_ONLY;
-            XAAMSG("WARNING:  TEGlyphRenderer cannot support TRANPARENCY_ONLY"
-                   " without solid fills\n");
-        }
-    }
-
-    /**** NonTE Glyphs ****/
-
-    if (infoRec->NonTEGlyphRenderer) {
-        XAAMSG("\tDriver provided NonTEGlyphRenderer replacement\n");
-    }
-    else if (infoRec->WriteBitmap &&
-             !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY)) {
-        infoRec->NonTEGlyphRenderer = XAANonTEGlyphRenderer;
-        infoRec->NonTEGlyphRendererFlags = infoRec->WriteBitmapFlags;
-    }
-
-    /**** WritePixmap ****/
-
-    if (infoRec->WritePixmap &&
-        !xf86ReturnOptValBool(options, XAAOPT_WRITE_PIXMAP, FALSE)) {
-        XAAMSG("\tDriver provided WritePixmap replacement\n");
-    }
-    else if (HaveImageWriteRect) {
-        infoRec->WritePixmap = XAAWritePixmap;
-        infoRec->WritePixmapFlags =
-            infoRec->ImageWriteFlags | CONVERT_32BPP_TO_24BPP;
-    }
-    else if (HaveScanlineImageWriteRect) {
-        infoRec->WritePixmap = XAAWritePixmapScanline;
-        infoRec->WritePixmapFlags = infoRec->ScanlineImageWriteFlags;
-    }
-    else
-        infoRec->WritePixmap = NULL;
-
-    /**** ReadPixmap ****/
-
-    if (infoRec->ReadPixmap) {
-        XAAMSG("\tDriver provided ReadPixmap replacement\n");
-    }
-
-    /************** GC Level *************/
-
-    /**** CopyArea ****/
-
-    if (infoRec->CopyArea) {
-        XAAMSG("\tDriver provided GC level CopyArea replacement\n");
-    }
-    else if (infoRec->ScreenToScreenBitBlt) {
-        infoRec->CopyArea = XAACopyArea;
-        infoRec->CopyAreaFlags = infoRec->ScreenToScreenBitBltFlags;
-
-        /* most GC level primitives use one mid-level primitive so
-           the GC level primitive gets the mid-level primitive flag
-           and we use that at GC validation time.  But CopyArea uses
-           more than one mid-level primitive so we have to essentially
-           do a GC validation every time that primitive is used.
-           The CopyAreaFlags would only be used for filtering out the
-           common denominators.  Here we assume that if you don't do
-           ScreenToScreenBitBlt you aren't going to do the others.
-           We also assume that ScreenToScreenBitBlt has the least
-           restrictions. */
-    }
-
-    if (infoRec->CopyPlane) {
-        XAAMSG("\tDriver provided GC level CopyPlane replacement\n");
-    }
-    else if (infoRec->WriteBitmap &&
-             !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)) {
-        infoRec->CopyPlane = XAACopyPlaneColorExpansion;
-        infoRec->CopyPlaneFlags = infoRec->WriteBitmapFlags;
-    }
-
-    if (infoRec->PushPixelsSolid) {
-        XAAMSG("\tDriver provided GC level PushPixelsSolid replacement\n");
-    }
-    else if (infoRec->WriteBitmap &&
-             !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY)) {
-        infoRec->PushPixelsSolid = XAAPushPixelsSolidColorExpansion;
-        infoRec->PushPixelsFlags = infoRec->WriteBitmapFlags;
-    }
-
-    if (infoRec->FillSolidRects) {
-        if (!infoRec->PolyFillRectSolid) {
-            infoRec->PolyFillRectSolid = XAAPolyFillRect;
-            infoRec->PolyFillRectSolidFlags = infoRec->FillSolidRectsFlags;
-        }
-    }
-    if (infoRec->FillSolidSpans) {
-        if (!infoRec->FillSpansSolid) {
-            infoRec->FillSpansSolid = XAAFillSpans;
-            infoRec->FillSpansSolidFlags = infoRec->FillSolidSpansFlags;
-        }
-    }
-
-    if (infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects ||
-        infoRec->FillCacheBltRects || infoRec->FillColorExpandRects ||
-        infoRec->FillCacheExpandRects) {
-        if (!infoRec->PolyFillRectStippled) {
-
-            infoRec->PolyFillRectStippled = XAAPolyFillRect;
-            infoRec->PolyFillRectStippledFlags = 0;
-        }
-    }
-
-    if (infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans ||
-        infoRec->FillCacheBltSpans || infoRec->FillColorExpandSpans ||
-        infoRec->FillCacheExpandSpans) {
-        if (!infoRec->FillSpansStippled) {
-
-            infoRec->FillSpansStippled = XAAFillSpans;
-            infoRec->FillSpansStippledFlags = 0;
-        }
-    }
-
-    if (infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects ||
-        infoRec->FillCacheBltRects || infoRec->FillColorExpandRects ||
-        infoRec->FillCacheExpandRects) {
-        if (!infoRec->PolyFillRectOpaqueStippled) {
-
-            infoRec->PolyFillRectOpaqueStippled = XAAPolyFillRect;
-            infoRec->PolyFillRectOpaqueStippledFlags = 0;
-        }
-    }
-
-    if (infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans ||
-        infoRec->FillCacheBltSpans || infoRec->FillColorExpandSpans ||
-        infoRec->FillCacheExpandSpans) {
-        if (!infoRec->FillSpansOpaqueStippled) {
-
-            infoRec->FillSpansOpaqueStippled = XAAFillSpans;
-            infoRec->FillSpansOpaqueStippledFlags = 0;
-        }
-    }
-
-    if (infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects ||
-        infoRec->FillCacheBltRects || infoRec->FillImageWriteRects) {
-        if (!infoRec->PolyFillRectTiled) {
-
-            infoRec->PolyFillRectTiled = XAAPolyFillRect;
-            infoRec->PolyFillRectTiledFlags = 0;
-        }
-    }
-
-    if (infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans ||
-        infoRec->FillCacheBltSpans) {
-        if (!infoRec->FillSpansTiled) {
-
-            infoRec->FillSpansTiled = XAAFillSpans;
-            infoRec->FillSpansTiledFlags = 0;
-        }
-    }
-
-    if (infoRec->TEGlyphRenderer &&
-        !(infoRec->TEGlyphRendererFlags & NO_TRANSPARENCY)) {
-
-        if (!infoRec->PolyText8TE) {
-            infoRec->PolyText8TE = XAAPolyText8TEColorExpansion;
-            infoRec->PolyText8TEFlags = infoRec->TEGlyphRendererFlags;
-        }
-
-        if (!infoRec->PolyText16TE) {
-            infoRec->PolyText16TE = XAAPolyText16TEColorExpansion;
-            infoRec->PolyText16TEFlags = infoRec->TEGlyphRendererFlags;
-        }
-
-        if (!infoRec->PolyGlyphBltTE) {
-            infoRec->PolyGlyphBltTE = XAAPolyGlyphBltTEColorExpansion;
-            infoRec->PolyGlyphBltTEFlags = infoRec->TEGlyphRendererFlags;
-        }
-    }
-
-    if (infoRec->TEGlyphRenderer &&
-        !(infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
-
-        if (!infoRec->ImageText8TE) {
-            infoRec->ImageText8TE = XAAImageText8TEColorExpansion;
-            infoRec->ImageText8TEFlags = infoRec->TEGlyphRendererFlags;
-        }
-
-        if (!infoRec->ImageText16TE) {
-            infoRec->ImageText16TE = XAAImageText16TEColorExpansion;
-            infoRec->ImageText16TEFlags = infoRec->TEGlyphRendererFlags;
-        }
-
-        if (!infoRec->ImageGlyphBltTE) {
-            infoRec->ImageGlyphBltTE = XAAImageGlyphBltTEColorExpansion;
-            infoRec->ImageGlyphBltTEFlags = infoRec->TEGlyphRendererFlags;
-        }
-    }
-
-    if (infoRec->NonTEGlyphRenderer) {
-        if (!infoRec->PolyText8NonTE) {
-            infoRec->PolyText8NonTE = XAAPolyText8NonTEColorExpansion;
-            infoRec->PolyText8NonTEFlags = infoRec->NonTEGlyphRendererFlags;
-        }
-
-        if (!infoRec->PolyText16NonTE) {
-            infoRec->PolyText16NonTE = XAAPolyText16NonTEColorExpansion;
-            infoRec->PolyText16NonTEFlags = infoRec->NonTEGlyphRendererFlags;
-        }
-        if (!infoRec->PolyGlyphBltNonTE) {
-            infoRec->PolyGlyphBltNonTE = XAAPolyGlyphBltNonTEColorExpansion;
-            infoRec->PolyGlyphBltNonTEFlags = infoRec->NonTEGlyphRendererFlags;
-        }
-    }
-
-    if (infoRec->NonTEGlyphRenderer && HaveSolidFillRect) {
-        if (!infoRec->ImageText8NonTE) {
-            infoRec->ImageText8NonTE = XAAImageText8NonTEColorExpansion;
-            infoRec->ImageText8NonTEFlags = infoRec->NonTEGlyphRendererFlags;
-        }
-
-        if (!infoRec->ImageText16NonTE) {
-            infoRec->ImageText16NonTE = XAAImageText16NonTEColorExpansion;
-            infoRec->ImageText16NonTEFlags = infoRec->NonTEGlyphRendererFlags;
-        }
-
-        if (!infoRec->ImageGlyphBltNonTE) {
-            infoRec->ImageGlyphBltNonTE = XAAImageGlyphBltNonTEColorExpansion;
-            infoRec->ImageGlyphBltNonTEFlags = infoRec->NonTEGlyphRendererFlags;
-        }
-    }
-
-    if (!infoRec->PolyRectangleThinSolid && HaveSolidHorVertLine) {
-        infoRec->PolyRectangleThinSolid = XAAPolyRectangleThinSolid;
-        infoRec->PolyRectangleThinSolidFlags = infoRec->SolidLineFlags;
-    }
-
-    if (!infoRec->FillPolygonSolid && HaveSolidFillRect) {
-        infoRec->FillPolygonSolid = XAAFillPolygonSolid;
-        infoRec->FillPolygonSolidFlags = infoRec->SolidFillFlags;
-    }
-
-    if (!infoRec->FillPolygonStippled && (HaveMono8x8PatternFillRect ||
-                                          HaveScreenToScreenColorExpandFill ||
-                                          HaveScreenToScreenCopy)) {
-        infoRec->FillPolygonStippled = XAAFillPolygonStippled;
-        infoRec->FillPolygonStippledFlags = infoRec->SolidFillFlags;
-    }
-
-    if (!infoRec->FillPolygonOpaqueStippled && (HaveMono8x8PatternFillRect ||
-                                                HaveScreenToScreenColorExpandFill
-                                                || HaveScreenToScreenCopy)) {
-        infoRec->FillPolygonOpaqueStippled = XAAFillPolygonStippled;
-        infoRec->FillPolygonOpaqueStippledFlags = infoRec->SolidFillFlags;
-    }
-
-    if (!infoRec->FillPolygonTiled && (HaveMono8x8PatternFillRect ||
-                                       HaveScreenToScreenColorExpandFill ||
-                                       HaveScreenToScreenCopy)) {
-        infoRec->FillPolygonTiled = XAAFillPolygonTiled;
-        infoRec->FillPolygonTiledFlags = infoRec->SolidFillFlags;
-    }
-
-    if (!infoRec->PolyFillArcSolid && HaveSolidFillRect) {
-        infoRec->PolyFillArcSolid = XAAPolyFillArcSolid;
-        infoRec->PolyFillArcSolidFlags = infoRec->SolidFillFlags;
-    }
-
-    if (!infoRec->PolylinesWideSolid && HaveSolidFillRect) {
-        infoRec->PolylinesWideSolid = XAAPolylinesWideSolid;
-        infoRec->PolylinesWideSolidFlags =
-            infoRec->SolidFillFlags | GXCOPY_ONLY;
-    }
-
-    if (!infoRec->PutImage && (infoRec->WritePixmap ||
-                               (infoRec->WriteBitmap &&
-                                !(infoRec->
-                                  WriteBitmapFlags & TRANSPARENCY_ONLY)))) {
-        infoRec->PutImage = XAAPutImage;
-
-        /* See comment for CopyArea above.  But here we make fewer 
-           assumptions.  The driver can provide the PutImageFlags if
-           it wants too */
-    }
-
-    if (HaveSolidHorVertLine &&
-        (HaveSolidBresenhamLine || (HaveSolidTwoPointLine &&
-                                    (infoRec->
-                                     ClippingFlags &
-                                     HARDWARE_CLIP_SOLID_LINE)))) {
-        if (!infoRec->PolylinesThinSolid) {
-            infoRec->PolylinesThinSolid = XAAPolyLines;
-            infoRec->PolylinesThinSolidFlags = infoRec->SolidLineFlags;
-        }
-        if (!infoRec->PolySegmentThinSolid) {
-            infoRec->PolySegmentThinSolid = XAAPolySegment;
-            infoRec->PolySegmentThinSolidFlags = infoRec->SolidLineFlags;
-        }
-    }
-
-    if (HaveDashedBresenhamLine || (HaveDashedTwoPointLine &&
-                                    (infoRec->
-                                     ClippingFlags &
-                                     HARDWARE_CLIP_DASHED_LINE))) {
-        if (!infoRec->PolylinesThinDashed) {
-            infoRec->PolylinesThinDashed = XAAPolyLinesDashed;
-            infoRec->PolylinesThinDashedFlags = infoRec->DashedLineFlags;
-        }
-        if (!infoRec->PolySegmentThinDashed) {
-            infoRec->PolySegmentThinDashed = XAAPolySegmentDashed;
-            infoRec->PolySegmentThinDashedFlags = infoRec->DashedLineFlags;
-        }
-    }
-
-    if (infoRec->PolylinesThinDashed || infoRec->PolySegmentThinDashed) {
-        if (!infoRec->ComputeDash)
-            infoRec->ComputeDash = XAAComputeDash;
-    }
-
-    {
-        Bool haveTexture = infoRec->CPUToScreenTextureFormats &&
-            infoRec->CPUToScreenTextureDstFormats &&
-            infoRec->SetupForCPUToScreenTexture2 &&
-            infoRec->SubsequentCPUToScreenTexture;
-        Bool haveAlphaTexture = infoRec->CPUToScreenAlphaTextureFormats &&
-            infoRec->CPUToScreenAlphaTextureDstFormats &&
-            infoRec->SetupForCPUToScreenAlphaTexture2 &&
-            infoRec->SubsequentCPUToScreenAlphaTexture;
-
-        if (!infoRec->Composite && (haveTexture || haveAlphaTexture))
-            infoRec->Composite = XAADoComposite;
-
-        if (!infoRec->Glyphs && infoRec->WriteBitmap &&
-            !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY)) {
-            infoRec->Glyphs = XAADoGlyphs;
-        }
-    }
-
-    /************  Validation Functions **************/
-
-    if (!infoRec->ValidateCopyArea && infoRec->CopyArea) {
-        infoRec->CopyAreaMask = GCWhenForced;
-        if ((infoRec->CopyAreaFlags & GXCOPY_ONLY) ||
-            (infoRec->CopyAreaFlags & ROP_NEEDS_SOURCE))
-            infoRec->CopyAreaMask |= GCFunction;
-        if (infoRec->CopyAreaFlags & NO_PLANEMASK)
-            infoRec->CopyAreaMask |= GCPlaneMask;
-        infoRec->ValidateCopyArea = XAAValidateCopyArea;
-    }
-
-    if (!infoRec->ValidateCopyPlane && infoRec->CopyPlane) {
-        infoRec->CopyPlaneMask = GCWhenForced;
-        if ((infoRec->CopyPlaneFlags & GXCOPY_ONLY) ||
-            (infoRec->CopyPlaneFlags & ROP_NEEDS_SOURCE))
-            infoRec->CopyPlaneMask |= GCFunction;
-        if (infoRec->CopyPlaneFlags & NO_PLANEMASK)
-            infoRec->CopyPlaneMask |= GCPlaneMask;
-        if (infoRec->CopyPlaneFlags & RGB_EQUAL)
-            infoRec->CopyPlaneMask |= GCForeground | GCBackground;
-        infoRec->ValidateCopyPlane = XAAValidateCopyPlane;
-    }
-
-    if (!infoRec->ValidatePutImage && infoRec->PutImage) {
-        infoRec->PutImageMask = GCWhenForced;
-        if ((infoRec->PutImageFlags & GXCOPY_ONLY) ||
-            (infoRec->PutImageFlags & ROP_NEEDS_SOURCE))
-            infoRec->PutImageMask |= GCFunction;
-        if (infoRec->PutImageFlags & NO_PLANEMASK)
-            infoRec->PutImageMask |= GCPlaneMask;
-        if (infoRec->PutImageFlags & RGB_EQUAL)
-            infoRec->PutImageMask |= GCForeground | GCBackground;
-        infoRec->ValidatePutImage = XAAValidatePutImage;
-    }
-
-    if (!infoRec->ValidatePushPixels && infoRec->PushPixelsSolid) {
-        infoRec->PushPixelsMask = GCFillStyle;
-        if ((infoRec->PushPixelsFlags & GXCOPY_ONLY) ||
-            (infoRec->PushPixelsFlags & ROP_NEEDS_SOURCE) ||
-            (infoRec->PushPixelsFlags & TRANSPARENCY_GXCOPY_ONLY))
-            infoRec->PushPixelsMask |= GCFunction;
-        if (infoRec->PushPixelsFlags & NO_PLANEMASK)
-            infoRec->PushPixelsMask |= GCPlaneMask;
-        if (infoRec->PushPixelsFlags & RGB_EQUAL)
-            infoRec->PushPixelsMask |= GCForeground;
-        infoRec->ValidatePushPixels = XAAValidatePushPixels;
-    }
-
-    /* By default XAA assumes the FillSpans, PolyFillRects, FillPolygon
-       and PolyFillArcs have the same restrictions.  If you supply GC 
-       level replacements for any of these and alter this relationship 
-       you may need to supply replacement validation routines */
-
-    if (!infoRec->ValidateFillSpans &&
-        (infoRec->FillSpansSolid || infoRec->FillSpansStippled ||
-         infoRec->FillSpansOpaqueStippled || infoRec->FillSpansTiled)) {
-
-        int compositeFlags = infoRec->FillSpansSolidFlags |
-            infoRec->FillSpansStippledFlags |
-            infoRec->FillSpansOpaqueStippledFlags |
-            infoRec->FillSpansTiledFlags;
-
-        infoRec->FillSpansMask = GCFillStyle | GCTile | GCStipple;
-
-        if ((compositeFlags & GXCOPY_ONLY) ||
-            (compositeFlags & ROP_NEEDS_SOURCE))
-            infoRec->FillSpansMask |= GCFunction;
-        if (compositeFlags & NO_PLANEMASK)
-            infoRec->FillSpansMask |= GCPlaneMask;
-        if (compositeFlags & RGB_EQUAL)
-            infoRec->FillSpansMask |= GCForeground;
-        infoRec->ValidateFillSpans = XAAValidateFillSpans;
-    }
-
-    /* By default XAA only provides Validations for the GlyphBlt
-       functions and not the text higher up. This is because the
-       Text8/16 and GlyphBlt are linked.  If you break this linkage,
-       you may need to have the driver supply its own Validation
-       routines */
-
-    if (!infoRec->ValidatePolyGlyphBlt &&
-        (infoRec->PolyGlyphBltTE || infoRec->PolyGlyphBltNonTE)) {
-        int compositeFlags = infoRec->PolyGlyphBltTEFlags |
-            infoRec->PolyGlyphBltNonTEFlags;
-
-        infoRec->PolyGlyphBltMask = GCFillStyle | GCFont;
-        if ((compositeFlags & GXCOPY_ONLY) ||
-            (compositeFlags & ROP_NEEDS_SOURCE) ||
-            (infoRec->PolyGlyphBltNonTEFlags & TRANSPARENCY_GXCOPY_ONLY))
-            infoRec->PolyGlyphBltMask |= GCFunction;
-        if (compositeFlags & NO_PLANEMASK)
-            infoRec->PolyGlyphBltMask |= GCPlaneMask;
-        if (compositeFlags & RGB_EQUAL)
-            infoRec->PolyGlyphBltMask |= GCForeground;
-        infoRec->ValidatePolyGlyphBlt = XAAValidatePolyGlyphBlt;
-    }
-
-    if (!infoRec->ValidateImageGlyphBlt &&
-        (infoRec->ImageGlyphBltTE || infoRec->ImageGlyphBltNonTE)) {
-        int compositeFlags = infoRec->ImageGlyphBltTEFlags |
-            infoRec->ImageGlyphBltNonTEFlags;
-
-        if (infoRec->ImageGlyphBltNonTE)
-            compositeFlags |= infoRec->SolidFillFlags;
-
-        infoRec->ImageGlyphBltMask = GCFont;
-        if (compositeFlags & NO_PLANEMASK)
-            infoRec->ImageGlyphBltMask |= GCPlaneMask;
-        if (compositeFlags & RGB_EQUAL)
-            infoRec->ImageGlyphBltMask |= GCForeground | GCBackground;
-        infoRec->ValidateImageGlyphBlt = XAAValidateImageGlyphBlt;
-    }
-
-    /* By default XAA only provides a Validation function for the 
-       Polylines and does segments and polylines at the same time */
-
-    if (!infoRec->ValidatePolylines && infoRec->ValidateFillSpans) {
-        int compositeFlags = infoRec->PolyRectangleThinSolidFlags |
-            infoRec->PolylinesWideSolidFlags |
-            infoRec->PolylinesThinSolidFlags |
-            infoRec->PolySegmentThinSolidFlags |
-            infoRec->PolySegmentThinDashedFlags |
-            infoRec->PolylinesThinDashedFlags;
-
-        infoRec->ValidatePolylines = XAAValidatePolylines;
-        infoRec->PolylinesMask =
-            infoRec->FillSpansMask | GCLineStyle | GCLineWidth;
-
-        if (infoRec->PolySegmentThinDashed || infoRec->PolylinesThinDashed)
-            infoRec->PolylinesMask |= GCDashList;
-        if (compositeFlags & NO_PLANEMASK)
-            infoRec->PolylinesMask |= GCPlaneMask;
-        if ((compositeFlags & GXCOPY_ONLY) ||
-            (compositeFlags & ROP_NEEDS_SOURCE))
-            infoRec->PolylinesMask |= GCFunction;
-        if (compositeFlags & RGB_EQUAL)
-            infoRec->PolylinesMask |= GCForeground;
-    }
-
-    /**** Fill choosers ****/
-
-    if (!infoRec->StippledFillChooser)
-        infoRec->StippledFillChooser = XAAStippledFillChooser;
-
-    if (!infoRec->OpaqueStippledFillChooser)
-        infoRec->OpaqueStippledFillChooser = XAAOpaqueStippledFillChooser;
-
-    if (!infoRec->TiledFillChooser)
-        infoRec->TiledFillChooser = XAATiledFillChooser;
-
-    /**** Setup the pixmap cache ****/
-
-    if (infoRec->WriteBitmapToCache) {
-    }
-    else if (infoRec->WriteBitmap &&
-             !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY))
-        infoRec->WriteBitmapToCache = XAAWriteBitmapToCache;
-    else if (infoRec->Flags & LINEAR_FRAMEBUFFER)
-        infoRec->WriteBitmapToCache = XAAWriteBitmapToCacheLinear;
-    else
-        infoRec->PixmapCacheFlags |= DO_NOT_BLIT_STIPPLES;
-
-    if (infoRec->WritePixmapToCache) {
-    }
-    else if (infoRec->WritePixmap && !(infoRec->WritePixmapFlags & NO_GXCOPY))
-        infoRec->WritePixmapToCache = XAAWritePixmapToCache;
-    else if (infoRec->Flags & LINEAR_FRAMEBUFFER)
-        infoRec->WritePixmapToCache = XAAWritePixmapToCacheLinear;
-    else
-        infoRec->Flags &= ~PIXMAP_CACHE;
-
-    if (xf86ReturnOptValBool(options, XAAOPT_PIXMAP_CACHE, FALSE))
-        infoRec->Flags &= ~PIXMAP_CACHE;
-
-    if (infoRec->WriteMono8x8PatternToCache) {
-    }
-    else if (infoRec->PixmapCacheFlags & CACHE_MONO_8x8) {
-        if (infoRec->WritePixmapToCache)
-            infoRec->WriteMono8x8PatternToCache = XAAWriteMono8x8PatternToCache;
-        else
-            infoRec->PixmapCacheFlags &= ~CACHE_MONO_8x8;
-    }
-
-    if (infoRec->WriteColor8x8PatternToCache) {
-    }
-    else if (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8) {
-        if (infoRec->WritePixmapToCache && infoRec->WriteBitmapToCache)
-            infoRec->WriteColor8x8PatternToCache =
-                XAAWriteColor8x8PatternToCache;
-        else
-            infoRec->PixmapCacheFlags &= ~CACHE_COLOR_8x8;
-    }
-
-    if (infoRec->CachePixelGranularity < 0) {
-        switch (pScrn->bitsPerPixel) {
-        case 24:
-        case 8:
-            infoRec->CachePixelGranularity = 4;
-            break;
-        case 16:
-            infoRec->CachePixelGranularity = 2;
-            break;
-        case 32:
-            infoRec->CachePixelGranularity = 1;
-            break;
-        default:
-            break;
-        }
-
-        if (BITMAP_SCANLINE_PAD == 64)
-            infoRec->CachePixelGranularity *= 2;
-    }
-
-    free(options);
-
-    if (!infoRec->CacheTile && infoRec->WritePixmapToCache)
-        infoRec->CacheTile = XAACacheTile;
-    if (!infoRec->CacheMonoStipple && infoRec->WritePixmapToCache)
-        infoRec->CacheMonoStipple = XAACacheMonoStipple;
-    if (!infoRec->CacheStipple && infoRec->WriteBitmapToCache)
-        infoRec->CacheStipple = XAACacheStipple;
-    if (!infoRec->CacheMono8x8Pattern && infoRec->WriteMono8x8PatternToCache)
-        infoRec->CacheMono8x8Pattern = XAACacheMono8x8Pattern;
-    if (!infoRec->CacheColor8x8Pattern && infoRec->WriteColor8x8PatternToCache)
-        infoRec->CacheColor8x8Pattern = XAACacheColor8x8Pattern;
-
-    if ((infoRec->Flags & PIXMAP_CACHE) && !infoRec->InitPixmapCache) {
-        infoRec->InitPixmapCache = XAAInitPixmapCache;
-        infoRec->ClosePixmapCache = XAAClosePixmapCache;
-    }
-
-    return TRUE;
-}
diff --git a/hw/xfree86/xaa/xaaLine.c b/hw/xfree86/xaa/xaaLine.c
deleted file mode 100644 (file)
index d7c6097..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <stdlib.h>
-
-#include <X11/X.h>
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "miline.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-void
-#ifdef POLYSEGMENT
- XAAPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg
-#else
-XAAPolyLines(DrawablePtr pDrawable, GCPtr pGC, int mode,        /* Origin or Previous */
-             int npt,           /* number of points */
-             DDXPointPtr pptInit
-#endif
-    )
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    BoxPtr pboxInit = RegionRects(pGC->pCompositeClip);
-    int nboxInit = RegionNumRects(pGC->pCompositeClip);
-    unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
-    int xorg = pDrawable->x;
-    int yorg = pDrawable->y;
-    int nbox;
-    BoxPtr pbox;
-
-#ifndef POLYSEGMENT
-    DDXPointPtr ppt;
-#endif
-    int x1, x2, y1, y2, tmp, len;
-
-    if (!nboxInit)
-        return;
-
-    if (infoRec->SolidLineFlags & LINE_LIMIT_COORDS) {
-        int minValX = infoRec->SolidLineLimits.x1;
-        int maxValX = infoRec->SolidLineLimits.x2;
-        int minValY = infoRec->SolidLineLimits.y1;
-        int maxValY = infoRec->SolidLineLimits.y2;
-
-#ifdef POLYSEGMENT
-        int n = nseg;
-        xSegment *s = pSeg;
-
-        while (n--)
-#else
-        int n = npt;
-        int xorgtmp = xorg;
-        int yorgtmp = yorg;
-
-        ppt = pptInit;
-        x2 = ppt->x + xorgtmp;
-        y2 = ppt->y + yorgtmp;
-        while (--n)
-#endif
-        {
-#ifdef POLYSEGMENT
-            x1 = s->x1 + xorg;
-            y1 = s->y1 + yorg;
-            x2 = s->x2 + xorg;
-            y2 = s->y2 + yorg;
-            s++;
-#else
-            x1 = x2;
-            y1 = y2;
-            ++ppt;
-            if (mode == CoordModePrevious) {
-                xorgtmp = x1;
-                yorgtmp = y1;
-            }
-            x2 = ppt->x + xorgtmp;
-            y2 = ppt->y + yorgtmp;
-#endif
-            if (x1 > maxValX || x1 < minValX ||
-                x2 > maxValX || x2 < minValX ||
-                y1 > maxValY || y1 < minValY || y2 > maxValY || y2 < minValY) {
-#ifdef POLYSEGMENT
-                XAAFallbackOps.PolySegment(pDrawable, pGC, nseg, pSeg);
-#else
-                XAAFallbackOps.Polylines(pDrawable, pGC, mode, npt, pptInit);
-#endif
-                return;
-            }
-        }
-    }
-
-    (*infoRec->SetupForSolidLine) (infoRec->pScrn, pGC->fgPixel,
-                                   pGC->alu, pGC->planemask);
-
-#ifdef POLYSEGMENT
-    while (nseg--)
-#else
-    ppt = pptInit;
-    x2 = ppt->x + xorg;
-    y2 = ppt->y + yorg;
-    while (--npt)
-#endif
-    {
-        nbox = nboxInit;
-        pbox = pboxInit;
-
-#ifdef POLYSEGMENT
-        x1 = pSeg->x1 + xorg;
-        y1 = pSeg->y1 + yorg;
-        x2 = pSeg->x2 + xorg;
-        y2 = pSeg->y2 + yorg;
-        pSeg++;
-#else
-        x1 = x2;
-        y1 = y2;
-        ++ppt;
-        if (mode == CoordModePrevious) {
-            xorg = x1;
-            yorg = y1;
-        }
-        x2 = ppt->x + xorg;
-        y2 = ppt->y + yorg;
-#endif
-
-        if (x1 == x2) {         /* vertical line */
-            /* make the line go top to bottom of screen, keeping
-               endpoint semantics
-             */
-            if (y1 > y2) {
-                tmp = y2;
-                y2 = y1 + 1;
-                y1 = tmp + 1;
-#ifdef POLYSEGMENT
-                if (pGC->capStyle != CapNotLast)
-                    y1--;
-#endif
-            }
-#ifdef POLYSEGMENT
-            else if (pGC->capStyle != CapNotLast)
-                y2++;
-#endif
-            /* get to first band that might contain part of line */
-            while (nbox && (pbox->y2 <= y1)) {
-                pbox++;
-                nbox--;
-            }
-
-            /* stop when lower edge of box is beyond end of line */
-            while (nbox && (y2 >= pbox->y1)) {
-                if ((x1 >= pbox->x1) && (x1 < pbox->x2)) {
-                    tmp = max(y1, pbox->y1);
-                    len = min(y2, pbox->y2) - tmp;
-                    if (len)
-                        (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn,
-                                                                x1, tmp, len,
-                                                                DEGREES_270);
-                }
-                nbox--;
-                pbox++;
-            }
-#ifndef POLYSEGMENT
-            y2 = ppt->y + yorg;
-#endif
-        }
-        else if (y1 == y2) {    /* horizontal line */
-            /* force line from left to right, keeping endpoint semantics */
-            if (x1 > x2) {
-                tmp = x2;
-                x2 = x1 + 1;
-                x1 = tmp + 1;
-#ifdef POLYSEGMENT
-                if (pGC->capStyle != CapNotLast)
-                    x1--;
-#endif
-            }
-#ifdef POLYSEGMENT
-            else if (pGC->capStyle != CapNotLast)
-                x2++;
-#endif
-
-            /* find the correct band */
-            while (nbox && (pbox->y2 <= y1)) {
-                pbox++;
-                nbox--;
-            }
-
-            /* try to draw the line, if we haven't gone beyond it */
-            if (nbox && (pbox->y1 <= y1)) {
-                int orig_y = pbox->y1;
-
-                /* when we leave this band, we're done */
-                while (nbox && (orig_y == pbox->y1)) {
-                    if (pbox->x2 <= x1) {
-                        /* skip boxes until one might contain start point */
-                        nbox--;
-                        pbox++;
-                        continue;
-                    }
-
-                    /* stop if left of box is beyond right of line */
-                    if (pbox->x1 >= x2) {
-                        nbox = 0;
-                        break;
-                    }
-
-                    tmp = max(x1, pbox->x1);
-                    len = min(x2, pbox->x2) - tmp;
-                    if (len)
-                        (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn,
-                                                                tmp, y1, len,
-                                                                DEGREES_0);
-                    nbox--;
-                    pbox++;
-                }
-            }
-#ifndef POLYSEGMENT
-            x2 = ppt->x + xorg;
-#endif
-        }
-        else {                  /* sloped line */
-            unsigned int oc1, oc2;
-            int dmin, dmaj, e, octant;
-
-            if (infoRec->SubsequentSolidBresenhamLine) {
-                if ((dmaj = x2 - x1) < 0) {
-                    dmaj = -dmaj;
-                    octant = XDECREASING;
-                }
-                else
-                    octant = 0;
-
-                if ((dmin = y2 - y1) < 0) {
-                    dmin = -dmin;
-                    octant |= YDECREASING;
-                }
-
-                if (dmin >= dmaj) {
-                    tmp = dmin;
-                    dmin = dmaj;
-                    dmaj = tmp;
-                    octant |= YMAJOR;
-                }
-
-                e = -dmaj - ((bias >> octant) & 1);
-                len = dmaj;
-                dmin <<= 1;
-                dmaj <<= 1;
-            }
-            else {              /* Muffle compiler */
-                dmin = dmaj = e = octant = len = 0;
-            }
-
-            while (nbox--) {
-                oc1 = oc2 = 0;
-                OUTCODES(oc1, x1, y1, pbox);
-                OUTCODES(oc2, x2, y2, pbox);
-                if (!(oc1 | oc2)) {     /* unclipped */
-                    if (infoRec->SubsequentSolidTwoPointLine) {
-                        (*infoRec->SubsequentSolidTwoPointLine) (infoRec->pScrn,
-                                                                 x1, y1, x2, y2,
-#ifdef POLYSEGMENT
-                                                                 (pGC->
-                                                                  capStyle !=
-                                                                  CapNotLast) ?
-                                                                 0 :
-#endif
-                                                                 OMIT_LAST);
-                    }
-                    else {
-                        (*infoRec->SubsequentSolidBresenhamLine) (infoRec->
-                                                                  pScrn, x1, y1,
-                                                                  dmaj, dmin, e,
-#ifdef POLYSEGMENT
-                                                                  (pGC->
-                                                                   capStyle !=
-                                                                   CapNotLast)
-                                                                  ? (len + 1) :
-#endif
-                                                                  len, octant);
-                    }
-                    break;
-                }
-                else if (oc1 & oc2) {   /* completely clipped */
-                    pbox++;
-                }
-                else if (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_LINE) {
-                    (*infoRec->SetClippingRectangle) (infoRec->pScrn,
-                                                      pbox->x1, pbox->y1,
-                                                      pbox->x2 - 1,
-                                                      pbox->y2 - 1);
-
-                    if (infoRec->SubsequentSolidBresenhamLine) {
-                        (*infoRec->SubsequentSolidBresenhamLine) (infoRec->
-                                                                  pScrn, x1, y1,
-                                                                  dmaj, dmin, e,
-#ifdef POLYSEGMENT
-                                                                  (pGC->
-                                                                   capStyle !=
-                                                                   CapNotLast)
-                                                                  ? (len + 1) :
-#endif
-                                                                  len, octant);
-                    }
-                    else {
-                        (*infoRec->SubsequentSolidTwoPointLine) (infoRec->pScrn,
-                                                                 x1, y1, x2, y2,
-#ifdef POLYSEGMENT
-                                                                 (pGC->
-                                                                  capStyle !=
-                                                                  CapNotLast) ?
-                                                                 0 :
-#endif
-                                                                 OMIT_LAST);
-                    }
-                    (*infoRec->DisableClipping) (infoRec->pScrn);
-                    pbox++;
-                }
-                else {
-                    int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
-                    int clip1 = 0, clip2 = 0;
-                    int err, adx, ady;
-
-                    if (octant & YMAJOR) {
-                        ady = dmaj >> 1;
-                        adx = dmin >> 1;
-                    }
-                    else {
-                        ady = dmin >> 1;
-                        adx = dmaj >> 1;
-                    }
-
-                    if (miZeroClipLine(pbox->x1, pbox->y1,
-                                       pbox->x2 - 1, pbox->y2 - 1,
-                                       &new_x1, &new_y1, &new_x2, &new_y2,
-                                       adx, ady, &clip1, &clip2,
-                                       octant, bias, oc1, oc2) == -1) {
-                        pbox++;
-                        continue;
-                    }
-
-                    if (octant & YMAJOR)
-                        len = abs(new_y2 - new_y1);
-                    else
-                        len = abs(new_x2 - new_x1);
-#ifdef POLYSEGMENT
-                    if (clip2 != 0 || pGC->capStyle != CapNotLast)
-                        len++;
-#else
-                    len += (clip2 != 0);
-#endif
-                    if (len) {
-                        int abserr, clipdx, clipdy;
-
-                        /* unwind bresenham error term to first point */
-                        if (clip1) {
-                            clipdx = abs(new_x1 - x1);
-                            clipdy = abs(new_y1 - y1);
-
-                            if (octant & YMAJOR)
-                                err = e + clipdy * dmin - clipdx * dmaj;
-                            else
-                                err = e + clipdx * dmin - clipdy * dmaj;
-                        }
-                        else
-                            err = e;
-
-#define range infoRec->SolidBresenhamLineErrorTermBits
-                        abserr = abs(err);
-                        while ((abserr & range) ||
-                               (dmaj & range) || (dmin & range)) {
-                            dmin >>= 1;
-                            dmaj >>= 1;
-                            abserr >>= 1;
-                            err /= 2;
-                        }
-
-                        (*infoRec->SubsequentSolidBresenhamLine) (infoRec->
-                                                                  pScrn, new_x1,
-                                                                  new_y1, dmaj,
-                                                                  dmin, err,
-                                                                  len, octant);
-                    }
-                    pbox++;
-                }
-            }                   /* while (nbox--) */
-        }                       /* sloped line */
-    }                           /* while (nline--) */
-
-#ifndef POLYSEGMENT
-    /* paint the last point if the end style isn't CapNotLast.
-       (Assume that a projecting, butt, or round cap that is one
-       pixel wide is the same as the single pixel of the endpoint.)
-     */
-
-    if ((pGC->capStyle != CapNotLast) &&
-        ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
-         (ppt->y + yorg != pptInit->y + pDrawable->y) ||
-         (ppt == pptInit + 1))) {
-        nbox = nboxInit;
-        pbox = pboxInit;
-        while (nbox--) {
-            if ((x2 >= pbox->x1) && (y2 >= pbox->y1) &&
-                (x2 < pbox->x2) && (y2 < pbox->y2)) {
-                (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn, x2, y2,
-                                                        1, DEGREES_0);
-                break;
-            }
-            else
-                pbox++;
-        }
-    }
-#endif
-
-    SET_SYNC_FLAG(infoRec);
-}
diff --git a/hw/xfree86/xaa/xaaLineMisc.c b/hw/xfree86/xaa/xaaLineMisc.c
deleted file mode 100644 (file)
index 4379778..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "miline.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-void
-XAASolidHorVertLineAsRects(ScrnInfoPtr pScrn, int x, int y, int len, int dir)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    if (dir == DEGREES_0)
-        (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, len, 1);
-    else
-        (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, 1, len);
-}
-
-void
-XAASolidHorVertLineAsTwoPoint(ScrnInfoPtr pScrn, int x, int y, int len, int dir)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    len--;
-
-    if (dir == DEGREES_0)
-        (*infoRec->SubsequentSolidTwoPointLine) (pScrn, x, y, x + len, y, 0);
-    else
-        (*infoRec->SubsequentSolidTwoPointLine) (pScrn, x, y, x, y + len, 0);
-}
-
-void
-XAASolidHorVertLineAsBresenham(ScrnInfoPtr pScrn,
-                               int x, int y, int len, int dir)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    if (dir == DEGREES_0)
-        (*infoRec->SubsequentSolidBresenhamLine) (pScrn, x, y, len << 1, 0,
-                                                  -len, len, 0);
-    else
-        (*infoRec->SubsequentSolidBresenhamLine) (pScrn, x, y, len << 1, 0,
-                                                  -len, len, YMAJOR);
-}
-
-void
-XAAComputeDash(GCPtr pGC)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAAGCPtr pGCPriv = (XAAGCPtr) dixLookupPrivate(&pGC->devPrivates,
-                                                   XAAGetGCKey());
-    Bool EvenDash = (pGC->numInDashList & 0x01) ? FALSE : TRUE;
-    int PatternLength = 0;
-    unsigned char *DashPtr = (unsigned char *) pGC->dash;
-    CARD32 *ptr;
-    int count = pGC->numInDashList;
-    int shift, value, direction;
-    Bool set;
-
-    free(pGCPriv->DashPattern);
-
-    pGCPriv->DashPattern = NULL;
-    pGCPriv->DashLength = 0;
-
-    while (count--)
-        PatternLength += *(DashPtr++);
-
-    if (!EvenDash)
-        PatternLength <<= 1;
-
-    if (PatternLength > infoRec->DashPatternMaxLength)
-        return;
-
-    if ((infoRec->DashedLineFlags & LINE_PATTERN_POWER_OF_2_ONLY) &&
-        (PatternLength & (PatternLength - 1)))
-        return;
-
-    pGCPriv->DashPattern = calloc((PatternLength + 31) >> 5, 4);
-    if (!pGCPriv->DashPattern)
-        return;
-    pGCPriv->DashLength = PatternLength;
-
-    if (infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED |
-                                    LINE_PATTERN_LSBFIRST_LSBJUSTIFIED)) {
-        direction = 1;
-        set = TRUE;
-        DashPtr = (unsigned char *) pGC->dash;
-    }
-    else {
-        direction = -1;
-        set = FALSE;
-        DashPtr = (unsigned char *) pGC->dash + pGC->numInDashList - 1;
-    }
-
-    if (infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED |
-                                    LINE_PATTERN_MSBFIRST_MSBJUSTIFIED))
-        shift = 32 - (PatternLength & 31);
-    else
-        shift = 0;
-
-    ptr = (CARD32 *) (pGCPriv->DashPattern);
-
- CONCATENATE:
-
-    count = pGC->numInDashList;
-
-    while (count--) {
-        value = *DashPtr;
-        DashPtr += direction;
-        while (value) {
-            if (value < (32 - shift)) {
-                if (set)
-                    *ptr |= XAAShiftMasks[value] << shift;
-                shift += value;
-                break;
-            }
-            else {
-                if (set)
-                    *ptr |= ~0L << shift;
-                value -= (32 - shift);
-                shift = 0;
-                ptr++;
-            }
-        }
-        if (set)
-            set = FALSE;
-        else
-            set = TRUE;
-    }
-
-    if (!EvenDash) {
-        EvenDash = TRUE;
-        if (infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED |
-                                        LINE_PATTERN_LSBFIRST_LSBJUSTIFIED))
-            DashPtr = (unsigned char *) pGC->dash;
-        else
-            DashPtr = (unsigned char *) pGC->dash + pGC->numInDashList;
-        goto CONCATENATE;
-    }
-}
diff --git a/hw/xfree86/xaa/xaaNonTEGlyph.c b/hw/xfree86/xaa/xaaNonTEGlyph.c
deleted file mode 100644 (file)
index bfe7f9a..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaacexp.h"
-#include "xf86.h"
-
-/* Not used anymore because the algorithm isn't correct. It doesn't
-   handle overlapping characters properly */
-
-#ifdef TRIPLE_BITS
-#define NonTEGlyphFunc EXPNAME(XAANonTEGlyphScanlineFunc3)
-#else
-#define NonTEGlyphFunc EXPNAME(XAANonTEGlyphScanlineFunc)
-#endif
-
-/********************************************************************
-
-   Here we have NonTEGlyphRenders for a bunch of different color
-   expansion types.  The driver may provide its own renderer, but
-   this is the default one which renders using lower-level primitives
-   exported by the chipset driver.
-
-********************************************************************/
-
-/* Since the dimensions of the text string and the backing rectangle
-       do not always coincide, it is possible that wBack or wText
-       may be 0!  The NonTEGlyphRender must always check for this. */
-
-/* This gets built for MSBFIRST or LSBFIRST with FIXEDBASE or not,
-       with TRIPLE_BITS or not. A total of 8 versions */
-
-/* if the backing rectangle and text are of the same dimensions
-       then we can draw in one pass */
-
-void
-#ifdef TRIPLE_BITS
- EXPNAME(XAANonTEGlyphRenderer3) (
-#else
- EXPNAME(XAANonTEGlyphRenderer) (
-#endif
-                                    ScrnInfoPtr pScrn,
-                                    int xText, int wText,
-                                    int y, int h, int skipleft, int startline,
-                                    NonTEGlyphInfo * glyphp,
-                                    int fg, int rop, unsigned int planemask) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    CARD32 *base = (CARD32 *) infoRec->ColorExpandBase;
-
-#ifdef TRIPLE_BITS
-    int dwords = ((3 * wText + 31) >> 5) * h;
-#else
-    int dwords = ((wText + 31) >> 5) * h;
-#endif
-
-    (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, -1, rop,
-                                                    planemask);
-    (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, xText, y, wText, h,
-                                                      0);
-
-#ifndef FIXEDBASE
-#ifdef TRIPLE_BITS
-    if ((((3 * wText + 31) >> 5) * h) <= infoRec->ColorExpandRange)
-#else
-    if ((((wText + 31) >> 5) * h) <= infoRec->ColorExpandRange)
-#endif
-        while (h--)
-            base = NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft);
-    else
-#endif
-        while (h--)
-            NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft);
-
-    if ((infoRec->CPUToScreenColorExpandFillFlags & CPU_TRANSFER_PAD_QWORD) &&
-        (dwords & 1)) {
-        base = (CARD32 *) infoRec->ColorExpandBase;
-        base[0] = 0x00000000;
-    }
-
-    if (infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
-        (*infoRec->Sync) (pScrn);
-    else
-        SET_SYNC_FLAG(infoRec);
-}
-
-#ifndef FIXEDBASE
-/*  Scanline version of above gets built for LSBFIRST and MSBFIRST */
-
-void
-#ifdef TRIPLE_BITS
- EXPNAME(XAANonTEGlyphRendererScanline3) (
-#else
- EXPNAME(XAANonTEGlyphRendererScanline) (
-#endif
-                                            ScrnInfoPtr pScrn,
-                                            int xText, int wText,
-                                            int y, int h, int skipleft,
-                                            int startline,
-                                            NonTEGlyphInfo * glyphp, int fg,
-                                            int rop, unsigned int planemask) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int bufferNo = 0;
-    CARD32 *base;
-
-    (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, -1, rop,
-                                                            planemask);
-    (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, xText, y,
-                                                              wText, h, 0);
-
-    while (h--) {
-        base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo];
-        NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft);
-        (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++);
-        if (bufferNo >= infoRec->NumScanlineColorExpandBuffers)
-            bufferNo = 0;
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-#endif
-
-/********************************************************************
-
-   Generic NonTE scanline rendering code.
-
-********************************************************************/
-
-CARD32 *
-NonTEGlyphFunc(CARD32 *base,
-               NonTEGlyphInfo * glyphp, int line, int TotalWidth, int skipleft)
-{
-    CARD32 bits = 0;
-    int shift = glyphp->width;
-
-    if (skipleft) {
-        if ((line >= glyphp->firstline) && (line <= glyphp->lastline))
-            bits = SHIFT_R(glyphp->bitsp[line], skipleft);
-        shift -= skipleft;
-    }
-    else if ((line >= glyphp->firstline) && (line <= glyphp->lastline))
-        bits = glyphp->bitsp[line];
-
-    while (TotalWidth > 32) {
-        while (shift < 32) {
-            glyphp++;
-            if ((line >= glyphp->firstline) && (line <= glyphp->lastline))
-                bits |= SHIFT_L(glyphp->bitsp[line], shift);
-            shift += glyphp->width;
-        }
-#ifdef TRIPLE_BITS
-        WRITE_BITS3(bits);
-#else
-        WRITE_BITS(bits);
-#endif
-        shift &= 31;
-        if (shift && (line >= glyphp->firstline) && (line <= glyphp->lastline))
-            bits = SHIFT_R(glyphp->bitsp[line], glyphp->width - shift);
-        else
-            bits = 0;
-        TotalWidth -= 32;
-    }
-
-    if (TotalWidth) {
-        TotalWidth -= shift;
-        while (TotalWidth > 0) {
-            glyphp++;
-            if ((line >= glyphp->firstline) && (line <= glyphp->lastline))
-                bits |= SHIFT_L(glyphp->bitsp[line], shift);
-            shift += glyphp->width;
-            TotalWidth -= glyphp->width;
-        }
-#ifdef TRIPLE_BITS
-        if (shift >= 22) {
-            WRITE_BITS3(bits);
-        }
-        else if (shift >= 11) {
-            WRITE_BITS2(bits);
-        }
-        else {
-            WRITE_BITS1(bits);
-        }
-#else
-        WRITE_BITS(bits);
-#endif
-    }
-
-    return base;
-}
diff --git a/hw/xfree86/xaa/xaaNonTEText.c b/hw/xfree86/xaa/xaaNonTEText.c
deleted file mode 100644 (file)
index 35b4391..0000000
+++ /dev/null
@@ -1,591 +0,0 @@
-
-/********************************************************************
-
-   In this file we have GC level replacements for PolyText8/16,
-   ImageText8/16, ImageGlyphBlt and PolyGlyphBlt for NonTE (proportional) 
-   fonts. The idea is that everything in this file is device independent.
-   The mentioned GCOps are merely wrappers for the 
-   PolyGlyphBltNonTEColorExpansion and ImageGlyphBltNonTEColorExpansion
-   functions which calculate the boxes containing arbitrarily clipped 
-   text and passes them to the NonTEGlyphRenderer which will usually 
-   be a lower level XAA function which renders these clipped glyphs using
-   the basic color expansion functions exported by the chipset driver.
-   The NonTEGlyphRenderer itself may optionally be driver supplied to
-   facilitate work-arounds/optimizations at a higher level than usual.
-
-   Written by Mark Vojkovich (mvojkovi@ucsd.edu)
-
-********************************************************************/
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <string.h>
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include <X11/fonts/font.h>
-#include "scrnintstr.h"
-#include "dixfontstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaacexp.h"
-#include "xaalocal.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-
-static void ImageGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn,
-                                             int xInit, int yInit, FontPtr font,
-                                             int fg, int bg, unsigned planemask,
-                                             RegionPtr cclip, int nglyph,
-                                             unsigned char *gBase,
-                                             CharInfoPtr * ppci);
-static int PolyGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn, int xInit,
-                                           int yInit, FontPtr font, int fg,
-                                           int rop, unsigned planemask,
-                                           RegionPtr cclip, int nglyph,
-                                           unsigned char *gBase,
-                                           CharInfoPtr * ppci);
-
-/********************************************************************
-
-   GC level replacements for PolyText8/16 and ImageText8/16
-   for NonTE fonts when using color expansion.
-
-********************************************************************/
-
-int
-XAAPolyText8NonTEColorExpansion(DrawablePtr pDraw,
-                                GCPtr pGC, int x, int y, int count, char *chars)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    unsigned long n;
-    int width = 0;
-
-    (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count,
-                              (unsigned char *) chars, Linear8Bit, &n,
-                              infoRec->CharInfo);
-
-    if (n) {
-        width = PolyGlyphBltNonTEColorExpansion(infoRec->pScrn,
-                                                x + pDraw->x, y + pDraw->y,
-                                                pGC->font, pGC->fgPixel,
-                                                pGC->alu, pGC->planemask,
-                                                pGC->pCompositeClip, n,
-                                                FONTGLYPHS(pGC->font),
-                                                infoRec->CharInfo);
-    }
-
-    return x + width;
-}
-
-int
-XAAPolyText16NonTEColorExpansion(DrawablePtr pDraw,
-                                 GCPtr pGC,
-                                 int x, int y, int count, unsigned short *chars)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    unsigned long n;
-    int width = 0;
-
-    (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count,
-                              (unsigned char *) chars,
-                              (FONTLASTROW(pGC->font) ==
-                               0) ? Linear16Bit : TwoD16Bit, &n,
-                              infoRec->CharInfo);
-
-    if (n) {
-        width = PolyGlyphBltNonTEColorExpansion(infoRec->pScrn,
-                                                x + pDraw->x, y + pDraw->y,
-                                                pGC->font, pGC->fgPixel,
-                                                pGC->alu, pGC->planemask,
-                                                pGC->pCompositeClip, n,
-                                                FONTGLYPHS(pGC->font),
-                                                infoRec->CharInfo);
-    }
-
-    return x + width;
-}
-
-void
-XAAImageText8NonTEColorExpansion(DrawablePtr pDraw,
-                                 GCPtr pGC,
-                                 int x, int y, int count, char *chars)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    unsigned long n;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count,
-                              (unsigned char *) chars, Linear8Bit, &n,
-                              infoRec->CharInfo);
-
-    if (n)
-        ImageGlyphBltNonTEColorExpansion(infoRec->pScrn, x + pDraw->x,
-                                         y + pDraw->y, pGC->font, pGC->fgPixel,
-                                         pGC->bgPixel, pGC->planemask,
-                                         pGC->pCompositeClip, n,
-                                         FONTGLYPHS(pGC->font),
-                                         infoRec->CharInfo);
-}
-
-void
-XAAImageText16NonTEColorExpansion(DrawablePtr pDraw,
-                                  GCPtr pGC,
-                                  int x,
-                                  int y, int count, unsigned short *chars)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    unsigned long n;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count,
-                              (unsigned char *) chars,
-                              (FONTLASTROW(pGC->font) ==
-                               0) ? Linear16Bit : TwoD16Bit, &n,
-                              infoRec->CharInfo);
-
-    if (n)
-        ImageGlyphBltNonTEColorExpansion(infoRec->pScrn, x + pDraw->x,
-                                         y + pDraw->y, pGC->font, pGC->fgPixel,
-                                         pGC->bgPixel, pGC->planemask,
-                                         pGC->pCompositeClip, n,
-                                         FONTGLYPHS(pGC->font),
-                                         infoRec->CharInfo);
-}
-
-/********************************************************************
-
-   GC level replacements for ImageGlyphBlt and PolyGlyphBlt for
-   NonTE fonts when using color expansion.
-
-********************************************************************/
-
-void
-XAAImageGlyphBltNonTEColorExpansion(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, CharInfoPtr * ppci,        /* array of character info */
-                                    pointer pglyphBase  /* start of array of glyphs */
-    )
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    ImageGlyphBltNonTEColorExpansion(infoRec->pScrn, xInit + pDraw->x,
-                                     yInit + pDraw->y, pGC->font, pGC->fgPixel,
-                                     pGC->bgPixel, pGC->planemask,
-                                     pGC->pCompositeClip, nglyph,
-                                     (unsigned char *) pglyphBase, ppci);
-}
-
-void
-XAAPolyGlyphBltNonTEColorExpansion(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */
-                                   pointer pglyphBase   /* start of array of glyphs */
-    )
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    PolyGlyphBltNonTEColorExpansion(infoRec->pScrn, xInit + pDraw->x,
-                                    yInit + pDraw->y, pGC->font, pGC->fgPixel,
-                                    pGC->alu, pGC->planemask,
-                                    pGC->pCompositeClip, nglyph,
-                                    (unsigned char *) pglyphBase, ppci);
-}
-
-/********************************************************************
-
-   ImageGlyphBltNonTEColorExpansion -
-   PolyGlyphBltNonTEColorExpansion -
-
-   These guys compute the clipped pieces of text and send it to
-   the lower-level function which will handle acceleration of 
-   arbitrarily clipped text.
-  
-********************************************************************/
-
-static int
-CollectCharacterInfo(NonTEGlyphPtr glyphs,
-                     unsigned int nglyph, CharInfoPtr * ppci, FontPtr pfont)
-{
-    int i, w = 0;
-
-    for (i = 0; i < nglyph; i++, ppci++, glyphs++) {
-        glyphs->bits = (unsigned char *) ((*ppci)->bits);
-        glyphs->start = w + (*ppci)->metrics.leftSideBearing;
-        glyphs->end = w + (*ppci)->metrics.rightSideBearing;
-        glyphs->yoff = (*ppci)->metrics.ascent;
-        glyphs->height = glyphs->yoff + (*ppci)->metrics.descent;
-        glyphs->srcwidth = PADGLYPHWIDTHBYTES(glyphs->end - glyphs->start);
-        w += (*ppci)->metrics.characterWidth;
-    }
-    return w;
-}
-
-static void
-PolyGlyphBltAsSingleBitmap(ScrnInfoPtr pScrn,
-                           int nglyph,
-                           FontPtr font,
-                           int xInit,
-                           int yInit,
-                           int nbox,
-                           BoxPtr pbox, int fg, int rop, unsigned planemask)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    CARD32 *block, *pntr, *bits;
-    int pitch, topLine, botLine, top, bot, height;
-    int Left, Right, Top, Bottom;
-    int LeftEdge, RightEdge;
-    int bitPitch, shift, size, i, skippix;
-    NonTEGlyphPtr glyphs = infoRec->GlyphInfo;
-    Bool extra;
-
-    Left = xInit + infoRec->GlyphInfo[0].start;
-    Right = xInit + infoRec->GlyphInfo[nglyph - 1].end;
-    Top = yInit - FONTMAXBOUNDS(font, ascent);
-    Bottom = yInit + FONTMAXBOUNDS(font, descent);
-
-    /* get into the first band that may contain part of our string */
-    while (nbox && (Top >= pbox->y2)) {
-        pbox++;
-        nbox--;
-    }
-
-    if (!nbox)
-        return;
-
-    pitch = (Right - Left + 31) >> 5;
-    size = (pitch << 2) * (Bottom - Top);
-    block = calloc(1, size);
-
-    topLine = 10000;
-    botLine = -10000;
-
-    while (nglyph--) {
-        top = -glyphs->yoff;
-        bot = top + glyphs->height;
-        if (top < topLine)
-            topLine = top;
-        if (bot > botLine)
-            botLine = bot;
-        skippix = glyphs->start - infoRec->GlyphInfo[0].start;
-        bits = (CARD32 *) glyphs->bits;
-        bitPitch = glyphs->srcwidth >> 2;
-        pntr = block + ((FONTMAXBOUNDS(font, ascent) + top) * pitch) +
-            (skippix >> 5);
-        shift = skippix & 31;
-        extra = ((shift + glyphs->end - glyphs->start) > 32);
-
-        for (i = top; i < bot; i++) {
-            *pntr |= SHIFT_L(*bits, shift);
-            if (extra)
-                *(pntr + 1) |= SHIFT_R(*bits, 32 - shift);
-            pntr += pitch;
-            bits += bitPitch;
-        }
-
-        glyphs++;
-    }
-
-    pntr = block + ((FONTMAXBOUNDS(font, ascent) + topLine) * pitch);
-
-    Top = yInit + topLine;
-    Bottom = yInit + botLine;
-
-    while (nbox && (Top >= pbox->y2)) {
-        pbox++;
-        nbox--;
-    }
-
-    while (nbox && (Bottom > pbox->y1)) {
-        LeftEdge = max(Left, pbox->x1);
-        RightEdge = min(Right, pbox->x2);
-
-        if (RightEdge > LeftEdge) {
-            skippix = LeftEdge - Left;
-            topLine = max(Top, pbox->y1);
-            botLine = min(Bottom, pbox->y2);
-            height = botLine - topLine;
-
-            if (height > 0)
-                (*infoRec->WriteBitmap) (pScrn, LeftEdge, topLine,
-                                         RightEdge - LeftEdge, height,
-                                         (unsigned char *) (pntr +
-                                                            ((topLine -
-                                                              Top) * pitch) +
-                                                            (skippix >> 5)),
-                                         pitch << 2, skippix & 31, fg, -1, rop,
-                                         planemask);
-        }
-
-        nbox--;
-        pbox++;
-    }
-
-    free(block);
-}
-
-static void
-ImageGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn,
-                                 int xInit, int yInit,
-                                 FontPtr font,
-                                 int fg, int bg,
-                                 unsigned planemask,
-                                 RegionPtr cclip,
-                                 int nglyph,
-                                 unsigned char *gBase, CharInfoPtr * ppci)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int skippix, skipglyph, width, n, i;
-    int Left, Right, Top, Bottom;
-    int LeftEdge, RightEdge, ytop, ybot;
-    int nbox = RegionNumRects(cclip);
-    BoxPtr pbox = RegionRects(cclip);
-    Bool AlreadySetup = FALSE;
-
-    width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font);
-
-    /* find our backing rectangle dimensions */
-    Left = xInit;
-    Right = Left + width;
-    Top = yInit - FONTASCENT(font);
-    Bottom = yInit + FONTDESCENT(font);
-
-    /* get into the first band that may contain part of our box */
-    while (nbox && (Top >= pbox->y2)) {
-        pbox++;
-        nbox--;
-    }
-
-    while (nbox && (Bottom >= pbox->y1)) {
-        /* handle backing rect first */
-        LeftEdge = max(Left, pbox->x1);
-        RightEdge = min(Right, pbox->x2);
-        if (RightEdge > LeftEdge) {
-            ytop = max(Top, pbox->y1);
-            ybot = min(Bottom, pbox->y2);
-
-            if (ybot > ytop) {
-                if (!AlreadySetup) {
-                    (*infoRec->SetupForSolidFill) (pScrn, bg, GXcopy,
-                                                   planemask);
-                    AlreadySetup = TRUE;
-                }
-                (*infoRec->SubsequentSolidFillRect) (pScrn,
-                                                     LeftEdge, ytop,
-                                                     RightEdge - LeftEdge,
-                                                     ybot - ytop);
-            }
-        }
-        nbox--;
-        pbox++;
-    }
-
-    nbox = RegionNumRects(cclip);
-    pbox = RegionRects(cclip);
-
-    if (infoRec->WriteBitmap && (nglyph > 1) &&
-        ((FONTMAXBOUNDS(font, rightSideBearing) -
-          FONTMINBOUNDS(font, leftSideBearing)) <= 32)) {
-        PolyGlyphBltAsSingleBitmap(pScrn, nglyph, font,
-                                   xInit, yInit, nbox, pbox,
-                                   fg, GXcopy, planemask);
-
-        return;
-    }
-
-    /* compute an approximate but covering bounding box */
-    Left = xInit + infoRec->GlyphInfo[0].start;
-    Right = xInit + infoRec->GlyphInfo[nglyph - 1].end;
-    Top = yInit - FONTMAXBOUNDS(font, ascent);
-    Bottom = yInit + FONTMAXBOUNDS(font, descent);
-
-    /* get into the first band that may contain part of our box */
-    while (nbox && (Top >= pbox->y2)) {
-        pbox++;
-        nbox--;
-    }
-
-    /* stop when the lower edge of the box is beyond our string */
-    while (nbox && (Bottom >= pbox->y1)) {
-        LeftEdge = max(Left, pbox->x1);
-        RightEdge = min(Right, pbox->x2);
-
-        if (RightEdge > LeftEdge) {     /* we're possibly drawing something */
-            ytop = max(Top, pbox->y1);
-            ybot = min(Bottom, pbox->y2);
-            if (ybot > ytop) {
-                skippix = LeftEdge - xInit;
-                skipglyph = 0;
-                while (skippix >= infoRec->GlyphInfo[skipglyph].end)
-                    skipglyph++;
-
-                skippix = RightEdge - xInit;
-                n = 0;
-                i = skipglyph;
-                while ((i < nglyph) && (skippix > infoRec->GlyphInfo[i].start)) {
-                    i++;
-                    n++;
-                }
-
-                if (n)
-                    (*infoRec->NonTEGlyphRenderer) (pScrn,
-                                                    xInit, yInit, n,
-                                                    infoRec->GlyphInfo +
-                                                    skipglyph, pbox, fg, GXcopy,
-                                                    planemask);
-            }
-        }
-
-        nbox--;
-        pbox++;
-    }
-}
-
-static int
-PolyGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn,
-                                int xInit, int yInit,
-                                FontPtr font,
-                                int fg, int rop,
-                                unsigned planemask,
-                                RegionPtr cclip,
-                                int nglyph,
-                                unsigned char *gBase, CharInfoPtr * ppci)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int skippix, skipglyph, width, n, i;
-    int Left, Right, Top, Bottom;
-    int LeftEdge, RightEdge;
-    int nbox = RegionNumRects(cclip);
-    BoxPtr pbox = RegionRects(cclip);
-
-    width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font);
-
-    if (!nbox)
-        return width;
-
-    if ((infoRec->WriteBitmap) && (rop == GXcopy) && (nglyph > 1) &&
-        ((FONTMAXBOUNDS(font, rightSideBearing) -
-          FONTMINBOUNDS(font, leftSideBearing)) <= 32)) {
-
-        PolyGlyphBltAsSingleBitmap(pScrn, nglyph, font,
-                                   xInit, yInit, nbox, pbox,
-                                   fg, rop, planemask);
-
-        return width;
-    }
-
-    /* compute an approximate but covering bounding box */
-    Left = xInit + infoRec->GlyphInfo[0].start;
-    Right = xInit + infoRec->GlyphInfo[nglyph - 1].end;
-    Top = yInit - FONTMAXBOUNDS(font, ascent);
-    Bottom = yInit + FONTMAXBOUNDS(font, descent);
-
-    /* get into the first band that may contain part of our string */
-    while (nbox && (Top >= pbox->y2)) {
-        pbox++;
-        nbox--;
-    }
-
-    /* stop when the lower edge of the box is beyond our string */
-    while (nbox && (Bottom >= pbox->y1)) {
-        LeftEdge = max(Left, pbox->x1);
-        RightEdge = min(Right, pbox->x2);
-
-        if (RightEdge > LeftEdge) {     /* we're possibly drawing something */
-
-            skippix = LeftEdge - xInit;
-            skipglyph = 0;
-            while (skippix >= infoRec->GlyphInfo[skipglyph].end)
-                skipglyph++;
-
-            skippix = RightEdge - xInit;
-            n = 0;
-            i = skipglyph;
-            while ((i < nglyph) && (skippix > infoRec->GlyphInfo[i].start)) {
-                i++;
-                n++;
-            }
-
-            if (n)
-                (*infoRec->NonTEGlyphRenderer) (pScrn,
-                                                xInit, yInit, n,
-                                                infoRec->GlyphInfo + skipglyph,
-                                                pbox, fg, rop, planemask);
-        }
-
-        nbox--;
-        pbox++;
-    }
-    return width;
-}
-
-/* It is possible that the none of the glyphs passed to the 
-   NonTEGlyphRenderer will be drawn.  This function being called
-   indicates that part of the text string's bounding box is visible
-   but not necessarily that any of the characters are visible */
-
-void
-XAANonTEGlyphRenderer(ScrnInfoPtr pScrn,
-                      int x, int y, int n,
-                      NonTEGlyphPtr glyphs,
-                      BoxPtr pbox, int fg, int rop, unsigned int planemask)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int x1, x2, y1, y2, i, w, h, skipleft, skiptop;
-    unsigned char *src;
-
-    for (i = 0; i < n; i++, glyphs++) {
-        x1 = x + glyphs->start;
-        x2 = x + glyphs->end;
-        y1 = y - glyphs->yoff;
-        y2 = y1 + glyphs->height;
-
-        if (y1 < pbox->y1) {
-            skiptop = pbox->y1 - y1;
-            y1 = pbox->y1;
-        }
-        else
-            skiptop = 0;
-        if (y2 > pbox->y2)
-            y2 = pbox->y2;
-        h = y2 - y1;
-        if (h <= 0)
-            continue;
-
-        if (x1 < pbox->x1) {
-            skipleft = pbox->x1 - x1;
-            x1 = pbox->x1;
-        }
-        else
-            skipleft = 0;
-        if (x2 > pbox->x2)
-            x2 = pbox->x2;
-
-        w = x2 - x1;
-
-        if (w > 0) {
-            src = glyphs->bits + (skiptop * glyphs->srcwidth);
-
-            if (skipleft) {
-                src += (skipleft >> 5) << 2;
-                skipleft &= 31;
-            }
-
-            (*infoRec->WriteBitmap) (pScrn, x1, y1, w, h, src,
-                                     glyphs->srcwidth, skipleft, fg, -1, rop,
-                                     planemask);
-        }
-    }
-
-}
diff --git a/hw/xfree86/xaa/xaaOffscreen.c b/hw/xfree86/xaa/xaaOffscreen.c
deleted file mode 100644 (file)
index 7d89fc1..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-
-/*
-   Copyright (c) 1999 -  The XFree86 Project Inc.
-
-   Written by Mark Vojkovich
-
-*/
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "miline.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "xf86fbman.h"
-#include "servermd.h"
-
-void
-XAAMoveOutOffscreenPixmaps(ScreenPtr pScreen)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
-    XAAPixmapPtr pPriv;
-
-    while (pLink) {
-        pPriv = XAA_GET_PIXMAP_PRIVATE(pLink->pPix);
-        pLink->area = pPriv->offscreenArea;
-        XAAMoveOutOffscreenPixmap(pLink->pPix);
-        pLink = pLink->next;
-    }
-}
-
-void
-XAAMoveInOffscreenPixmaps(ScreenPtr pScreen)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
-    PixmapPtr pPix, pScreenPix, tmpPix;
-    pointer data;
-    XAAPixmapPtr pPriv;
-    GCPtr pGC;
-    FBAreaPtr area;
-
-    pScreenPix = (*pScreen->GetScreenPixmap) (pScreen);
-
-    while (pLink) {
-        pPix = pLink->pPix;
-        pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
-        area = pLink->area;
-
-        data = pPix->devPrivate.ptr;
-        tmpPix = GetScratchPixmapHeader(pScreen,
-                                        pPix->drawable.width,
-                                        pPix->drawable.height,
-                                        pPix->drawable.depth,
-                                        pPix->drawable.bitsPerPixel,
-                                        pPix->devKind, data);
-
-        pPriv->freeData = FALSE;
-
-        pPix->drawable.x = area->box.x1;
-        pPix->drawable.y = area->box.y1;
-        pPix->devKind = pScreenPix->devKind;
-        pPix->devPrivate.ptr = pScreenPix->devPrivate.ptr;
-        pPix->drawable.bitsPerPixel = infoRec->pScrn->bitsPerPixel;
-        pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
-        if (!tmpPix) {
-            pPriv->offscreenArea = area;
-            free(data);
-            pLink = pLink->next;
-            continue;
-        }
-
-        pGC = GetScratchGC(pPix->drawable.depth, pScreen);
-        ValidateGC((DrawablePtr) pPix, pGC);
-
-        (*pGC->ops->CopyArea) ((DrawablePtr) tmpPix, (DrawablePtr) pPix, pGC,
-                               0, 0, pPix->drawable.width,
-                               pPix->drawable.height, 0, 0);
-
-        free(data);
-        tmpPix->devPrivate.ptr = NULL;
-
-        FreeScratchGC(pGC);
-        FreeScratchPixmapHeader(tmpPix);
-
-        pPriv->offscreenArea = area;
-        pLink->area = NULL;
-        pLink = pLink->next;
-    }
-}
-
-void
-XAARemoveAreaCallback(FBAreaPtr area)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(area->pScreen);
-    PixmapPtr pPix = (PixmapPtr) area->devPrivate.ptr;
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
-
-    XAAMoveOutOffscreenPixmap(pPix);
-
-    pPriv->flags &= ~OFFSCREEN;
-
-    DELIST_OFFSCREEN_PIXMAP(pPix);
-}
-
-void
-XAAMoveOutOffscreenPixmap(PixmapPtr pPix)
-{
-    ScreenPtr pScreen = pPix->drawable.pScreen;
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
-    int width, height, devKind, bitsPerPixel;
-    PixmapPtr tmpPix;
-    unsigned char *data;
-    GCPtr pGC;
-
-    width = pPix->drawable.width;
-    height = pPix->drawable.height;
-    bitsPerPixel = pPix->drawable.bitsPerPixel;
-
-    devKind = BitmapBytePad(width * bitsPerPixel);
-    if (!(data = malloc(devKind * height)))
-        FatalError("Out of memory\n");
-
-    tmpPix = GetScratchPixmapHeader(pScreen, width, height,
-                                    pPix->drawable.depth, bitsPerPixel, devKind,
-                                    data);
-    if (!tmpPix) {
-        free(data);
-        FatalError("Out of memory\n");
-    }
-
-    pGC = GetScratchGC(pPix->drawable.depth, pScreen);
-    ValidateGC((DrawablePtr) tmpPix, pGC);
-
-    (*pGC->ops->CopyArea) ((DrawablePtr) pPix, (DrawablePtr) tmpPix,
-                           pGC, 0, 0, width, height, 0, 0);
-
-    FreeScratchGC(pGC);
-    FreeScratchPixmapHeader(tmpPix);
-
-    pPix->drawable.x = 0;
-    pPix->drawable.y = 0;
-    pPix->devKind = devKind;
-    pPix->devPrivate.ptr = data;
-    pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
-    pPriv->offscreenArea = NULL;
-    pPriv->freeData = TRUE;
-}
diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c
deleted file mode 100644 (file)
index 25d18da..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "mioverlay.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-static void
-XAACopyWindow8_32(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-{
-    DDXPointPtr pptSrc, ppt;
-    RegionRec rgnDst;
-    BoxPtr pbox;
-    int dx, dy, nbox;
-    WindowPtr pwinRoot;
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
-    Bool doUnderlay = miOverlayCopyUnderlay(pScreen);
-    RegionPtr borderClip = &pWin->borderClip;
-    Bool freeReg = FALSE;
-
-    if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt ||
-        (infoRec->ScreenToScreenBitBltFlags & NO_PLANEMASK)) {
-        XAA_SCREEN_PROLOGUE(pScreen, CopyWindow);
-        if (infoRec->pScrn->vtSema && infoRec->NeedToSync) {
-            (*infoRec->Sync) (infoRec->pScrn);
-            infoRec->NeedToSync = FALSE;
-        }
-        (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
-        XAA_SCREEN_EPILOGUE(pScreen, CopyWindow, XAACopyWindow8_32);
-        return;
-    }
-
-    pwinRoot = pScreen->root;
-
-    if (doUnderlay)
-        freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
-
-    RegionNull(&rgnDst);
-
-    dx = ptOldOrg.x - pWin->drawable.x;
-    dy = ptOldOrg.y - pWin->drawable.y;
-    RegionTranslate(prgnSrc, -dx, -dy);
-    RegionIntersect(&rgnDst, borderClip, prgnSrc);
-
-    pbox = RegionRects(&rgnDst);
-    nbox = RegionNumRects(&rgnDst);
-    if (!nbox || !(pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec)))) {
-        RegionUninit(&rgnDst);
-        return;
-    }
-    ppt = pptSrc;
-
-    while (nbox--) {
-        ppt->x = pbox->x1 + dx;
-        ppt->y = pbox->y1 + dy;
-        ppt++;
-        pbox++;
-    }
-
-    infoRec->ScratchGC.planemask = doUnderlay ? 0x00ffffff : 0xff000000;
-    infoRec->ScratchGC.alu = GXcopy;
-
-    XAADoBitBlt((DrawablePtr) pwinRoot, (DrawablePtr) pwinRoot,
-                &(infoRec->ScratchGC), &rgnDst, pptSrc);
-
-    free(pptSrc);
-    RegionUninit(&rgnDst);
-    if (freeReg)
-        RegionDestroy(borderClip);
-}
-
-static void
-XAASetColorKey8_32(ScreenPtr pScreen, int nbox, BoxPtr pbox)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    ScrnInfoPtr pScrn = infoRec->pScrn;
-
-    /* I'm counting on writes being clipped away while switched away.
-       If this isn't going to be true then I need to be wrapping instead. */
-    if (!infoRec->pScrn->vtSema)
-        return;
-
-    (*infoRec->FillSolidRects) (pScrn, pScrn->colorKey << 24, GXcopy,
-                                0xff000000, nbox, pbox);
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAASetupOverlay8_32Planar(ScreenPtr pScreen)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    int i;
-
-    pScreen->CopyWindow = XAACopyWindow8_32;
-
-    if (!(infoRec->FillSolidRectsFlags & NO_PLANEMASK))
-        miOverlaySetTransFunction(pScreen, XAASetColorKey8_32);
-
-    infoRec->FullPlanemask = ~0;
-    for (i = 0; i < 32; i++)    /* haven't thought about this much */
-        infoRec->FullPlanemasks[i] = ~0;
-}
diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c
deleted file mode 100644 (file)
index 5918f65..0000000
+++ /dev/null
@@ -1,906 +0,0 @@
-/*
-   Copyright (c) 1999 - The XFree86 Project Inc.
-
-   Written by Mark Vojkovich
-*/
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "miline.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "servermd.h"
-
-/* Screen funcs */
-
-static void XAAOverCopyWindow(WindowPtr, DDXPointRec, RegionPtr);
-static void XAAOverWindowExposures(WindowPtr, RegionPtr, RegionPtr);
-
-static int XAAOverStippledFillChooser(GCPtr);
-static int XAAOverOpaqueStippledFillChooser(GCPtr);
-static int XAAOverTiledFillChooser(GCPtr);
-
-/* GC funcs */
-
-static RegionPtr XAAOverCopyArea(DrawablePtr, DrawablePtr, GC *,
-                                 int, int, int, int, int, int);
-static RegionPtr XAAOverCopyPlane(DrawablePtr, DrawablePtr, GCPtr,
-                                  int, int, int, int, int, int, unsigned long);
-static void XAAOverPushPixelsSolid(GCPtr, PixmapPtr, DrawablePtr, int,
-                                   int, int, int);
-static void XAAOverPolyFillRectSolid(DrawablePtr, GCPtr, int, xRectangle *);
-static void XAAOverPolyFillRectStippled(DrawablePtr, GCPtr, int, xRectangle *);
-static void XAAOverPolyFillRectOpaqueStippled(DrawablePtr, GCPtr,
-                                              int, xRectangle *);
-static void XAAOverPolyFillRectTiled(DrawablePtr, GCPtr, int, xRectangle *);
-static void XAAOverFillSpansSolid(DrawablePtr, GCPtr, int, DDXPointPtr,
-                                  int *, int);
-static void XAAOverFillSpansStippled(DrawablePtr, GCPtr, int, DDXPointPtr,
-                                     int *, int);
-static void XAAOverFillSpansOpaqueStippled(DrawablePtr, GCPtr, int,
-                                           DDXPointPtr, int *, int);
-static void XAAOverFillSpansTiled(DrawablePtr, GCPtr, int, DDXPointPtr,
-                                  int *, int);
-static int XAAOverPolyText8TE(DrawablePtr, GCPtr, int, int, int, char *);
-static int XAAOverPolyText16TE(DrawablePtr, GCPtr, int, int, int,
-                               unsigned short *);
-static void XAAOverImageText8TE(DrawablePtr, GCPtr, int, int, int, char *);
-static void XAAOverImageText16TE(DrawablePtr, GCPtr, int, int, int,
-                                 unsigned short *);
-static void XAAOverImageGlyphBltTE(DrawablePtr, GCPtr, int, int,
-                                   unsigned int, CharInfoPtr *, pointer);
-static void XAAOverPolyGlyphBltTE(DrawablePtr, GCPtr, int, int,
-                                  unsigned int, CharInfoPtr *, pointer);
-static int XAAOverPolyText8NonTE(DrawablePtr, GCPtr, int, int, int, char *);
-static int XAAOverPolyText16NonTE(DrawablePtr, GCPtr, int, int, int,
-                                  unsigned short *);
-static void XAAOverImageText8NonTE(DrawablePtr, GCPtr, int, int, int, char *);
-static void XAAOverImageText16NonTE(DrawablePtr, GCPtr, int, int, int,
-                                    unsigned short *);
-static void XAAOverImageGlyphBltNonTE(DrawablePtr, GCPtr, int, int,
-                                      unsigned int, CharInfoPtr *, pointer);
-static void XAAOverPolyGlyphBltNonTE(DrawablePtr, GCPtr, int, int,
-                                     unsigned int, CharInfoPtr *, pointer);
-static void XAAOverPolyRectangleThinSolid(DrawablePtr, GCPtr, int,
-                                          xRectangle *);
-static void XAAOverPolylinesWideSolid(DrawablePtr, GCPtr, int, int,
-                                      DDXPointPtr);
-static void XAAOverPolylinesThinSolid(DrawablePtr, GCPtr, int, int,
-                                      DDXPointPtr);
-static void XAAOverPolySegmentThinSolid(DrawablePtr, GCPtr, int, xSegment *);
-static void XAAOverPolylinesThinDashed(DrawablePtr, GCPtr, int, int,
-                                       DDXPointPtr);
-static void XAAOverPolySegmentThinDashed(DrawablePtr, GCPtr, int, xSegment *);
-static void XAAOverFillPolygonSolid(DrawablePtr, GCPtr, int, int, int,
-                                    DDXPointPtr);
-static void XAAOverFillPolygonStippled(DrawablePtr, GCPtr, int, int, int,
-                                       DDXPointPtr);
-static void XAAOverFillPolygonOpaqueStippled(DrawablePtr, GCPtr, int, int, int,
-                                             DDXPointPtr);
-static void XAAOverFillPolygonTiled(DrawablePtr, GCPtr, int, int, int,
-                                    DDXPointPtr);
-static void XAAOverPolyFillArcSolid(DrawablePtr, GCPtr, int, xArc *);
-static void XAAOverPutImage(DrawablePtr, GCPtr, int, int, int, int, int,
-                            int, int, char *);
-
-typedef struct {
-    ScrnInfoPtr pScrn;
-    DepthChangeFuncPtr callback;
-    int currentDepth;
-/* GC funcs */
-    RegionPtr (*CopyArea) (DrawablePtr, DrawablePtr, GC *,
-                           int, int, int, int, int, int);
-    RegionPtr (*CopyPlane) (DrawablePtr, DrawablePtr, GCPtr,
-                            int, int, int, int, int, int, unsigned long);
-    void (*PushPixelsSolid) (GCPtr, PixmapPtr, DrawablePtr, int, int, int, int);
-    void (*PolyFillRectSolid) (DrawablePtr, GCPtr, int, xRectangle *);
-    void (*PolyFillRectStippled) (DrawablePtr, GCPtr, int, xRectangle *);
-    void (*PolyFillRectOpaqueStippled) (DrawablePtr, GCPtr, int, xRectangle *);
-    void (*PolyFillRectTiled) (DrawablePtr, GCPtr, int, xRectangle *);
-    void (*FillSpansSolid) (DrawablePtr, GCPtr, int, DDXPointPtr, int *, int);
-    void (*FillSpansStippled) (DrawablePtr, GCPtr, int, DDXPointPtr, int *,
-                               int);
-    void (*FillSpansOpaqueStippled) (DrawablePtr, GCPtr, int, DDXPointPtr,
-                                     int *, int);
-    void (*FillSpansTiled) (DrawablePtr, GCPtr, int, DDXPointPtr, int *, int);
-    int (*PolyText8TE) (DrawablePtr, GCPtr, int, int, int, char *);
-    int (*PolyText16TE) (DrawablePtr, GCPtr, int, int, int, unsigned short *);
-    void (*ImageText8TE) (DrawablePtr, GCPtr, int, int, int, char *);
-    void (*ImageText16TE) (DrawablePtr, GCPtr, int, int, int, unsigned short *);
-    void (*ImageGlyphBltTE) (DrawablePtr, GCPtr, int, int, unsigned int,
-                             CharInfoPtr *, pointer);
-    void (*PolyGlyphBltTE) (DrawablePtr, GCPtr, int, int, unsigned int,
-                            CharInfoPtr *, pointer);
-    int (*PolyText8NonTE) (DrawablePtr, GCPtr, int, int, int, char *);
-    int (*PolyText16NonTE) (DrawablePtr, GCPtr, int, int, int,
-                            unsigned short *);
-    void (*ImageText8NonTE) (DrawablePtr, GCPtr, int, int, int, char *);
-    void (*ImageText16NonTE) (DrawablePtr, GCPtr, int, int, int,
-                              unsigned short *);
-    void (*ImageGlyphBltNonTE) (DrawablePtr, GCPtr, int, int, unsigned int,
-                                CharInfoPtr *, pointer);
-    void (*PolyGlyphBltNonTE) (DrawablePtr, GCPtr, int, int, unsigned int,
-                               CharInfoPtr *, pointer);
-    void (*PolyRectangleThinSolid) (DrawablePtr, GCPtr, int, xRectangle *);
-    void (*PolylinesWideSolid) (DrawablePtr, GCPtr, int, int, DDXPointPtr);
-
-    void (*PolylinesThinSolid) (DrawablePtr, GCPtr, int, int, DDXPointPtr);
-    void (*PolySegmentThinSolid) (DrawablePtr, GCPtr, int, xSegment *);
-    void (*PolylinesThinDashed) (DrawablePtr, GCPtr, int, int, DDXPointPtr);
-    void (*PolySegmentThinDashed) (DrawablePtr, GCPtr, int, xSegment *);
-    void (*FillPolygonSolid) (DrawablePtr, GCPtr, int, int, int, DDXPointPtr);
-    void (*FillPolygonStippled) (DrawablePtr, GCPtr, int, int, int,
-                                 DDXPointPtr);
-    void (*FillPolygonOpaqueStippled) (DrawablePtr, GCPtr, int, int, int,
-                                       DDXPointPtr);
-    void (*FillPolygonTiled) (DrawablePtr, GCPtr, int, int, int, DDXPointPtr);
-    void (*PolyFillArcSolid) (DrawablePtr, GCPtr, int, xArc *);
-    void (*PutImage) (DrawablePtr, GCPtr, int, int, int, int, int, int,
-                      int, char *);
-    int (*StippledFillChooser) (GCPtr);
-    int (*OpaqueStippledFillChooser) (GCPtr);
-    int (*TiledFillChooser) (GCPtr);
-} XAAOverlayRec, *XAAOverlayPtr;
-
-static DevPrivateKeyRec XAAOverlayKeyRec;
-
-#define XAAOverlayKey (&XAAOverlayKeyRec)
-
-#define GET_OVERLAY_PRIV(pScreen) \
-    (XAAOverlayPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAOverlayKey)
-
-#define SWITCH_DEPTH(d) \
-   if(pOverPriv->currentDepth != d) { \
-       (*pOverPriv->callback)(pOverPriv->pScrn, d); \
-       pOverPriv->currentDepth = d; \
-   }
-
-Bool
-XAAInitDualFramebufferOverlay(ScreenPtr pScreen, DepthChangeFuncPtr callback)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    XAAOverlayPtr pOverPriv;
-
-    if (!dixRegisterPrivateKey(&XAAOverlayKeyRec, PRIVATE_SCREEN, 0))
-        return FALSE;
-
-    if (!(pOverPriv = malloc(sizeof(XAAOverlayRec))))
-        return FALSE;
-
-    dixSetPrivate(&pScreen->devPrivates, XAAOverlayKey, pOverPriv);
-
-    pOverPriv->pScrn = pScrn;
-    pOverPriv->callback = callback;
-    pOverPriv->currentDepth = -1;
-
-    /* Overwrite key screen functions.  The XAA core will clean up */
-
-    pScreen->CopyWindow = XAAOverCopyWindow;
-    pScreen->WindowExposures = XAAOverWindowExposures;
-
-    pOverPriv->StippledFillChooser = infoRec->StippledFillChooser;
-    pOverPriv->OpaqueStippledFillChooser = infoRec->OpaqueStippledFillChooser;
-    pOverPriv->TiledFillChooser = infoRec->TiledFillChooser;
-
-    infoRec->StippledFillChooser = XAAOverStippledFillChooser;
-    infoRec->OpaqueStippledFillChooser = XAAOverOpaqueStippledFillChooser;
-    infoRec->TiledFillChooser = XAAOverTiledFillChooser;
-
-    /* wrap all XAA GC rendering */
-
-    pOverPriv->CopyArea = infoRec->CopyArea;
-    pOverPriv->CopyPlane = infoRec->CopyPlane;
-    pOverPriv->PushPixelsSolid = infoRec->PushPixelsSolid;
-    pOverPriv->PolyFillRectSolid = infoRec->PolyFillRectSolid;
-    pOverPriv->PolyFillRectStippled = infoRec->PolyFillRectStippled;
-    pOverPriv->PolyFillRectOpaqueStippled = infoRec->PolyFillRectOpaqueStippled;
-    pOverPriv->PolyFillRectTiled = infoRec->PolyFillRectTiled;
-    pOverPriv->FillSpansSolid = infoRec->FillSpansSolid;
-    pOverPriv->FillSpansStippled = infoRec->FillSpansStippled;
-    pOverPriv->FillSpansOpaqueStippled = infoRec->FillSpansOpaqueStippled;
-    pOverPriv->FillSpansTiled = infoRec->FillSpansTiled;
-    pOverPriv->PolyText8TE = infoRec->PolyText8TE;
-    pOverPriv->PolyText16TE = infoRec->PolyText16TE;
-    pOverPriv->ImageText8TE = infoRec->ImageText8TE;
-    pOverPriv->ImageText16TE = infoRec->ImageText16TE;
-    pOverPriv->ImageGlyphBltTE = infoRec->ImageGlyphBltTE;
-    pOverPriv->PolyGlyphBltTE = infoRec->PolyGlyphBltTE;
-    pOverPriv->PolyText8NonTE = infoRec->PolyText8NonTE;
-    pOverPriv->PolyText16NonTE = infoRec->PolyText16NonTE;
-    pOverPriv->ImageText8NonTE = infoRec->ImageText8NonTE;
-    pOverPriv->ImageText16NonTE = infoRec->ImageText16NonTE;
-    pOverPriv->ImageGlyphBltNonTE = infoRec->ImageGlyphBltNonTE;
-    pOverPriv->PolyGlyphBltNonTE = infoRec->PolyGlyphBltNonTE;
-    pOverPriv->PolyRectangleThinSolid = infoRec->PolyRectangleThinSolid;
-    pOverPriv->PolylinesWideSolid = infoRec->PolylinesWideSolid;
-    pOverPriv->PolylinesThinSolid = infoRec->PolylinesThinSolid;
-    pOverPriv->PolySegmentThinSolid = infoRec->PolySegmentThinSolid;
-    pOverPriv->PolylinesThinDashed = infoRec->PolylinesThinDashed;
-    pOverPriv->PolySegmentThinDashed = infoRec->PolySegmentThinDashed;
-    pOverPriv->FillPolygonSolid = infoRec->FillPolygonSolid;
-    pOverPriv->FillPolygonStippled = infoRec->FillPolygonStippled;
-    pOverPriv->FillPolygonOpaqueStippled = infoRec->FillPolygonOpaqueStippled;
-    pOverPriv->FillPolygonTiled = infoRec->FillPolygonTiled;
-    pOverPriv->PolyFillArcSolid = infoRec->PolyFillArcSolid;
-    pOverPriv->PutImage = infoRec->PutImage;
-
-    if (infoRec->CopyArea)
-        infoRec->CopyArea = XAAOverCopyArea;
-    if (infoRec->CopyPlane)
-        infoRec->CopyPlane = XAAOverCopyPlane;
-    if (infoRec->PushPixelsSolid)
-        infoRec->PushPixelsSolid = XAAOverPushPixelsSolid;
-    if (infoRec->PolyFillRectSolid)
-        infoRec->PolyFillRectSolid = XAAOverPolyFillRectSolid;
-    if (infoRec->PolyFillRectStippled)
-        infoRec->PolyFillRectStippled = XAAOverPolyFillRectStippled;
-    if (infoRec->PolyFillRectOpaqueStippled)
-        infoRec->PolyFillRectOpaqueStippled = XAAOverPolyFillRectOpaqueStippled;
-    if (infoRec->PolyFillRectTiled)
-        infoRec->PolyFillRectTiled = XAAOverPolyFillRectTiled;
-    if (infoRec->FillSpansSolid)
-        infoRec->FillSpansSolid = XAAOverFillSpansSolid;
-    if (infoRec->FillSpansStippled)
-        infoRec->FillSpansStippled = XAAOverFillSpansStippled;
-    if (infoRec->FillSpansOpaqueStippled)
-        infoRec->FillSpansOpaqueStippled = XAAOverFillSpansOpaqueStippled;
-    if (infoRec->FillSpansTiled)
-        infoRec->FillSpansTiled = XAAOverFillSpansTiled;
-    if (infoRec->PolyText8TE)
-        infoRec->PolyText8TE = XAAOverPolyText8TE;
-    if (infoRec->PolyText16TE)
-        infoRec->PolyText16TE = XAAOverPolyText16TE;
-    if (infoRec->ImageText8TE)
-        infoRec->ImageText8TE = XAAOverImageText8TE;
-    if (infoRec->ImageText16TE)
-        infoRec->ImageText16TE = XAAOverImageText16TE;
-    if (infoRec->ImageGlyphBltTE)
-        infoRec->ImageGlyphBltTE = XAAOverImageGlyphBltTE;
-    if (infoRec->PolyGlyphBltTE)
-        infoRec->PolyGlyphBltTE = XAAOverPolyGlyphBltTE;
-    if (infoRec->PolyText8NonTE)
-        infoRec->PolyText8NonTE = XAAOverPolyText8NonTE;
-    if (infoRec->PolyText16NonTE)
-        infoRec->PolyText16NonTE = XAAOverPolyText16NonTE;
-    if (infoRec->ImageText8NonTE)
-        infoRec->ImageText8NonTE = XAAOverImageText8NonTE;
-    if (infoRec->ImageText16NonTE)
-        infoRec->ImageText16NonTE = XAAOverImageText16NonTE;
-    if (infoRec->ImageGlyphBltNonTE)
-        infoRec->ImageGlyphBltNonTE = XAAOverImageGlyphBltNonTE;
-    if (infoRec->PolyGlyphBltNonTE)
-        infoRec->PolyGlyphBltNonTE = XAAOverPolyGlyphBltNonTE;
-    if (infoRec->PolyRectangleThinSolid)
-        infoRec->PolyRectangleThinSolid = XAAOverPolyRectangleThinSolid;
-    if (infoRec->PolylinesWideSolid)
-        infoRec->PolylinesWideSolid = XAAOverPolylinesWideSolid;
-    if (infoRec->PolylinesThinSolid)
-        infoRec->PolylinesThinSolid = XAAOverPolylinesThinSolid;
-    if (infoRec->PolySegmentThinSolid)
-        infoRec->PolySegmentThinSolid = XAAOverPolySegmentThinSolid;
-    if (infoRec->PolylinesThinDashed)
-        infoRec->PolylinesThinDashed = XAAOverPolylinesThinDashed;
-    if (infoRec->PolySegmentThinDashed)
-        infoRec->PolySegmentThinDashed = XAAOverPolySegmentThinDashed;
-    if (infoRec->FillPolygonSolid)
-        infoRec->FillPolygonSolid = XAAOverFillPolygonSolid;
-    if (infoRec->FillPolygonStippled)
-        infoRec->FillPolygonStippled = XAAOverFillPolygonStippled;
-    if (infoRec->FillPolygonOpaqueStippled)
-        infoRec->FillPolygonOpaqueStippled = XAAOverFillPolygonOpaqueStippled;
-    if (infoRec->FillPolygonTiled)
-        infoRec->FillPolygonTiled = XAAOverFillPolygonTiled;
-    if (infoRec->PolyFillArcSolid)
-        infoRec->PolyFillArcSolid = XAAOverPolyFillArcSolid;
-    if (infoRec->PutImage)
-        infoRec->PutImage = XAAOverPutImage;
-
-    return TRUE;
-}
-
-/***********************  Screen functions ************************/
-
-void
-XAAOverCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-{
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
-    ScrnInfoPtr pScrn = infoRec->pScrn;
-    DDXPointPtr ppt, pptSrc;
-    RegionRec rgnDst;
-    BoxPtr pbox;
-    int i, nbox, dx, dy;
-    WindowPtr pRoot = pScreen->root;
-
-    if (!pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) {
-        XAA_SCREEN_PROLOGUE(pScreen, CopyWindow);
-        if (pScrn->vtSema && infoRec->NeedToSync) {
-            (*infoRec->Sync) (pScrn);
-            infoRec->NeedToSync = FALSE;
-        }
-        (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
-        XAA_SCREEN_EPILOGUE(pScreen, CopyWindow, XAAOverCopyWindow);
-        return;
-    }
-
-    infoRec->ScratchGC.alu = GXcopy;
-    infoRec->ScratchGC.planemask = ~0;
-
-    RegionNull(&rgnDst);
-
-    dx = ptOldOrg.x - pWin->drawable.x;
-    dy = ptOldOrg.y - pWin->drawable.y;
-    RegionTranslate(prgnSrc, -dx, -dy);
-    RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
-
-    nbox = RegionNumRects(&rgnDst);
-    if (nbox && (pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec)))) {
-
-        pbox = RegionRects(&rgnDst);
-        for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
-            ppt->x = pbox->x1 + dx;
-            ppt->y = pbox->y1 + dy;
-        }
-
-        SWITCH_DEPTH(8);
-        XAADoBitBlt((DrawablePtr) pRoot, (DrawablePtr) pRoot,
-                    &(infoRec->ScratchGC), &rgnDst, pptSrc);
-
-        if (pWin->drawable.bitsPerPixel != 8) {
-            SWITCH_DEPTH(pScrn->depth);
-            XAADoBitBlt((DrawablePtr) pRoot, (DrawablePtr) pRoot,
-                        &(infoRec->ScratchGC), &rgnDst, pptSrc);
-        }
-
-        free(pptSrc);
-    }
-
-    RegionUninit(&rgnDst);
-
-    if (pWin->drawable.depth == 8) {
-        RegionNull(&rgnDst);
-        miSegregateChildren(pWin, &rgnDst, pScrn->depth);
-        if (RegionNotEmpty(&rgnDst)) {
-            RegionIntersect(&rgnDst, &rgnDst, prgnSrc);
-            nbox = RegionNumRects(&rgnDst);
-            if (nbox &&
-                (pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec)))) {
-
-                pbox = RegionRects(&rgnDst);
-                for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
-                    ppt->x = pbox->x1 + dx;
-                    ppt->y = pbox->y1 + dy;
-                }
-
-                SWITCH_DEPTH(pScrn->depth);
-                XAADoBitBlt((DrawablePtr) pRoot, (DrawablePtr) pRoot,
-                            &(infoRec->ScratchGC), &rgnDst, pptSrc);
-                free(pptSrc);
-            }
-        }
-        RegionUninit(&rgnDst);
-    }
-}
-
-void
-XAAOverWindowExposures(WindowPtr pWin, RegionPtr pReg, RegionPtr pOtherReg)
-{
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-
-    if ((pWin->drawable.bitsPerPixel != 8) && infoRec->pScrn->vtSema) {
-        if (RegionNumRects(pReg) && infoRec->FillSolidRects) {
-            XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
-
-            SWITCH_DEPTH(8);
-            (*infoRec->FillSolidRects) (infoRec->pScrn,
-                                        infoRec->pScrn->colorKey, GXcopy, ~0,
-                                        RegionNumRects(pReg),
-                                        RegionRects(pReg));
-            miWindowExposures(pWin, pReg, pOtherReg);
-            return;
-        }
-        else if (infoRec->NeedToSync) {
-            (*infoRec->Sync) (infoRec->pScrn);
-            infoRec->NeedToSync = FALSE;
-        }
-    }
-
-    XAA_SCREEN_PROLOGUE(pScreen, WindowExposures);
-    (*pScreen->WindowExposures) (pWin, pReg, pOtherReg);
-    XAA_SCREEN_EPILOGUE(pScreen, WindowExposures, XAAOverWindowExposures);
-}
-
-/*********************  Choosers *************************/
-
-static int
-XAAOverStippledFillChooser(GCPtr pGC)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-    int ret;
-
-    ret = (*pOverPriv->StippledFillChooser) (pGC);
-
-    if ((pGC->depth == 8) && ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) {
-        ret = 0;
-    }
-
-    return ret;
-}
-
-static int
-XAAOverOpaqueStippledFillChooser(GCPtr pGC)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-    int ret;
-
-    ret = (*pOverPriv->OpaqueStippledFillChooser) (pGC);
-
-    if ((pGC->depth == 8) && ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) {
-        ret = 0;
-    }
-
-    return ret;
-}
-
-static int
-XAAOverTiledFillChooser(GCPtr pGC)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-    int ret;
-
-    ret = (*pOverPriv->TiledFillChooser) (pGC);
-
-    if ((pGC->depth == 8) && ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) {
-        ret = 0;
-    }
-
-    return ret;
-}
-
-/**************************** GC Functions **************************/
-
-static RegionPtr
-XAAOverCopyArea(DrawablePtr pSrc,
-                DrawablePtr pDst,
-                GC * pGC,
-                int srcx, int srcy, int width, int height, int dstx, int dsty)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    return (*pOverPriv->CopyArea) (pSrc, pDst,
-                                   pGC, srcx, srcy, width, height, dstx, dsty);
-}
-
-static RegionPtr
-XAAOverCopyPlane(DrawablePtr pSrc,
-                 DrawablePtr pDst,
-                 GCPtr pGC,
-                 int srcx, int srcy,
-                 int width, int height,
-                 int dstx, int dsty, unsigned long bitPlane)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    return (*pOverPriv->CopyPlane) (pSrc, pDst,
-                                    pGC, srcx, srcy, width, height, dstx, dsty,
-                                    bitPlane);
-
-}
-
-static void
-XAAOverPushPixelsSolid(GCPtr pGC,
-                       PixmapPtr pBitMap,
-                       DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PushPixelsSolid) (pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
-}
-
-static void
-XAAOverPolyFillRectSolid(DrawablePtr pDraw,
-                         GCPtr pGC, int nrectFill, xRectangle *prectInit)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolyFillRectSolid) (pDraw, pGC, nrectFill, prectInit);
-}
-
-static void
-XAAOverPolyFillRectStippled(DrawablePtr pDraw,
-                            GCPtr pGC, int nrectFill, xRectangle *prectInit)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolyFillRectStippled) (pDraw, pGC, nrectFill, prectInit);
-}
-
-static void
-XAAOverPolyFillRectOpaqueStippled(DrawablePtr pDraw,
-                                  GCPtr pGC,
-                                  int nrectFill, xRectangle *prectInit)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolyFillRectOpaqueStippled) (pDraw, pGC, nrectFill, prectInit);
-}
-
-static void
-XAAOverPolyFillRectTiled(DrawablePtr pDraw,
-                         GCPtr pGC, int nrectFill, xRectangle *prectInit)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolyFillRectTiled) (pDraw, pGC, nrectFill, prectInit);
-}
-
-static void
-XAAOverFillSpansSolid(DrawablePtr pDraw,
-                      GCPtr pGC,
-                      int nInit, DDXPointPtr ppt, int *pwidth, int fSorted)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->FillSpansSolid) (pDraw, pGC, nInit, ppt, pwidth, fSorted);
-}
-
-static void
-XAAOverFillSpansStippled(DrawablePtr pDraw,
-                         GCPtr pGC,
-                         int nInit, DDXPointPtr ppt, int *pwidth, int fSorted)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->FillSpansStippled) (pDraw, pGC, nInit, ppt, pwidth, fSorted);
-}
-
-static void
-XAAOverFillSpansOpaqueStippled(DrawablePtr pDraw,
-                               GCPtr pGC,
-                               int nInit,
-                               DDXPointPtr ppt, int *pwidth, int fSorted)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->FillSpansOpaqueStippled) (pDraw, pGC, nInit, ppt, pwidth,
-                                           fSorted);
-}
-
-static void
-XAAOverFillSpansTiled(DrawablePtr pDraw,
-                      GCPtr pGC,
-                      int nInit, DDXPointPtr ppt, int *pwidth, int fSorted)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->FillSpansTiled) (pDraw, pGC, nInit, ppt, pwidth, fSorted);
-}
-
-static int
-XAAOverPolyText8TE(DrawablePtr pDraw,
-                   GCPtr pGC, int x, int y, int count, char *chars)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    return (*pOverPriv->PolyText8TE) (pDraw, pGC, x, y, count, chars);
-}
-
-static int
-XAAOverPolyText16TE(DrawablePtr pDraw,
-                    GCPtr pGC, int x, int y, int count, unsigned short *chars)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    return (*pOverPriv->PolyText16TE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAOverImageText8TE(DrawablePtr pDraw,
-                    GCPtr pGC, int x, int y, int count, char *chars)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->ImageText8TE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAOverImageText16TE(DrawablePtr pDraw,
-                     GCPtr pGC, int x, int y, int count, unsigned short *chars)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->ImageText16TE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAOverImageGlyphBltTE(DrawablePtr pDraw,
-                       GCPtr pGC,
-                       int xInit, int yInit,
-                       unsigned int nglyph,
-                       CharInfoPtr * ppci, pointer pglyphBase)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->ImageGlyphBltTE) (pDraw, pGC, xInit, yInit, nglyph, ppci,
-                                   pglyphBase);
-}
-
-static void
-XAAOverPolyGlyphBltTE(DrawablePtr pDraw,
-                      GCPtr pGC,
-                      int xInit, int yInit,
-                      unsigned int nglyph,
-                      CharInfoPtr * ppci, pointer pglyphBase)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolyGlyphBltTE) (pDraw, pGC, xInit, yInit, nglyph, ppci,
-                                  pglyphBase);
-}
-
-static int
-XAAOverPolyText8NonTE(DrawablePtr pDraw,
-                      GCPtr pGC, int x, int y, int count, char *chars)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    return (*pOverPriv->PolyText8NonTE) (pDraw, pGC, x, y, count, chars);
-}
-
-static int
-XAAOverPolyText16NonTE(DrawablePtr pDraw,
-                       GCPtr pGC,
-                       int x, int y, int count, unsigned short *chars)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    return (*pOverPriv->PolyText16NonTE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAOverImageText8NonTE(DrawablePtr pDraw,
-                       GCPtr pGC, int x, int y, int count, char *chars)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->ImageText8NonTE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAOverImageText16NonTE(DrawablePtr pDraw,
-                        GCPtr pGC,
-                        int x, int y, int count, unsigned short *chars)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->ImageText16NonTE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAOverImageGlyphBltNonTE(DrawablePtr pDraw,
-                          GCPtr pGC,
-                          int xInit, int yInit,
-                          unsigned int nglyph,
-                          CharInfoPtr * ppci, pointer pglyphBase)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->ImageGlyphBltNonTE) (pDraw, pGC, xInit, yInit, nglyph, ppci,
-                                      pglyphBase);
-}
-
-static void
-XAAOverPolyGlyphBltNonTE(DrawablePtr pDraw,
-                         GCPtr pGC,
-                         int xInit, int yInit,
-                         unsigned int nglyph,
-                         CharInfoPtr * ppci, pointer pglyphBase)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolyGlyphBltNonTE) (pDraw, pGC, xInit, yInit, nglyph, ppci,
-                                     pglyphBase);
-}
-
-static void
-XAAOverPolyRectangleThinSolid(DrawablePtr pDraw,
-                              GCPtr pGC, int nRectsInit, xRectangle *pRectsInit)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolyRectangleThinSolid) (pDraw, pGC, nRectsInit, pRectsInit);
-}
-
-static void
-XAAOverPolylinesWideSolid(DrawablePtr pDraw,
-                          GCPtr pGC, int mode, int npt, DDXPointPtr pPts)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolylinesWideSolid) (pDraw, pGC, mode, npt, pPts);
-}
-
-static void
-XAAOverPolylinesThinSolid(DrawablePtr pDraw,
-                          GCPtr pGC, int mode, int npt, DDXPointPtr pPts)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolylinesThinSolid) (pDraw, pGC, mode, npt, pPts);
-}
-
-static void
-XAAOverPolySegmentThinSolid(DrawablePtr pDraw,
-                            GCPtr pGC, int nseg, xSegment * pSeg)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolySegmentThinSolid) (pDraw, pGC, nseg, pSeg);
-}
-
-static void
-XAAOverPolylinesThinDashed(DrawablePtr pDraw,
-                           GCPtr pGC, int mode, int npt, DDXPointPtr pPts)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolylinesThinDashed) (pDraw, pGC, mode, npt, pPts);
-}
-
-static void
-XAAOverPolySegmentThinDashed(DrawablePtr pDraw,
-                             GCPtr pGC, int nseg, xSegment * pSeg)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolySegmentThinDashed) (pDraw, pGC, nseg, pSeg);
-}
-
-static void
-XAAOverFillPolygonSolid(DrawablePtr pDraw,
-                        GCPtr pGC,
-                        int shape, int mode, int count, DDXPointPtr ptsIn)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->FillPolygonSolid) (pDraw, pGC, shape, mode, count, ptsIn);
-}
-
-static void
-XAAOverFillPolygonStippled(DrawablePtr pDraw,
-                           GCPtr pGC,
-                           int shape, int mode, int count, DDXPointPtr ptsIn)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->FillPolygonStippled) (pDraw, pGC, shape, mode, count, ptsIn);
-}
-
-static void
-XAAOverFillPolygonOpaqueStippled(DrawablePtr pDraw,
-                                 GCPtr pGC,
-                                 int shape,
-                                 int mode, int count, DDXPointPtr ptsIn)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->FillPolygonOpaqueStippled) (pDraw, pGC, shape, mode, count,
-                                             ptsIn);
-}
-
-static void
-XAAOverFillPolygonTiled(DrawablePtr pDraw,
-                        GCPtr pGC,
-                        int shape, int mode, int count, DDXPointPtr ptsIn)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->FillPolygonTiled) (pDraw, pGC, shape, mode, count, ptsIn);
-}
-
-static void
-XAAOverPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PolyFillArcSolid) (pDraw, pGC, narcs, parcs);
-}
-
-static void
-XAAOverPutImage(DrawablePtr pDraw,
-                GCPtr pGC,
-                int depth,
-                int x,
-                int y, int w, int h, int leftPad, int format, char *pImage)
-{
-    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
-    SWITCH_DEPTH(pGC->depth);
-
-    (*pOverPriv->PutImage) (pDraw, pGC, depth, x, y, w, h,
-                            leftPad, format, pImage);
-}
diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c
deleted file mode 100644 (file)
index 02c0cd4..0000000
+++ /dev/null
@@ -1,2527 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <string.h>
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "gc.h"
-#include "mi.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "regionstr.h"
-#include "servermd.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaacexp.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-
-#define MAX_COLOR      32
-#define MAX_MONO       32
-#define MAX_8          32
-#define MAX_128                32
-#define MAX_256                32
-#define MAX_512                16
-
-static int CacheInitIndex = -1;
-
-#define CACHEINIT(p) ((p)->privates[CacheInitIndex].val)
-
-typedef struct _CacheLink {
-    int x;
-    int y;
-    int w;
-    int h;
-    struct _CacheLink *next;
-} CacheLink, *CacheLinkPtr;
-
-static void
-TransferList(CacheLinkPtr list, XAACacheInfoPtr array, int num)
-{
-    while (num--) {
-        array->x = list->x;
-        array->y = list->y;
-        array->w = list->w;
-        array->h = list->h;
-        array->serialNumber = 0;
-        array->fg = array->bg = -1;
-        list = list->next;
-        array++;
-    }
-}
-
-static CacheLinkPtr
-Enlist(CacheLinkPtr link, int x, int y, int w, int h)
-{
-    CacheLinkPtr newLink;
-
-    newLink = malloc(sizeof(CacheLink));
-    newLink->next = link;
-    newLink->x = x;
-    newLink->y = y;
-    newLink->w = w;
-    newLink->h = h;
-    return newLink;
-}
-
-static CacheLinkPtr
-Delist(CacheLinkPtr link)
-{
-    CacheLinkPtr ret = NULL;
-
-    if (link) {
-        ret = link->next;
-        free(link);
-    }
-    return ret;
-}
-
-static void
-FreeList(CacheLinkPtr link)
-{
-    CacheLinkPtr tmp;
-
-    while (link) {
-        tmp = link;
-        link = link->next;
-        free(tmp);
-    }
-}
-
-static CacheLinkPtr
-QuadLinks(CacheLinkPtr big, CacheLinkPtr little)
-{
-    /* CAUTION: This doesn't free big */
-    int w1, w2, h1, h2;
-
-    while (big) {
-        w1 = big->w >> 1;
-        w2 = big->w - w1;
-        h1 = big->h >> 1;
-        h2 = big->h - h1;
-
-        little = Enlist(little, big->x, big->y, w1, h1);
-        little = Enlist(little, big->x + w1, big->y, w2, h1);
-        little = Enlist(little, big->x, big->y + h1, w1, h2);
-        little = Enlist(little, big->x + w1, big->y + h1, w2, h2);
-
-        big = big->next;
-    }
-    return little;
-}
-
-static void
-SubdivideList(CacheLinkPtr * large, CacheLinkPtr * small)
-{
-    CacheLinkPtr big = *large;
-    CacheLinkPtr little = *small;
-    int size = big->w >> 1;
-
-    little = Enlist(little, big->x, big->y, size, size);
-    little = Enlist(little, big->x + size, big->y, size, size);
-    little = Enlist(little, big->x, big->y + size, size, size);
-    little = Enlist(little, big->x + size, big->y + size, size, size);
-    *small = little;
-    big = Delist(big);
-    *large = big;
-}
-
-static void
-FreePixmapCachePrivate(XAAPixmapCachePrivatePtr pPriv)
-{
-    if (!pPriv)
-        return;
-
-    free(pPriv->Info512);
-    free(pPriv->Info256);
-    free(pPriv->Info128);
-    free(pPriv->InfoColor);
-    free(pPriv->InfoMono);
-    free(pPriv->InfoPartial);
-
-    free(pPriv);
-}
-
-void
-XAAClosePixmapCache(ScreenPtr pScreen)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-
-    if (infoRec->PixmapCachePrivate)
-        FreePixmapCachePrivate((XAAPixmapCachePrivatePtr) infoRec->
-                               PixmapCachePrivate);
-
-    infoRec->PixmapCachePrivate = NULL;
-}
-
-static CacheLinkPtr
-ThinOutPartials(CacheLinkPtr ListPartial, int *num, int *maxw, int *maxh)
-{
-/* This guy's job is to get at least 4 big slots out of a list of fragments */
-
-    CacheLinkPtr List64, List32, List16, List8, pCur, next, ListKeepers;
-    int Num64, Num32, Num16, Num8, NumKeepers;
-    int w, h;
-
-    List64 = List32 = List16 = List8 = ListKeepers = NULL;
-    Num64 = Num32 = Num16 = Num8 = NumKeepers = 0;
-    w = h = 0;
-
-    /* We sort partials by how large a square tile they can cache.
-       If a partial can't store a 64x64, 32x32, 16x16 or 8x8 tile,
-       we free it.  */
-
-    pCur = ListPartial;
-    while (pCur) {
-        next = pCur->next;
-        if ((pCur->w >= 64) && (pCur->h >= 64)) {
-            pCur->next = List64;
-            List64 = pCur;
-            Num64++;
-        }
-        else if ((pCur->w >= 32) && (pCur->h >= 32)) {
-            pCur->next = List32;
-            List32 = pCur;
-            Num32++;
-        }
-        else if ((pCur->w >= 16) && (pCur->h >= 16)) {
-            pCur->next = List16;
-            List16 = pCur;
-            Num16++;
-        }
-        else if ((pCur->w >= 8) && (pCur->h >= 8)) {
-            pCur->next = List8;
-            List8 = pCur;
-            Num8++;
-        }
-        else {
-            free(pCur);
-        }
-
-        pCur = next;
-    }
-
-    /* We save all the tiles from the largest bin that we can get
-       at least 4 of.  If there are too few of a bigger slot, we
-       cut it in fourths to make smaller slots. */
-
-    if (Num64 >= 4) {
-        ListKeepers = List64;
-        List64 = NULL;
-        NumKeepers = Num64;
-        goto GOT_EM;
-    }
-    else if (Num64) {
-        List32 = QuadLinks(List64, List32);
-        Num32 += Num64 * 4;
-        Num64 = 0;
-    }
-
-    if (Num32 >= 4) {
-        ListKeepers = List32;
-        List32 = NULL;
-        NumKeepers = Num32;
-        goto GOT_EM;
-    }
-    else if (Num32) {
-        List16 = QuadLinks(List32, List16);
-        Num16 += Num32 * 4;
-        Num32 = 0;
-    }
-
-    if (Num16 >= 4) {
-        ListKeepers = List16;
-        List16 = NULL;
-        NumKeepers = Num16;
-        goto GOT_EM;
-    }
-    else if (Num16) {
-        List8 = QuadLinks(List16, List8);
-        Num8 += Num16 * 4;
-        Num16 = 0;
-    }
-
-    if (Num8 >= 4) {
-        ListKeepers = List8;
-        List8 = NULL;
-        NumKeepers = Num8;
-        goto GOT_EM;
-    }
-
- GOT_EM:
-
-    /* Free the ones we aren't using */
-
-    if (List64)
-        FreeList(List64);
-    if (List32)
-        FreeList(List32);
-    if (List16)
-        FreeList(List16);
-    if (List8)
-        FreeList(List8);
-
-    /* Enlarge the slots if we can */
-
-    if (ListKeepers) {
-        CacheLinkPtr pLink = ListKeepers;
-
-        w = h = 128;
-
-        while (pLink) {
-            if (pLink->w < w)
-                w = pLink->w;
-            if (pLink->h < h)
-                h = pLink->h;
-            pLink = pLink->next;
-        }
-    }
-
-    *maxw = w;
-    *maxh = h;
-    *num = NumKeepers;
-    return ListKeepers;
-}
-
-static void
-ConvertColorToMono(CacheLinkPtr * ColorList,
-                   int ColorW, int ColorH,
-                   CacheLinkPtr * MonoList, int MonoW, int MonoH)
-{
-    int x, y, w;
-
-    x = (*ColorList)->x;
-    y = (*ColorList)->y;
-    *ColorList = Delist(*ColorList);
-
-    while (ColorH) {
-        ColorH -= MonoH;
-        for (w = 0; w <= (ColorW - MonoW); w += MonoW)
-            *MonoList = Enlist(*MonoList, x + w, y + ColorH, MonoW, MonoH);
-    }
-}
-
-static void
-ConvertAllPartialsTo8x8(int *NumMono, int *NumColor,
-                        CacheLinkPtr ListPartial,
-                        CacheLinkPtr * ListMono,
-                        CacheLinkPtr * ListColor, XAAInfoRecPtr infoRec)
-{
-/* This guy extracts as many 8x8 slots as it can out of fragments */
-
-    int ColorH = infoRec->CacheHeightColor8x8Pattern;
-    int ColorW = infoRec->CacheWidthColor8x8Pattern;
-    int MonoH = infoRec->CacheHeightMono8x8Pattern;
-    int MonoW = infoRec->CacheWidthMono8x8Pattern;
-    int x, y, w, Height, Width;
-    Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8);
-    Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8);
-    CacheLinkPtr pLink = ListPartial;
-    CacheLinkPtr MonoList = *ListMono, ColorList = *ListColor;
-
-    if (DoColor && DoMono) {
-        /* we assume color patterns take more space than color ones */
-        if (MonoH > ColorH)
-            ColorH = MonoH;
-        if (MonoW > ColorW)
-            ColorW = MonoW;
-    }
-
-    /* Break up the area into as many Color and Mono slots as we can */
-
-    while (pLink) {
-        Height = pLink->h;
-        Width = pLink->w;
-        x = pLink->x;
-        y = pLink->y;
-
-        if (DoColor) {
-            while (Height >= ColorH) {
-                Height -= ColorH;
-                for (w = 0; w <= (Width - ColorW); w += ColorW) {
-                    ColorList =
-                        Enlist(ColorList, x + w, y + Height, ColorW, ColorH);
-                    (*NumColor)++;
-                }
-            }
-        }
-
-        if (DoMono && (Height >= MonoH)) {
-            while (Height >= MonoH) {
-                Height -= MonoH;
-                for (w = 0; w <= (Width - MonoW); w += MonoW) {
-                    MonoList =
-                        Enlist(MonoList, x + w, y + Height, MonoW, MonoH);
-                    (*NumMono)++;
-                }
-            }
-        }
-
-        pLink = pLink->next;
-    }
-
-    *ListMono = MonoList;
-    *ListColor = ColorList;
-    FreeList(ListPartial);
-}
-
-static CacheLinkPtr
-ExtractOneThatFits(CacheLinkPtr * initList, int w, int h)
-{
-    CacheLinkPtr list = *initList;
-    CacheLinkPtr prev = NULL;
-
-    while (list) {
-        if ((list->w >= w) && (list->h >= h))
-            break;
-        prev = list;
-        list = list->next;
-    }
-
-    if (list) {
-        if (prev)
-            prev->next = list->next;
-        else
-            *initList = list->next;
-
-        list->next = NULL;
-    }
-
-    return list;
-}
-
-static CacheLinkPtr
-ConvertSomePartialsTo8x8(int *NumMono, int *NumColor, int *NumPartial,
-                         CacheLinkPtr ListPartial,
-                         CacheLinkPtr * ListMono,
-                         CacheLinkPtr * ListColor,
-                         int *maxw, int *maxh, XAAInfoRecPtr infoRec)
-{
-/* This guy tries to get 4 of each type of 8x8 slot requested out of
-   a list of fragments all while trying to retain some big fragments
-   for the cache blits */
-
-    int ColorH = infoRec->CacheHeightColor8x8Pattern;
-    int ColorW = infoRec->CacheWidthColor8x8Pattern;
-    int MonoH = infoRec->CacheHeightMono8x8Pattern;
-    int MonoW = infoRec->CacheWidthMono8x8Pattern;
-    Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8);
-    Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8);
-    CacheLinkPtr List64, List32, List16, List8, pCur, next, ListKeepers;
-    CacheLinkPtr MonoList = *ListMono, ColorList = *ListColor;
-    int Num64, Num32, Num16, Num8, NumKeepers;
-    int w, h, Width, Height;
-    int MonosPerColor = 1;
-
-    if (DoColor && DoMono) {
-        /* we assume color patterns take more space than color ones */
-        if (MonoH > ColorH)
-            ColorH = MonoH;
-        if (MonoW > ColorW)
-            ColorW = MonoW;
-        MonosPerColor = (ColorH / MonoH) * (ColorW / MonoW);
-    }
-
-    List64 = List32 = List16 = List8 = ListKeepers = MonoList = ColorList =
-        NULL;
-    Num64 = Num32 = Num16 = Num8 = NumKeepers = 0;
-    Width = Height = 0;
-
-    /* We sort partials by how large a square tile they can cache.
-       We make 8x8 patterns from the leftovers if we can. */
-
-    pCur = ListPartial;
-    while (pCur) {
-        next = pCur->next;
-        if ((pCur->w >= 64) && (pCur->h >= 64)) {
-            pCur->next = List64;
-            List64 = pCur;
-            Num64++;
-        }
-        else if ((pCur->w >= 32) && (pCur->h >= 32)) {
-            pCur->next = List32;
-            List32 = pCur;
-            Num32++;
-        }
-        else if ((pCur->w >= 16) && (pCur->h >= 16)) {
-            pCur->next = List16;
-            List16 = pCur;
-            Num16++;
-        }
-        else if ((pCur->w >= 8) && (pCur->h >= 8)) {
-            pCur->next = List8;
-            List8 = pCur;
-            Num8++;
-        }
-        else {
-            h = pCur->h;
-            if (DoColor && (pCur->w >= ColorW) && (h >= ColorH)) {
-                while (h >= ColorH) {
-                    h -= ColorH;
-                    for (w = 0; w <= (pCur->w - ColorW); w += ColorW) {
-                        ColorList = Enlist(ColorList,
-                                           pCur->x + w, pCur->y + h, ColorW,
-                                           ColorH);
-                        (*NumColor)++;
-                    }
-                }
-            }
-            if (DoMono && (pCur->w >= MonoW) && (h >= MonoH)) {
-                while (h >= MonoH) {
-                    h -= MonoH;
-                    for (w = 0; w <= (pCur->w - MonoW); w += MonoW) {
-                        MonoList = Enlist(MonoList,
-                                          pCur->x + w, pCur->y + h, MonoW,
-                                          MonoH);
-                        (*NumMono)++;
-                    }
-                }
-            }
-            free(pCur);
-        }
-
-        pCur = next;
-    }
-
-    /* Try to extract at least 4 of each type of 8x8 slot that we need */
-
-    if (DoColor) {
-        CacheLinkPtr theOne;
-
-        while (*NumColor < 4) {
-            theOne = NULL;
-            if (Num8) {
-                if ((theOne = ExtractOneThatFits(&List8, ColorW, ColorH)))
-                    Num8--;
-            }
-            if (Num16 && !theOne) {
-                if ((theOne = ExtractOneThatFits(&List16, ColorW, ColorH)))
-                    Num16--;
-            }
-            if (Num32 && !theOne) {
-                if ((theOne = ExtractOneThatFits(&List32, ColorW, ColorH)))
-                    Num32--;
-            }
-            if (Num64 && !theOne) {
-                if ((theOne = ExtractOneThatFits(&List64, ColorW, ColorH)))
-                    Num64--;
-            }
-
-            if (!theOne)
-                break;
-
-            ConvertAllPartialsTo8x8(NumMono, NumColor, theOne,
-                                    &MonoList, &ColorList, infoRec);
-
-            if (DoMono) {
-                while (*NumColor && (*NumMono < 4)) {
-                    ConvertColorToMono(&ColorList, ColorW, ColorH,
-                                       &MonoList, MonoW, MonoH);
-                    (*NumColor)--;
-                    *NumMono += MonosPerColor;
-                }
-            }
-        }
-    }
-
-    if (DoMono) {
-        CacheLinkPtr theOne;
-
-        while (*NumMono < 4) {
-            theOne = NULL;
-            if (Num8) {
-                if ((theOne = ExtractOneThatFits(&List8, MonoW, MonoH)))
-                    Num8--;
-            }
-            if (Num16 && !theOne) {
-                if ((theOne = ExtractOneThatFits(&List16, MonoW, MonoH)))
-                    Num16--;
-            }
-            if (Num32 && !theOne) {
-                if ((theOne = ExtractOneThatFits(&List32, MonoW, MonoH)))
-                    Num32--;
-            }
-            if (Num64 && !theOne) {
-                if ((theOne = ExtractOneThatFits(&List64, MonoW, MonoH)))
-                    Num64--;
-            }
-
-            if (!theOne)
-                break;
-
-            ConvertAllPartialsTo8x8(NumMono, NumColor, theOne,
-                                    &MonoList, &ColorList, infoRec);
-        }
-    }
-
-    /* We save all the tiles from the largest bin that we can get
-       at least 4 of.  If there are too few of a bigger slot, we
-       cut it in fourths to make smaller slots. */
-
-    if (Num64 >= 4) {
-        ListKeepers = List64;
-        List64 = NULL;
-        NumKeepers = Num64;
-        goto GOT_EM;
-    }
-    else if (Num64) {
-        List32 = QuadLinks(List64, List32);
-        Num32 += Num64 * 4;
-        Num64 = 0;
-    }
-
-    if (Num32 >= 4) {
-        ListKeepers = List32;
-        List32 = NULL;
-        NumKeepers = Num32;
-        goto GOT_EM;
-    }
-    else if (Num32) {
-        List16 = QuadLinks(List32, List16);
-        Num16 += Num32 * 4;
-        Num32 = 0;
-    }
-
-    if (Num16 >= 4) {
-        ListKeepers = List16;
-        List16 = NULL;
-        NumKeepers = Num16;
-        goto GOT_EM;
-    }
-    else if (Num16) {
-        List8 = QuadLinks(List16, List8);
-        Num8 += Num16 * 4;
-        Num16 = 0;
-    }
-
-    if (Num8 >= 4) {
-        ListKeepers = List8;
-        List8 = NULL;
-        NumKeepers = Num8;
-        goto GOT_EM;
-    }
-
- GOT_EM:
-
-    /* Free the ones we aren't using */
-
-    if (List64)
-        ConvertAllPartialsTo8x8(NumMono, NumColor, List64,
-                                &MonoList, &ColorList, infoRec);
-    if (List32)
-        ConvertAllPartialsTo8x8(NumMono, NumColor, List32,
-                                &MonoList, &ColorList, infoRec);
-    if (List16)
-        ConvertAllPartialsTo8x8(NumMono, NumColor, List16,
-                                &MonoList, &ColorList, infoRec);
-    if (List8)
-        ConvertAllPartialsTo8x8(NumMono, NumColor, List8,
-                                &MonoList, &ColorList, infoRec);
-
-    /* Enlarge the slots if we can */
-
-    if (ListKeepers) {
-        CacheLinkPtr pLink = ListKeepers;
-
-        Width = Height = 128;
-
-        while (pLink) {
-            if (pLink->w < Width)
-                Width = pLink->w;
-            if (pLink->h < Height)
-                Height = pLink->h;
-            pLink = pLink->next;
-        }
-    }
-
-    *ListMono = MonoList;
-    *ListColor = ColorList;
-    *maxw = Width;
-    *maxh = Height;
-    *NumPartial = NumKeepers;
-    return ListKeepers;
-}
-
-void
-XAAInitPixmapCache(ScreenPtr pScreen, RegionPtr areas, pointer data)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    XAAInfoRecPtr infoRec = (XAAInfoRecPtr) data;
-    XAAPixmapCachePrivatePtr pCachePriv;
-    BoxPtr pBox = RegionRects(areas);
-    int nBox = RegionNumRects(areas);
-    int Num512, Num256, Num128, NumPartial, NumColor, NumMono;
-    int Target512, Target256;
-    CacheLinkPtr List512, List256, List128, ListPartial, ListColor, ListMono;
-    int x, y, w, h, ntotal, granularity, width, height, i;
-    int MaxPartialWidth, MaxPartialHeight;
-
-    infoRec->MaxCacheableTileWidth = 0;
-    infoRec->MaxCacheableTileHeight = 0;
-    infoRec->MaxCacheableStippleHeight = 0;
-    infoRec->MaxCacheableStippleWidth = 0;
-    infoRec->UsingPixmapCache = FALSE;
-
-    if (!nBox || !pBox || !(infoRec->Flags & PIXMAP_CACHE))
-        return;
-
-    /* Allocate a persistent per-screen init flag to control messages */
-    if (CacheInitIndex < 0)
-        CacheInitIndex = xf86AllocateScrnInfoPrivateIndex();
-
-    /* free the old private data if it exists */
-    if (infoRec->PixmapCachePrivate) {
-        FreePixmapCachePrivate((XAAPixmapCachePrivatePtr) infoRec->
-                               PixmapCachePrivate);
-        infoRec->PixmapCachePrivate = NULL;
-    }
-
-    Num512 = Num256 = Num128 = NumPartial = NumMono = NumColor = 0;
-    List512 = List256 = List128 = ListPartial = ListMono = ListColor = NULL;
-    granularity = infoRec->CachePixelGranularity;
-    if (granularity <= 1)
-        granularity = 0;
-
-    /* go through the boxes and break it into as many pieces as we can fit */
-
-    while (nBox--) {
-        x = pBox->x1;
-        if (granularity) {
-            int tmp = x % granularity;
-
-            if (tmp)
-                x += (granularity - tmp);
-        }
-        width = pBox->x2 - x;
-        if (width <= 0) {
-            pBox++;
-            continue;
-        }
-
-        y = pBox->y1;
-        height = pBox->y2 - y;
-
-        for (h = 0; h <= (height - 512); h += 512) {
-            for (w = 0; w <= (width - 512); w += 512) {
-                List512 = Enlist(List512, x + w, y + h, 512, 512);
-                Num512++;
-            }
-            for (; w <= (width - 256); w += 256) {
-                List256 = Enlist(List256, x + w, y + h, 256, 256);
-                List256 = Enlist(List256, x + w, y + h + 256, 256, 256);
-                Num256 += 2;
-            }
-            for (; w <= (width - 128); w += 128) {
-                List128 = Enlist(List128, x + w, y + h, 128, 128);
-                List128 = Enlist(List128, x + w, y + h + 128, 128, 128);
-                List128 = Enlist(List128, x + w, y + h + 256, 128, 128);
-                List128 = Enlist(List128, x + w, y + h + 384, 128, 128);
-                Num128 += 4;
-            }
-            if (w < width) {
-                int d = width - w;
-
-                ListPartial = Enlist(ListPartial, x + w, y + h, d, 128);
-                ListPartial = Enlist(ListPartial, x + w, y + h + 128, d, 128);
-                ListPartial = Enlist(ListPartial, x + w, y + h + 256, d, 128);
-                ListPartial = Enlist(ListPartial, x + w, y + h + 384, d, 128);
-                NumPartial += 4;
-            }
-        }
-        for (; h <= (height - 256); h += 256) {
-            for (w = 0; w <= (width - 256); w += 256) {
-                List256 = Enlist(List256, x + w, y + h, 256, 256);
-                Num256++;
-            }
-            for (; w <= (width - 128); w += 128) {
-                List128 = Enlist(List128, x + w, y + h, 128, 128);
-                List128 = Enlist(List128, x + w, y + h + 128, 128, 128);
-                Num128 += 2;
-            }
-            if (w < width) {
-                int d = width - w;
-
-                ListPartial = Enlist(ListPartial, x + w, y + h, d, 128);
-                ListPartial = Enlist(ListPartial, x + w, y + h + 128, d, 128);
-                NumPartial += 2;
-            }
-        }
-        for (; h <= (height - 128); h += 128) {
-            for (w = 0; w <= (width - 128); w += 128) {
-                List128 = Enlist(List128, x + w, y + h, 128, 128);
-                Num128++;
-            }
-            if (w < width) {
-                ListPartial = Enlist(ListPartial, x + w, y + h, width - w, 128);
-                NumPartial++;
-            }
-        }
-        if (h < height) {
-            int d = height - h;
-
-            for (w = 0; w <= (width - 128); w += 128) {
-                ListPartial = Enlist(ListPartial, x + w, y + h, 128, d);
-                NumPartial++;
-            }
-            if (w < width) {
-                ListPartial = Enlist(ListPartial, x + w, y + h, width - w, d);
-                NumPartial++;
-            }
-        }
-        pBox++;
-    }
-
-/* 
-   by this point we've carved the space into as many 512x512, 256x256
-       and 128x128 blocks as we could fit.  We will then break larger
-       blocks into smaller ones if we need to.  The rules are as follows:
-
-     512x512 -
-       1) Don't take up more than half the memory.
-       2) Don't bother if you can't get at least four.
-       3) Don't make more than MAX_512.
-       4) Don't have any of there are no 256x256s.
-
-     256x256 -
-       1) Don't take up more than a quarter of the memory enless there
-               aren't any 512x512s.  Then we can take up to half.
-       2) Don't bother if you can't get at least four.
-       3) Don't make more than MAX_256.
-
-     128x128 -
-       1) Don't make more than MAX_128.
-
-     We don't bother with the partial blocks unless we can use them
-     for 8x8 pattern fills or we are short on larger blocks.
-
-*/
-
-    ntotal = Num128 + (Num256 << 2) + (Num512 << 4);
-
-    Target512 = ntotal >> 5;
-    if (Target512 < 4)
-        Target512 = 0;
-    if (!Target512)
-        Target256 = ntotal >> 3;
-    else
-        Target256 = ntotal >> 4;
-    if (Target256 < 4)
-        Target256 = 0;
-
-    if (Num512 && Num256 < 4) {
-        while (Num512 && Num256 < Target256) {
-            SubdivideList(&List512, &List256);
-            Num256 += 4;
-            Num512--;
-        }
-    }
-
-    if (!Num512) {              /* no room */
-    }
-    else if ((Num512 < 4) || (!Target512)) {
-        while (Num512) {
-            SubdivideList(&List512, &List256);
-            Num256 += 4;
-            Num512--;
-        }
-    }
-    else if ((Num512 > MAX_512) || (Num512 > Target512)) {
-        while (Num512 > MAX_512) {
-            SubdivideList(&List512, &List256);
-            Num256 += 4;
-            Num512--;
-        }
-        while (Num512 > Target512) {
-            if (Num256 < MAX_256) {
-                SubdivideList(&List512, &List256);
-                Num256 += 4;
-                Num512--;
-            }
-            else
-                break;
-        }
-    }
-
-    if (!Num256) {              /* no room */
-    }
-    else if ((Num256 < 4) || (!Target256)) {
-        while (Num256) {
-            SubdivideList(&List256, &List128);
-            Num128 += 4;
-            Num256--;
-        }
-    }
-    else if ((Num256 > MAX_256) || (Num256 > Target256)) {
-        while (Num256 > MAX_256) {
-            SubdivideList(&List256, &List128);
-            Num128 += 4;
-            Num256--;
-        }
-        while (Num256 > Target256) {
-            if (Num128 < MAX_128) {
-                SubdivideList(&List256, &List128);
-                Num128 += 4;
-                Num256--;
-            }
-            else
-                break;
-        }
-    }
-
-    if (Num128 && ((Num128 < 4) || (Num128 > MAX_128))) {
-        CacheLinkPtr next;
-        int max = (Num128 > MAX_128) ? MAX_128 : 0;
-
-        /*
-         * Note: next is set in this way to work around a code generation
-         * bug in gcc 2.7.2.3.
-         */
-        next = List128->next;
-        while (Num128 > max) {
-            List128->next = ListPartial;
-            ListPartial = List128;
-            if ((List128 = next))
-                next = List128->next;
-            NumPartial++;
-            Num128--;
-        }
-    }
-
-    MaxPartialHeight = MaxPartialWidth = 0;
-
-    /* at this point we have as many 512x512 and 256x256 slots as we
-       want but may have an excess of 128x128 slots.  We still need
-       to find out if we need 8x8 slots.  We take these from the
-       partials if we have them.  Otherwise, we break some 128x128's */
-
-    if (!(infoRec->PixmapCacheFlags & (CACHE_MONO_8x8 | CACHE_COLOR_8x8))) {
-        if (NumPartial) {
-            if (Num128) {       /* don't bother with partials */
-                FreeList(ListPartial);
-                NumPartial = 0;
-                ListPartial = NULL;
-            }
-            else {
-                /* We have no big slots.  Weed out the unusable partials */
-                ListPartial = ThinOutPartials(ListPartial, &NumPartial,
-                                              &MaxPartialWidth,
-                                              &MaxPartialHeight);
-            }
-        }
-    }
-    else {
-        int MonosPerColor = 1;
-        int ColorH = infoRec->CacheHeightColor8x8Pattern;
-        int ColorW = infoRec->CacheWidthColor8x8Pattern;
-        int MonoH = infoRec->CacheHeightMono8x8Pattern;
-        int MonoW = infoRec->CacheWidthMono8x8Pattern;
-        Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8);
-        Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8);
-
-        if (DoColor)
-            infoRec->CanDoColor8x8 = FALSE;
-        if (DoMono)
-            infoRec->CanDoMono8x8 = FALSE;
-
-        if (DoColor && DoMono) {
-            /* we assume color patterns take more space than color ones */
-            if (MonoH > ColorH)
-                ColorH = MonoH;
-            if (MonoW > ColorW)
-                ColorW = MonoW;
-            MonosPerColor = (ColorH / MonoH) * (ColorW / MonoW);
-        }
-
-        if (Num128) {
-            if (NumPartial) {   /* use all for 8x8 slots */
-                ConvertAllPartialsTo8x8(&NumMono, &NumColor,
-                                        ListPartial, &ListMono, &ListColor,
-                                        infoRec);
-                NumPartial = 0;
-                ListPartial = NULL;
-            }
-
-            /* Get some 8x8 slots from the 128 slots */
-            while ((Num128 > 4) &&
-                   ((NumMono < MAX_MONO) && (NumColor < MAX_COLOR))) {
-                CacheLinkPtr tmp = NULL;
-
-                tmp = Enlist(tmp, List128->x, List128->y,
-                             List128->w, List128->h);
-                List128 = Delist(List128);
-                Num128--;
-
-                ConvertAllPartialsTo8x8(&NumMono, &NumColor,
-                                        tmp, &ListMono, &ListColor, infoRec);
-            }
-        }
-        else if (NumPartial) {
-            /* We have share partials between 8x8 slots and tiles. */
-            ListPartial = ConvertSomePartialsTo8x8(&NumMono, &NumColor,
-                                                   &NumPartial, ListPartial,
-                                                   &ListMono, &ListColor,
-                                                   &MaxPartialWidth,
-                                                   &MaxPartialHeight, infoRec);
-        }
-
-        if (DoMono && DoColor) {
-            if (NumColor && ((NumColor > MAX_COLOR) || (NumColor < 4))) {
-                int max = (NumColor > MAX_COLOR) ? MAX_COLOR : 0;
-
-                while (NumColor > max) {
-                    ConvertColorToMono(&ListColor, ColorW, ColorH,
-                                       &ListMono, MonoW, MonoH);
-                    NumColor--;
-                    NumMono += MonosPerColor;
-                }
-            }
-
-            /* favor Mono slots over Color ones */
-            while ((NumColor > 4) && (NumMono < MAX_MONO)) {
-                ConvertColorToMono(&ListColor, ColorW, ColorH,
-                                   &ListMono, MonoW, MonoH);
-                NumColor--;
-                NumMono += MonosPerColor;
-            }
-        }
-
-        if (NumMono && ((NumMono > MAX_MONO) || (NumMono < 4))) {
-            int max = (NumMono > MAX_MONO) ? MAX_MONO : 0;
-
-            while (NumMono > max) {
-                ListMono = Delist(ListMono);
-                NumMono--;
-            }
-        }
-        if (NumColor && ((NumColor > MAX_COLOR) || (NumColor < 4))) {
-            int max = (NumColor > MAX_COLOR) ? MAX_COLOR : 0;
-
-            while (NumColor > max) {
-                ListColor = Delist(ListColor);
-                NumColor--;
-            }
-        }
-    }
-
-    pCachePriv = calloc(1, sizeof(XAAPixmapCachePrivate));
-    if (!pCachePriv) {
-        if (Num512)
-            FreeList(List512);
-        if (Num256)
-            FreeList(List256);
-        if (Num128)
-            FreeList(List128);
-        if (NumPartial)
-            FreeList(ListPartial);
-        if (NumColor)
-            FreeList(ListColor);
-        if (NumMono)
-            FreeList(ListMono);
-        return;
-    }
-
-    infoRec->PixmapCachePrivate = (char *) pCachePriv;
-
-    if (Num512) {
-        pCachePriv->Info512 = calloc(Num512, sizeof(XAACacheInfoRec));
-        if (!pCachePriv->Info512)
-            Num512 = 0;
-        if (Num512)
-            TransferList(List512, pCachePriv->Info512, Num512);
-        FreeList(List512);
-        pCachePriv->Num512x512 = Num512;
-    }
-    if (Num256) {
-        pCachePriv->Info256 = calloc(Num256, sizeof(XAACacheInfoRec));
-        if (!pCachePriv->Info256)
-            Num256 = 0;
-        if (Num256)
-            TransferList(List256, pCachePriv->Info256, Num256);
-        FreeList(List256);
-        pCachePriv->Num256x256 = Num256;
-    }
-    if (Num128) {
-        pCachePriv->Info128 = calloc(Num128, sizeof(XAACacheInfoRec));
-        if (!pCachePriv->Info128)
-            Num128 = 0;
-        if (Num128)
-            TransferList(List128, pCachePriv->Info128, Num128);
-        FreeList(List128);
-        pCachePriv->Num128x128 = Num128;
-    }
-
-    if (NumPartial) {
-        pCachePriv->InfoPartial = calloc(NumPartial, sizeof(XAACacheInfoRec));
-        if (!pCachePriv->InfoPartial)
-            NumPartial = 0;
-        if (NumPartial)
-            TransferList(ListPartial, pCachePriv->InfoPartial, NumPartial);
-        FreeList(ListPartial);
-        pCachePriv->NumPartial = NumPartial;
-    }
-
-    if (NumColor) {
-        pCachePriv->InfoColor = calloc(NumColor, sizeof(XAACacheInfoRec));
-        if (!pCachePriv->InfoColor)
-            NumColor = 0;
-        if (NumColor)
-            TransferList(ListColor, pCachePriv->InfoColor, NumColor);
-        FreeList(ListColor);
-        pCachePriv->NumColor = NumColor;
-    }
-
-    if (NumMono) {
-        pCachePriv->InfoMono = calloc(NumMono, sizeof(XAACacheInfoRec));
-        if (!pCachePriv->InfoMono)
-            NumMono = 0;
-        if (NumMono)
-            TransferList(ListMono, pCachePriv->InfoMono, NumMono);
-        FreeList(ListMono);
-        pCachePriv->NumMono = NumMono;
-    }
-
-    if (NumPartial) {
-        infoRec->MaxCacheableTileWidth = MaxPartialWidth;
-        infoRec->MaxCacheableTileHeight = MaxPartialHeight;
-    }
-    if (Num128)
-        infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 128;
-    if (Num256)
-        infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 256;
-    if (Num512)
-        infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 512;
-
-    infoRec->MaxCacheableStippleHeight = infoRec->MaxCacheableTileHeight;
-    infoRec->MaxCacheableStippleWidth =
-        infoRec->MaxCacheableTileWidth * pScrn->bitsPerPixel;
-    if (infoRec->ScreenToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP)
-        infoRec->MaxCacheableStippleWidth /= 3;
-
-    if (NumMono) {
-        if (!(infoRec->Mono8x8PatternFillFlags &
-              (HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
-               HARDWARE_PATTERN_PROGRAMMED_BITS))) {
-            int numPerLine =
-                infoRec->CacheWidthMono8x8Pattern / infoRec->MonoPatternPitch;
-
-            for (i = 0; i < 64; i++) {
-                pCachePriv->MonoOffsets[i].y = i / numPerLine;
-                pCachePriv->MonoOffsets[i].x = (i % numPerLine) *
-                    infoRec->MonoPatternPitch;
-            }
-        }
-        infoRec->CanDoMono8x8 = TRUE;
-    }
-    if (NumColor) {
-        if (!(infoRec->Color8x8PatternFillFlags &
-              HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-
-            for (i = 0; i < 64; i++) {
-                pCachePriv->ColorOffsets[i].y = i & 0x07;
-                pCachePriv->ColorOffsets[i].x = i & ~0x07;
-            }
-        }
-        infoRec->CanDoColor8x8 = TRUE;
-    }
-
-    if (!CACHEINIT(pScrn)) {
-        xf86ErrorF("\tSetting up tile and stipple cache:\n");
-        if (NumPartial)
-            xf86ErrorF("\t\t%i %ix%i slots\n",
-                       NumPartial, MaxPartialWidth, MaxPartialHeight);
-        if (Num128)
-            xf86ErrorF("\t\t%i 128x128 slots\n", Num128);
-        if (Num256)
-            xf86ErrorF("\t\t%i 256x256 slots\n", Num256);
-        if (Num512)
-            xf86ErrorF("\t\t%i 512x512 slots\n", Num512);
-        if (NumColor)
-            xf86ErrorF("\t\t%i 8x8 color pattern slots\n", NumColor);
-        if (NumMono)
-            xf86ErrorF("\t\t%i 8x8 color expansion slots\n", NumMono);
-    }
-
-    if (!(NumPartial | Num128 | Num256 | Num512 | NumColor | NumMono)) {
-        if (!CACHEINIT(pScrn))
-            xf86ErrorF("\t\tNot enough video memory for pixmap cache\n");
-    }
-    else
-        infoRec->UsingPixmapCache = TRUE;
-
-    CACHEINIT(pScrn) = 1;
-}
-
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-static CARD32 StippleMasks[4] = {
-    0x80808080,
-    0xC0C0C0C0,
-    0x00000000,
-    0xF0F0F0F0
-};
-#else
-static CARD32 StippleMasks[4] = {
-    0x01010101,
-    0x03030303,
-    0x00000000,
-    0x0F0F0F0F
-};
-#endif
-
-Bool
-XAACheckStippleReducibility(PixmapPtr pPixmap)
-{
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE(&pPixmap->drawable);
-    CARD32 *IntPtr = (CARD32 *) pPixmap->devPrivate.ptr;
-    int w = pPixmap->drawable.width;
-    int h = pPixmap->drawable.height;
-    int i;
-    CARD32 bits[8];
-    CARD32 mask = SHIFT_R(0xFFFFFFFF, 24);
-
-    pPriv->flags |= REDUCIBILITY_CHECKED | REDUCIBLE_TO_2_COLOR;
-    pPriv->flags &= ~REDUCIBLE_TO_8x8;
-
-    if ((w > 32) || (h > 32) || (w & (w - 1)) || (h & (h - 1)))
-        return FALSE;
-
-    i = (h > 8) ? 8 : h;
-
-    switch (w) {
-    case 32:
-        while (i--) {
-            bits[i] = IntPtr[i] & mask;
-            if ((bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask, 8)), 8)) ||
-                (bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask, 16)), 16)) ||
-                (bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask, 24)), 24)))
-                return FALSE;
-        }
-        break;
-    case 16:
-        while (i--) {
-            bits[i] = IntPtr[i] & mask;
-            if (bits[i] != ((IntPtr[i] & SHIFT_R(SHIFT_L(mask, 8), 8))))
-                return FALSE;
-        }
-        break;
-    default:
-        while (i--)
-            bits[i] = IntPtr[i] & mask;
-        break;
-    }
-
-    switch (h) {
-    case 32:
-        if ((IntPtr[8] != IntPtr[16]) || (IntPtr[9] != IntPtr[17]) ||
-            (IntPtr[10] != IntPtr[18]) || (IntPtr[11] != IntPtr[19]) ||
-            (IntPtr[12] != IntPtr[20]) || (IntPtr[13] != IntPtr[21]) ||
-            (IntPtr[14] != IntPtr[22]) || (IntPtr[15] != IntPtr[23]) ||
-            (IntPtr[16] != IntPtr[24]) || (IntPtr[17] != IntPtr[25]) ||
-            (IntPtr[18] != IntPtr[26]) || (IntPtr[19] != IntPtr[27]) ||
-            (IntPtr[20] != IntPtr[28]) || (IntPtr[21] != IntPtr[29]) ||
-            (IntPtr[22] != IntPtr[30]) || (IntPtr[23] != IntPtr[31]))
-            return FALSE;
-        /* fall through */
-    case 16:
-        if ((IntPtr[0] != IntPtr[8]) || (IntPtr[1] != IntPtr[9]) ||
-            (IntPtr[2] != IntPtr[10]) || (IntPtr[3] != IntPtr[11]) ||
-            (IntPtr[4] != IntPtr[12]) || (IntPtr[5] != IntPtr[13]) ||
-            (IntPtr[6] != IntPtr[14]) || (IntPtr[7] != IntPtr[15]))
-            return FALSE;
-    case 8:
-        break;
-    case 1:
-        bits[1] = bits[0];
-    case 2:
-        bits[2] = bits[0];
-        bits[3] = bits[1];
-    case 4:
-        bits[4] = bits[0];
-        bits[5] = bits[1];
-        bits[6] = bits[2];
-        bits[7] = bits[3];
-        break;
-    }
-
-    pPriv->flags |= REDUCIBLE_TO_8x8;
-
-    pPriv->pattern0 =
-        bits[0] | SHIFT_L(bits[1], 8) | SHIFT_L(bits[2], 16) | SHIFT_L(bits[3],
-                                                                       24);
-    pPriv->pattern1 =
-        bits[4] | SHIFT_L(bits[5], 8) | SHIFT_L(bits[6], 16) | SHIFT_L(bits[7],
-                                                                       24);
-
-    if (w < 8) {
-        pPriv->pattern0 &= StippleMasks[w - 1];
-        pPriv->pattern1 &= StippleMasks[w - 1];
-
-        switch (w) {
-        case 1:
-            pPriv->pattern0 |= SHIFT_L(pPriv->pattern0, 1);
-            pPriv->pattern1 |= SHIFT_L(pPriv->pattern1, 1);
-        case 2:
-            pPriv->pattern0 |= SHIFT_L(pPriv->pattern0, 2);
-            pPriv->pattern1 |= SHIFT_L(pPriv->pattern1, 2);
-        case 4:
-            pPriv->pattern0 |= SHIFT_L(pPriv->pattern0, 4);
-            pPriv->pattern1 |= SHIFT_L(pPriv->pattern1, 4);
-        }
-    }
-
-    if (infoRec->Mono8x8PatternFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
-        pPriv->pattern0 = SWAP_BITS_IN_BYTES(pPriv->pattern0);
-        pPriv->pattern1 = SWAP_BITS_IN_BYTES(pPriv->pattern1);
-    }
-
-    return TRUE;
-}
-
-Bool
-XAACheckTileReducibility(PixmapPtr pPixmap, Bool checkMono)
-{
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
-    CARD32 *IntPtr;
-    int w = pPixmap->drawable.width;
-    int h = pPixmap->drawable.height;
-    int pitch = pPixmap->devKind >> 2;
-    int dwords, i, j;
-
-    pPriv->flags |= REDUCIBILITY_CHECKED;
-    pPriv->flags &= ~(REDUCIBILITY_CHECKED | REDUCIBLE_TO_2_COLOR);
-
-    if ((w > 32) || (h > 32) || (w & (w - 1)) || (h & (h - 1)))
-        return FALSE;
-
-    dwords = ((w * pPixmap->drawable.bitsPerPixel) + 31) >> 5;
-    i = (h > 8) ? 8 : h;
-
-    if (w > 8) {
-        IntPtr = (CARD32 *) pPixmap->devPrivate.ptr;
-        switch (pPixmap->drawable.bitsPerPixel) {
-        case 8:
-            while (i--) {
-                for (j = 2; j < dwords; j++)
-                    if (IntPtr[j] != IntPtr[j & 0x01])
-                        return FALSE;
-                IntPtr += pitch;
-            }
-            break;
-        case 16:
-            while (i--) {
-                for (j = 4; j < dwords; j++)
-                    if (IntPtr[j] != IntPtr[j & 0x03])
-                        return FALSE;
-                IntPtr += pitch;
-            }
-            break;
-        case 24:
-            while (i--) {
-                for (j = 6; j < dwords; j++)
-                    if (IntPtr[j] != IntPtr[j % 6])
-                        return FALSE;
-                IntPtr += pitch;
-            }
-            break;
-        case 32:
-            while (i--) {
-                for (j = 8; j < dwords; j++)
-                    if (IntPtr[j] != IntPtr[j & 0x07])
-                        return FALSE;
-                IntPtr += pitch;
-            }
-            break;
-        default:
-            return FALSE;
-        }
-
-    }
-
-    if (h == 32) {
-        CARD32 *IntPtr2, *IntPtr3, *IntPtr4;
-
-        i = 8;
-        IntPtr = (CARD32 *) pPixmap->devPrivate.ptr;
-        IntPtr2 = IntPtr + (pitch << 3);
-        IntPtr3 = IntPtr2 + (pitch << 3);
-        IntPtr4 = IntPtr3 + (pitch << 3);
-        while (i--) {
-            for (j = 0; j < dwords; j++)
-                if ((IntPtr[j] != IntPtr2[j]) || (IntPtr[j] != IntPtr3[j]) ||
-                    (IntPtr[j] != IntPtr4[j]))
-                    return FALSE;
-            IntPtr += pitch;
-            IntPtr2 += pitch;
-            IntPtr3 += pitch;
-            IntPtr4 += pitch;
-        }
-    }
-    else if (h == 16) {
-        CARD32 *IntPtr2;
-
-        i = 8;
-        IntPtr = (CARD32 *) pPixmap->devPrivate.ptr;
-        IntPtr2 = IntPtr + (pitch << 3);
-        while (i--) {
-            for (j = 0; j < dwords; j++)
-                if (IntPtr[j] != IntPtr2[j])
-                    return FALSE;
-            IntPtr += pitch;
-            IntPtr2 += pitch;
-        }
-    }
-
-    pPriv->flags |= REDUCIBLE_TO_8x8;
-
-    if (checkMono) {
-        XAAInfoRecPtr infoRec =
-            GET_XAAINFORECPTR_FROM_DRAWABLE(&pPixmap->drawable);
-        unsigned char bits[8];
-        int fg, bg = -1, x, y;
-
-        i = (h > 8) ? 8 : h;
-        j = (w > 8) ? 8 : w;
-
-        if (pPixmap->drawable.bitsPerPixel == 8) {
-            unsigned char *srcp = pPixmap->devPrivate.ptr;
-
-            fg = srcp[0];
-            pitch = pPixmap->devKind;
-            for (y = 0; y < i; y++) {
-                bits[y] = 0;
-                for (x = 0; x < j; x++) {
-                    if (srcp[x] != fg) {
-                        if (bg == -1)
-                            bg = srcp[x];
-                        else if (bg != srcp[x])
-                            return TRUE;
-                    }
-                    else
-                        bits[y] |= 1 << x;
-                }
-                srcp += pitch;
-            }
-        }
-        else if (pPixmap->drawable.bitsPerPixel == 16) {
-            unsigned short *srcp = (unsigned short *) pPixmap->devPrivate.ptr;
-
-            fg = srcp[0];
-            pitch = pPixmap->devKind >> 1;
-            for (y = 0; y < i; y++) {
-                bits[y] = 0;
-                for (x = 0; x < j; x++) {
-                    if (srcp[x] != fg) {
-                        if (bg == -1)
-                            bg = srcp[x];
-                        else if (bg != srcp[x])
-                            return TRUE;
-                    }
-                    else
-                        bits[y] |= 1 << x;
-                }
-                srcp += pitch;
-            }
-        }
-        else if (pPixmap->drawable.bitsPerPixel == 24) {
-            CARD32 val;
-            unsigned char *srcp = pPixmap->devPrivate.ptr;
-
-            fg = *((CARD32 *) srcp) & 0x00FFFFFF;
-            pitch = pPixmap->devKind;
-            j *= 3;
-            for (y = 0; y < i; y++) {
-                bits[y] = 0;
-                for (x = 0; x < j; x += 3) {
-                    val = *((CARD32 *) (srcp + x)) & 0x00FFFFFF;
-                    if (val != fg) {
-                        if (bg == -1)
-                            bg = val;
-                        else if (bg != val)
-                            return TRUE;
-                    }
-                    else
-                        bits[y] |= 1 << (x / 3);
-                }
-                srcp += pitch;
-            }
-        }
-        else if (pPixmap->drawable.bitsPerPixel == 32) {
-            IntPtr = (CARD32 *) pPixmap->devPrivate.ptr;
-            fg = IntPtr[0];
-            for (y = 0; y < i; y++) {
-                bits[y] = 0;
-                for (x = 0; x < j; x++) {
-                    if (IntPtr[x] != fg) {
-                        if (bg == -1)
-                            bg = IntPtr[x];
-                        else if (bg != IntPtr[x])
-                            return TRUE;
-                    }
-                    else
-                        bits[y] |= 1 << x;
-                }
-                IntPtr += pitch;
-            }
-        }
-        else
-            return TRUE;
-
-        pPriv->fg = fg;
-        if (bg == -1)
-            pPriv->bg = fg;
-        else
-            pPriv->bg = bg;
-
-        if (h < 8) {
-            switch (h) {
-            case 1:
-                bits[1] = bits[0];
-            case 2:
-                bits[2] = bits[0];
-                bits[3] = bits[1];
-            case 4:
-                bits[4] = bits[0];
-                bits[5] = bits[1];
-                bits[6] = bits[2];
-                bits[7] = bits[3];
-                break;
-            }
-        }
-
-        pPriv->pattern0 =
-            bits[0] | (bits[1] << 8) | (bits[2] << 16) | (bits[3] << 24);
-        pPriv->pattern1 =
-            bits[4] | (bits[5] << 8) | (bits[6] << 16) | (bits[7] << 24);
-
-        if (w < 8) {
-            switch (w) {
-            case 1:
-                pPriv->pattern0 |= (pPriv->pattern0 << 1);
-                pPriv->pattern1 |= (pPriv->pattern1 << 1);
-            case 2:
-                pPriv->pattern0 |= (pPriv->pattern0 << 2);
-                pPriv->pattern1 |= (pPriv->pattern1 << 2);
-            case 4:
-                pPriv->pattern0 |= (pPriv->pattern0 << 4);
-                pPriv->pattern1 |= (pPriv->pattern1 << 4);
-            }
-        }
-        pPriv->flags |= REDUCIBLE_TO_2_COLOR;
-
-        if (infoRec->Mono8x8PatternFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
-            pPriv->pattern0 = SWAP_BITS_IN_BYTES(pPriv->pattern0);
-            pPriv->pattern1 = SWAP_BITS_IN_BYTES(pPriv->pattern1);
-        }
-
-    }
-
-    return TRUE;
-}
-
-void
-XAATileCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache, int w, int h)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    (*infoRec->SetupForScreenToScreenCopy) (pScrn, 1, 1, GXcopy, ~0, -1);
-
-    while ((w << 1) <= pCache->w) {
-        (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pCache->x, pCache->y,
-                                                  pCache->x + w, pCache->y, w,
-                                                  h);
-        w <<= 1;
-    }
-    if (w != pCache->w) {
-        (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pCache->x, pCache->y,
-                                                  pCache->x + w, pCache->y,
-                                                  pCache->w - w, h);
-        w = pCache->w;
-    }
-
-    while ((h << 1) <= pCache->h) {
-        (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pCache->x, pCache->y,
-                                                  pCache->x, pCache->y + h, w,
-                                                  h);
-        h <<= 1;
-    }
-    if (h != pCache->h) {
-        (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pCache->x, pCache->y,
-                                                  pCache->x, pCache->y + h, w,
-                                                  pCache->h - h);
-    }
-    SET_SYNC_FLAG(infoRec);
-}
-
-XAACacheInfoPtr
-XAACacheTile(ScrnInfoPtr pScrn, PixmapPtr pPix)
-{
-    int w = pPix->drawable.width;
-    int h = pPix->drawable.height;
-    int size = max(w, h);
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    XAAPixmapCachePrivatePtr pCachePriv =
-        (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate;
-    XAACacheInfoPtr pCache, cacheRoot = NULL;
-    int i, max = 0;
-    int *current;
-
-    if (size <= 128) {
-        if (pCachePriv->Info128) {
-            cacheRoot = pCachePriv->Info128;
-            max = pCachePriv->Num128x128;
-            current = &pCachePriv->Current128;
-        }
-        else {
-            cacheRoot = pCachePriv->InfoPartial;
-            max = pCachePriv->NumPartial;
-            current = &pCachePriv->CurrentPartial;
-        }
-    }
-    else if (size <= 256) {
-        cacheRoot = pCachePriv->Info256;
-        max = pCachePriv->Num256x256;
-        current = &pCachePriv->Current256;
-    }
-    else if (size <= 512) {
-        cacheRoot = pCachePriv->Info512;
-        max = pCachePriv->Num512x512;
-        current = &pCachePriv->Current512;
-    }
-    else {                      /* something's wrong */
-        ErrorF("Something's wrong in XAACacheTile()\n");
-        return pCachePriv->Info128;
-    }
-
-    pCache = cacheRoot;
-
-    /* lets look for it */
-    for (i = 0; i < max; i++, pCache++) {
-        if (pCache->serialNumber == pPix->drawable.serialNumber) {
-            pCache->trans_color = -1;
-            return pCache;
-        }
-    }
-
-    pCache = &cacheRoot[(*current)++];
-    if (*current >= max)
-        *current = 0;
-
-    pCache->serialNumber = pPix->drawable.serialNumber;
-    pCache->trans_color = pCache->bg = pCache->fg = -1;
-    pCache->orig_w = w;
-    pCache->orig_h = h;
-    (*infoRec->WritePixmapToCache) (pScrn, pCache->x, pCache->y, w, h,
-                                    pPix->devPrivate.ptr, pPix->devKind,
-                                    pPix->drawable.bitsPerPixel,
-                                    pPix->drawable.depth);
-    if (!(infoRec->PixmapCacheFlags & DO_NOT_TILE_COLOR_DATA) &&
-        ((w != pCache->w) || (h != pCache->h)))
-        XAATileCache(pScrn, pCache, w, h);
-
-    return pCache;
-}
-
-XAACacheInfoPtr
-XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
-{
-    int w = pPix->drawable.width;
-    int h = pPix->drawable.height;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    XAAPixmapCachePrivatePtr pCachePriv =
-        (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate;
-    XAACacheInfoPtr pCache, cacheRoot = NULL;
-    int i, max = 0, funcNo, pad, dwords, bpp = pScrn->bitsPerPixel;
-    int *current;
-    StippleScanlineProcPtr StippleFunc;
-    unsigned char *data, *srcPtr, *dstPtr;
-
-    if ((h <= 128) && (w <= 128 * bpp)) {
-        if (pCachePriv->Info128) {
-            cacheRoot = pCachePriv->Info128;
-            max = pCachePriv->Num128x128;
-            current = &pCachePriv->Current128;
-        }
-        else {
-            cacheRoot = pCachePriv->InfoPartial;
-            max = pCachePriv->NumPartial;
-            current = &pCachePriv->CurrentPartial;
-        }
-    }
-    else if ((h <= 256) && (w <= 256 * bpp)) {
-        cacheRoot = pCachePriv->Info256;
-        max = pCachePriv->Num256x256;
-        current = &pCachePriv->Current256;
-    }
-    else if ((h <= 512) && (w <= 526 * bpp)) {
-        cacheRoot = pCachePriv->Info512;
-        max = pCachePriv->Num512x512;
-        current = &pCachePriv->Current512;
-    }
-    else {                      /* something's wrong */
-        ErrorF("Something's wrong in XAACacheMonoStipple()\n");
-        return pCachePriv->Info128;
-    }
-
-    pCache = cacheRoot;
-
-    /* lets look for it */
-    for (i = 0; i < max; i++, pCache++) {
-        if ((pCache->serialNumber == pPix->drawable.serialNumber) &&
-            (pCache->fg == -1) && (pCache->bg == -1)) {
-            pCache->trans_color = -1;
-            return pCache;
-        }
-    }
-
-    pCache = &cacheRoot[(*current)++];
-    if (*current >= max)
-        *current = 0;
-
-    pCache->serialNumber = pPix->drawable.serialNumber;
-    pCache->trans_color = pCache->bg = pCache->fg = -1;
-    pCache->orig_w = w;
-    pCache->orig_h = h;
-
-    if (w <= 32) {
-        if (w & (w - 1))
-            funcNo = 1;
-        else
-            funcNo = 0;
-    }
-    else
-        funcNo = 2;
-
-    pad = BitmapBytePad(pCache->w * bpp);
-    dwords = bytes_to_int32(pad);
-    dstPtr = data = (unsigned char *) malloc(pad * pCache->h);
-    srcPtr = (unsigned char *) pPix->devPrivate.ptr;
-
-    if (infoRec->
-        ScreenToScreenColorExpandFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST)
-        StippleFunc = XAAStippleScanlineFuncMSBFirst[funcNo];
-    else
-        StippleFunc = XAAStippleScanlineFuncLSBFirst[funcNo];
-
-    /* don't bother generating more than we'll ever use */
-    max = ((pScrn->displayWidth + w - 1) + 31) >> 5;
-    if (dwords > max)
-        dwords = max;
-
-    for (i = 0; i < h; i++) {
-        (*StippleFunc) ((CARD32 *) dstPtr, (CARD32 *) srcPtr, 0, w, dwords);
-        srcPtr += pPix->devKind;
-        dstPtr += pad;
-    }
-
-    while ((h << 1) <= pCache->h) {
-        memcpy(data + (pad * h), data, pad * h);
-        h <<= 1;
-    }
-
-    if (h < pCache->h)
-        memcpy(data + (pad * h), data, pad * (pCache->h - h));
-
-    (*infoRec->WritePixmapToCache) (pScrn, pCache->x, pCache->y, pCache->w,
-                                    pCache->h, data, pad, bpp, pScrn->depth);
-
-    free(data);
-
-    return pCache;
-}
-
-XAACacheInfoPtr
-XAACachePlanarMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
-{
-    int w = pPix->drawable.width;
-    int h = pPix->drawable.height;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    XAAPixmapCachePrivatePtr pCachePriv =
-        (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate;
-    XAACacheInfoPtr pCache, cacheRoot = NULL;
-    int i, max = 0;
-    int *current;
-
-    if ((h <= 128) && (w <= 128)) {
-        if (pCachePriv->Info128) {
-            cacheRoot = pCachePriv->Info128;
-            max = pCachePriv->Num128x128;
-            current = &pCachePriv->Current128;
-        }
-        else {
-            cacheRoot = pCachePriv->InfoPartial;
-            max = pCachePriv->NumPartial;
-            current = &pCachePriv->CurrentPartial;
-        }
-    }
-    else if ((h <= 256) && (w <= 256)) {
-        cacheRoot = pCachePriv->Info256;
-        max = pCachePriv->Num256x256;
-        current = &pCachePriv->Current256;
-    }
-    else if ((h <= 512) && (w <= 526)) {
-        cacheRoot = pCachePriv->Info512;
-        max = pCachePriv->Num512x512;
-        current = &pCachePriv->Current512;
-    }
-    else {                      /* something's wrong */
-        ErrorF("Something's wrong in XAACachePlanarMonoStipple()\n");
-        return pCachePriv->Info128;
-    }
-
-    pCache = cacheRoot;
-
-    /* lets look for it */
-    for (i = 0; i < max; i++, pCache++) {
-        if ((pCache->serialNumber == pPix->drawable.serialNumber) &&
-            (pCache->fg == -1) && (pCache->bg == -1)) {
-            pCache->trans_color = -1;
-            return pCache;
-        }
-    }
-
-    pCache = &cacheRoot[(*current)++];
-    if (*current >= max)
-        *current = 0;
-
-    pCache->serialNumber = pPix->drawable.serialNumber;
-    pCache->trans_color = pCache->bg = pCache->fg = -1;
-    pCache->orig_w = w;
-    pCache->orig_h = h;
-
-    /* Plane 0 holds the stipple. Plane 1 holds the inverted stipple */
-    (*infoRec->WriteBitmapToCache) (pScrn, pCache->x, pCache->y,
-                                    pPix->drawable.width, pPix->drawable.height,
-                                    pPix->devPrivate.ptr, pPix->devKind, 1, 2);
-    if (!(infoRec->PixmapCacheFlags & DO_NOT_TILE_MONO_DATA) &&
-        ((w != pCache->w) || (h != pCache->h)))
-        XAATileCache(pScrn, pCache, w, h);
-
-    return pCache;
-}
-
-XAACachePlanarMonoStippleProc
-XAAGetCachePlanarMonoStipple(void)
-{
-    return XAACachePlanarMonoStipple;
-}
-
-XAACacheInfoPtr
-XAACacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg)
-{
-    int w = pPix->drawable.width;
-    int h = pPix->drawable.height;
-    int size = max(w, h);
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    XAAPixmapCachePrivatePtr pCachePriv =
-        (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate;
-    XAACacheInfoPtr pCache, cacheRoot = NULL;
-    int i, max = 0;
-    int *current;
-
-    if (size <= 128) {
-        if (pCachePriv->Info128) {
-            cacheRoot = pCachePriv->Info128;
-            max = pCachePriv->Num128x128;
-            current = &pCachePriv->Current128;
-        }
-        else {
-            cacheRoot = pCachePriv->InfoPartial;
-            max = pCachePriv->NumPartial;
-            current = &pCachePriv->CurrentPartial;
-        }
-    }
-    else if (size <= 256) {
-        cacheRoot = pCachePriv->Info256;
-        max = pCachePriv->Num256x256;
-        current = &pCachePriv->Current256;
-    }
-    else if (size <= 512) {
-        cacheRoot = pCachePriv->Info512;
-        max = pCachePriv->Num512x512;
-        current = &pCachePriv->Current512;
-    }
-    else {                      /* something's wrong */
-        ErrorF("Something's wrong in XAACacheStipple()\n");
-        return pCachePriv->Info128;
-    }
-
-    pCache = cacheRoot;
-    /* lets look for it */
-    if (bg == -1)
-        for (i = 0; i < max; i++, pCache++) {
-            if ((pCache->serialNumber == pPix->drawable.serialNumber) &&
-                (fg == pCache->fg) && (pCache->fg != pCache->bg)) {
-                pCache->trans_color = pCache->bg;
-                return pCache;
-            }
-        }
-    else
-        for (i = 0; i < max; i++, pCache++) {
-            if ((pCache->serialNumber == pPix->drawable.serialNumber) &&
-                (fg == pCache->fg) && (bg == pCache->bg)) {
-                pCache->trans_color = -1;
-                return pCache;
-            }
-        }
-
-    pCache = &cacheRoot[(*current)++];
-    if (*current >= max)
-        *current = 0;
-
-    pCache->serialNumber = pPix->drawable.serialNumber;
-    pCache->fg = fg;
-    if (bg == -1)
-        pCache->trans_color = bg = fg ^ 1;
-    else
-        pCache->trans_color = -1;
-    pCache->bg = bg;
-
-    pCache->orig_w = w;
-    pCache->orig_h = h;
-    (*infoRec->WriteBitmapToCache) (pScrn, pCache->x, pCache->y,
-                                    pPix->drawable.width, pPix->drawable.height,
-                                    pPix->devPrivate.ptr, pPix->devKind, fg,
-                                    bg);
-    if (!(infoRec->PixmapCacheFlags & DO_NOT_TILE_COLOR_DATA) &&
-        ((w != pCache->w) || (h != pCache->h)))
-        XAATileCache(pScrn, pCache, w, h);
-
-    return pCache;
-}
-
-XAACacheInfoPtr
-XAACacheMono8x8Pattern(ScrnInfoPtr pScrn, int pat0, int pat1)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    XAAPixmapCachePrivatePtr pCachePriv =
-        (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate;
-    XAACacheInfoPtr pCache = pCachePriv->InfoMono;
-    int i;
-
-    for (i = 0; i < pCachePriv->NumMono; i++, pCache++) {
-        if (pCache->serialNumber &&
-            (pCache->pat0 == pat0) && (pCache->pat1 == pat1))
-            return pCache;
-    }
-
-    /* OK, let's cache it */
-    pCache = &pCachePriv->InfoMono[pCachePriv->CurrentMono++];
-    if (pCachePriv->CurrentMono >= pCachePriv->NumMono)
-        pCachePriv->CurrentMono = 0;
-
-    pCache->serialNumber = 1;   /* we don't care since we do lookups by pattern */
-    pCache->pat0 = pat0;
-    pCache->pat1 = pat1;
-
-    (*infoRec->WriteMono8x8PatternToCache) (pScrn, pCache);
-
-    return pCache;
-}
-
-XAACacheInfoPtr
-XAACacheColor8x8Pattern(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    XAAPixmapCachePrivatePtr pCachePriv =
-        (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate;
-    XAACacheInfoPtr pCache = pCachePriv->InfoColor;
-    XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
-    int i;
-
-    if (!(pixPriv->flags & REDUCIBLE_TO_2_COLOR)) {
-        for (i = 0; i < pCachePriv->NumColor; i++, pCache++) {
-            if (pCache->serialNumber == pPix->drawable.serialNumber) {
-                pCache->trans_color = -1;
-                return pCache;
-            }
-        }
-        pCache = &pCachePriv->InfoColor[pCachePriv->CurrentColor++];
-        if (pCachePriv->CurrentColor >= pCachePriv->NumColor)
-            pCachePriv->CurrentColor = 0;
-
-        pCache->serialNumber = pPix->drawable.serialNumber;
-        pCache->trans_color = pCache->fg = pCache->bg = -1;
-    }
-    else {
-        int pat0 = pixPriv->pattern0;
-        int pat1 = pixPriv->pattern1;
-
-        if (fg == -1) {         /* it's a tile */
-            fg = pixPriv->fg;
-            bg = pixPriv->bg;
-        }
-
-        if (bg == -1) {         /* stipple */
-            for (i = 0; i < pCachePriv->NumColor; i++, pCache++) {
-                if (pCache->serialNumber &&
-                    (pCache->pat0 == pat0) && (pCache->pat1 == pat1) &&
-                    (pCache->fg == fg) && (pCache->bg != fg)) {
-                    pCache->trans_color = pCache->bg;
-                    return pCache;
-                }
-            }
-        }
-        else {                  /* opaque stipple */
-            for (i = 0; i < pCachePriv->NumColor; i++, pCache++) {
-                if (pCache->serialNumber &&
-                    (pCache->pat0 == pat0) && (pCache->pat1 == pat1) &&
-                    (pCache->fg == fg) && (pCache->bg == bg)) {
-                    pCache->trans_color = -1;
-                    return pCache;
-                }
-            }
-        }
-        pCache = &pCachePriv->InfoColor[pCachePriv->CurrentColor++];
-        if (pCachePriv->CurrentColor >= pCachePriv->NumColor)
-            pCachePriv->CurrentColor = 0;
-
-        if (bg == -1)
-            pCache->trans_color = bg = fg ^ 1;
-        else
-            pCache->trans_color = -1;
-
-        pCache->pat0 = pat0;
-        pCache->pat1 = pat1;
-        pCache->fg = fg;
-        pCache->bg = bg;
-        pCache->serialNumber = 1;
-    }
-
-    (*infoRec->WriteColor8x8PatternToCache) (pScrn, pPix, pCache);
-
-    return pCache;
-}
-
-void
-XAAWriteBitmapToCache(ScrnInfoPtr pScrn,
-                      int x, int y, int w, int h,
-                      unsigned char *src, int srcwidth, int fg, int bg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    (*infoRec->WriteBitmap) (pScrn, x, y, w, h, src, srcwidth,
-                             0, fg, bg, GXcopy, ~0);
-}
-
-void
-XAAWriteBitmapToCacheLinear(ScrnInfoPtr pScrn,
-                            int x, int y, int w, int h,
-                            unsigned char *src, int srcwidth, int fg, int bg)
-{
-    ScreenPtr pScreen = pScrn->pScreen;
-    PixmapPtr pScreenPix, pDstPix;
-    ChangeGCVal gcvals[2];
-    GCPtr pGC;
-
-    pScreenPix = (*pScreen->GetScreenPixmap) (pScreen);
-
-    pDstPix = GetScratchPixmapHeader(pScreen, pScreenPix->drawable.width,
-                                     y + h, pScreenPix->drawable.depth,
-                                     pScreenPix->drawable.bitsPerPixel,
-                                     pScreenPix->devKind,
-                                     pScreenPix->devPrivate.ptr);
-
-    pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen);
-    gcvals[0].val = fg;
-    gcvals[1].val = bg;
-    ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcvals);
-    ValidateGC((DrawablePtr) pDstPix, pGC);
-
-    /* We've unwrapped already so these ops miss a sync */
-    SYNC_CHECK(pScrn);
-
-    (*pGC->ops->PutImage) ((DrawablePtr) pDstPix, pGC, 1, x, y, w, h, 0,
-                           XYBitmap, (pointer) src);
-
-    FreeScratchGC(pGC);
-    FreeScratchPixmapHeader(pDstPix);
-}
-
-void
-XAAWritePixmapToCache(ScrnInfoPtr pScrn,
-                      int x, int y, int w, int h,
-                      unsigned char *src, int srcwidth, int bpp, int depth)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    (*infoRec->WritePixmap) (pScrn, x, y, w, h, src, srcwidth,
-                             GXcopy, ~0, -1, bpp, depth);
-}
-
-void
-XAAWritePixmapToCacheLinear(ScrnInfoPtr pScrn,
-                            int x, int y, int w, int h,
-                            unsigned char *src,
-                            int srcwidth, int bpp, int depth)
-{
-    ScreenPtr pScreen = pScrn->pScreen;
-    PixmapPtr pScreenPix, pDstPix;
-    GCPtr pGC;
-
-    pScreenPix = (*pScreen->GetScreenPixmap) (pScreen);
-
-    pDstPix = GetScratchPixmapHeader(pScreen, x + w, y + h,
-                                     depth, bpp, pScreenPix->devKind,
-                                     pScreenPix->devPrivate.ptr);
-
-    pGC = GetScratchGC(depth, pScreen);
-    ValidateGC((DrawablePtr) pDstPix, pGC);
-
-    /* We've unwrapped already so these ops miss a sync */
-    SYNC_CHECK(pScrn);
-
-    if (bpp == BitsPerPixel(depth))
-        (*pGC->ops->PutImage) ((DrawablePtr) pDstPix, pGC, depth, x, y, w,
-                               h, 0, ZPixmap, (pointer) src);
-    else {
-        PixmapPtr pSrcPix;
-
-        pSrcPix = GetScratchPixmapHeader(pScreen, w, h, depth, bpp,
-                                         srcwidth, (pointer) src);
-
-        (*pGC->ops->CopyArea) ((DrawablePtr) pSrcPix, (DrawablePtr) pDstPix,
-                               pGC, 0, 0, w, h, x, y);
-
-        FreeScratchPixmapHeader(pSrcPix);
-    }
-
-    FreeScratchGC(pGC);
-    FreeScratchPixmapHeader(pDstPix);
-}
-
-void
-XAAWriteMono8x8PatternToCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    XAAPixmapCachePrivatePtr pCachePriv =
-        (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate;
-    unsigned char *data;
-    int pad, Bpp = (pScrn->bitsPerPixel >> 3);
-
-    pCache->offsets = pCachePriv->MonoOffsets;
-
-    pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel);
-
-    data = (unsigned char *) malloc(pad * pCache->h);
-    if (!data)
-        return;
-
-    if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
-        CARD32 *ptr = (CARD32 *) data;
-
-        ptr[0] = pCache->pat0;
-        ptr[1] = pCache->pat1;
-    }
-    else {
-        CARD32 *ptr;
-        DDXPointPtr pPoint = pCache->offsets;
-        int patx, paty, i;
-
-        for (i = 0; i < 64; i++, pPoint++) {
-            patx = pCache->pat0;
-            paty = pCache->pat1;
-            XAARotateMonoPattern(&patx, &paty, i & 0x07, i >> 3,
-                                 (infoRec->Mono8x8PatternFillFlags &
-                                  BIT_ORDER_IN_BYTE_MSBFIRST));
-            ptr = (CARD32 *) (data + (pad * pPoint->y) + (Bpp * pPoint->x));
-            ptr[0] = patx;
-            ptr[1] = paty;
-        }
-    }
-
-    (*infoRec->WritePixmapToCache) (pScrn, pCache->x, pCache->y,
-                                    pCache->w, pCache->h, data, pad,
-                                    pScrn->bitsPerPixel, pScrn->depth);
-
-    free(data);
-}
-
-void
-XAAWriteColor8x8PatternToCache(ScrnInfoPtr pScrn,
-                               PixmapPtr pPix, XAACacheInfoPtr pCache)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
-    XAAPixmapCachePrivatePtr pCachePriv =
-        (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate;
-    int pad, i, w, h, nw, nh, Bpp;
-    unsigned char *data, *srcPtr, *dstPtr;
-
-    pCache->offsets = pCachePriv->ColorOffsets;
-
-    if (pixPriv->flags & REDUCIBLE_TO_2_COLOR) {
-        CARD32 *ptr;
-
-        pad = BitmapBytePad(pCache->w);
-        data = (unsigned char *) malloc(pad * pCache->h);
-        if (!data)
-            return;
-
-        if (infoRec->Color8x8PatternFillFlags &
-            HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
-            ptr = (CARD32 *) data;
-            ptr[0] = pCache->pat0;
-            ptr[1] = pCache->pat1;
-        }
-        else {
-            int patx, paty;
-
-            ptr = (CARD32 *) data;
-            ptr[0] = ptr[2] = pCache->pat0;
-            ptr[1] = ptr[3] = pCache->pat1;
-            for (i = 1; i < 8; i++) {
-                patx = pCache->pat0;
-                paty = pCache->pat1;
-                XAARotateMonoPattern(&patx, &paty, i, 0,
-                                     (infoRec->Mono8x8PatternFillFlags &
-                                      BIT_ORDER_IN_BYTE_MSBFIRST));
-                ptr = (CARD32 *) (data + (pad * i));
-                ptr[0] = ptr[2] = patx;
-                ptr[1] = ptr[3] = paty;
-            }
-        }
-
-        (*infoRec->WriteBitmapToCache) (pScrn, pCache->x, pCache->y,
-                                        pCache->w, pCache->h, data, pad,
-                                        pCache->fg, pCache->bg);
-
-        free(data);
-        return;
-    }
-
-    Bpp = pScrn->bitsPerPixel >> 3;
-    h = min(8, pPix->drawable.height);
-    w = min(8, pPix->drawable.width);
-    pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel);
-
-    data = (unsigned char *) malloc(pad * pCache->h);
-    if (!data)
-        return;
-
-    /* Write and expand horizontally. */
-    for (i = h, dstPtr = data, srcPtr = pPix->devPrivate.ptr; i--;
-         srcPtr += pPix->devKind, dstPtr += pScrn->bitsPerPixel) {
-        nw = w;
-        memcpy(dstPtr, srcPtr, w * Bpp);
-        while (nw != 8) {
-            memcpy(dstPtr + (nw * Bpp), dstPtr, nw * Bpp);
-            nw <<= 1;
-        }
-    }
-    nh = h;
-    /* Expand vertically. */
-    while (nh != 8) {
-        memcpy(data + (nh * pScrn->bitsPerPixel), data,
-               nh * pScrn->bitsPerPixel);
-        nh <<= 1;
-    }
-
-    if (!(infoRec->Color8x8PatternFillFlags &
-          HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-        int j;
-        unsigned char *ptr = data + (128 * Bpp);
-
-        memcpy(data + (64 * Bpp), data, 64 * Bpp);
-        for (i = 1; i < 8; i++, ptr += (128 * Bpp)) {
-            for (j = 0; j < 8; j++) {
-                memcpy(ptr + (j * 8) * Bpp, data + (j * 8 + i) * Bpp,
-                       (8 - i) * Bpp);
-                memcpy(ptr + (j * 8 + 8 - i) * Bpp, data + j * 8 * Bpp,
-                       i * Bpp);
-            }
-            memcpy(ptr + (64 * Bpp), ptr, 64 * Bpp);
-        }
-    }
-
-    (*infoRec->WritePixmapToCache) (pScrn, pCache->x, pCache->y,
-                                    pCache->w, pCache->h, data, pad,
-                                    pScrn->bitsPerPixel, pScrn->depth);
-
-    free(data);
-}
-
-int
-XAAStippledFillChooser(GCPtr pGC)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    PixmapPtr pPixmap = pGC->stipple;
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
-
-    if (!(pPriv->flags & REDUCIBILITY_CHECKED) &&
-        (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
-        XAACheckStippleReducibility(pPixmap);
-    }
-
-    if (pPriv->flags & REDUCIBLE_TO_8x8) {
-        if (infoRec->CanDoMono8x8 &&
-            !(infoRec->FillMono8x8PatternSpansFlags & NO_TRANSPARENCY) &&
-            ((pGC->alu == GXcopy) || !(infoRec->FillMono8x8PatternSpansFlags &
-                                       TRANSPARENCY_GXCOPY_ONLY)) &&
-            CHECK_ROP(pGC, infoRec->FillMono8x8PatternSpansFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->FillMono8x8PatternSpansFlags) &&
-            CHECK_FG(pGC, infoRec->FillMono8x8PatternSpansFlags) &&
-            CHECK_PLANEMASK(pGC, infoRec->FillMono8x8PatternSpansFlags)) {
-
-            return DO_MONO_8x8;
-        }
-
-        if (infoRec->CanDoColor8x8 &&
-            !(infoRec->FillColor8x8PatternSpansFlags & NO_TRANSPARENCY) &&
-            ((pGC->alu == GXcopy) || !(infoRec->FillColor8x8PatternSpansFlags &
-                                       TRANSPARENCY_GXCOPY_ONLY)) &&
-            CHECK_ROP(pGC, infoRec->FillColor8x8PatternSpansFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->FillColor8x8PatternSpansFlags) &&
-            CHECK_PLANEMASK(pGC, infoRec->FillColor8x8PatternSpansFlags)) {
-
-            return DO_COLOR_8x8;
-        }
-    }
-
-    if (infoRec->UsingPixmapCache && infoRec->FillCacheExpandSpans &&
-        (pPixmap->drawable.height <= infoRec->MaxCacheableStippleHeight) &&
-        (pPixmap->drawable.width <= infoRec->MaxCacheableStippleWidth /
-         infoRec->CacheColorExpandDensity) &&
-        !(infoRec->FillCacheExpandSpansFlags & NO_TRANSPARENCY) &&
-        ((pGC->alu == GXcopy) || !(infoRec->FillCacheExpandSpansFlags &
-                                   TRANSPARENCY_GXCOPY_ONLY)) &&
-        CHECK_ROP(pGC, infoRec->FillCacheExpandSpansFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->FillCacheExpandSpansFlags) &&
-        CHECK_FG(pGC, infoRec->FillCacheExpandSpansFlags) &&
-        CHECK_PLANEMASK(pGC, infoRec->FillCacheExpandSpansFlags)) {
-
-        return DO_CACHE_EXPAND;
-    }
-
-    if (infoRec->UsingPixmapCache &&
-        !(infoRec->PixmapCacheFlags & DO_NOT_BLIT_STIPPLES) &&
-        infoRec->FillCacheBltSpans &&
-        (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) &&
-        (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) &&
-        !(infoRec->FillCacheBltSpansFlags & NO_TRANSPARENCY) &&
-        ((pGC->alu == GXcopy) || !(infoRec->FillCacheBltSpansFlags &
-                                   TRANSPARENCY_GXCOPY_ONLY)) &&
-        CHECK_ROP(pGC, infoRec->FillCacheBltSpansFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->FillCacheBltSpansFlags) &&
-        CHECK_PLANEMASK(pGC, infoRec->FillCacheBltSpansFlags)) {
-
-        return DO_CACHE_BLT;
-    }
-
-    if (infoRec->FillColorExpandSpans &&
-        !(infoRec->FillColorExpandSpansFlags & NO_TRANSPARENCY) &&
-        ((pGC->alu == GXcopy) || !(infoRec->FillColorExpandSpansFlags &
-                                   TRANSPARENCY_GXCOPY_ONLY)) &&
-        CHECK_ROP(pGC, infoRec->FillColorExpandSpansFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->FillColorExpandSpansFlags) &&
-        CHECK_FG(pGC, infoRec->FillColorExpandSpansFlags) &&
-        CHECK_PLANEMASK(pGC, infoRec->FillColorExpandSpansFlags)) {
-
-        return DO_COLOR_EXPAND;
-    }
-
-    return 0;
-}
-
-int
-XAAOpaqueStippledFillChooser(GCPtr pGC)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    PixmapPtr pPixmap = pGC->stipple;
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
-
-    if (XAA_DEPTH_BUG(pGC))
-        return 0;
-
-    if (!(pPriv->flags & REDUCIBILITY_CHECKED) &&
-        (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
-        XAACheckStippleReducibility(pPixmap);
-    }
-
-    if (pPriv->flags & REDUCIBLE_TO_8x8) {
-        if (infoRec->CanDoMono8x8 &&
-            !(infoRec->FillMono8x8PatternSpansFlags & TRANSPARENCY_ONLY) &&
-            CHECK_ROP(pGC, infoRec->FillMono8x8PatternSpansFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->FillMono8x8PatternSpansFlags) &&
-            CHECK_COLORS(pGC, infoRec->FillMono8x8PatternSpansFlags) &&
-            CHECK_PLANEMASK(pGC, infoRec->FillMono8x8PatternSpansFlags)) {
-
-            return DO_MONO_8x8;
-        }
-
-        if (infoRec->CanDoColor8x8 &&
-            CHECK_ROP(pGC, infoRec->FillColor8x8PatternSpansFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->FillColor8x8PatternSpansFlags) &&
-            CHECK_PLANEMASK(pGC, infoRec->FillColor8x8PatternSpansFlags)) {
-
-            return DO_COLOR_8x8;
-        }
-    }
-
-    if (infoRec->UsingPixmapCache && infoRec->FillCacheExpandSpans &&
-        (pPixmap->drawable.height <= infoRec->MaxCacheableStippleHeight) &&
-        (pPixmap->drawable.width <= infoRec->MaxCacheableStippleWidth /
-         infoRec->CacheColorExpandDensity) &&
-        !(infoRec->FillCacheExpandSpansFlags & TRANSPARENCY_ONLY) &&
-        CHECK_ROP(pGC, infoRec->FillCacheExpandSpansFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->FillCacheExpandSpansFlags) &&
-        CHECK_COLORS(pGC, infoRec->FillCacheExpandSpansFlags) &&
-        CHECK_PLANEMASK(pGC, infoRec->FillCacheExpandSpansFlags)) {
-
-        return DO_CACHE_EXPAND;
-    }
-
-    if (infoRec->UsingPixmapCache &&
-        !(infoRec->PixmapCacheFlags & DO_NOT_BLIT_STIPPLES) &&
-        infoRec->FillCacheBltSpans &&
-        (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) &&
-        (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) &&
-        CHECK_ROP(pGC, infoRec->FillCacheBltSpansFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->FillCacheBltSpansFlags) &&
-        CHECK_PLANEMASK(pGC, infoRec->FillCacheBltSpansFlags)) {
-
-        return DO_CACHE_BLT;
-    }
-
-    if (infoRec->FillColorExpandSpans &&
-        !(infoRec->FillColorExpandSpansFlags & TRANSPARENCY_ONLY) &&
-        CHECK_ROP(pGC, infoRec->FillColorExpandSpansFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->FillColorExpandSpansFlags) &&
-        CHECK_COLORS(pGC, infoRec->FillColorExpandSpansFlags) &&
-        CHECK_PLANEMASK(pGC, infoRec->FillColorExpandSpansFlags)) {
-
-        return DO_COLOR_EXPAND;
-    }
-
-    return 0;
-}
-
-int
-XAATiledFillChooser(GCPtr pGC)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    PixmapPtr pPixmap = pGC->tile.pixmap;
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
-
-    if (IS_OFFSCREEN_PIXMAP(pPixmap) && infoRec->FillCacheBltSpans &&
-        CHECK_ROP(pGC, infoRec->FillCacheBltSpansFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->FillCacheBltSpansFlags) &&
-        CHECK_PLANEMASK(pGC, infoRec->FillCacheBltSpansFlags)) {
-
-        return DO_PIXMAP_COPY;
-    }
-
-    if (!(pPriv->flags & REDUCIBILITY_CHECKED) &&
-        (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
-        XAACheckTileReducibility(pPixmap, infoRec->CanDoMono8x8);
-    }
-
-    if (pPriv->flags & REDUCIBLE_TO_8x8) {
-        if ((pPriv->flags & REDUCIBLE_TO_2_COLOR) && infoRec->CanDoMono8x8 &&
-            !(infoRec->FillMono8x8PatternSpansFlags & TRANSPARENCY_ONLY) &&
-            CHECK_ROP(pGC, infoRec->FillMono8x8PatternSpansFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->FillMono8x8PatternSpansFlags) &&
-            (!(infoRec->FillMono8x8PatternSpansFlags & RGB_EQUAL) ||
-             (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg))) &&
-            CHECK_PLANEMASK(pGC, infoRec->FillMono8x8PatternSpansFlags)) {
-
-            return DO_MONO_8x8;
-        }
-
-        if (infoRec->CanDoColor8x8 &&
-            CHECK_ROP(pGC, infoRec->FillColor8x8PatternSpansFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->FillColor8x8PatternSpansFlags) &&
-            CHECK_PLANEMASK(pGC, infoRec->FillColor8x8PatternSpansFlags)) {
-
-            return DO_COLOR_8x8;
-        }
-    }
-
-    if (infoRec->UsingPixmapCache && infoRec->FillCacheBltSpans &&
-        (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) &&
-        (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) &&
-        CHECK_ROP(pGC, infoRec->FillCacheBltSpansFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->FillCacheBltSpansFlags) &&
-        CHECK_PLANEMASK(pGC, infoRec->FillCacheBltSpansFlags)) {
-
-        return DO_CACHE_BLT;
-    }
-
-    if (infoRec->FillImageWriteRects &&
-        CHECK_NO_GXCOPY(pGC, infoRec->FillImageWriteRectsFlags) &&
-        CHECK_ROP(pGC, infoRec->FillImageWriteRectsFlags) &&
-        CHECK_ROPSRC(pGC, infoRec->FillImageWriteRectsFlags) &&
-        CHECK_PLANEMASK(pGC, infoRec->FillImageWriteRectsFlags)) {
-
-        return DO_IMAGE_WRITE;
-    }
-
-    return 0;
-}
-
-static int RotateMasksX[8] = {
-    0xFFFFFFFF, 0x7F7F7F7F, 0x3F3F3F3F, 0x1F1F1F1F,
-    0x0F0F0F0F, 0x07070707, 0x03030303, 0x01010101
-};
-
-static int RotateMasksY[4] = {
-    0xFFFFFFFF, 0x00FFFFFF, 0x0000FFFF, 0x000000FF
-};
-
-void
-XAARotateMonoPattern(int *pat0, int *pat1, int xorg, int yorg, Bool msbfirst)
-{
-    int tmp, mask;
-
-    if (xorg) {
-        if (msbfirst)
-            xorg = 8 - xorg;
-        mask = RotateMasksX[xorg];
-        *pat0 = ((*pat0 >> xorg) & mask) | ((*pat0 << (8 - xorg)) & ~mask);
-        *pat1 = ((*pat1 >> xorg) & mask) | ((*pat1 << (8 - xorg)) & ~mask);
-    }
-    if (yorg >= 4) {
-        tmp = *pat0;
-        *pat0 = *pat1;
-        *pat1 = tmp;
-        yorg -= 4;
-    }
-    if (yorg) {
-        mask = RotateMasksY[yorg];
-        yorg <<= 3;
-        tmp = *pat0;
-        *pat0 = ((*pat0 >> yorg) & mask) | ((*pat1 << (32 - yorg)) & ~mask);
-        *pat1 = ((*pat1 >> yorg) & mask) | ((tmp << (32 - yorg)) & ~mask);
-    }
-}
-
-void
-XAAInvalidatePixmapCache(ScreenPtr pScreen)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    XAAPixmapCachePrivatePtr pCachePriv =
-        (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate;
-    int i;
-
-    if (!pCachePriv)
-        return;
-
-    for (i = 0; i < pCachePriv->Num512x512; i++)
-        (pCachePriv->Info512)[i].serialNumber = 0;
-    for (i = 0; i < pCachePriv->Num256x256; i++)
-        (pCachePriv->Info256)[i].serialNumber = 0;
-    for (i = 0; i < pCachePriv->Num128x128; i++)
-        (pCachePriv->Info128)[i].serialNumber = 0;
-    for (i = 0; i < pCachePriv->NumPartial; i++)
-        (pCachePriv->InfoPartial)[i].serialNumber = 0;
-    for (i = 0; i < pCachePriv->NumMono; i++)
-        (pCachePriv->InfoMono)[i].serialNumber = 0;
-    for (i = 0; i < pCachePriv->NumColor; i++)
-        (pCachePriv->InfoColor)[i].serialNumber = 0;
-}
diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c
deleted file mode 100644 (file)
index 0721768..0000000
+++ /dev/null
@@ -1,654 +0,0 @@
-/*
- *
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Keith Packard makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <string.h>
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "picturestr.h"
-#include "glyphstr.h"
-#include "picture.h"
-#include "mipict.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "xaacexp.h"
-#include "xf86fbman.h"
-#include "servermd.h"
-
-Bool
-XAAGetPixelFromRGBA(CARD32 *pixel,
-                    CARD16 red,
-                    CARD16 green, CARD16 blue, CARD16 alpha, CARD32 format)
-{
-    int rbits, bbits, gbits, abits;
-    int rshift, bshift, gshift, ashift;
-
-    *pixel = 0;
-
-    if (!PICT_FORMAT_COLOR(format))
-        return FALSE;
-
-    rbits = PICT_FORMAT_R(format);
-    gbits = PICT_FORMAT_G(format);
-    bbits = PICT_FORMAT_B(format);
-    abits = PICT_FORMAT_A(format);
-
-    if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) {
-        bshift = 0;
-        gshift = bbits;
-        rshift = gshift + gbits;
-        ashift = rshift + rbits;
-    }
-    else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ABGR) {
-        rshift = 0;
-        gshift = rbits;
-        bshift = gshift + gbits;
-        ashift = bshift + bbits;
-    }
-    else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) {
-        bshift = PICT_FORMAT_BPP(format) - bbits;
-        gshift = bshift - gbits;
-        rshift = gshift - rbits;
-        ashift = 0;
-    }
-    else
-        return FALSE;
-
-    *pixel |= (blue >> (16 - bbits)) << bshift;
-    *pixel |= (red >> (16 - rbits)) << rshift;
-    *pixel |= (green >> (16 - gbits)) << gshift;
-    *pixel |= (alpha >> (16 - abits)) << ashift;
-
-    return TRUE;
-}
-
-Bool
-XAAGetRGBAFromPixel(CARD32 pixel,
-                    CARD16 *red,
-                    CARD16 *green, CARD16 *blue, CARD16 *alpha, CARD32 format)
-{
-    int rbits, bbits, gbits, abits;
-    int rshift, bshift, gshift, ashift;
-
-    if (!PICT_FORMAT_COLOR(format))
-        return FALSE;
-
-    rbits = PICT_FORMAT_R(format);
-    gbits = PICT_FORMAT_G(format);
-    bbits = PICT_FORMAT_B(format);
-    abits = PICT_FORMAT_A(format);
-
-    if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) {
-        bshift = 0;
-        gshift = bbits;
-        rshift = gshift + gbits;
-        ashift = rshift + rbits;
-    }
-    else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ABGR) {
-        rshift = 0;
-        gshift = rbits;
-        bshift = gshift + gbits;
-        ashift = bshift + bbits;
-    }
-    else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) {
-        bshift = PICT_FORMAT_BPP(format) - bbits;
-        gshift = bshift - gbits;
-        rshift = gshift - rbits;
-        ashift = 0;
-    }
-    else
-        return FALSE;
-
-    *red = ((pixel >> rshift) & ((1 << rbits) - 1)) << (16 - rbits);
-    while (rbits < 16) {
-        *red |= *red >> rbits;
-        rbits <<= 1;
-    }
-
-    *green = ((pixel >> gshift) & ((1 << gbits) - 1)) << (16 - gbits);
-    while (gbits < 16) {
-        *green |= *green >> gbits;
-        gbits <<= 1;
-    }
-
-    *blue = ((pixel >> bshift) & ((1 << bbits) - 1)) << (16 - bbits);
-    while (bbits < 16) {
-        *blue |= *blue >> bbits;
-        bbits <<= 1;
-    }
-
-    if (abits) {
-        *alpha = ((pixel >> ashift) & ((1 << abits) - 1)) << (16 - abits);
-        while (abits < 16) {
-            *alpha |= *alpha >> abits;
-            abits <<= 1;
-        }
-    }
-    else
-        *alpha = 0xffff;
-
-    return TRUE;
-}
-
-/* 8:8:8 + PICT_a8 -> 8:8:8:8 texture */
-
-void
-XAA_888_plus_PICT_a8_to_8888(CARD32 color, CARD8 *alphaPtr,     /* in bytes */
-                             int alphaPitch, CARD32 *dstPtr, int dstPitch,      /* in dwords */
-                             int width, int height)
-{
-    int x;
-
-    color &= 0x00ffffff;
-
-    while (height--) {
-        for (x = 0; x < width; x++)
-            dstPtr[x] = color | (alphaPtr[x] << 24);
-        dstPtr += dstPitch;
-        alphaPtr += alphaPitch;
-    }
-}
-
-#define DRAWABLE_IS_ON_CARD(pDraw) \
-    (pDraw->type == DRAWABLE_WINDOW || \
-     (pDraw->type == DRAWABLE_PIXMAP && IS_OFFSCREEN_PIXMAP(pDraw)))
-
-Bool
-XAADoComposite(CARD8 op,
-               PicturePtr pSrc,
-               PicturePtr pMask,
-               PicturePtr pDst,
-               INT16 xSrc,
-               INT16 ySrc,
-               INT16 xMask,
-               INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
-{
-    ScreenPtr pScreen = pDst->pDrawable->pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    RegionRec region;
-    CARD32 *formats, *dstformats;
-    int flags = 0;
-    BoxPtr pbox;
-    int nbox, w, h;
-
-    if (!RegionNumRects(pDst->pCompositeClip))
-        return TRUE;
-
-    if (!infoRec->pScrn->vtSema || !DRAWABLE_IS_ON_CARD(pDst->pDrawable))
-        return FALSE;
-
-    if (DRAWABLE_IS_ON_CARD(pSrc->pDrawable))
-        return FALSE;
-
-    if (pSrc->transform || (pMask && pMask->transform))
-        return FALSE;
-
-    if (pDst->alphaMap || pSrc->alphaMap || (pMask && pMask->alphaMap))
-        return FALSE;
-
-    if ((pSrc->repeat && pSrc->repeatType != RepeatNormal) ||
-        (pMask && pMask->repeat && pMask->repeatType != RepeatNormal)) {
-        return FALSE;
-    }
-
-    xDst += pDst->pDrawable->x;
-    yDst += pDst->pDrawable->y;
-    xSrc += pSrc->pDrawable->x;
-    ySrc += pSrc->pDrawable->y;
-
-    if (pMask) {
-        if (pMask->componentAlpha)
-            return FALSE;
-
-        /* for now we only do it if there is a 1x1 (solid) source */
-
-        if ((pSrc->pDrawable->width == 1) && (pSrc->pDrawable->height == 1)) {
-            CARD16 red, green, blue, alpha;
-            CARD32 pixel =
-                *((CARD32 *) (((PixmapPtr) (pSrc->pDrawable))->devPrivate.ptr));
-
-            if (!XAAGetRGBAFromPixel
-                (pixel, &red, &green, &blue, &alpha, pSrc->format))
-                return FALSE;
-
-            xMask += pMask->pDrawable->x;
-            yMask += pMask->pDrawable->y;
-
-            /* pull out color expandable operations here */
-            if ((pMask->format == PICT_a1) && (alpha == 0xffff) &&
-                (op == PictOpOver) && infoRec->WriteBitmap && !pMask->repeat &&
-                !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY) &&
-                (!(infoRec->WriteBitmapFlags & RGB_EQUAL) ||
-                 ((red == green) && (green == blue)))) {
-                PixmapPtr pPix = (PixmapPtr) (pMask->pDrawable);
-                int skipleft;
-
-                if (!miComputeCompositeRegion(&region, pSrc, pMask, pDst,
-                                              xSrc, ySrc, xMask, yMask, xDst,
-                                              yDst, width, height))
-                    return TRUE;
-
-                nbox = RegionNumRects(&region);
-                pbox = RegionRects(&region);
-
-                if (!nbox)
-                    return TRUE;
-
-                XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format);
-
-                xMask -= xDst;
-                yMask -= yDst;
-
-                while (nbox--) {
-                    skipleft = pbox->x1 + xMask;
-
-                    (*infoRec->WriteBitmap) (infoRec->pScrn,
-                                             pbox->x1, pbox->y1,
-                                             pbox->x2 - pbox->x1,
-                                             pbox->y2 - pbox->y1,
-                                             (unsigned char *) (pPix->
-                                                                devPrivate.
-                                                                ptr) +
-                                             (pPix->devKind *
-                                              (pbox->y1 + yMask)) +
-                                             ((skipleft >> 3) & ~3),
-                                             pPix->devKind, skipleft & 31,
-                                             pixel, -1, GXcopy, ~0);
-                    pbox++;
-                }
-
-                /* WriteBitmap sets the Sync flag */
-                RegionUninit(&region);
-                return TRUE;
-            }
-
-            formats = infoRec->CPUToScreenAlphaTextureFormats;
-            dstformats = infoRec->CPUToScreenAlphaTextureDstFormats;
-            if (!formats || !dstformats)
-                return FALSE;
-
-            w = pMask->pDrawable->width;
-            h = pMask->pDrawable->height;
-
-            if (pMask->repeat) {
-                if ((infoRec->CPUToScreenAlphaTextureFlags & XAA_RENDER_NO_TILE)
-                    ||
-                    ((infoRec->
-                      CPUToScreenAlphaTextureFlags &
-                      XAA_RENDER_POWER_OF_2_TILE_ONLY) && ((h & (h - 1)) ||
-                                                           (w & (w - 1))))) {
-                    return FALSE;
-                }
-                flags |= XAA_RENDER_REPEAT;
-            }
-
-            if ((alpha != 0xffff) &&
-                (infoRec->
-                 CPUToScreenAlphaTextureFlags & XAA_RENDER_NO_SRC_ALPHA))
-                return FALSE;
-
-            while (*formats != pMask->format) {
-                if (!(*formats))
-                    return FALSE;
-                formats++;
-            }
-            while (*dstformats != pDst->format) {
-                if (!(*dstformats))
-                    return FALSE;
-                dstformats++;
-            }
-
-            if (!miComputeCompositeRegion(&region, pSrc, pMask, pDst,
-                                          xSrc, ySrc, xMask, yMask, xDst, yDst,
-                                          width, height))
-                return TRUE;
-
-            nbox = RegionNumRects(&region);
-            pbox = RegionRects(&region);
-
-            if (!nbox) {
-                RegionUninit(&region);
-                return TRUE;
-            }
-
-            if (!(infoRec->SetupForCPUToScreenAlphaTexture2) (infoRec->pScrn,
-                                                              op, red, green,
-                                                              blue, alpha,
-                                                              pMask->format,
-                                                              pDst->format,
-                                                              ((PixmapPtr)
-                                                               (pMask->
-                                                                pDrawable))->
-                                                              devPrivate.ptr,
-                                                              ((PixmapPtr)
-                                                               (pMask->
-                                                                pDrawable))->
-                                                              devKind, w, h,
-                                                              flags)) {
-                RegionUninit(&region);
-                return FALSE;
-            }
-
-            xMask -= xDst;
-            yMask -= yDst;
-
-            while (nbox--) {
-                (*infoRec->SubsequentCPUToScreenAlphaTexture) (infoRec->pScrn,
-                                                               pbox->x1,
-                                                               pbox->y1,
-                                                               pbox->x1 + xMask,
-                                                               pbox->y1 + yMask,
-                                                               pbox->x2 -
-                                                               pbox->x1,
-                                                               pbox->y2 -
-                                                               pbox->y1);
-                pbox++;
-            }
-
-            SET_SYNC_FLAG(infoRec);
-            RegionUninit(&region);
-            return TRUE;
-        }
-    }
-    else {
-        formats = infoRec->CPUToScreenTextureFormats;
-        dstformats = infoRec->CPUToScreenTextureDstFormats;
-        if (!formats || !dstformats)
-            return FALSE;
-
-        w = pSrc->pDrawable->width;
-        h = pSrc->pDrawable->height;
-
-        if (pSrc->repeat) {
-            if ((infoRec->CPUToScreenTextureFlags & XAA_RENDER_NO_TILE) ||
-                ((infoRec->CPUToScreenTextureFlags &
-                  XAA_RENDER_POWER_OF_2_TILE_ONLY) &&
-                 ((h & (h - 1)) || (w & (w - 1))))) {
-                return FALSE;
-            }
-            flags |= XAA_RENDER_REPEAT;
-        }
-
-        while (*formats != pSrc->format) {
-            if (!(*formats))
-                return FALSE;
-            formats++;
-        }
-        while (*dstformats != pDst->format) {
-            if (!(*dstformats))
-                return FALSE;
-            dstformats++;
-        }
-
-        if (!miComputeCompositeRegion(&region, pSrc, pMask, pDst,
-                                      xSrc, ySrc, xMask, yMask, xDst, yDst,
-                                      width, height))
-            return TRUE;
-
-        nbox = RegionNumRects(&region);
-        pbox = RegionRects(&region);
-
-        if (!nbox) {
-            RegionUninit(&region);
-            return TRUE;
-        }
-
-        if (!(infoRec->SetupForCPUToScreenTexture2) (infoRec->pScrn,
-                                                     op, pSrc->format,
-                                                     pDst->format,
-                                                     ((PixmapPtr)
-                                                      (pSrc->pDrawable))->
-                                                     devPrivate.ptr,
-                                                     ((PixmapPtr)
-                                                      (pSrc->pDrawable))->
-                                                     devKind, w, h, flags)) {
-            RegionUninit(&region);
-            return FALSE;
-        }
-
-        xSrc -= xDst;
-        ySrc -= yDst;
-
-        while (nbox--) {
-            (*infoRec->SubsequentCPUToScreenTexture) (infoRec->pScrn,
-                                                      pbox->x1, pbox->y1,
-                                                      pbox->x1 + xSrc,
-                                                      pbox->y1 + ySrc,
-                                                      pbox->x2 - pbox->x1,
-                                                      pbox->y2 - pbox->y1);
-            pbox++;
-        }
-
-        SET_SYNC_FLAG(infoRec);
-        RegionUninit(&region);
-        return TRUE;
-    }
-
-    return FALSE;
-}
-
-static void
-XAACompositeSrcCopy(PicturePtr pSrc,
-                    PicturePtr pDst,
-                    INT16 xSrc,
-                    INT16 ySrc,
-                    INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
-{
-    ScreenPtr pScreen = pDst->pDrawable->pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-    int i, nbox;
-    int xoff, yoff;
-    BoxPtr pbox;
-    DDXPointPtr pptSrc;
-    RegionRec region;
-
-    xDst += pDst->pDrawable->x;
-    yDst += pDst->pDrawable->y;
-    xSrc += pSrc->pDrawable->x;
-    ySrc += pSrc->pDrawable->y;
-
-    if (!miComputeCompositeRegion(&region, pSrc, NULL, pDst,
-                                  xSrc, ySrc, 0, 0, xDst, yDst, width, height))
-        return;
-
-    nbox = RegionNumRects(&region);
-    pbox = RegionRects(&region);
-
-    if (!nbox) {
-        RegionUninit(&region);
-        return;
-    }
-    pptSrc = malloc(sizeof(DDXPointRec) * nbox);
-    if (!pptSrc) {
-        RegionUninit(&region);
-        return;
-    }
-    xoff = xSrc - xDst;
-    yoff = ySrc - yDst;
-    for (i = 0; i < nbox; i++) {
-        pptSrc[i].x = pbox[i].x1 + xoff;
-        pptSrc[i].y = pbox[i].y1 + yoff;
-    }
-
-    infoRec->ScratchGC.planemask = ~0L;
-    infoRec->ScratchGC.alu = GXcopy;
-
-    XAADoBitBlt(pSrc->pDrawable, pDst->pDrawable, &infoRec->ScratchGC, &region,
-                pptSrc);
-
-    free(pptSrc);
-    RegionUninit(&region);
-    return;
-}
-
-void
-XAAComposite(CARD8 op,
-             PicturePtr pSrc,
-             PicturePtr pMask,
-             PicturePtr pDst,
-             INT16 xSrc,
-             INT16 ySrc,
-             INT16 xMask,
-             INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
-{
-    ScreenPtr pScreen = pDst->pDrawable->pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-
-    XAA_RENDER_PROLOGUE(pScreen, Composite);
-
-    if (!pMask && infoRec->pScrn->vtSema &&
-        infoRec->ScreenToScreenBitBlt &&
-        pSrc->pDrawable &&
-        DRAWABLE_IS_ON_CARD(pSrc->pDrawable) &&
-        DRAWABLE_IS_ON_CARD(pDst->pDrawable) &&
-        !pSrc->transform &&
-        (!pSrc->repeat || (xSrc >= 0 && ySrc >= 0 &&
-                           xSrc + width <= pSrc->pDrawable->width &&
-                           ySrc + height <= pSrc->pDrawable->height)) &&
-        ((op == PictOpSrc &&
-          ((pSrc->format == pDst->format) ||
-           (pSrc->format == PICT_a8r8g8b8 && pDst->format == PICT_x8r8g8b8) ||
-           (pSrc->format == PICT_a8b8g8r8 && pDst->format == PICT_x8b8g8r8))) ||
-         (op == PictOpOver && !pSrc->alphaMap && !pDst->alphaMap &&
-          pSrc->format == pDst->format &&
-          (pSrc->format == PICT_x8r8g8b8 || pSrc->format == PICT_x8b8g8r8)))) {
-        XAACompositeSrcCopy(pSrc, pDst, xSrc, ySrc, xDst, yDst, width, height);
-    }
-    else if (!pSrc->pDrawable || (pMask && !pMask->pDrawable) ||
-             !infoRec->Composite ||
-             !(*infoRec->Composite) (op, pSrc, pMask, pDst,
-                                     xSrc, ySrc, xMask, yMask, xDst, yDst,
-                                     width, height)) {
-        if (infoRec->pScrn->vtSema &&
-            ((pSrc->pDrawable &&
-              (pSrc->pDrawable->type == DRAWABLE_WINDOW ||
-               IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))) ||
-             pDst->pDrawable->type == DRAWABLE_WINDOW ||
-             IS_OFFSCREEN_PIXMAP(pDst->pDrawable))) {
-            SYNC_CHECK(pDst->pDrawable);
-        }
-        (*GetPictureScreen(pScreen)->Composite) (op,
-                                                 pSrc,
-                                                 pMask,
-                                                 pDst,
-                                                 xSrc,
-                                                 ySrc,
-                                                 xMask,
-                                                 yMask,
-                                                 xDst, yDst, width, height);
-    }
-
-    if (pDst->pDrawable->type == DRAWABLE_PIXMAP)
-        (XAA_GET_PIXMAP_PRIVATE((PixmapPtr) (pDst->pDrawable)))->flags |= DIRTY;
-
-    XAA_RENDER_EPILOGUE(pScreen, Composite, XAAComposite);
-}
-
-Bool
-XAADoGlyphs(CARD8 op,
-            PicturePtr pSrc,
-            PicturePtr pDst,
-            PictFormatPtr maskFormat,
-            INT16 xSrc,
-            INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs)
-{
-    ScreenPtr pScreen = pDst->pDrawable->pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-
-    if (!RegionNumRects(pDst->pCompositeClip))
-        return TRUE;
-
-    if (!infoRec->pScrn->vtSema ||
-        ((pDst->pDrawable->type != DRAWABLE_WINDOW) &&
-         !IS_OFFSCREEN_PIXMAP(pDst->pDrawable)))
-        return FALSE;
-
-    if ((pSrc->pDrawable->type != DRAWABLE_PIXMAP) ||
-        IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))
-        return FALSE;
-
-    /*
-     * If it looks like we have a chance of being able to draw these
-     * glyphs with an accelerated Composite, do that now to avoid
-     * unneeded and costly syncs.
-     */
-    if (maskFormat) {
-        if (!infoRec->CPUToScreenAlphaTextureFormats)
-            return FALSE;
-    }
-    else {
-        if (!infoRec->CPUToScreenTextureFormats)
-            return FALSE;
-    }
-
-    miGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
-
-    return TRUE;
-}
-
-void
-XAAGlyphs(CARD8 op,
-          PicturePtr pSrc,
-          PicturePtr pDst,
-          PictFormatPtr maskFormat,
-          INT16 xSrc,
-          INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs)
-{
-    ScreenPtr pScreen = pDst->pDrawable->pScreen;
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-
-    XAA_RENDER_PROLOGUE(pScreen, Glyphs);
-
-    if (!pSrc->pDrawable || !infoRec->Glyphs ||
-        !(*infoRec->Glyphs) (op, pSrc, pDst, maskFormat,
-                             xSrc, ySrc, nlist, list, glyphs)) {
-        if (infoRec->pScrn->vtSema &&
-            ((pSrc->pDrawable &&
-              (pSrc->pDrawable->type == DRAWABLE_WINDOW ||
-               IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))) ||
-             pDst->pDrawable->type == DRAWABLE_WINDOW ||
-             IS_OFFSCREEN_PIXMAP(pDst->pDrawable))) {
-            SYNC_CHECK(pDst->pDrawable);
-        }
-        (*GetPictureScreen(pScreen)->Glyphs) (op, pSrc, pDst, maskFormat,
-                                              xSrc, ySrc, nlist, list, glyphs);
-    }
-
-    if (pDst->pDrawable->type == DRAWABLE_PIXMAP)
-        (XAA_GET_PIXMAP_PRIVATE((PixmapPtr) (pDst->pDrawable)))->flags |= DIRTY;
-
-    XAA_RENDER_EPILOGUE(pScreen, Glyphs, XAAGlyphs);
-}
diff --git a/hw/xfree86/xaa/xaaROP.c b/hw/xfree86/xaa/xaaROP.c
deleted file mode 100644 (file)
index 3b6ec93..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaarop.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-int XAACopyROP[16] = {
-    ROP_0,                      /* GXclear */
-    ROP_DSa,                    /* GXand */
-    ROP_SDna,                   /* GXandReverse */
-    ROP_S,                      /* GXcopy */
-    ROP_DSna,                   /* GXandInverted */
-    ROP_D,                      /* GXnoop */
-    ROP_DSx,                    /* GXxor */
-    ROP_DSo,                    /* GXor */
-    ROP_DSon,                   /* GXnor */
-    ROP_DSxn,                   /* GXequiv */
-    ROP_Dn,                     /* GXinvert */
-    ROP_SDno,                   /* GXorReverse */
-    ROP_Sn,                     /* GXcopyInverted */
-    ROP_DSno,                   /* GXorInverted */
-    ROP_DSan,                   /* GXnand */
-    ROP_1                       /* GXset */
-};
-
-int XAACopyROP_PM[16] = {
-    ROP_0,                      /* not used */
-    ROP_DSPnoa,
-    ROP_DPSnaon,
-    ROP_DPSDxax,
-    ROP_DPSana,
-    ROP_D,                      /* not used */
-    ROP_DPSax,
-    ROP_DPSao,
-    ROP_DPSaon,
-    ROP_DPSaxn,
-    ROP_Dn,                     /* not used */
-    ROP_DPSanan,
-    ROP_PSDPxox,                /* is that correct ? */
-    ROP_DPSnao,
-    ROP_DSPnoan,
-    ROP_1                       /* not used */
-};
-
-int XAAPatternROP[16] = {
-    ROP_0,
-    ROP_DPa,
-    ROP_PDna,
-    ROP_P,
-    ROP_DPna,
-    ROP_D,
-    ROP_DPx,
-    ROP_DPo,
-    ROP_DPon,
-    ROP_PDxn,
-    ROP_Dn,
-    ROP_PDno,
-    ROP_Pn,
-    ROP_DPno,
-    ROP_DPan,
-    ROP_1
-};
-
-int XAAPatternROP_PM[16] = {
-    ROP_DPna,
-    ROP_DPSnoa,
-    ROP_DSPnaon,
-    ROP_DSPDxax,
-    ROP_DPSana,
-    ROP_D,
-    ROP_DPSax,
-    ROP_DPSao,
-    ROP_DPSaon,
-    ROP_DPSaxn,
-    ROP_DPx,
-    ROP_DPSanan,
-    ROP_SPDSxox,                /* is that correct ? */
-    ROP_DSPnao,
-    ROP_DPSnoan,
-    ROP_DPo
-};
-
-int
-XAAGetCopyROP(int i)
-{
-    return XAACopyROP[i];
-}
-
-int
-XAAGetCopyROP_PM(int i)
-{
-    return XAACopyROP_PM[i];
-}
-
-int
-XAAGetPatternROP(int i)
-{
-    return XAAPatternROP[i];
-}
-
-int
-XAAGetPatternROP_PM(int i)
-{
-    return XAAPatternROP_PM[i];
-}
-
-int
-XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int ret = 0;
-
-    pm &= infoRec->FullPlanemasks[pScrn->depth - 1];
-
-    if (pm == infoRec->FullPlanemasks[pScrn->depth - 1]) {
-        if (!NO_SRC_ROP(*rop))
-            ret |= ROP_PAT;
-        *rop = XAAPatternROP[*rop];
-    }
-    else {
-        switch (*rop) {
-        case GXnoop:
-            break;
-        case GXset:
-        case GXclear:
-        case GXinvert:
-            ret |= ROP_PAT;
-            *fg = pm;
-            if (*bg != -1)
-                *bg = pm;
-            break;
-        default:
-            ret |= ROP_PAT | ROP_SRC;
-            break;
-        }
-        *rop = XAAPatternROP_PM[*rop];
-    }
-
-    return ret;
-}
-
-int
-XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int ret = 0;
-
-    pm &= infoRec->FullPlanemasks[pScrn->depth - 1];
-
-    if (pm == infoRec->FullPlanemasks[pScrn->depth - 1]) {
-        if (!NO_SRC_ROP(*rop))
-            ret |= ROP_PAT;
-        *rop = XAAPatternROP[*rop];
-    }
-    else {
-        switch (*rop) {
-        case GXnoop:
-            break;
-        case GXset:
-        case GXclear:
-        case GXinvert:
-            ret |= ROP_PAT;
-            *fg = pm;
-            break;
-        default:
-            ret |= ROP_PAT | ROP_SRC;
-            break;
-        }
-        *rop = XAAPatternROP_PM[*rop];
-    }
-
-    return ret;
-}
diff --git a/hw/xfree86/xaa/xaaRect.c b/hw/xfree86/xaa/xaaRect.c
deleted file mode 100644 (file)
index 0020900..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-/*
-   Much of this file based on code by 
-       Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
-*/
-
-void
-XAAPolyRectangleThinSolid(DrawablePtr pDrawable,
-                          GCPtr pGC, int nRectsInit, xRectangle *pRectsInit)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int nClipRects;             /* number of clip rectangles */
-    BoxPtr pClipRects;          /* points to the list of clip rects */
-    int xOrigin;                /* Drawables x origin */
-    int yOrigin;                /* Drawables x origin */
-    xRectangle *pRect;          /* list of rects */
-    int nRects;                 /* running count of number of rects */
-    int origX1, origY1;         /* original rectangle's U/L corner */
-    int origX2, origY2;         /* original rectangle's L/R corner */
-    int clippedX1;              /* clipped rectangle's left x */
-    int clippedY1;              /* clipped rectangle's top y */
-    int clippedX2;              /* clipped rectangle's right x */
-    int clippedY2;              /* clipped rectangle's bottom y */
-    int clipXMin;               /* upper left corner of clip rect */
-    int clipYMin;               /* upper left corner of clip rect */
-    int clipXMax;               /* lower right corner of clip rect */
-    int clipYMax;               /* lower right corner of clip rect */
-    int width, height;          /* width and height of rect */
-
-    nClipRects = RegionNumRects(pGC->pCompositeClip);
-    pClipRects = RegionRects(pGC->pCompositeClip);
-
-    if (!nClipRects)
-        return;
-
-    xOrigin = pDrawable->x;
-    yOrigin = pDrawable->y;
-
-    (*infoRec->SetupForSolidLine) (infoRec->pScrn,
-                                   pGC->fgPixel, pGC->alu, pGC->planemask);
-
-    for (; nClipRects > 0; nClipRects--, pClipRects++) {
-        clipYMin = pClipRects->y1;
-        clipYMax = pClipRects->y2 - 1;
-        clipXMin = pClipRects->x1;
-        clipXMax = pClipRects->x2 - 1;
-
-        for (pRect = pRectsInit, nRects = nRectsInit;
-             nRects > 0; nRects--, pRect++) {
-            /* translate rectangle data over to the drawable */
-            origX1 = pRect->x + xOrigin;
-            origY1 = pRect->y + yOrigin;
-            origX2 = origX1 + pRect->width;
-            origY2 = origY1 + pRect->height;
-
-            /* reject entire rectangle if completely outside clip rect */
-            if ((origX1 > clipXMax) || (origX2 < clipXMin) ||
-                (origY1 > clipYMax) || (origY2 < clipYMin))
-                continue;
-
-            /* clip the rectangle */
-            clippedX1 = max(origX1, clipXMin);
-            clippedX2 = min(origX2, clipXMax);
-            clippedY1 = max(origY1, clipYMin);
-            clippedY2 = min(origY2, clipYMax);
-
-            width = clippedX2 - clippedX1 + 1;
-
-            if (origY1 >= clipYMin) {
-                (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn,
-                                                        clippedX1, clippedY1,
-                                                        width, DEGREES_0);
-
-                /* don't overwrite corner */
-                clippedY1++;
-            }
-
-            if ((origY2 <= clipYMax) && (origY1 != origY2)) {
-                (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn,
-                                                        clippedX1, clippedY2,
-                                                        width, DEGREES_0);
-
-                /* don't overwrite corner */
-                clippedY2--;
-            }
-
-            if (clippedY2 < clippedY1)
-                continue;
-
-            height = clippedY2 - clippedY1 + 1;
-
-            /* draw vertical edges using lines if not clipped out */
-            if (origX1 >= clipXMin)
-                (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn,
-                                                        clippedX1, clippedY1,
-                                                        height, DEGREES_270);
-
-            if ((origX2 <= clipXMax) && (origX2 != origX1))
-                (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn,
-                                                        clippedX2, clippedY1,
-                                                        height, DEGREES_270);
-        }
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
diff --git a/hw/xfree86/xaa/xaaSpans.c b/hw/xfree86/xaa/xaaSpans.c
deleted file mode 100644 (file)
index f03452a..0000000
+++ /dev/null
@@ -1,876 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "mispans.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-static void XAARenderSolidSpans(GCPtr, int, DDXPointPtr, int *, int, int, int);
-static void XAARenderColor8x8Spans(GCPtr, int, DDXPointPtr, int *, int, int,
-                                   int);
-static void XAARenderMono8x8Spans(GCPtr, int, DDXPointPtr, int *, int, int,
-                                  int);
-static void XAARenderCacheBltSpans(GCPtr, int, DDXPointPtr, int *, int, int,
-                                   int);
-static void XAARenderColorExpandSpans(GCPtr, int, DDXPointPtr, int *, int, int,
-                                      int);
-static void XAARenderCacheExpandSpans(GCPtr, int, DDXPointPtr, int *, int, int,
-                                      int);
-static void XAARenderPixmapCopySpans(GCPtr, int, DDXPointPtr, int *, int, int,
-                                     int);
-
-void
-XAAFillSpans(DrawablePtr pDraw, GC * pGC, int nInit,    /* number of spans to fill */
-             DDXPointPtr pptInit,       /* pointer to list of start points */
-             int *pwidthInit,   /* pointer to list of n widths */
-             int fSorted)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int type = 0;
-    ClipAndRenderSpansFunc function;
-    Bool fastClip = FALSE;
-
-    if ((nInit <= 0) || !pGC->planemask)
-        return;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    switch (pGC->fillStyle) {
-    case FillSolid:
-        type = DO_SOLID;
-        break;
-    case FillStippled:
-        type = (*infoRec->StippledFillChooser) (pGC);
-        break;
-    case FillOpaqueStippled:
-        if ((pGC->fgPixel == pGC->bgPixel) && infoRec->FillSpansSolid &&
-            CHECK_PLANEMASK(pGC, infoRec->FillSpansSolidFlags) &&
-            CHECK_ROP(pGC, infoRec->FillSpansSolidFlags) &&
-            CHECK_ROPSRC(pGC, infoRec->FillSpansSolidFlags) &&
-            CHECK_FG(pGC, infoRec->FillSpansSolidFlags))
-            type = DO_SOLID;
-        else
-            type = (*infoRec->OpaqueStippledFillChooser) (pGC);
-        break;
-    case FillTiled:
-        type = (*infoRec->TiledFillChooser) (pGC);
-        break;
-    }
-
-    switch (type) {
-    case DO_SOLID:
-        function = XAARenderSolidSpans;
-        if (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL)
-            fastClip = TRUE;
-        break;
-    case DO_COLOR_8x8:
-        function = XAARenderColor8x8Spans;
-        if (infoRec->ClippingFlags & HARDWARE_CLIP_COLOR_8x8_FILL)
-            fastClip = TRUE;
-        break;
-    case DO_MONO_8x8:
-        function = XAARenderMono8x8Spans;
-        if (infoRec->ClippingFlags & HARDWARE_CLIP_MONO_8x8_FILL)
-            fastClip = TRUE;
-        break;
-    case DO_CACHE_BLT:
-        function = XAARenderCacheBltSpans;
-        if (infoRec->ClippingFlags & HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY)
-            fastClip = TRUE;
-        break;
-    case DO_COLOR_EXPAND:
-        function = XAARenderColorExpandSpans;
-        break;
-    case DO_CACHE_EXPAND:
-        function = XAARenderCacheExpandSpans;
-        if (infoRec->ClippingFlags &
-            HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND)
-            fastClip = TRUE;
-        break;
-    case DO_PIXMAP_COPY:
-        function = XAARenderPixmapCopySpans;
-        if (infoRec->ClippingFlags & HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY)
-            fastClip = TRUE;
-        break;
-    case DO_IMAGE_WRITE:
-    default:
-        (*XAAFallbackOps.FillSpans) (pDraw, pGC, nInit, pptInit,
-                                     pwidthInit, fSorted);
-        return;
-    }
-
-    if ((nInit < 10) || (RegionNumRects(pGC->pCompositeClip) != 1))
-        fastClip = FALSE;
-
-    if (fastClip) {
-        infoRec->ClipBox = &pGC->pCompositeClip->extents;
-        (*function) (pGC, nInit, pptInit, pwidthInit, fSorted,
-                     pDraw->x, pDraw->y);
-        infoRec->ClipBox = NULL;
-    }
-    else
-        XAAClipAndRenderSpans(pGC, pptInit, pwidthInit, nInit, fSorted,
-                              function, pDraw->x, pDraw->y);
-}
-
-        /*********************\
-       |     Solid Spans     |
-       \*********************/
-
-static void
-XAARenderSolidSpans(GCPtr pGC,
-                    int n,
-                    DDXPointPtr ppt,
-                    int *pwidth, int fSorted, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    (*infoRec->FillSolidSpans) (infoRec->pScrn, pGC->fgPixel,
-                                pGC->alu, pGC->planemask, n, ppt, pwidth,
-                                fSorted);
-}
-
-        /************************\
-       |     Mono 8x8 Spans     |
-       \************************/
-
-static void
-XAARenderMono8x8Spans(GCPtr pGC,
-                      int n,
-                      DDXPointPtr ppt,
-                      int *pwidth, int fSorted, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAAPixmapPtr pPriv;
-    int fg, bg;
-
-    switch (pGC->fillStyle) {
-    case FillStippled:
-        pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
-        fg = pGC->fgPixel;
-        bg = -1;
-        break;
-    case FillOpaqueStippled:
-        pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
-        fg = pGC->fgPixel;
-        bg = pGC->bgPixel;
-        break;
-    case FillTiled:
-        pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-        fg = pPriv->fg;
-        bg = pPriv->bg;
-        break;
-    default:                   /* Muffle compiler */
-        pPriv = NULL;           /* Kaboom */
-        fg = -1;
-        bg = -1;
-        break;
-    }
-
-    (*infoRec->FillMono8x8PatternSpans) (infoRec->pScrn,
-                                         fg, bg, pGC->alu, pGC->planemask,
-                                         n, ppt, pwidth, fSorted,
-                                         pPriv->pattern0, pPriv->pattern1,
-                                         (xorg + pGC->patOrg.x),
-                                         (yorg + pGC->patOrg.y));
-}
-
-        /*************************\
-       |     Color 8x8 Spans     |
-       \*************************/
-
-static void
-XAARenderColor8x8Spans(GCPtr pGC,
-                       int n,
-                       DDXPointPtr ppt,
-                       int *pwidth, int fSorted, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAACacheInfoPtr pCache;
-    PixmapPtr pPix;
-    int fg, bg;
-
-    switch (pGC->fillStyle) {
-    case FillStippled:
-        pPix = pGC->stipple;
-        fg = pGC->fgPixel;
-        bg = -1;
-        break;
-    case FillOpaqueStippled:
-        pPix = pGC->stipple;
-        fg = pGC->fgPixel;
-        bg = pGC->bgPixel;
-        break;
-    case FillTiled:
-        pPix = pGC->tile.pixmap;
-        fg = -1;
-        bg = -1;
-        break;
-    default:                   /* Muffle compiler */
-        pPix = NULL;
-        fg = -1;
-        bg = -1;
-        break;
-    }
-
-    pCache = (*infoRec->CacheColor8x8Pattern) (infoRec->pScrn, pPix, fg, bg);
-
-    (*infoRec->FillColor8x8PatternSpans) (infoRec->pScrn,
-                                          pGC->alu, pGC->planemask, n, ppt,
-                                          pwidth, fSorted, pCache,
-                                          (yorg + pGC->patOrg.x),
-                                          (xorg + pGC->patOrg.y));
-}
-
-        /****************************\
-       |     Color Expand Spans     |
-       \****************************/
-
-static void
-XAARenderColorExpandSpans(GCPtr pGC,
-                          int n,
-                          DDXPointPtr ppt,
-                          int *pwidth, int fSorted, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int fg, bg;
-
-    switch (pGC->fillStyle) {
-    case FillStippled:
-        fg = pGC->fgPixel;
-        bg = -1;
-        break;
-    case FillOpaqueStippled:
-        fg = pGC->fgPixel;
-        bg = pGC->bgPixel;
-        break;
-    default:                   /* Muffle compiler */
-        fg = -1;
-        bg = -1;
-        break;
-    }
-
-    (*infoRec->FillColorExpandSpans) (infoRec->pScrn, fg, bg,
-                                      pGC->alu, pGC->planemask, n, ppt, pwidth,
-                                      fSorted, (xorg + pGC->patOrg.x),
-                                      (yorg + pGC->patOrg.y), pGC->stipple);
-
-}
-
-        /*************************\
-       |     Cache Blt Spans     |
-       \*************************/
-
-static void
-XAARenderCacheBltSpans(GCPtr pGC,
-                       int n,
-                       DDXPointPtr ppt,
-                       int *pwidth, int fSorted, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAACacheInfoPtr pCache;
-
-    switch (pGC->fillStyle) {
-    case FillStippled:
-        pCache = (*infoRec->CacheStipple) (infoRec->pScrn, pGC->stipple,
-                                           pGC->fgPixel, -1);
-        break;
-    case FillOpaqueStippled:
-        pCache = (*infoRec->CacheStipple) (infoRec->pScrn, pGC->stipple,
-                                           pGC->fgPixel, pGC->bgPixel);
-        break;
-    case FillTiled:
-        pCache = (*infoRec->CacheTile) (infoRec->pScrn, pGC->tile.pixmap);
-        break;
-    default:                   /* Muffle compiler */
-        pCache = NULL;
-        break;
-    }
-
-    (*infoRec->FillCacheBltSpans) (infoRec->pScrn,
-                                   pGC->alu, pGC->planemask, n, ppt, pwidth,
-                                   fSorted, pCache, (xorg + pGC->patOrg.x),
-                                   (yorg + pGC->patOrg.y));
-
-}
-
-        /****************************\
-       |     Cache Expand Spans     |
-       \****************************/
-
-static void
-XAARenderCacheExpandSpans(GCPtr pGC,
-                          int n,
-                          DDXPointPtr ppt,
-                          int *pwidth, int fSorted, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int fg, bg;
-
-    switch (pGC->fillStyle) {
-    case FillStippled:
-        fg = pGC->fgPixel;
-        bg = -1;
-        break;
-    case FillOpaqueStippled:
-        fg = pGC->fgPixel;
-        bg = pGC->bgPixel;
-        break;
-    default:                   /* Muffle compiler */
-        fg = -1;
-        bg = -1;
-        break;
-    }
-
-    (*infoRec->FillCacheExpandSpans) (infoRec->pScrn, fg, bg,
-                                      pGC->alu, pGC->planemask, n, ppt, pwidth,
-                                      fSorted, (xorg + pGC->patOrg.x),
-                                      (yorg + pGC->patOrg.y), pGC->stipple);
-}
-
-        /***************************\
-       |     Pixmap Copy Spans     |
-       \***************************/
-
-static void
-XAARenderPixmapCopySpans(GCPtr pGC,
-                         int n,
-                         DDXPointPtr ppt,
-                         int *pwidth, int fSorted, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec);
-    XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-
-    pCache->x = pPriv->offscreenArea->box.x1;
-    pCache->y = pPriv->offscreenArea->box.y1;
-    pCache->w = pCache->orig_w = pPriv->offscreenArea->box.x2 - pCache->x;
-    pCache->h = pCache->orig_h = pPriv->offscreenArea->box.y2 - pCache->y;
-    pCache->trans_color = -1;
-
-    (*infoRec->FillCacheBltSpans) (infoRec->pScrn,
-                                   pGC->alu, pGC->planemask, n, ppt, pwidth,
-                                   fSorted, pCache, (xorg + pGC->patOrg.x),
-                                   (yorg + pGC->patOrg.y));
-}
-
-        /****************\
-       |     Solid      |
-       \****************/
-
-void
-XAAFillSolidSpans(ScrnInfoPtr pScrn,
-                  int fg, int rop,
-                  unsigned int planemask,
-                  int n, DDXPointPtr ppt, int *pwidth, int fSorted)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
-    (*infoRec->SetupForSolidFill) (pScrn, fg, rop, planemask);
-
-    if (infoRec->ClipBox)
-        (*infoRec->SetClippingRectangle) (infoRec->pScrn,
-                                          infoRec->ClipBox->x1,
-                                          infoRec->ClipBox->y1,
-                                          infoRec->ClipBox->x2 - 1,
-                                          infoRec->ClipBox->y2 - 1);
-
-    while (n--) {
-        if (*pwidth > 0)
-            (*infoRec->SubsequentSolidFillRect) (pScrn, ppt->x, ppt->y,
-                                                 *pwidth, 1);
-        ppt++;
-        pwidth++;
-    }
-
-    if (infoRec->ClipBox)
-        (*infoRec->DisableClipping) (infoRec->pScrn);
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-        /***************\
-       |   Mono 8x8    |
-       \***************/
-
-void
-XAAFillMono8x8PatternSpansScreenOrigin(ScrnInfoPtr pScrn,
-                                       int fg, int bg, int rop,
-                                       unsigned int planemask,
-                                       int n,
-                                       DDXPointPtr ppt,
-                                       int *pwidth, int fSorted,
-                                       int pattern0, int pattern1,
-                                       int xorigin, int yorigin)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int patx = pattern0, paty = pattern1;
-    int xorg = (-xorigin) & 0x07;
-    int yorg = (-yorigin) & 0x07;
-
-    if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) {
-        if (!(infoRec->Mono8x8PatternFillFlags &
-              HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-            XAARotateMonoPattern(&patx, &paty, xorg, yorg,
-                                 (infoRec->Mono8x8PatternFillFlags &
-                                  BIT_ORDER_IN_BYTE_MSBFIRST));
-            xorg = patx;
-            yorg = paty;
-        }
-    }
-    else {
-        XAACacheInfoPtr pCache =
-            (*infoRec->CacheMono8x8Pattern) (pScrn, pattern0, pattern1);
-        patx = pCache->x;
-        paty = pCache->y;
-        if (!(infoRec->Mono8x8PatternFillFlags &
-              HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-            int slot = (yorg << 3) + xorg;
-
-            patx += pCache->offsets[slot].x;
-            paty += pCache->offsets[slot].y;
-            xorg = patx;
-            yorg = paty;
-        }
-    }
-
-    (*infoRec->SetupForMono8x8PatternFill) (pScrn, patx, paty,
-                                            fg, bg, rop, planemask);
-
-    if (infoRec->ClipBox)
-        (*infoRec->SetClippingRectangle) (infoRec->pScrn,
-                                          infoRec->ClipBox->x1,
-                                          infoRec->ClipBox->y1,
-                                          infoRec->ClipBox->x2 - 1,
-                                          infoRec->ClipBox->y2 - 1);
-
-    while (n--) {
-        (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn,
-                                                      xorg, yorg, ppt->x,
-                                                      ppt->y, *pwidth, 1);
-        ppt++;
-        pwidth++;
-    }
-
-    if (infoRec->ClipBox)
-        (*infoRec->DisableClipping) (infoRec->pScrn);
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAFillMono8x8PatternSpans(ScrnInfoPtr pScrn,
-                           int fg, int bg, int rop,
-                           unsigned int planemask,
-                           int n,
-                           DDXPointPtr ppt,
-                           int *pwidth, int fSorted,
-                           int pattern0, int pattern1, int xorigin, int yorigin)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int patx = pattern0, paty = pattern1;
-    int xorg, yorg, slot;
-    XAACacheInfoPtr pCache = NULL;
-
-    if (!(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS)) {
-        pCache = (*infoRec->CacheMono8x8Pattern) (pScrn, pattern0, pattern1);
-        patx = pCache->x;
-        paty = pCache->y;
-    }
-
-    (*infoRec->SetupForMono8x8PatternFill) (pScrn, patx, paty,
-                                            fg, bg, rop, planemask);
-
-    if (infoRec->ClipBox)
-        (*infoRec->SetClippingRectangle) (infoRec->pScrn,
-                                          infoRec->ClipBox->x1,
-                                          infoRec->ClipBox->y1,
-                                          infoRec->ClipBox->x2 - 1,
-                                          infoRec->ClipBox->y2 - 1);
-
-    while (n--) {
-        xorg = (ppt->x - xorigin) & 0x07;
-        yorg = (ppt->y - yorigin) & 0x07;
-
-        if (!(infoRec->Mono8x8PatternFillFlags &
-              HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-            if (infoRec->Mono8x8PatternFillFlags &
-                HARDWARE_PATTERN_PROGRAMMED_BITS) {
-                patx = pattern0;
-                paty = pattern1;
-                XAARotateMonoPattern(&patx, &paty, xorg, yorg,
-                                     (infoRec->Mono8x8PatternFillFlags &
-                                      BIT_ORDER_IN_BYTE_MSBFIRST));
-                xorg = patx;
-                yorg = paty;
-            }
-            else {
-                slot = (yorg << 3) + xorg;
-                xorg = patx + pCache->offsets[slot].x;
-                yorg = paty + pCache->offsets[slot].y;
-            }
-        }
-
-        (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn,
-                                                      xorg, yorg, ppt->x,
-                                                      ppt->y, *pwidth, 1);
-        ppt++;
-        pwidth++;
-    }
-
-    if (infoRec->ClipBox)
-        (*infoRec->DisableClipping) (infoRec->pScrn);
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-        /****************\
-       |   Color 8x8    |
-       \****************/
-
-void
-XAAFillColor8x8PatternSpansScreenOrigin(ScrnInfoPtr pScrn,
-                                        int rop,
-                                        unsigned int planemask,
-                                        int n,
-                                        DDXPointPtr ppt,
-                                        int *pwidth, int fSorted,
-                                        XAACacheInfoPtr pCache,
-                                        int xorigin, int yorigin)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int patx = pCache->x, paty = pCache->y;
-    int xorg = (-xorigin) & 0x07;
-    int yorg = (-yorigin) & 0x07;
-
-    if (!(infoRec->Color8x8PatternFillFlags &
-          HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-        int slot = (yorg << 3) + xorg;
-
-        paty += pCache->offsets[slot].y;
-        patx += pCache->offsets[slot].x;
-        xorg = patx;
-        yorg = paty;
-    }
-
-    (*infoRec->SetupForColor8x8PatternFill) (pScrn, patx, paty,
-                                             rop, planemask,
-                                             pCache->trans_color);
-
-    if (infoRec->ClipBox)
-        (*infoRec->SetClippingRectangle) (infoRec->pScrn,
-                                          infoRec->ClipBox->x1,
-                                          infoRec->ClipBox->y1,
-                                          infoRec->ClipBox->x2 - 1,
-                                          infoRec->ClipBox->y2 - 1);
-
-    while (n--) {
-        (*infoRec->SubsequentColor8x8PatternFillRect) (pScrn,
-                                                       xorg, yorg, ppt->x,
-                                                       ppt->y, *pwidth, 1);
-        ppt++;
-        pwidth++;
-    }
-
-    if (infoRec->ClipBox)
-        (*infoRec->DisableClipping) (infoRec->pScrn);
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAFillColor8x8PatternSpans(ScrnInfoPtr pScrn,
-                            int rop,
-                            unsigned int planemask,
-                            int n,
-                            DDXPointPtr ppt,
-                            int *pwidth, int fSorted,
-                            XAACacheInfoPtr pCache, int xorigin, int yorigin)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int xorg, yorg, slot;
-
-    (*infoRec->SetupForColor8x8PatternFill) (pScrn, pCache->x, pCache->y,
-                                             rop, planemask,
-                                             pCache->trans_color);
-
-    if (infoRec->ClipBox)
-        (*infoRec->SetClippingRectangle) (infoRec->pScrn,
-                                          infoRec->ClipBox->x1,
-                                          infoRec->ClipBox->y1,
-                                          infoRec->ClipBox->x2 - 1,
-                                          infoRec->ClipBox->y2 - 1);
-
-    while (n--) {
-        xorg = (ppt->x - xorigin) & 0x07;
-        yorg = (ppt->y - yorigin) & 0x07;
-
-        if (!(infoRec->Color8x8PatternFillFlags &
-              HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-            slot = (yorg << 3) + xorg;
-            yorg = pCache->y + pCache->offsets[slot].y;
-            xorg = pCache->x + pCache->offsets[slot].x;
-        }
-
-        (*infoRec->SubsequentColor8x8PatternFillRect) (pScrn,
-                                                       xorg, yorg, ppt->x,
-                                                       ppt->y, *pwidth, 1);
-        ppt++;
-        pwidth++;
-    }
-
-    if (infoRec->ClipBox)
-        (*infoRec->DisableClipping) (infoRec->pScrn);
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-        /*****************\
-       |   Cache Blit    |
-       \*****************/
-
-void
-XAAFillCacheBltSpans(ScrnInfoPtr pScrn,
-                     int rop,
-                     unsigned int planemask,
-                     int n,
-                     DDXPointPtr ppt,
-                     int *pwidth,
-                     int fSorted, XAACacheInfoPtr pCache, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int x, w, phaseX, phaseY, blit_w;
-
-    (*infoRec->SetupForScreenToScreenCopy) (pScrn, 1, 1, rop, planemask,
-                                            pCache->trans_color);
-
-    if (infoRec->ClipBox)
-        (*infoRec->SetClippingRectangle) (infoRec->pScrn,
-                                          infoRec->ClipBox->x1,
-                                          infoRec->ClipBox->y1,
-                                          infoRec->ClipBox->x2 - 1,
-                                          infoRec->ClipBox->y2 - 1);
-
-    while (n--) {
-        x = ppt->x;
-        w = *pwidth;
-        phaseX = (x - xorg) % pCache->orig_w;
-        if (phaseX < 0)
-            phaseX += pCache->orig_w;
-        phaseY = (ppt->y - yorg) % pCache->orig_h;
-        if (phaseY < 0)
-            phaseY += pCache->orig_h;
-
-        while (1) {
-            blit_w = pCache->w - phaseX;
-            if (blit_w > w)
-                blit_w = w;
-
-            (*infoRec->SubsequentScreenToScreenCopy) (pScrn,
-                                                      pCache->x + phaseX,
-                                                      pCache->y + phaseY, x,
-                                                      ppt->y, blit_w, 1);
-
-            w -= blit_w;
-            if (!w)
-                break;
-            x += blit_w;
-            phaseX = (phaseX + blit_w) % pCache->orig_w;
-        }
-        ppt++;
-        pwidth++;
-    }
-
-    if (infoRec->ClipBox)
-        (*infoRec->DisableClipping) (infoRec->pScrn);
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-        /****************\
-       |  Cache Expand  |
-       \****************/
-
-void
-XAAFillCacheExpandSpans(ScrnInfoPtr pScrn,
-                        int fg, int bg, int rop,
-                        unsigned int planemask,
-                        int n,
-                        DDXPointPtr ppt,
-                        int *pwidth,
-                        int fSorted, int xorg, int yorg, PixmapPtr pPix)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int x, w, phaseX, phaseY, blit_w, cacheWidth;
-    XAACacheInfoPtr pCache;
-
-    pCache = (*infoRec->CacheMonoStipple) (pScrn, pPix);
-
-    cacheWidth = (pCache->w * pScrn->bitsPerPixel) /
-        infoRec->CacheColorExpandDensity;
-
-    (*infoRec->SetupForScreenToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                       planemask);
-
-    if (infoRec->ClipBox)
-        (*infoRec->SetClippingRectangle) (infoRec->pScrn,
-                                          infoRec->ClipBox->x1,
-                                          infoRec->ClipBox->y1,
-                                          infoRec->ClipBox->x2 - 1,
-                                          infoRec->ClipBox->y2 - 1);
-
-    while (n--) {
-        x = ppt->x;
-        w = *pwidth;
-        phaseX = (x - xorg) % pCache->orig_w;
-        if (phaseX < 0)
-            phaseX += pCache->orig_w;
-        phaseY = (ppt->y - yorg) % pCache->orig_h;
-        if (phaseY < 0)
-            phaseY += pCache->orig_h;
-
-        while (1) {
-            blit_w = cacheWidth - phaseX;
-            if (blit_w > w)
-                blit_w = w;
-
-            (*infoRec->SubsequentScreenToScreenColorExpandFill) (pScrn, x,
-                                                                 ppt->y, blit_w,
-                                                                 1, pCache->x,
-                                                                 pCache->y +
-                                                                 phaseY,
-                                                                 phaseX);
-
-            w -= blit_w;
-            if (!w)
-                break;
-            x += blit_w;
-            phaseX = (phaseX + blit_w) % pCache->orig_w;
-        }
-        ppt++;
-        pwidth++;
-    }
-
-    if (infoRec->ClipBox)
-        (*infoRec->DisableClipping) (infoRec->pScrn);
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAClipAndRenderSpans(GCPtr pGC,
-                      DDXPointPtr ppt,
-                      int *pwidth,
-                      int nspans,
-                      int fSorted,
-                      ClipAndRenderSpansFunc func, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    DDXPointPtr pptNew, pptBase;
-    int *pwidthBase, *pwidthNew;
-    int Right, numRects, MaxBoxes;
-
-    MaxBoxes = infoRec->PreAllocSize / (sizeof(DDXPointRec) + sizeof(int));
-    pptBase = (DDXPointRec *) infoRec->PreAllocMem;
-    pwidthBase = (int *) (&pptBase[MaxBoxes]);
-
-    pptNew = pptBase;
-    pwidthNew = pwidthBase;
-
-    numRects = RegionNumRects(pGC->pCompositeClip);
-
-    if (numRects == 1) {
-        BoxPtr pextent = RegionRects(pGC->pCompositeClip);
-
-        while (nspans--) {
-            if ((pextent->y1 <= ppt->y) && (ppt->y < pextent->y2)) {
-                pptNew->x = max(pextent->x1, ppt->x);
-                Right = ppt->x + *pwidth;
-                *pwidthNew = min(pextent->x2, Right) - pptNew->x;
-
-                if (*pwidthNew > 0) {
-                    pptNew->y = ppt->y;
-                    pptNew++;
-                    pwidthNew++;
-
-                    if (pptNew >= (pptBase + MaxBoxes)) {
-                        (*func) (pGC, MaxBoxes, pptBase, pwidthBase, fSorted,
-                                 xorg, yorg);
-                        pptNew = pptBase;
-                        pwidthNew = pwidthBase;
-                    }
-                }
-            }
-            ppt++;
-            pwidth++;
-        }
-    }
-    else if (numRects) {
-        BoxPtr pbox;
-        int nbox;
-
-        while (nspans--) {
-            nbox = numRects;
-            pbox = RegionRects(pGC->pCompositeClip);
-
-            /* find the first band */
-            while (nbox && (pbox->y2 <= ppt->y)) {
-                pbox++;
-                nbox--;
-            }
-
-            if (nbox && (pbox->y1 <= ppt->y)) {
-                int orig_y = pbox->y1;
-
-                Right = ppt->x + *pwidth;
-                while (nbox && (orig_y == pbox->y1)) {
-                    if (pbox->x2 <= ppt->x) {
-                        nbox--;
-                        pbox++;
-                        continue;
-                    }
-
-                    if (pbox->x1 >= Right) {
-                        nbox = 0;
-                        break;
-                    }
-
-                    pptNew->x = max(pbox->x1, ppt->x);
-                    *pwidthNew = min(pbox->x2, Right) - pptNew->x;
-                    if (*pwidthNew > 0) {
-                        pptNew->y = ppt->y;
-                        pptNew++;
-                        pwidthNew++;
-
-                        if (pptNew >= (pptBase + MaxBoxes)) {
-                            (*func) (pGC, MaxBoxes, pptBase, pwidthBase,
-                                     fSorted, xorg, yorg);
-                            pptNew = pptBase;
-                            pwidthNew = pwidthBase;
-                        }
-                    }
-                    pbox++;
-                    nbox--;
-                }
-            }
-            ppt++;
-            pwidth++;
-        }
-    }
-
-    if (pptNew != pptBase)
-        (*func) (pGC, pptNew - pptBase, pptBase, pwidthBase, fSorted,
-                 xorg, yorg);
-}
diff --git a/hw/xfree86/xaa/xaaStateChange.c b/hw/xfree86/xaa/xaaStateChange.c
deleted file mode 100644 (file)
index 0218cb5..0000000
+++ /dev/null
@@ -1,1665 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "miline.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "servermd.h"
-
-#define XAA_STATE_WRAP(func) do {\
-if(infoRec->func) { \
-   pStatePriv->func = infoRec->func;\
-   infoRec->func = XAAStateWrap##func;\
-}} while(0)
-
-/* Wrap all XAA functions and allocate our private structure.
- */
-
-typedef struct _XAAStateWrapRec {
-    ScrnInfoPtr pScrn;
-    void (*RestoreAccelState) (ScrnInfoPtr pScrn);
-    void (*Sync) (ScrnInfoPtr pScrn);
-    void (*SetupForScreenToScreenCopy) (ScrnInfoPtr pScrn, int xdir, int ydir,
-                                        int rop, unsigned int planemask,
-                                        int trans_color);
-    void (*SetupForSolidFill) (ScrnInfoPtr pScrn, int color, int rop,
-                               unsigned int planemask);
-    void (*SetupForSolidLine) (ScrnInfoPtr pScrn, int color, int rop,
-                               unsigned int planemask);
-    void (*SetupForDashedLine) (ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                unsigned int planemask, int length,
-                                unsigned char *pattern);
-    void (*SetClippingRectangle) (ScrnInfoPtr pScrn, int left, int top,
-                                  int right, int bottom);
-    void (*DisableClipping) (ScrnInfoPtr pScrn);
-    void (*SetupForMono8x8PatternFill) (ScrnInfoPtr pScrn, int patx, int paty,
-                                        int fg, int bg, int rop,
-                                        unsigned int planemask);
-    void (*SetupForColor8x8PatternFill) (ScrnInfoPtr pScrn, int patx, int paty,
-                                         int rop, unsigned int planemask,
-                                         int transparency_color);
-    void (*SetupForCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn, int fg,
-                                                int bg, int rop,
-                                                unsigned int planemask);
-    void (*SetupForScanlineCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn,
-                                                        int fg, int bg, int rop,
-                                                        unsigned int planemask);
-    void (*SetupForScreenToScreenColorExpandFill) (ScrnInfoPtr pScrn,
-                                                   int fg, int bg, int rop,
-                                                   unsigned int planemask);
-    void (*SetupForImageWrite) (ScrnInfoPtr pScrn, int rop,
-                                unsigned int planemask, int transparency_color,
-                                int bpp, int depth);
-    void (*SetupForScanlineImageWrite) (ScrnInfoPtr pScrn, int rop,
-                                        unsigned int planemask,
-                                        int transparency_color,
-                                        int bpp, int depth);
-    void (*SetupForImageRead) (ScrnInfoPtr pScrn, int bpp, int depth);
-    void (*ScreenToScreenBitBlt) (ScrnInfoPtr pScrn, int nbox,
-                                  DDXPointPtr pptSrc, BoxPtr pbox, int xdir,
-                                  int ydir, int alu, unsigned int planmask);
-    void (*WriteBitmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                         unsigned char *src, int srcwidth, int skipleft,
-                         int fg, int bg, int rop, unsigned int planemask);
-    void (*FillSolidRects) (ScrnInfoPtr pScrn, int fg, int rop,
-                            unsigned int planemask, int nBox, BoxPtr pBox);
-    void (*FillMono8x8PatternRects) (ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                     unsigned int planemask, int nBox,
-                                     BoxPtr pBox, int pat0, int pat1,
-                                     int xorg, int yorg);
-    void (*FillColor8x8PatternRects) (ScrnInfoPtr pScrn, int rop,
-                                      unsigned int planemask, int nBox,
-                                      BoxPtr pBox, int xorg, int yorg,
-                                      XAACacheInfoPtr pCache);
-    void (*FillCacheBltRects) (ScrnInfoPtr pScrn, int rop,
-                               unsigned int planemask, int nBox, BoxPtr pBox,
-                               int xorg, int yorg, XAACacheInfoPtr pCache);
-    void (*FillColorExpandRects) (ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                  unsigned int planemask, int nBox,
-                                  BoxPtr pBox, int xorg, int yorg,
-                                  PixmapPtr pPix);
-    void (*FillCacheExpandRects) (ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                  unsigned int planemask, int nBox, BoxPtr pBox,
-                                  int xorg, int yorg, PixmapPtr pPix);
-    void (*FillImageWriteRects) (ScrnInfoPtr pScrn, int rop,
-                                 unsigned int planemask, int nBox, BoxPtr pBox,
-                                 int xorg, int yorg, PixmapPtr pPix);
-    void (*FillSolidSpans) (ScrnInfoPtr pScrn, int fg, int rop,
-                            unsigned int planemask, int n, DDXPointPtr points,
-                            int *widths, int fSorted);
-    void (*FillMono8x8PatternSpans) (ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                     unsigned int planemask, int n,
-                                     DDXPointPtr points, int *widths,
-                                     int fSorted, int pat0, int pat1,
-                                     int xorg, int yorg);
-    void (*FillColor8x8PatternSpans) (ScrnInfoPtr pScrn, int rop,
-                                      unsigned int planemask, int n,
-                                      DDXPointPtr points, int *widths,
-                                      int fSorted, XAACacheInfoPtr pCache,
-                                      int xorg, int yorg);
-    void (*FillCacheBltSpans) (ScrnInfoPtr pScrn, int rop,
-                               unsigned int planemask, int n,
-                               DDXPointPtr points, int *widths, int fSorted,
-                               XAACacheInfoPtr pCache, int xorg, int yorg);
-    void (*FillColorExpandSpans) (ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                  unsigned int planemask, int n,
-                                  DDXPointPtr points, int *widths, int fSorted,
-                                  int xorg, int yorg, PixmapPtr pPix);
-    void (*FillCacheExpandSpans) (ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                  unsigned int planemask, int n,
-                                  DDXPointPtr ppt, int *pwidth, int fSorted,
-                                  int xorg, int yorg, PixmapPtr pPix);
-    void (*TEGlyphRenderer) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                             int skipleft, int startline, unsigned int **glyphs,
-                             int glyphWidth, int fg, int bg, int rop,
-                             unsigned planemask);
-    void (*NonTEGlyphRenderer) (ScrnInfoPtr pScrn, int x, int y, int n,
-                                NonTEGlyphPtr glyphs, BoxPtr pbox, int fg,
-                                int rop, unsigned int planemask);
-    void (*WritePixmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                         unsigned char *src, int srcwidth, int rop,
-                         unsigned int planemask, int transparency_color,
-                         int bpp, int depth);
-    void (*ReadPixmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                        unsigned char *dst, int dstwidth, int bpp, int depth);
-    RegionPtr (*CopyArea) (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
-                           GC * pGC, int srcx, int srcy, int width, int height,
-                           int dstx, int dsty);
-    RegionPtr (*CopyPlane) (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
-                            int srcx, int srcy, int width, int height, int dstx,
-                            int dsty, unsigned long bitPlane);
-    void (*PushPixelsSolid) (GCPtr pGC, PixmapPtr pBitMap,
-                             DrawablePtr pDrawable, int dx, int dy, int xOrg,
-                             int yOrg);
-    void (*PolyFillRectSolid) (DrawablePtr pDraw, GCPtr pGC, int nrectFill,
-                               xRectangle *prectInit);
-    void (*PolyFillRectStippled) (DrawablePtr pDraw, GCPtr pGC, int nrectFill,
-                                  xRectangle *prectInit);
-    void (*PolyFillRectOpaqueStippled) (DrawablePtr pDraw, GCPtr pGC,
-                                        int nrectFill, xRectangle *prectInit);
-    void (*PolyFillRectTiled) (DrawablePtr pDraw, GCPtr pGC, int nrectFill,
-                               xRectangle *prectInit);
-    void (*FillSpansSolid) (DrawablePtr pDraw, GCPtr pGC, int nInit,
-                            DDXPointPtr ppt, int *pwidth, int fSorted);
-    void (*FillSpansStippled) (DrawablePtr pDraw, GCPtr pGC, int nInit,
-                               DDXPointPtr ppt, int *pwidth, int fSorted);
-    void (*FillSpansOpaqueStippled) (DrawablePtr pDraw, GCPtr pGC, int nInit,
-                                     DDXPointPtr ppt, int *pwidth, int fSorted);
-    void (*FillSpansTiled) (DrawablePtr pDraw, GCPtr pGC, int nInit,
-                            DDXPointPtr ppt, int *pwidth, int fSorted);
-    int (*PolyText8TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
-                        char *chars);
-    int (*PolyText16TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
-                         unsigned short *chars);
-    void (*ImageText8TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
-                          char *chars);
-    void (*ImageText16TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                           int count, unsigned short *chars);
-    void (*ImageGlyphBltTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
-                             int yInit, unsigned int nglyph, CharInfoPtr * ppci,
-                             pointer pglyphBase);
-    void (*PolyGlyphBltTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
-                            int yInit, unsigned int nglyph, CharInfoPtr * ppci,
-                            pointer pglyphBase);
-    int (*PolyText8NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                           int count, char *chars);
-    int (*PolyText16NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                            int count, unsigned short *chars);
-    void (*ImageText8NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                             int count, char *chars);
-    void (*ImageText16NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                              int count, unsigned short *chars);
-    void (*ImageGlyphBltNonTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
-                                int yInit, unsigned int nglyph,
-                                CharInfoPtr * ppci, pointer pglyphBase);
-    void (*PolyGlyphBltNonTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
-                               int yInit, unsigned int nglyph,
-                               CharInfoPtr * ppci, pointer pglyphBase);
-    void (*PolyRectangleThinSolid) (DrawablePtr pDrawable, GCPtr pGC,
-                                    int nRectsInit, xRectangle *pRectsInit);
-    void (*PolylinesWideSolid) (DrawablePtr pDrawable, GCPtr pGC, int mode,
-                                int npt, DDXPointPtr pPts);
-    void (*PolylinesThinSolid) (DrawablePtr pDrawable, GCPtr pGC, int mode,
-                                int npt, DDXPointPtr pPts);
-    void (*PolySegmentThinSolid) (DrawablePtr pDrawable, GCPtr pGC, int nseg,
-                                  xSegment * pSeg);
-    void (*PolylinesThinDashed) (DrawablePtr pDrawable, GCPtr pGC, int mode,
-                                 int npt, DDXPointPtr pPts);
-    void (*PolySegmentThinDashed) (DrawablePtr pDrawable, GCPtr pGC, int nseg,
-                                   xSegment * pSeg);
-    void (*FillPolygonSolid) (DrawablePtr pDrawable, GCPtr pGC, int shape,
-                              int mode, int count, DDXPointPtr ptsIn);
-    void (*FillPolygonStippled) (DrawablePtr pDrawable, GCPtr pGC, int shape,
-                                 int mode, int count, DDXPointPtr ptsIn);
-    void (*FillPolygonOpaqueStippled) (DrawablePtr pDrawable, GCPtr pGC,
-                                       int shape, int mode, int count,
-                                       DDXPointPtr ptsIn);
-    void (*FillPolygonTiled) (DrawablePtr pDrawable, GCPtr pGC, int shape,
-                              int mode, int count, DDXPointPtr ptsIn);
-    void (*PolyFillArcSolid) (DrawablePtr pDraw, GCPtr pGC, int narcs,
-                              xArc * parcs);
-    void (*PutImage) (DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y,
-                      int w, int h, int leftPad, int format, char *pImage);
-    ValidateGCProcPtr ValidateFillSpans;
-    ValidateGCProcPtr ValidateSetSpans;
-    ValidateGCProcPtr ValidatePutImage;
-    ValidateGCProcPtr ValidateCopyArea;
-    ValidateGCProcPtr ValidateCopyPlane;
-    ValidateGCProcPtr ValidatePolyPoint;
-    ValidateGCProcPtr ValidatePolylines;
-    ValidateGCProcPtr ValidatePolySegment;
-    ValidateGCProcPtr ValidatePolyRectangle;
-    ValidateGCProcPtr ValidatePolyArc;
-    ValidateGCProcPtr ValidateFillPolygon;
-    ValidateGCProcPtr ValidatePolyFillRect;
-    ValidateGCProcPtr ValidatePolyFillArc;
-    ValidateGCProcPtr ValidatePolyText8;
-    ValidateGCProcPtr ValidatePolyText16;
-    ValidateGCProcPtr ValidateImageText8;
-    ValidateGCProcPtr ValidateImageText16;
-    ValidateGCProcPtr ValidatePolyGlyphBlt;
-    ValidateGCProcPtr ValidateImageGlyphBlt;
-    ValidateGCProcPtr ValidatePushPixels;
-    void (*ComputeDash) (GCPtr pGC);
-    void (*InitPixmapCache) (ScreenPtr pScreen, RegionPtr areas, pointer data);
-    void (*ClosePixmapCache) (ScreenPtr pScreen);
-    int (*StippledFillChooser) (GCPtr pGC);
-    int (*OpaqueStippledFillChooser) (GCPtr pGC);
-    int (*TiledFillChooser) (GCPtr pGC);
-     XAACacheInfoPtr(*CacheTile) (ScrnInfoPtr Scrn, PixmapPtr pPix);
-     XAACacheInfoPtr(*CacheStipple) (ScrnInfoPtr Scrn, PixmapPtr pPix, int fg,
-                                     int bg);
-     XAACacheInfoPtr(*CacheMonoStipple) (ScrnInfoPtr Scrn, PixmapPtr pPix);
-     XAACacheInfoPtr(*CacheMono8x8Pattern) (ScrnInfoPtr Scrn, int pat0,
-                                            int pat1);
-     XAACacheInfoPtr(*CacheColor8x8Pattern) (ScrnInfoPtr Scrn, PixmapPtr pPix,
-                                             int fg, int bg);
-    void (*WriteBitmapToCache) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                                unsigned char *src, int srcwidth, int fg,
-                                int bg);
-    void (*WritePixmapToCache) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                                unsigned char *src, int srcwidth, int bpp,
-                                int depth);
-    void (*WriteMono8x8PatternToCache) (ScrnInfoPtr pScrn,
-                                        XAACacheInfoPtr pCache);
-    void (*WriteColor8x8PatternToCache) (ScrnInfoPtr pScrn, PixmapPtr pPix,
-                                         XAACacheInfoPtr pCache);
-    GetImageProcPtr GetImage;
-    GetSpansProcPtr GetSpans;
-    CopyWindowProcPtr CopyWindow;
-    Bool (*SetupForCPUToScreenAlphaTexture2) (ScrnInfoPtr pScrn, int op,
-                                              CARD16 red, CARD16 green,
-                                              CARD16 blue, CARD16 alpha,
-                                              CARD32 maskFormat,
-                                              CARD32 dstFormat, CARD8 *alphaPtr,
-                                              int alphaPitch, int width,
-                                              int height, int flags);
-    Bool (*SetupForCPUToScreenTexture2) (ScrnInfoPtr pScrn, int op,
-                                         CARD32 srcFormat, CARD32 dstFormat,
-                                         CARD8 *texPtr, int texPitch, int width,
-                                         int height, int flags);
-} XAAStateWrapRec, *XAAStateWrapPtr;
-
-static DevPrivateKeyRec XAAStateKeyRec;
-
-#define XAAStateKey (&XAAStateKeyRec)
-
-/* Wrap functions start here */
-#define GET_STATEPRIV_GC(pGC)   XAAStateWrapPtr pStatePriv =\
-(XAAStateWrapPtr)dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAStateKey)
-
-#define GET_STATEPRIV_SCREEN(pScreen)   XAAStateWrapPtr pStatePriv =\
-(XAAStateWrapPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAStateKey)
-
-#define GET_STATEPRIV_PSCRN(pScrn)   XAAStateWrapPtr pStatePriv =\
-(XAAStateWrapPtr)dixLookupPrivate(&(pScrn)->pScreen->devPrivates, XAAStateKey)
-
-#define STATE_CHECK_SP(pStatePriv) {\
-       ScrnInfoPtr pScrn = pStatePriv->pScrn;\
-       int i = 0;\
-       int need_change = 0;\
-       while(i < pScrn->numEntities) {\
-               if(xf86IsEntityShared(pScrn->entityList[i]) &&\
-                  xf86GetLastScrnFlag(pScrn->entityList[i]) != pScrn->scrnIndex) {\
-                       need_change = 1;\
-                       xf86SetLastScrnFlag(pScrn->entityList[i],\
-                                           pScrn->scrnIndex);\
-               }\
-               i++;\
-       }\
-       if(need_change == 1) (*pStatePriv->RestoreAccelState)(pScrn);\
-}
-
-#define STATE_CHECK_PSCRN(pScrn) {\
-       int i = 0;\
-       int need_change = 0;\
-       while(i < pScrn->numEntities) {\
-               if(xf86IsEntityShared(pScrn->entityList[i]) &&\
-                  xf86GetLastScrnFlag(pScrn->entityList[i]) != pScrn->scrnIndex) {\
-                       need_change = 1;\
-                       xf86SetLastScrnFlag(pScrn->entityList[i],\
-                                           pScrn->scrnIndex);\
-               }\
-               i++;\
-       }\
-       if(need_change == 1) (*pStatePriv->RestoreAccelState)(pScrn);\
-}
-
-static void
-XAAStateWrapSync(ScrnInfoPtr pScrn)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->Sync) (pScrn);
-}
-
-static void
-XAAStateWrapSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir,
-                                       int rop, unsigned int planemask,
-                                       int trans_color)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForScreenToScreenCopy) (pScrn, xdir, ydir, rop,
-                                               planemask, trans_color);
-}
-
-static void
-XAAStateWrapSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
-                              unsigned int planemask)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForSolidFill) (pScrn, color, rop, planemask);
-}
-
-static void
-XAAStateWrapSetupForSolidLine(ScrnInfoPtr pScrn, int color, int rop,
-                              unsigned int planemask)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForSolidLine) (pScrn, color, rop, planemask);
-}
-
-static void
-XAAStateWrapSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                               unsigned int planemask, int length,
-                               unsigned char *pattern)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForDashedLine) (pScrn, fg, bg, rop, planemask, length,
-                                       pattern);
-}
-
-static void
-XAAStateWrapSetClippingRectangle(ScrnInfoPtr pScrn, int left, int top,
-                                 int right, int bottom)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetClippingRectangle) (pScrn, left, top, right, bottom);
-}
-
-static void
-XAAStateWrapDisableClipping(ScrnInfoPtr pScrn)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->DisableClipping) (pScrn);
-}
-
-static void
-XAAStateWrapSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
-                                       int fg, int bg, int rop,
-                                       unsigned int planemask)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForMono8x8PatternFill) (pScrn, patx, paty, fg, bg, rop,
-                                               planemask);
-}
-
-static void
-XAAStateWrapSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
-                                        int rop, unsigned int planemask,
-                                        int transparency_color)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForColor8x8PatternFill) (pScrn, patx, paty, rop,
-                                                planemask, transparency_color);
-}
-
-static void
-XAAStateWrapSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg,
-                                               int bg, int rop,
-                                               unsigned int planemask)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                       planemask);
-}
-
-static void
-XAAStateWrapSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
-                                                       int fg, int bg,
-                                                       int rop,
-                                                       unsigned int planemask)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg,
-                                                               rop, planemask);
-}
-
-static void
-XAAStateWrapSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrn,
-                                                  int fg, int bg, int rop,
-                                                  unsigned int planemask)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForScreenToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                          planemask);
-}
-
-static void
-XAAStateWrapSetupForImageWrite(ScrnInfoPtr pScrn, int rop,
-                               unsigned int planemask, int transparency_color,
-                               int bpp, int depth)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForImageWrite) (pScrn, rop, planemask,
-                                       transparency_color, bpp, depth);
-}
-
-static void
-XAAStateWrapSetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
-                                       unsigned int planemask,
-                                       int transparency_color,
-                                       int bpp, int depth)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForScanlineImageWrite) (pScrn, rop, planemask,
-                                               transparency_color, bpp, depth);
-}
-
-static void
-XAAStateWrapSetupForImageRead(ScrnInfoPtr pScrn, int bpp, int depth)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->SetupForImageRead) (pScrn, bpp, depth);
-}
-
-static void
-XAAStateWrapScreenToScreenBitBlt(ScrnInfoPtr pScrn, int nbox,
-                                 DDXPointPtr pptSrc, BoxPtr pbox, int xdir,
-                                 int ydir, int alu, unsigned int planmask)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->ScreenToScreenBitBlt) (pScrn, nbox,
-                                         pptSrc, pbox, xdir,
-                                         ydir, alu, planmask);
-}
-
-static void
-XAAStateWrapWriteBitmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                        unsigned char *src, int srcwidth, int skipleft,
-                        int fg, int bg, int rop, unsigned int planemask)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->WriteBitmap) (pScrn, x, y, w, h,
-                                src, srcwidth, skipleft,
-                                fg, bg, rop, planemask);
-}
-
-static void
-XAAStateWrapFillSolidRects(ScrnInfoPtr pScrn, int fg, int rop,
-                           unsigned int planemask, int nBox, BoxPtr pBox)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillSolidRects) (pScrn, fg, rop, planemask, nBox, pBox);
-}
-
-static void
-XAAStateWrapFillMono8x8PatternRects(ScrnInfoPtr pScrn, int fg, int bg,
-                                    int rop, unsigned int planemask, int nBox,
-                                    BoxPtr pBox, int pat0, int pat1,
-                                    int xorg, int yorg)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillMono8x8PatternRects) (pScrn, fg, bg,
-                                            rop, planemask, nBox,
-                                            pBox, pat0, pat1, xorg, yorg);
-}
-
-static void
-XAAStateWrapFillColor8x8PatternRects(ScrnInfoPtr pScrn, int rop,
-                                     unsigned int planemask, int nBox,
-                                     BoxPtr pBox, int xorg, int yorg,
-                                     XAACacheInfoPtr pCache)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillColor8x8PatternRects) (pScrn, rop,
-                                             planemask, nBox,
-                                             pBox, xorg, yorg, pCache);
-}
-
-static void
-XAAStateWrapFillCacheBltRects(ScrnInfoPtr pScrn, int rop,
-                              unsigned int planemask, int nBox, BoxPtr pBox,
-                              int xorg, int yorg, XAACacheInfoPtr pCache)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillCacheBltRects) (pScrn, rop,
-                                      planemask, nBox, pBox,
-                                      xorg, yorg, pCache);
-}
-
-static void
-XAAStateWrapFillColorExpandRects(ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                 unsigned int planemask, int nBox,
-                                 BoxPtr pBox, int xorg, int yorg,
-                                 PixmapPtr pPix)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillColorExpandRects) (pScrn, fg, bg, rop,
-                                         planemask, nBox,
-                                         pBox, xorg, yorg, pPix);
-}
-
-static void
-XAAStateWrapFillCacheExpandRects(ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                 unsigned int planemask, int nBox,
-                                 BoxPtr pBox, int xorg, int yorg,
-                                 PixmapPtr pPix)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillCacheExpandRects) (pScrn, fg, bg, rop,
-                                         planemask, nBox,
-                                         pBox, xorg, yorg, pPix);
-}
-
-static void
-XAAStateWrapFillImageWriteRects(ScrnInfoPtr pScrn, int rop,
-                                unsigned int planemask, int nBox, BoxPtr pBox,
-                                int xorg, int yorg, PixmapPtr pPix)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillImageWriteRects) (pScrn, rop,
-                                        planemask, nBox, pBox,
-                                        xorg, yorg, pPix);
-}
-
-static void
-XAAStateWrapFillSolidSpans(ScrnInfoPtr pScrn, int fg, int rop,
-                           unsigned int planemask, int n, DDXPointPtr points,
-                           int *widths, int fSorted)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillSolidSpans) (pScrn, fg, rop,
-                                   planemask, n, points, widths, fSorted);
-}
-
-static void
-XAAStateWrapFillMono8x8PatternSpans(ScrnInfoPtr pScrn, int fg, int bg,
-                                    int rop, unsigned int planemask, int n,
-                                    DDXPointPtr points, int *widths,
-                                    int fSorted, int pat0, int pat1,
-                                    int xorg, int yorg)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillMono8x8PatternSpans) (pScrn, fg, bg,
-                                            rop, planemask, n,
-                                            points, widths,
-                                            fSorted, pat0, pat1, xorg, yorg);
-}
-
-static void
-XAAStateWrapFillColor8x8PatternSpans(ScrnInfoPtr pScrn, int rop,
-                                     unsigned int planemask, int n,
-                                     DDXPointPtr points, int *widths,
-                                     int fSorted, XAACacheInfoPtr pCache,
-                                     int xorg, int yorg)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillColor8x8PatternSpans) (pScrn, rop,
-                                             planemask, n,
-                                             points, widths,
-                                             fSorted, pCache, xorg, yorg);
-}
-
-static void
-XAAStateWrapFillCacheBltSpans(ScrnInfoPtr pScrn, int rop,
-                              unsigned int planemask, int n,
-                              DDXPointPtr points, int *widths,
-                              int fSorted, XAACacheInfoPtr pCache,
-                              int xorg, int yorg)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillCacheBltSpans) (pScrn, rop,
-                                      planemask, n,
-                                      points, widths,
-                                      fSorted, pCache, xorg, yorg);
-}
-
-static void
-XAAStateWrapFillColorExpandSpans(ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                 unsigned int planemask, int n,
-                                 DDXPointPtr points, int *widths, int fSorted,
-                                 int xorg, int yorg, PixmapPtr pPix)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillColorExpandSpans) (pScrn, fg, bg, rop,
-                                         planemask, n,
-                                         points, widths, fSorted,
-                                         xorg, yorg, pPix);
-}
-
-static void
-XAAStateWrapFillCacheExpandSpans(ScrnInfoPtr pScrn, int fg, int bg, int rop,
-                                 unsigned int planemask, int n,
-                                 DDXPointPtr ppt, int *pwidth, int fSorted,
-                                 int xorg, int yorg, PixmapPtr pPix)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->FillCacheExpandSpans) (pScrn, fg, bg, rop,
-                                         planemask, n,
-                                         ppt, pwidth, fSorted,
-                                         xorg, yorg, pPix);
-}
-
-static void
-XAAStateWrapTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                            int skipleft, int startline,
-                            unsigned int **glyphs,
-                            int glyphWidth, int fg, int bg, int rop,
-                            unsigned planemask)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->TEGlyphRenderer) (pScrn, x, y, w, h,
-                                    skipleft, startline,
-                                    glyphs, glyphWidth, fg, bg, rop, planemask);
-}
-
-static void
-XAAStateWrapNonTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int n,
-                               NonTEGlyphPtr glyphs, BoxPtr pbox,
-                               int fg, int rop, unsigned int planemask)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->NonTEGlyphRenderer) (pScrn, x, y, n,
-                                       glyphs, pbox, fg, rop, planemask);
-}
-
-static void
-XAAStateWrapWritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                        unsigned char *src, int srcwidth, int rop,
-                        unsigned int planemask, int transparency_color,
-                        int bpp, int depth)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->WritePixmap) (pScrn, x, y, w, h,
-                                src, srcwidth, rop,
-                                planemask, transparency_color, bpp, depth);
-}
-
-static void
-XAAStateWrapReadPixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                       unsigned char *dst, int dstwidth, int bpp, int depth)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->ReadPixmap) (pScrn, x, y, w, h, dst, dstwidth, bpp, depth);
-}
-
-static RegionPtr
-XAAStateWrapCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
-                     GC * pGC, int srcx, int srcy, int width, int height,
-                     int dstx, int dsty)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    return (*pStatePriv->CopyArea) (pSrcDrawable, pDstDrawable,
-                                    pGC, srcx, srcy, width, height, dstx, dsty);
-}
-
-static RegionPtr
-XAAStateWrapCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
-                      int srcx, int srcy, int width, int height,
-                      int dstx, int dsty, unsigned long bitPlane)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    return (*pStatePriv->CopyPlane) (pSrc, pDst, pGC,
-                                     srcx, srcy, width, height,
-                                     dstx, dsty, bitPlane);
-}
-
-static void
-XAAStateWrapPushPixelsSolid(GCPtr pGC, PixmapPtr pBitMap,
-                            DrawablePtr pDrawable, int dx, int dy, int xOrg,
-                            int yOrg)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PushPixelsSolid) (pGC, pBitMap,
-                                    pDrawable, dx, dy, xOrg, yOrg);
-}
-
-static void
-XAAStateWrapPolyFillRectSolid(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
-                              xRectangle *prectInit)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolyFillRectSolid) (pDraw, pGC, nrectFill, prectInit);
-}
-
-static void
-XAAStateWrapPolyFillRectStippled(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
-                                 xRectangle *prectInit)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolyFillRectStippled) (pDraw, pGC, nrectFill, prectInit);
-}
-
-static void
-XAAStateWrapPolyFillRectOpaqueStippled(DrawablePtr pDraw, GCPtr pGC,
-                                       int nrectFill, xRectangle *prectInit)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolyFillRectOpaqueStippled) (pDraw, pGC,
-                                               nrectFill, prectInit);
-}
-
-static void
-XAAStateWrapPolyFillRectTiled(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
-                              xRectangle *prectInit)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolyFillRectTiled) (pDraw, pGC, nrectFill, prectInit);
-}
-
-static void
-XAAStateWrapFillSpansSolid(DrawablePtr pDraw, GCPtr pGC, int nInit,
-                           DDXPointPtr ppt, int *pwidth, int fSorted)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->FillSpansSolid) (pDraw, pGC, nInit, ppt, pwidth, fSorted);
-}
-
-static void
-XAAStateWrapFillSpansStippled(DrawablePtr pDraw, GCPtr pGC, int nInit,
-                              DDXPointPtr ppt, int *pwidth, int fSorted)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->FillSpansStippled) (pDraw, pGC, nInit, ppt, pwidth, fSorted);
-}
-
-static void
-XAAStateWrapFillSpansOpaqueStippled(DrawablePtr pDraw, GCPtr pGC, int nInit,
-                                    DDXPointPtr ppt, int *pwidth, int fSorted)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->FillSpansOpaqueStippled) (pDraw, pGC, nInit,
-                                            ppt, pwidth, fSorted);
-}
-
-static void
-XAAStateWrapFillSpansTiled(DrawablePtr pDraw, GCPtr pGC, int nInit,
-                           DDXPointPtr ppt, int *pwidth, int fSorted)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->FillSpansTiled) (pDraw, pGC, nInit, ppt, pwidth, fSorted);
-}
-
-static int
-XAAStateWrapPolyText8TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
-                        char *chars)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    return (*pStatePriv->PolyText8TE) (pDraw, pGC, x, y, count, chars);
-}
-
-static int
-XAAStateWrapPolyText16TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
-                         unsigned short *chars)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    return (*pStatePriv->PolyText16TE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAStateWrapImageText8TE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                         int count, char *chars)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ImageText8TE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAStateWrapImageText16TE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                          int count, unsigned short *chars)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ImageText16TE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAStateWrapImageGlyphBltTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
-                            int yInit, unsigned int nglyph, CharInfoPtr * ppci,
-                            pointer pglyphBase)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ImageGlyphBltTE) (pDrawable, pGC, xInit,
-                                    yInit, nglyph, ppci, pglyphBase);
-}
-
-static void
-XAAStateWrapPolyGlyphBltTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
-                           int yInit, unsigned int nglyph, CharInfoPtr * ppci,
-                           pointer pglyphBase)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolyGlyphBltTE) (pDrawable, pGC, xInit,
-                                   yInit, nglyph, ppci, pglyphBase);
-}
-
-static int
-XAAStateWrapPolyText8NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                           int count, char *chars)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    return (*pStatePriv->PolyText8NonTE) (pDraw, pGC, x, y, count, chars);
-}
-
-static int
-XAAStateWrapPolyText16NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                            int count, unsigned short *chars)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    return (*pStatePriv->PolyText16NonTE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAStateWrapImageText8NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                            int count, char *chars)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ImageText8NonTE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAStateWrapImageText16NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
-                             int count, unsigned short *chars)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ImageText16NonTE) (pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAStateWrapImageGlyphBltNonTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
-                               int yInit, unsigned int nglyph,
-                               CharInfoPtr * ppci, pointer pglyphBase)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ImageGlyphBltNonTE) (pDrawable, pGC, xInit,
-                                       yInit, nglyph, ppci, pglyphBase);
-}
-
-static void
-XAAStateWrapPolyGlyphBltNonTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
-                              int yInit, unsigned int nglyph,
-                              CharInfoPtr * ppci, pointer pglyphBase)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolyGlyphBltNonTE) (pDrawable, pGC, xInit,
-                                      yInit, nglyph, ppci, pglyphBase);
-}
-
-static void
-XAAStateWrapPolyRectangleThinSolid(DrawablePtr pDrawable, GCPtr pGC,
-                                   int nRectsInit, xRectangle *pRectsInit)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolyRectangleThinSolid) (pDrawable, pGC,
-                                           nRectsInit, pRectsInit);
-}
-
-static void
-XAAStateWrapPolylinesWideSolid(DrawablePtr pDrawable, GCPtr pGC, int mode,
-                               int npt, DDXPointPtr pPts)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolylinesWideSolid) (pDrawable, pGC, mode, npt, pPts);
-}
-
-static void
-XAAStateWrapPolylinesThinSolid(DrawablePtr pDrawable, GCPtr pGC, int mode,
-                               int npt, DDXPointPtr pPts)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolylinesThinSolid) (pDrawable, pGC, mode, npt, pPts);
-}
-
-static void
-XAAStateWrapPolySegmentThinSolid(DrawablePtr pDrawable, GCPtr pGC, int nseg,
-                                 xSegment * pSeg)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolySegmentThinSolid) (pDrawable, pGC, nseg, pSeg);
-}
-
-static void
-XAAStateWrapPolylinesThinDashed(DrawablePtr pDrawable, GCPtr pGC, int mode,
-                                int npt, DDXPointPtr pPts)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolylinesThinDashed) (pDrawable, pGC, mode, npt, pPts);
-}
-
-static void
-XAAStateWrapPolySegmentThinDashed(DrawablePtr pDrawable, GCPtr pGC, int nseg,
-                                  xSegment * pSeg)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolySegmentThinDashed) (pDrawable, pGC, nseg, pSeg);
-}
-
-static void
-XAAStateWrapFillPolygonSolid(DrawablePtr pDrawable, GCPtr pGC, int shape,
-                             int mode, int count, DDXPointPtr ptsIn)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->FillPolygonSolid) (pDrawable, pGC, shape, mode, count, ptsIn);
-}
-
-static void
-XAAStateWrapFillPolygonStippled(DrawablePtr pDrawable, GCPtr pGC, int shape,
-                                int mode, int count, DDXPointPtr ptsIn)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->FillPolygonStippled) (pDrawable, pGC, shape,
-                                        mode, count, ptsIn);
-}
-
-static void
-XAAStateWrapFillPolygonOpaqueStippled(DrawablePtr pDrawable, GCPtr pGC,
-                                      int shape, int mode, int count,
-                                      DDXPointPtr ptsIn)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->FillPolygonOpaqueStippled) (pDrawable, pGC,
-                                              shape, mode, count, ptsIn);
-}
-
-static void
-XAAStateWrapFillPolygonTiled(DrawablePtr pDrawable, GCPtr pGC, int shape,
-                             int mode, int count, DDXPointPtr ptsIn)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->FillPolygonTiled) (pDrawable, pGC, shape, mode, count, ptsIn);
-}
-
-static void
-XAAStateWrapPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs,
-                             xArc * parcs)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PolyFillArcSolid) (pDraw, pGC, narcs, parcs);
-}
-
-static void
-XAAStateWrapPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y,
-                     int w, int h, int leftPad, int format, char *pImage)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->PutImage) (pDraw, pGC, depth, x, y,
-                             w, h, leftPad, format, pImage);
-}
-
-static void
-XAAStateWrapValidateFillSpans(GCPtr pGC, unsigned long changes,
-                              DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidateFillSpans) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidateSetSpans(GCPtr pGC, unsigned long changes,
-                             DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidateSetSpans) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePutImage(GCPtr pGC, unsigned long changes,
-                             DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePutImage) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidateCopyArea(GCPtr pGC, unsigned long changes,
-                             DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidateCopyArea) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidateCopyPlane(GCPtr pGC, unsigned long changes,
-                              DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidateCopyPlane) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePolyPoint(GCPtr pGC, unsigned long changes,
-                              DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePolyPoint) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePolylines(GCPtr pGC, unsigned long changes,
-                              DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePolylines) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePolySegment(GCPtr pGC, unsigned long changes,
-                                DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePolySegment) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePolyRectangle(GCPtr pGC, unsigned long changes,
-                                  DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePolyRectangle) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePolyArc(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePolyArc) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidateFillPolygon(GCPtr pGC, unsigned long changes,
-                                DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidateFillPolygon) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePolyFillRect(GCPtr pGC, unsigned long changes,
-                                 DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePolyFillRect) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePolyFillArc(GCPtr pGC, unsigned long changes,
-                                DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePolyFillArc) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePolyText8(GCPtr pGC, unsigned long changes,
-                              DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePolyText8) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePolyText16(GCPtr pGC, unsigned long changes,
-                               DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePolyText16) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidateImageText8(GCPtr pGC, unsigned long changes,
-                               DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidateImageText8) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidateImageText16(GCPtr pGC, unsigned long changes,
-                                DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidateImageText16) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePolyGlyphBlt(GCPtr pGC, unsigned long changes,
-                                 DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePolyGlyphBlt) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidateImageGlyphBlt(GCPtr pGC, unsigned long changes,
-                                  DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-    (*pStatePriv->ValidateImageGlyphBlt) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapValidatePushPixels(GCPtr pGC, unsigned long changes,
-                               DrawablePtr pDraw)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ValidatePushPixels) (pGC, changes, pDraw);
-}
-
-static void
-XAAStateWrapComputeDash(GCPtr pGC)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ComputeDash) (pGC);
-}
-
-static void
-XAAStateWrapInitPixmapCache(ScreenPtr pScreen, RegionPtr areas, pointer data)
-{
-    GET_STATEPRIV_SCREEN(pScreen);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->InitPixmapCache) (pScreen, areas, data);
-}
-
-static void
-XAAStateWrapClosePixmapCache(ScreenPtr pScreen)
-{
-    GET_STATEPRIV_SCREEN(pScreen);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->ClosePixmapCache) (pScreen);
-}
-
-static int
-XAAStateWrapStippledFillChooser(GCPtr pGC)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    return (*pStatePriv->StippledFillChooser) (pGC);
-}
-
-static int
-XAAStateWrapOpaqueStippledFillChooser(GCPtr pGC)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    return (*pStatePriv->OpaqueStippledFillChooser) (pGC);
-}
-
-static int
-XAAStateWrapTiledFillChooser(GCPtr pGC)
-{
-    GET_STATEPRIV_GC(pGC);
-    STATE_CHECK_SP(pStatePriv);
-
-    return (*pStatePriv->TiledFillChooser) (pGC);
-}
-
-static XAACacheInfoPtr
-XAAStateWrapCacheTile(ScrnInfoPtr pScrn, PixmapPtr pPix)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    return (*pStatePriv->CacheTile) (pScrn, pPix);
-}
-
-static XAACacheInfoPtr
-XAAStateWrapCacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    return (*pStatePriv->CacheStipple) (pScrn, pPix, fg, bg);
-}
-
-static XAACacheInfoPtr
-XAAStateWrapCacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    return (*pStatePriv->CacheMonoStipple) (pScrn, pPix);
-}
-
-static XAACacheInfoPtr
-XAAStateWrapCacheMono8x8Pattern(ScrnInfoPtr pScrn, int pat0, int pat1)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    return (*pStatePriv->CacheMono8x8Pattern) (pScrn, pat0, pat1);
-}
-
-static XAACacheInfoPtr
-XAAStateWrapCacheColor8x8Pattern(ScrnInfoPtr pScrn, PixmapPtr pPix,
-                                 int fg, int bg)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    return (*pStatePriv->CacheColor8x8Pattern) (pScrn, pPix, fg, bg);
-}
-
-static void
-XAAStateWrapWriteBitmapToCache(ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                               unsigned char *src, int srcwidth, int fg, int bg)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->WriteBitmapToCache) (pScrn, x, y, w, h,
-                                       src, srcwidth, fg, bg);
-}
-
-static void
-XAAStateWrapWritePixmapToCache(ScrnInfoPtr pScrn, int x, int y, int w, int h,
-                               unsigned char *src, int srcwidth, int bpp,
-                               int depth)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->WritePixmapToCache) (pScrn, x, y, w, h,
-                                       src, srcwidth, bpp, depth);
-}
-
-static void
-XAAStateWrapWriteMono8x8PatternToCache(ScrnInfoPtr pScrn,
-                                       XAACacheInfoPtr pCache)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->WriteMono8x8PatternToCache) (pScrn, pCache);
-}
-
-static void
-XAAStateWrapWriteColor8x8PatternToCache(ScrnInfoPtr pScrn, PixmapPtr pPix,
-                                        XAACacheInfoPtr pCache)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    (*pStatePriv->WriteColor8x8PatternToCache) (pScrn, pPix, pCache);
-}
-
-static void
-XAAStateWrapGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
-                     unsigned int format, unsigned long planeMask,
-                     char *pdstLine)
-{
-    GET_STATEPRIV_SCREEN(pDrawable->pScreen);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->GetImage) (pDrawable, sx, sy, w, h,
-                             format, planeMask, pdstLine);
-}
-
-static void
-XAAStateWrapGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
-                     int *pwidth, int nspans, char *pdstStart)
-{
-    GET_STATEPRIV_SCREEN(pDrawable->pScreen);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
-}
-
-static void
-XAAStateWrapCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg,
-                       RegionPtr prgnSrc)
-{
-    GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen);
-    STATE_CHECK_SP(pStatePriv);
-
-    (*pStatePriv->CopyWindow) (pWindow, ptOldOrg, prgnSrc);
-}
-
-static Bool
-XAAStateWrapSetupForCPUToScreenAlphaTexture2(ScrnInfoPtr pScrn,
-                                             int op, CARD16 red,
-                                             CARD16 green,
-                                             CARD16 blue,
-                                             CARD16 alpha,
-                                             CARD32 srcFormat,
-                                             CARD32 dstFormat,
-                                             CARD8 *alphaPtr,
-                                             int alphaPitch,
-                                             int width, int height, int flags)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    return (*pStatePriv->SetupForCPUToScreenAlphaTexture2) (pScrn, op, red,
-                                                            green, blue, alpha,
-                                                            srcFormat,
-                                                            dstFormat, alphaPtr,
-                                                            alphaPitch, width,
-                                                            height, flags);
-}
-
-static Bool
-XAAStateWrapSetupForCPUToScreenTexture2(ScrnInfoPtr pScrn, int op,
-                                        CARD32 srcFormat,
-                                        CARD32 dstFormat,
-                                        CARD8 *texPtr, int texPitch,
-                                        int width, int height, int flags)
-{
-    GET_STATEPRIV_PSCRN(pScrn);
-    STATE_CHECK_PSCRN(pScrn);
-
-    return (*pStatePriv->SetupForCPUToScreenTexture2) (pScrn, op, srcFormat,
-                                                       dstFormat, texPtr,
-                                                       texPitch, width, height,
-                                                       flags);
-}
-
-/* Setup Function */
-Bool
-XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    XAAStateWrapPtr pStatePriv;
-    int i = 0;
-
-    if (!dixRegisterPrivateKey(&XAAStateKeyRec, PRIVATE_SCREEN, 0))
-        return FALSE;
-    if (!(pStatePriv = malloc(sizeof(XAAStateWrapRec))))
-        return FALSE;
-    dixSetPrivate(&pScreen->devPrivates, XAAStateKey, pStatePriv);
-    pStatePriv->RestoreAccelState = infoRec->RestoreAccelState;
-    pStatePriv->pScrn = pScrn;
-
-    /* Initialize the last screen to -1 so whenever an accel function
-     * is called the proper state is setup
-     */
-    while (i < pScrn->numEntities) {
-        xf86SetLastScrnFlag(pScrn->entityList[i], -1);
-        i++;
-    }
-/* Do the wrapping */
-    XAA_STATE_WRAP(Sync);
-    XAA_STATE_WRAP(SetupForScreenToScreenCopy);
-    XAA_STATE_WRAP(SetupForSolidFill);
-    XAA_STATE_WRAP(SetupForSolidLine);
-    XAA_STATE_WRAP(SetupForDashedLine);
-    XAA_STATE_WRAP(SetClippingRectangle);
-    XAA_STATE_WRAP(DisableClipping);
-    XAA_STATE_WRAP(SetupForMono8x8PatternFill);
-    XAA_STATE_WRAP(SetupForColor8x8PatternFill);
-    XAA_STATE_WRAP(SetupForCPUToScreenColorExpandFill);
-    XAA_STATE_WRAP(SetupForScanlineCPUToScreenColorExpandFill);
-    XAA_STATE_WRAP(SetupForScreenToScreenColorExpandFill);
-    XAA_STATE_WRAP(SetupForImageWrite);
-    XAA_STATE_WRAP(SetupForScanlineImageWrite);
-    XAA_STATE_WRAP(SetupForImageRead);
-    XAA_STATE_WRAP(ScreenToScreenBitBlt);
-    XAA_STATE_WRAP(WriteBitmap);
-    XAA_STATE_WRAP(FillSolidRects);
-    XAA_STATE_WRAP(FillMono8x8PatternRects);
-    XAA_STATE_WRAP(FillColor8x8PatternRects);
-    XAA_STATE_WRAP(FillCacheBltRects);
-    XAA_STATE_WRAP(FillColorExpandRects);
-    XAA_STATE_WRAP(FillCacheExpandRects);
-    XAA_STATE_WRAP(FillImageWriteRects);
-    XAA_STATE_WRAP(FillSolidSpans);
-    XAA_STATE_WRAP(FillMono8x8PatternSpans);
-    XAA_STATE_WRAP(FillColor8x8PatternSpans);
-    XAA_STATE_WRAP(FillCacheBltSpans);
-    XAA_STATE_WRAP(FillColorExpandSpans);
-    XAA_STATE_WRAP(FillCacheExpandSpans);
-    XAA_STATE_WRAP(TEGlyphRenderer);
-    XAA_STATE_WRAP(NonTEGlyphRenderer);
-    XAA_STATE_WRAP(WritePixmap);
-    XAA_STATE_WRAP(ReadPixmap);
-    XAA_STATE_WRAP(CopyArea);
-    XAA_STATE_WRAP(CopyPlane);
-    XAA_STATE_WRAP(PushPixelsSolid);
-    XAA_STATE_WRAP(PolyFillRectSolid);
-    XAA_STATE_WRAP(PolyFillRectStippled);
-    XAA_STATE_WRAP(PolyFillRectOpaqueStippled);
-    XAA_STATE_WRAP(PolyFillRectTiled);
-    XAA_STATE_WRAP(FillSpansSolid);
-    XAA_STATE_WRAP(FillSpansStippled);
-    XAA_STATE_WRAP(FillSpansOpaqueStippled);
-    XAA_STATE_WRAP(FillSpansTiled);
-    XAA_STATE_WRAP(PolyText8TE);
-    XAA_STATE_WRAP(PolyText16TE);
-    XAA_STATE_WRAP(ImageText8TE);
-    XAA_STATE_WRAP(ImageText16TE);
-    XAA_STATE_WRAP(ImageGlyphBltTE);
-    XAA_STATE_WRAP(PolyGlyphBltTE);
-    XAA_STATE_WRAP(PolyText8NonTE);
-    XAA_STATE_WRAP(PolyText16NonTE);
-    XAA_STATE_WRAP(ImageText8NonTE);
-    XAA_STATE_WRAP(ImageText16NonTE);
-    XAA_STATE_WRAP(ImageGlyphBltNonTE);
-    XAA_STATE_WRAP(PolyGlyphBltNonTE);
-    XAA_STATE_WRAP(PolyRectangleThinSolid);
-    XAA_STATE_WRAP(PolylinesWideSolid);
-    XAA_STATE_WRAP(PolylinesThinSolid);
-    XAA_STATE_WRAP(PolySegmentThinSolid);
-    XAA_STATE_WRAP(PolylinesThinDashed);
-    XAA_STATE_WRAP(PolySegmentThinDashed);
-    XAA_STATE_WRAP(FillPolygonSolid);
-    XAA_STATE_WRAP(FillPolygonStippled);
-    XAA_STATE_WRAP(FillPolygonOpaqueStippled);
-    XAA_STATE_WRAP(FillPolygonTiled);
-    XAA_STATE_WRAP(PolyFillArcSolid);
-    XAA_STATE_WRAP(PutImage);
-    XAA_STATE_WRAP(ValidateFillSpans);
-    XAA_STATE_WRAP(ValidateSetSpans);
-    XAA_STATE_WRAP(ValidatePutImage);
-    XAA_STATE_WRAP(ValidateCopyArea);
-    XAA_STATE_WRAP(ValidateCopyPlane);
-    XAA_STATE_WRAP(ValidatePolyPoint);
-    XAA_STATE_WRAP(ValidatePolylines);
-    XAA_STATE_WRAP(ValidatePolySegment);
-    XAA_STATE_WRAP(ValidatePolyRectangle);
-    XAA_STATE_WRAP(ValidatePolyArc);
-    XAA_STATE_WRAP(ValidateFillPolygon);
-    XAA_STATE_WRAP(ValidatePolyFillRect);
-    XAA_STATE_WRAP(ValidatePolyFillArc);
-    XAA_STATE_WRAP(ValidatePolyText8);
-    XAA_STATE_WRAP(ValidatePolyText16);
-    XAA_STATE_WRAP(ValidateImageText8);
-    XAA_STATE_WRAP(ValidateImageText16);
-    XAA_STATE_WRAP(ValidatePolyGlyphBlt);
-    XAA_STATE_WRAP(ValidateImageGlyphBlt);
-    XAA_STATE_WRAP(ValidatePushPixels);
-    XAA_STATE_WRAP(ComputeDash);
-    XAA_STATE_WRAP(InitPixmapCache);
-    XAA_STATE_WRAP(ClosePixmapCache);
-    XAA_STATE_WRAP(StippledFillChooser);
-    XAA_STATE_WRAP(OpaqueStippledFillChooser);
-    XAA_STATE_WRAP(TiledFillChooser);
-    XAA_STATE_WRAP(CacheTile);
-    XAA_STATE_WRAP(CacheStipple);
-    XAA_STATE_WRAP(CacheMonoStipple);
-    XAA_STATE_WRAP(CacheMono8x8Pattern);
-    XAA_STATE_WRAP(CacheColor8x8Pattern);
-    XAA_STATE_WRAP(WriteBitmapToCache);
-    XAA_STATE_WRAP(WritePixmapToCache);
-    XAA_STATE_WRAP(WriteMono8x8PatternToCache);
-    XAA_STATE_WRAP(WriteColor8x8PatternToCache);
-    XAA_STATE_WRAP(GetImage);
-    XAA_STATE_WRAP(GetSpans);
-    XAA_STATE_WRAP(CopyWindow);
-    XAA_STATE_WRAP(SetupForCPUToScreenAlphaTexture2);
-    XAA_STATE_WRAP(SetupForCPUToScreenTexture2);
-    return TRUE;
-}
diff --git a/hw/xfree86/xaa/xaaStipple.c b/hw/xfree86/xaa/xaaStipple.c
deleted file mode 100644 (file)
index fc74e39..0000000
+++ /dev/null
@@ -1,915 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaacexp.h"
-#include "xf86.h"
-
-static CARD32 *StipplePowerOfTwo(CARD32 *, CARD32 *, int, int, int);
-static CARD32 *StipplePowerOfTwo_Inverted(CARD32 *, CARD32 *, int, int, int);
-static CARD32 *StippleUpTo32(CARD32 *, CARD32 *, int, int, int);
-static CARD32 *StippleUpTo32_Inverted(CARD32 *, CARD32 *, int, int, int);
-static CARD32 *StippleOver32(CARD32 *, CARD32 *, int, int, int);
-static CARD32 *StippleOver32_Inverted(CARD32 *, CARD32 *, int, int, int);
-
-#ifdef TRIPLE_BITS
-#define stipple_scanline_func EXPNAME(XAAStippleScanlineFunc3)
-#define stipple_get_scanline_func EXPNAME(XAAGetStippleScanlineFunc3)
-#else
-#define stipple_scanline_func EXPNAME(XAAStippleScanlineFunc)
-#define stipple_get_scanline_func EXPNAME(XAAGetStippleScanlineFunc)
-#endif
-
-StippleScanlineProcPtr stipple_scanline_func[6] = {
-    StipplePowerOfTwo,
-    StippleUpTo32,
-    StippleOver32,
-    StipplePowerOfTwo_Inverted,
-    StippleUpTo32_Inverted,
-    StippleOver32_Inverted
-};
-
-StippleScanlineProcPtr *
-stipple_get_scanline_func(void)
-{
-    return stipple_scanline_func;
-}
-
-#ifdef FIXEDBASE
-#define DEST(i)        *dest
-#define RETURN(i)      return(dest)
-#else
-#define DEST(i)        dest[i]
-#define RETURN(i)      return(dest + i)
-#endif
-
-/* TRIPLE_BITS pattern expansion */
-#ifdef TRIPLE_BITS
-#define EXPAND_PAT \
-       CARD32 pat1 = byte_expand3[pat & 0xFF], \
-              pat2 = byte_expand3[(pat & 0xFF00) >> 8], \
-              pat3 = byte_expand3[(pat & 0xFF0000) >> 16], \
-              pat4 = byte_expand3[(pat & 0xFF000000) >> 24], \
-              patA = pat1 | (pat2 << 24), \
-              patB = (pat2 >> 8) | (pat3 << 16), \
-              patC = (pat3 >> 16) | (pat4 << 8)
-#ifdef FIXED_BASE
-#define WRITE_PAT1 { \
-       *dest = patA; }
-#define WRITE_PAT2 { \
-       *dest = patA; \
-       *dest = patB; }
-#define WRITE_PAT3 { \
-       *dest = patA; \
-       *dest = patB; \
-       *dest = patC; }
-#else
-#define WRITE_PAT1 { \
-       *(dest++) = patA; }
-#define WRITE_PAT2 { \
-       *(dest) = patA; \
-       *(dest + 1) = patB; \
-       dest += 2; }
-#define WRITE_PAT3 { \
-       *(dest) = patA; \
-       *(dest + 1) = patB; \
-       *(dest + 2) = patC; \
-       dest += 3; }
-#endif
-#endif
-
-#if !defined(FIXEDBASE) && !defined(MSBFIRST) && !defined(TRIPLE_BITS)
-
-unsigned int XAAShiftMasks[32] = {
-    /* gcc is rather pedantic about SHIFT_R(0xFFFFFFFF,32) */
-    0x00000000, SHIFT_R(0xFFFFFFFF, 31),
-    SHIFT_R(0xFFFFFFFF, 30), SHIFT_R(0xFFFFFFFF, 29),
-    SHIFT_R(0xFFFFFFFF, 28), SHIFT_R(0xFFFFFFFF, 27),
-    SHIFT_R(0xFFFFFFFF, 26), SHIFT_R(0xFFFFFFFF, 25),
-    SHIFT_R(0xFFFFFFFF, 24), SHIFT_R(0xFFFFFFFF, 23),
-    SHIFT_R(0xFFFFFFFF, 22), SHIFT_R(0xFFFFFFFF, 21),
-    SHIFT_R(0xFFFFFFFF, 20), SHIFT_R(0xFFFFFFFF, 19),
-    SHIFT_R(0xFFFFFFFF, 18), SHIFT_R(0xFFFFFFFF, 17),
-    SHIFT_R(0xFFFFFFFF, 16), SHIFT_R(0xFFFFFFFF, 15),
-    SHIFT_R(0xFFFFFFFF, 14), SHIFT_R(0xFFFFFFFF, 13),
-    SHIFT_R(0xFFFFFFFF, 12), SHIFT_R(0xFFFFFFFF, 11),
-    SHIFT_R(0xFFFFFFFF, 10), SHIFT_R(0xFFFFFFFF, 9),
-    SHIFT_R(0xFFFFFFFF, 8), SHIFT_R(0xFFFFFFFF, 7),
-    SHIFT_R(0xFFFFFFFF, 6), SHIFT_R(0xFFFFFFFF, 5),
-    SHIFT_R(0xFFFFFFFF, 4), SHIFT_R(0xFFFFFFFF, 3),
-    SHIFT_R(0xFFFFFFFF, 2), SHIFT_R(0xFFFFFFFF, 1)
-};
-
-#endif
-
-void
-#ifdef TRIPLE_BITS
- EXPNAME(XAAFillColorExpandRects3) (
-#else
- EXPNAME(XAAFillColorExpandRects) (
-#endif
-                                      ScrnInfoPtr pScrn,
-                                      int fg, int bg, int rop,
-                                      unsigned int planemask,
-                                      int nBox,
-                                      BoxPtr pBox,
-                                      int xorg, int yorg, PixmapPtr pPix) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    CARD32 *base;
-    Bool TwoPass = FALSE, FirstPass = TRUE;
-    StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
-    int stipplewidth = pPix->drawable.width;
-    int stippleheight = pPix->drawable.height;
-    int srcwidth = pPix->devKind;
-    int dwords, srcy, srcx, funcNo = 2, h;
-    unsigned char *src = (unsigned char *) pPix->devPrivate.ptr;
-    unsigned char *srcp;
-    int flag;
-
-    if (stipplewidth <= 32) {
-        if (stipplewidth & (stipplewidth - 1))
-            funcNo = 1;
-        else
-            funcNo = 0;
-    }
-    StippleFunc = stipple_scanline_func[funcNo];
-    SecondFunc = stipple_scanline_func[funcNo];
-    FirstFunc = stipple_scanline_func[funcNo + 3];
-
-#ifdef TRIPLE_BITS
-    if ((bg == -1) ||
-        (!(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) &&
-         (!(infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
-          (CHECK_RGB_EQUAL(bg))))) {
-#else
-    if ((bg == -1) ||
-        !(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
-        /* one pass */
-    }
-    else if ((rop == GXcopy) && infoRec->FillSolidRects) {
-        /* one pass but we fill background rects first */
-        (*infoRec->FillSolidRects) (pScrn, bg, rop, planemask, nBox, pBox);
-        bg = -1;
-    }
-    else {
-        /* gotta do two passes */
-        TwoPass = TRUE;
-    }
-
-    if (!TwoPass)
-        (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                        planemask);
-
-    while (nBox--) {
-#ifdef TRIPLE_BITS
-        dwords = (3 * (pBox->x2 - pBox->x1) + 31) >> 5;
-#else
-        dwords = (pBox->x2 - pBox->x1 + 31) >> 5;
-#endif
-
- SECOND_PASS:
-        if (TwoPass) {
-            (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn,
-                                                            (FirstPass) ? bg :
-                                                            fg, -1, rop,
-                                                            planemask);
-            StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
-        }
-
-        h = pBox->y2 - pBox->y1;
-        flag = (infoRec->CPUToScreenColorExpandFillFlags
-                & CPU_TRANSFER_PAD_QWORD) && ((dwords * h) & 0x01);
-
-        (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, pBox->x1,
-                                                          pBox->y1,
-                                                          pBox->x2 - pBox->x1,
-                                                          h, 0);
-
-        base = (CARD32 *) infoRec->ColorExpandBase;
-
-        srcy = (pBox->y1 - yorg) % stippleheight;
-        if (srcy < 0)
-            srcy += stippleheight;
-        srcx = (pBox->x1 - xorg) % stipplewidth;
-        if (srcx < 0)
-            srcx += stipplewidth;
-
-        srcp = (srcwidth * srcy) + src;
-
-#ifndef FIXEDBASE
-        if ((dwords * h) <= infoRec->ColorExpandRange) {
-            while (h--) {
-                base =
-                    (*StippleFunc) (base, (CARD32 *) srcp, srcx, stipplewidth,
-                                    dwords);
-                srcy++;
-                srcp += srcwidth;
-                if (srcy >= stippleheight) {
-                    srcy = 0;
-                    srcp = src;
-                }
-            }
-        }
-        else
-#endif
-            while (h--) {
-                (*StippleFunc) (base, (CARD32 *) srcp, srcx, stipplewidth,
-                                dwords);
-                srcy++;
-                srcp += srcwidth;
-                if (srcy >= stippleheight) {
-                    srcy = 0;
-                    srcp = src;
-                }
-            }
-
-        if (flag) {
-            base = (CARD32 *) infoRec->ColorExpandBase;
-            base[0] = 0x00000000;
-        }
-
-        if (TwoPass) {
-            if (FirstPass) {
-                FirstPass = FALSE;
-                goto SECOND_PASS;
-            }
-            else
-                FirstPass = TRUE;
-        }
-
-        pBox++;
-    }
-
-    if (infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
-        (*infoRec->Sync) (pScrn);
-    else
-        SET_SYNC_FLAG(infoRec);
-}
-
-void
-#ifdef TRIPLE_BITS
- EXPNAME(XAAFillColorExpandSpans3) (
-#else
- EXPNAME(XAAFillColorExpandSpans) (
-#endif
-                                      ScrnInfoPtr pScrn,
-                                      int fg, int bg, int rop,
-                                      unsigned int planemask,
-                                      int n,
-                                      DDXPointPtr ppt,
-                                      int *pwidth,
-                                      int fSorted,
-                                      int xorg, int yorg, PixmapPtr pPix) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    CARD32 *base;
-    Bool TwoPass = FALSE, FirstPass = TRUE;
-    StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
-    int stipplewidth = pPix->drawable.width;
-    int stippleheight = pPix->drawable.height;
-    int dwords, srcy, srcx, funcNo = 2;
-    unsigned char *srcp;
-
-    if (stipplewidth <= 32) {
-        if (stipplewidth & (stipplewidth - 1))
-            funcNo = 1;
-        else
-            funcNo = 0;
-    }
-    StippleFunc = stipple_scanline_func[funcNo];
-    SecondFunc = stipple_scanline_func[funcNo];
-    FirstFunc = stipple_scanline_func[funcNo + 3];
-
-#ifdef TRIPLE_BITS
-    if ((bg == -1) ||
-        (!(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) &&
-         (!(infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
-          (CHECK_RGB_EQUAL(bg))))) {
-#else
-    if ((bg == -1) ||
-        !(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
-        /* one pass */
-    }
-    else if ((rop == GXcopy) && infoRec->FillSolidSpans) {
-        /* one pass but we fill background rects first */
-        (*infoRec->FillSolidSpans) (pScrn, bg, rop, planemask, n, ppt, pwidth,
-                                    fSorted);
-        bg = -1;
-    }
-    else {
-        /* gotta do two passes */
-        TwoPass = TRUE;
-    }
-
-    if (!TwoPass)
-        (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                        planemask);
-
-    while (n--) {
-#ifdef TRIPLE_BITS
-        dwords = (3 * *pwidth + 31) >> 5;
-#else
-        dwords = (*pwidth + 31) >> 5;
-#endif
-
-        srcy = (ppt->y - yorg) % stippleheight;
-        if (srcy < 0)
-            srcy += stippleheight;
-        srcx = (ppt->x - xorg) % stipplewidth;
-        if (srcx < 0)
-            srcx += stipplewidth;
-
-        srcp = (pPix->devKind * srcy) + (unsigned char *) pPix->devPrivate.ptr;
-
- SECOND_PASS:
-        if (TwoPass) {
-            (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn,
-                                                            (FirstPass) ? bg :
-                                                            fg, -1, rop,
-                                                            planemask);
-            StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
-        }
-
-        (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, ppt->x, ppt->y,
-                                                          *pwidth, 1, 0);
-
-        base = (CARD32 *) infoRec->ColorExpandBase;
-
-        (*StippleFunc) (base, (CARD32 *) srcp, srcx, stipplewidth, dwords);
-
-        if ((infoRec->CPUToScreenColorExpandFillFlags & CPU_TRANSFER_PAD_QWORD)
-            && (dwords & 0x01)) {
-            base = (CARD32 *) infoRec->ColorExpandBase;
-            base[0] = 0x00000000;
-        }
-
-        if (TwoPass) {
-            if (FirstPass) {
-                FirstPass = FALSE;
-                goto SECOND_PASS;
-            }
-            else
-                FirstPass = TRUE;
-        }
-
-        ppt++;
-        pwidth++;
-    }
-
-    if (infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
-        (*infoRec->Sync) (pScrn);
-    else
-        SET_SYNC_FLAG(infoRec);
-}
-
-#ifndef FIXEDBASE
-
-void
-#ifdef TRIPLE_BITS
- EXPNAME(XAAFillScanlineColorExpandRects3) (
-#else
- EXPNAME(XAAFillScanlineColorExpandRects) (
-#endif
-                                              ScrnInfoPtr pScrn,
-                                              int fg, int bg, int rop,
-                                              unsigned int planemask,
-                                              int nBox,
-                                              BoxPtr pBox,
-                                              int xorg, int yorg,
-                                              PixmapPtr pPix) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    CARD32 *base;
-    Bool TwoPass = FALSE, FirstPass = TRUE;
-    StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
-    int stipplewidth = pPix->drawable.width;
-    int stippleheight = pPix->drawable.height;
-    int srcwidth = pPix->devKind;
-    int dwords, srcy, srcx, funcNo = 2, bufferNo, h;
-    unsigned char *src = pPix->devPrivate.ptr;
-    unsigned char *srcp;
-
-    if (stipplewidth <= 32) {
-        if (stipplewidth & (stipplewidth - 1))
-            funcNo = 1;
-        else
-            funcNo = 0;
-    }
-    StippleFunc = stipple_scanline_func[funcNo];
-    SecondFunc = stipple_scanline_func[funcNo];
-    FirstFunc = stipple_scanline_func[funcNo + 3];
-
-#ifdef TRIPLE_BITS
-    if ((bg == -1) ||
-        (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)
-         && (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
-             (CHECK_RGB_EQUAL(bg))))) {
-#else
-    if ((bg == -1) ||
-        !(infoRec->
-          ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
-        /* one pass */
-    }
-    else if ((rop == GXcopy) && infoRec->FillSolidRects) {
-        /* one pass but we fill background rects first */
-        (*infoRec->FillSolidRects) (pScrn, bg, rop, planemask, nBox, pBox);
-        bg = -1;
-    }
-    else {
-        /* gotta do two passes */
-        TwoPass = TRUE;
-    }
-
-    if (!TwoPass)
-        (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg,
-                                                                rop, planemask);
-
-    while (nBox--) {
-#ifdef TRIPLE_BITS
-        dwords = (3 * (pBox->x2 - pBox->x1) + 31) >> 5;
-#else
-        dwords = (pBox->x2 - pBox->x1 + 31) >> 5;
-#endif
-
- SECOND_PASS:
-        if (TwoPass) {
-            (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn,
-                                                                    (FirstPass)
-                                                                    ? bg : fg,
-                                                                    -1, rop,
-                                                                    planemask);
-            StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
-        }
-
-        h = pBox->y2 - pBox->y1;
-
-        (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn,
-                                                                  pBox->x1,
-                                                                  pBox->y1,
-                                                                  pBox->x2 -
-                                                                  pBox->x1, h,
-                                                                  0);
-
-        bufferNo = 0;
-
-        srcy = (pBox->y1 - yorg) % stippleheight;
-        if (srcy < 0)
-            srcy += stippleheight;
-        srcx = (pBox->x1 - xorg) % stipplewidth;
-        if (srcx < 0)
-            srcx += stipplewidth;
-
-        srcp = (srcwidth * srcy) + src;
-
-        while (h--) {
-            base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo];
-            (*StippleFunc) (base, (CARD32 *) srcp, srcx, stipplewidth, dwords);
-            (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++);
-            if (bufferNo >= infoRec->NumScanlineColorExpandBuffers)
-                bufferNo = 0;
-            srcy++;
-            srcp += srcwidth;
-            if (srcy >= stippleheight) {
-                srcy = 0;
-                srcp = src;
-            }
-        }
-
-        if (TwoPass) {
-            if (FirstPass) {
-                FirstPass = FALSE;
-                goto SECOND_PASS;
-            }
-            else
-                FirstPass = TRUE;
-        }
-
-        pBox++;
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-#ifdef TRIPLE_BITS
- EXPNAME(XAAFillScanlineColorExpandSpans3) (
-#else
- EXPNAME(XAAFillScanlineColorExpandSpans) (
-#endif
-                                              ScrnInfoPtr pScrn,
-                                              int fg, int bg, int rop,
-                                              unsigned int planemask,
-                                              int n,
-                                              DDXPointPtr ppt,
-                                              int *pwidth,
-                                              int fSorted,
-                                              int xorg, int yorg,
-                                              PixmapPtr pPix) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    CARD32 *base;
-    Bool TwoPass = FALSE, FirstPass = TRUE;
-    StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
-    int stipplewidth = pPix->drawable.width;
-    int stippleheight = pPix->drawable.height;
-    int dwords, srcy, srcx, funcNo = 2;
-    unsigned char *srcp;
-
-    if (stipplewidth <= 32) {
-        if (stipplewidth & (stipplewidth - 1))
-            funcNo = 1;
-        else
-            funcNo = 0;
-    }
-    StippleFunc = stipple_scanline_func[funcNo];
-    SecondFunc = stipple_scanline_func[funcNo];
-    FirstFunc = stipple_scanline_func[funcNo + 3];
-
-#ifdef TRIPLE_BITS
-    if ((bg == -1) ||
-        (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)
-         && (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
-             (CHECK_RGB_EQUAL(bg))))) {
-#else
-    if ((bg == -1) ||
-        !(infoRec->
-          ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
-        /* one pass */
-    }
-    else if ((rop == GXcopy) && infoRec->FillSolidSpans) {
-        /* one pass but we fill background rects first */
-        (*infoRec->FillSolidSpans) (pScrn, bg, rop, planemask, n, ppt, pwidth,
-                                    fSorted);
-        bg = -1;
-    }
-    else {
-        /* gotta do two passes */
-        TwoPass = TRUE;
-    }
-
-    if (!TwoPass)
-        (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg,
-                                                                rop, planemask);
-
-    while (n--) {
-#ifdef TRIPLE_BITS
-        dwords = (3 * *pwidth + 31) >> 5;
-#else
-        dwords = (*pwidth + 31) >> 5;
-#endif
-
-        srcy = (ppt->y - yorg) % stippleheight;
-        if (srcy < 0)
-            srcy += stippleheight;
-        srcx = (ppt->x - xorg) % stipplewidth;
-        if (srcx < 0)
-            srcx += stipplewidth;
-
-        srcp = (pPix->devKind * srcy) + (unsigned char *) pPix->devPrivate.ptr;
-
- SECOND_PASS:
-        if (TwoPass) {
-            (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn,
-                                                                    (FirstPass)
-                                                                    ? bg : fg,
-                                                                    -1, rop,
-                                                                    planemask);
-            StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
-        }
-
-        (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, ppt->x,
-                                                                  ppt->y,
-                                                                  *pwidth, 1,
-                                                                  0);
-
-        base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[0];
-
-        (*StippleFunc) (base, (CARD32 *) srcp, srcx, stipplewidth, dwords);
-        (*infoRec->SubsequentColorExpandScanline) (pScrn, 0);
-
-        if (TwoPass) {
-            if (FirstPass) {
-                FirstPass = FALSE;
-                goto SECOND_PASS;
-            }
-            else
-                FirstPass = TRUE;
-        }
-
-        ppt++;
-        pwidth++;
-    }
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-#endif
-
-static CARD32 *
-StipplePowerOfTwo(CARD32 *dest, CARD32 *src, int shift, int width, int dwords)
-{
-    CARD32 pat = *src;
-
-    if (width < 32) {
-        pat &= XAAShiftMasks[width];
-        while (width < 32) {
-            pat |= SHIFT_L(pat, width);
-            width <<= 1;
-        }
-    }
-
-    if (shift)
-        pat = SHIFT_R(pat, shift) | SHIFT_L(pat, 32 - shift);
-
-#ifdef MSBFIRST
-    pat = SWAP_BITS_IN_BYTES(pat);
-#endif
-
-#ifdef TRIPLE_BITS
-    {
-        EXPAND_PAT;
-
-        while (dwords >= 3) {
-            WRITE_PAT3;
-            dwords -= 3;
-        }
-        if (dwords == 2) {
-            WRITE_PAT2;
-        }
-        else if (dwords == 1) {
-            WRITE_PAT1;
-        }
-
-        return dest;
-    }
-#else                           /* TRIPLE_BITS */
-    while (dwords >= 4) {
-        DEST(0) = pat;
-        DEST(1) = pat;
-        DEST(2) = pat;
-        DEST(3) = pat;
-        dwords -= 4;
-#ifndef FIXEDBASE
-        dest += 4;
-#endif
-    }
-
-    if (!dwords)
-        return dest;
-    DEST(0) = pat;
-    if (dwords == 1)
-        RETURN(1);
-    DEST(1) = pat;
-    if (dwords == 2)
-        RETURN(2);
-    DEST(2) = pat;
-    RETURN(3);
-#endif                          /* TRIPLE_BITS */
-}
-
-static CARD32 *
-StipplePowerOfTwo_Inverted(CARD32 *dest, CARD32 *src,
-                           int shift, int width, int dwords)
-{
-    CARD32 pat = *src;
-
-    if (width < 32) {
-        pat &= XAAShiftMasks[width];
-        while (width < 32) {
-            pat |= SHIFT_L(pat, width);
-            width <<= 1;
-        }
-    }
-
-    if (shift)
-        pat = SHIFT_R(pat, shift) | SHIFT_L(pat, 32 - shift);
-
-#ifdef MSBFIRST
-    pat = SWAP_BITS_IN_BYTES(pat);
-#endif
-
-    pat = ~pat;
-
-#ifdef TRIPLE_BITS
-    {
-        EXPAND_PAT;
-
-        while (dwords >= 3) {
-            WRITE_PAT3;
-            dwords -= 3;
-        }
-        if (dwords == 2) {
-            WRITE_PAT2;
-        }
-        else if (dwords == 1) {
-            WRITE_PAT1;
-        }
-
-        return dest;
-    }
-#else                           /* TRIPLE_BITS */
-    while (dwords >= 4) {
-        DEST(0) = pat;
-        DEST(1) = pat;
-        DEST(2) = pat;
-        DEST(3) = pat;
-        dwords -= 4;
-#ifndef FIXEDBASE
-        dest += 4;
-#endif
-    }
-
-    if (!dwords)
-        return dest;
-    DEST(0) = pat;
-    if (dwords == 1)
-        RETURN(1);
-    DEST(1) = pat;
-    if (dwords == 2)
-        RETURN(2);
-    DEST(2) = pat;
-    RETURN(3);
-#endif                          /* TRIPLE_BITS */
-}
-
-static CARD32 *
-StippleUpTo32(CARD32 *base, CARD32 *src, int shift, int width, int dwords)
-{
-    CARD32 pat = *src & XAAShiftMasks[width];
-
-    while (width <= 15) {
-        pat |= SHIFT_L(pat, width);
-        width <<= 1;
-    }
-    pat |= SHIFT_L(pat, width);
-
-    while (dwords--) {
-        CARD32 bits = SHIFT_R(pat, shift) | SHIFT_L(pat, width - shift);
-
-#ifdef TRIPLE_BITS
-        if (dwords >= 2) {
-            WRITE_BITS3(bits);
-            dwords -= 2;
-        }
-        else if (dwords > 0) {
-            WRITE_BITS2(bits);
-            dwords--;
-        }
-        else {
-            WRITE_BITS1(bits);
-        }
-#else
-        WRITE_BITS(bits);
-#endif
-
-        shift += 32;
-        shift %= width;
-    }
-    return base;
-}
-
-static CARD32 *
-StippleUpTo32_Inverted(CARD32 *base, CARD32 *src,
-                       int shift, int width, int dwords)
-{
-    CARD32 pat = *src & XAAShiftMasks[width];
-
-    while (width <= 15) {
-        pat |= SHIFT_L(pat, width);
-        width <<= 1;
-    }
-    pat |= SHIFT_L(pat, width);
-
-    while (dwords--) {
-        CARD32 bits = ~(SHIFT_R(pat, shift) | SHIFT_L(pat, width - shift));
-
-#ifdef TRIPLE_BITS
-        if (dwords >= 2) {
-            WRITE_BITS3(bits);
-            dwords -= 2;
-        }
-        else if (dwords > 0) {
-            WRITE_BITS2(bits);
-            dwords--;
-        }
-        else {
-            WRITE_BITS1(bits);
-        }
-#else
-        WRITE_BITS(bits);
-#endif
-
-        shift += 32;
-        shift %= width;
-    }
-    return base;
-}
-
-static CARD32 *
-StippleOver32(CARD32 *base, CARD32 *src, int offset, int width, int dwords)
-{
-    CARD32 *srcp;
-    CARD32 bits;
-    int bitsleft, shift, usable;
-
-    while (dwords--) {
-        bitsleft = width - offset;
-        srcp = src + (offset >> 5);
-        shift = offset & 31;
-        usable = 32 - shift;
-
-        if (bitsleft < 32) {
-            if (bitsleft <= usable) {
-                bits = SHIFT_L(*src, bitsleft) |
-                    (SHIFT_R(*srcp, shift) & XAAShiftMasks[bitsleft]);
-            }
-            else {
-                bits = SHIFT_L(*src, bitsleft) |
-                    (SHIFT_L(srcp[1], usable) & XAAShiftMasks[bitsleft]) |
-                    (SHIFT_R(*srcp, shift) & XAAShiftMasks[usable]);
-            }
-        }
-        else if (shift)
-            bits = SHIFT_R(*srcp, shift) | SHIFT_L(srcp[1], usable);
-        else
-            bits = *srcp;
-
-#ifdef TRIPLE_BITS
-        if (dwords >= 2) {
-            WRITE_BITS3(bits);
-            dwords -= 2;
-        }
-        else if (dwords > 0) {
-            WRITE_BITS2(bits);
-            dwords--;
-        }
-        else {
-            WRITE_BITS1(bits);
-        }
-#else
-        WRITE_BITS(bits);
-#endif
-
-        offset += 32;
-        offset %= width;
-    }
-    return base;
-}
-
-static CARD32 *
-StippleOver32_Inverted(CARD32 *base, CARD32 *src,
-                       int offset, int width, int dwords)
-{
-    CARD32 *srcp;
-    CARD32 bits;
-    int bitsleft, shift, usable;
-
-    while (dwords--) {
-        bitsleft = width - offset;
-        srcp = src + (offset >> 5);
-        shift = offset & 31;
-        usable = 32 - shift;
-
-        if (bitsleft < 32) {
-            if (bitsleft <= usable) {
-                bits = SHIFT_L(*src, bitsleft) |
-                    (SHIFT_R(*srcp, shift) & XAAShiftMasks[bitsleft]);
-            }
-            else {
-                bits = SHIFT_L(*src, bitsleft) |
-                    (SHIFT_L(srcp[1], usable) & XAAShiftMasks[bitsleft]) |
-                    (SHIFT_R(*srcp, shift) & XAAShiftMasks[usable]);
-            }
-        }
-        else if (shift)
-            bits = SHIFT_R(*srcp, shift) | SHIFT_L(srcp[1], usable);
-        else
-            bits = *srcp;
-
-        bits = ~bits;
-
-#ifdef TRIPLE_BITS
-        if (dwords >= 2) {
-            WRITE_BITS3(bits);
-            dwords -= 2;
-        }
-        else if (dwords > 0) {
-            WRITE_BITS2(bits);
-            dwords--;
-        }
-        else {
-            WRITE_BITS1(bits);
-        }
-#else
-        WRITE_BITS(bits);
-#endif
-
-        offset += 32;
-        offset %= width;
-    }
-    return base;
-}
diff --git a/hw/xfree86/xaa/xaaTEGlyph.c b/hw/xfree86/xaa/xaaTEGlyph.c
deleted file mode 100644 (file)
index 2926c1d..0000000
+++ /dev/null
@@ -1,1083 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaacexp.h"
-#include "xf86.h"
-
-/* scanline function for TRIPLE_BITS_24BPP */
-static CARD32 *DrawTextScanline3(CARD32 *base, CARD32 *mem, int width);
-
-/* Loop unrolled functions for common font widths */
-static CARD32 *DrawTETextScanlineGeneric(CARD32 *base, unsigned int **glyphp,
-                                         int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth7(CARD32 *base, unsigned int **glyphp,
-                                        int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth10(CARD32 *base, unsigned int **glyphp,
-                                         int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth12(CARD32 *base, unsigned int **glyphp,
-                                         int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth14(CARD32 *base, unsigned int **glyphp,
-                                         int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth16(CARD32 *base, unsigned int **glyphp,
-                                         int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth18(CARD32 *base, unsigned int **glyphp,
-                                         int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth24(CARD32 *base, unsigned int **glyphp,
-                                         int line, int width, int glyphwidth);
-
-#ifdef USEASSEMBLER
-#ifdef FIXEDBASE
-#ifdef MSBFIRST
-CARD32 *DrawTETextScanlineWidth6PMSBFirstFixedBase(CARD32 *base,
-                                                   unsigned int **glyphp,
-                                                   int line, int width,
-                                                   int glyphwidth);
-CARD32 *DrawTETextScanlineWidth8PMSBFirstFixedBase(CARD32 *base,
-                                                   unsigned int **glyphp,
-                                                   int line, int width,
-                                                   int glyphwidth);
-CARD32 *DrawTETextScanlineWidth9PMSBFirstFixedBase(CARD32 *base,
-                                                   unsigned int **glyphp,
-                                                   int line, int width,
-                                                   int glyphwidth);
-#else
-CARD32 *DrawTETextScanlineWidth6PLSBFirstFixedBase(CARD32 *base,
-                                                   unsigned int **glyphp,
-                                                   int line, int width,
-                                                   int glyphwidth);
-CARD32 *DrawTETextScanlineWidth8PLSBFirstFixedBase(CARD32 *base,
-                                                   unsigned int **glyphp,
-                                                   int line, int width,
-                                                   int glyphwidth);
-CARD32 *DrawTETextScanlineWidth9PLSBFirstFixedBase(CARD32 *base,
-                                                   unsigned int **glyphp,
-                                                   int line, int width,
-                                                   int glyphwidth);
-#endif
-#else
-#ifdef MSBFIRST
-CARD32 *DrawTETextScanlineWidth6PMSBFirst(CARD32 *base, unsigned int **glyphp,
-                                          int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth8PMSBFirst(CARD32 *base, unsigned int **glyphp,
-                                          int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth9PMSBFirst(CARD32 *base, unsigned int **glyphp,
-                                          int line, int width, int glyphwidth);
-#else
-CARD32 *DrawTETextScanlineWidth6PLSBFirst(CARD32 *base, unsigned int **glyphp,
-                                          int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth8PLSBFirst(CARD32 *base, unsigned int **glyphp,
-                                          int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth9PLSBFirst(CARD32 *base, unsigned int **glyphp,
-                                          int line, int width, int glyphwidth);
-#endif
-#endif
-#else
-static CARD32 *DrawTETextScanlineWidth6(CARD32 *base, unsigned int **glyphp,
-                                        int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth8(CARD32 *base, unsigned int **glyphp,
-                                        int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth9(CARD32 *base, unsigned int **glyphp,
-                                        int line, int width, int glyphwidth);
-#endif
-
-#define glyph_scanline_func EXPNAME(XAAGlyphScanlineFunc)
-#define glyph_get_scanline_func EXPNAME(XAAGetGlyphScanlineFunc)
-
-GlyphScanlineFuncPtr glyph_scanline_func[32] = {
-    DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
-    DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
-    DrawTETextScanlineGeneric,
-#ifdef USEASSEMBLER
-#ifdef FIXEDBASE
-#ifdef MSBFIRST
-    DrawTETextScanlineWidth6PMSBFirstFixedBase,
-    DrawTETextScanlineWidth7,
-    DrawTETextScanlineWidth8PMSBFirstFixedBase,
-    DrawTETextScanlineWidth9PMSBFirstFixedBase,
-#else
-    DrawTETextScanlineWidth6PLSBFirstFixedBase,
-    DrawTETextScanlineWidth7,
-    DrawTETextScanlineWidth8PLSBFirstFixedBase,
-    DrawTETextScanlineWidth9PLSBFirstFixedBase,
-#endif
-#else
-#ifdef MSBFIRST
-    DrawTETextScanlineWidth6PMSBFirst,
-    DrawTETextScanlineWidth7,
-    DrawTETextScanlineWidth8PMSBFirst,
-    DrawTETextScanlineWidth9PMSBFirst,
-#else
-    DrawTETextScanlineWidth6PLSBFirst,
-    DrawTETextScanlineWidth7,
-    DrawTETextScanlineWidth8PLSBFirst,
-    DrawTETextScanlineWidth9PLSBFirst,
-#endif
-#endif
-#else
-    DrawTETextScanlineWidth6, DrawTETextScanlineWidth7,
-    DrawTETextScanlineWidth8, DrawTETextScanlineWidth9,
-#endif
-    DrawTETextScanlineWidth10,
-    DrawTETextScanlineGeneric, DrawTETextScanlineWidth12,
-    DrawTETextScanlineGeneric, DrawTETextScanlineWidth14,
-    DrawTETextScanlineGeneric, DrawTETextScanlineWidth16,
-    DrawTETextScanlineGeneric, DrawTETextScanlineWidth18,
-    DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
-    DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
-    DrawTETextScanlineGeneric, DrawTETextScanlineWidth24,
-    DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
-    DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
-    DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
-    DrawTETextScanlineGeneric, DrawTETextScanlineGeneric
-};
-
-GlyphScanlineFuncPtr *
-glyph_get_scanline_func(void)
-{
-    return glyph_scanline_func;
-}
-
-/********************************************************************
-
-   Here we have TEGlyphRenders for a bunch of different color
-   expansion types.  The driver may provide its own renderer, but
-   this is the default one which renders using lower-level primitives
-   exported by the chipset driver.
-
-********************************************************************/
-
-/* This gets built for MSBFIRST or LSBFIRST with FIXEDBASE or not.
-       A total of 4 versions */
-
-void
-
-EXPNAME(XAATEGlyphRenderer) (ScrnInfoPtr pScrn,
-                             int x, int y, int w, int h, int skipleft,
-                             int startline, unsigned int **glyphs,
-                             int glyphWidth, int fg, int bg, int rop,
-                             unsigned planemask) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    CARD32 *base;
-    GlyphScanlineFuncPtr GlyphFunc = glyph_scanline_func[glyphWidth - 1];
-    int dwords = 0;
-
-    if ((bg != -1) && (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
-        (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask);
-        (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h);
-        bg = -1;
-    }
-
-    (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                    planemask);
-
-    if (skipleft &&
-        (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING) ||
-         (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
-          (skipleft > x)))) {
-        /* draw the first character only */
-
-        int count = h, line = startline;
-        int width = glyphWidth - skipleft;
-
-        if (width > w)
-            width = w;
-
-        (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, x, y, width, h,
-                                                          0);
-
-        base = (CARD32 *) infoRec->ColorExpandBase;
-
-        while (count--) {
-            register CARD32 tmp = SHIFT_R(glyphs[0][line++], skipleft);
-
-            WRITE_BITS(tmp);
-        }
-
-        w -= width;
-        if ((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
-            ((((width + 31) >> 5) * h) & 1)) {
-            base = (CARD32 *) infoRec->ColorExpandBase;
-            base[0] = 0x00000000;
-        }
-        if (!w)
-            goto THE_END;
-        glyphs++;
-        x += width;
-        skipleft = 0;           /* nicely aligned again */
-    }
-
-    w += skipleft;
-    x -= skipleft;
-    dwords = ((w + 31) >> 5) * h;
-
-    (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, x, y, w, h,
-                                                      skipleft);
-
-    base = (CARD32 *) infoRec->ColorExpandBase;
-
-#ifndef FIXEDBASE
-    if ((((w + 31) >> 5) * h) <= infoRec->ColorExpandRange)
-        while (h--) {
-            base = (*GlyphFunc) (base, glyphs, startline++, w, glyphWidth);
-        }
-    else
-#endif
-        while (h--) {
-            (*GlyphFunc) (base, glyphs, startline++, w, glyphWidth);
-        }
-
-    if ((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
-        (dwords & 1)) {
-        base = (CARD32 *) infoRec->ColorExpandBase;
-        base[0] = 0x00000000;
-    }
-
- THE_END:
-
-    if (infoRec->TEGlyphRendererFlags & SYNC_AFTER_COLOR_EXPAND)
-        (*infoRec->Sync) (pScrn);
-    else
-        SET_SYNC_FLAG(infoRec);
-}
-
-/********************************************************************
-   This is the GlyphRenderer for TRIPLE_BITS_24BPP. It renders to a buffer
-   with the non FIXEDBASE LSB_FIRST code before tripling, and possibly
-   reversing the bits and sending them to the screen
-
-********************************************************************/
-
-void
-
-EXPNAME(XAATEGlyphRenderer3) (ScrnInfoPtr pScrn,
-                              int x, int y, int w, int h, int skipleft,
-                              int startline, unsigned int **glyphs,
-                              int glyphWidth, int fg, int bg, int rop,
-                              unsigned planemask) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    CARD32 *base, *mem;
-    GlyphScanlineFuncPtr GlyphFunc =
-        XAAGlyphScanlineFuncLSBFirst[glyphWidth - 1];
-    int dwords = 0;
-
-    if ((bg != -1) &&
-        ((infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY) ||
-         ((infoRec->TEGlyphRendererFlags & RGB_EQUAL) &&
-          (!CHECK_RGB_EQUAL(bg))))) {
-        (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask);
-        (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h);
-        bg = -1;
-    }
-
-    (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                    planemask);
-
-    if (skipleft) {
-        /* draw the first character only */
-
-        int count = h, line = startline;
-        int width = glyphWidth - skipleft;
-        CARD32 bits;
-
-        if (width > w)
-            width = w;
-        (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, x, y, width, h,
-                                                          0);
-
-        base = (CARD32 *) infoRec->ColorExpandBase;
-
-        while (count--) {
-            bits = SHIFT_R(glyphs[0][line++], skipleft);
-            if (width >= 22) {
-                WRITE_BITS3(bits);
-            }
-            else if (width >= 11) {
-                WRITE_BITS2(bits);
-            }
-            else {
-                WRITE_BITS1(bits);
-            }
-        }
-
-        w -= width;
-        if ((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
-            ((((3 * width + 31) >> 5) * h) & 1)) {
-            base = (CARD32 *) infoRec->ColorExpandBase;
-            base[0] = 0x00000000;
-        }
-        if (!w)
-            goto THE_END;
-        glyphs++;
-        x += width;
-        skipleft = 0;           /* nicely aligned again */
-    }
-
-    dwords = ((3 * w + 31) >> 5) * h;
-    mem = (CARD32 *) malloc(((w + 31) >> 3) * sizeof(char));
-    if (!mem)
-        return;
-
-    (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, x, y, w, h, 0);
-
-    base = (CARD32 *) infoRec->ColorExpandBase;
-
-#ifndef FIXEDBASE
-    if ((((3 * w + 31) >> 5) * h) <= infoRec->ColorExpandRange)
-        while (h--) {
-            (*GlyphFunc) (mem, glyphs, startline++, w, glyphWidth);
-            base = DrawTextScanline3(base, mem, w);
-        }
-    else
-#endif
-        while (h--) {
-            (*GlyphFunc) (mem, glyphs, startline++, w, glyphWidth);
-            DrawTextScanline3(base, mem, w);
-        }
-
-    free(mem);
-
-    if ((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
-        (dwords & 1)) {
-        base = (CARD32 *) infoRec->ColorExpandBase;
-        base[0] = 0x00000000;
-    }
-
- THE_END:
-
-    if (infoRec->TEGlyphRendererFlags & SYNC_AFTER_COLOR_EXPAND)
-        (*infoRec->Sync) (pScrn);
-    else
-        SET_SYNC_FLAG(infoRec);
-}
-
-#ifndef FIXEDBASE
-/*  Scanline version of above gets built for LSBFIRST and MSBFIRST */
-
-void
-
-EXPNAME(XAATEGlyphRendererScanline) (ScrnInfoPtr pScrn,
-                                     int x, int y, int w, int h, int skipleft,
-                                     int startline, unsigned int **glyphs,
-                                     int glyphWidth, int fg, int bg, int rop,
-                                     unsigned planemask) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int bufferNo;
-    CARD32 *base;
-    GlyphScanlineFuncPtr GlyphFunc = glyph_scanline_func[glyphWidth - 1];
-
-    if ((bg != -1) && (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
-        (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask);
-        (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h);
-        bg = -1;
-    }
-
-    (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                            planemask);
-
-    if (skipleft &&
-        (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING) ||
-         (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
-          (skipleft > x)))) {
-        /* draw the first character only */
-
-        int count = h, line = startline;
-        int width = glyphWidth - skipleft;
-
-        if (width > w)
-            width = w;
-
-        (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, x, y,
-                                                                  width, h, 0);
-
-        bufferNo = 0;
-
-        while (count--) {
-            register CARD32 tmp = SHIFT_R(glyphs[0][line++], skipleft);
-
-            base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo];
-            WRITE_BITS(tmp);
-            (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++);
-            if (bufferNo >= infoRec->NumScanlineColorExpandBuffers)
-                bufferNo = 0;
-        }
-
-        w -= width;
-        if (!w)
-            goto THE_END;
-        glyphs++;
-        x += width;
-        skipleft = 0;           /* nicely aligned again */
-    }
-
-    w += skipleft;
-    x -= skipleft;
-
-    (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, x, y, w, h,
-                                                              skipleft);
-
-    bufferNo = 0;
-
-    while (h--) {
-        base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo];
-        (*GlyphFunc) (base, glyphs, startline++, w, glyphWidth);
-        (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++);
-        if (bufferNo >= infoRec->NumScanlineColorExpandBuffers)
-            bufferNo = 0;
-    }
-
- THE_END:
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-void
-
-EXPNAME(XAATEGlyphRendererScanline3) (ScrnInfoPtr pScrn,
-                                      int x, int y, int w, int h, int skipleft,
-                                      int startline, unsigned int **glyphs,
-                                      int glyphWidth, int fg, int bg, int rop,
-                                      unsigned planemask) {
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int bufferNo;
-    CARD32 *base, *mem;
-    GlyphScanlineFuncPtr GlyphFunc =
-        XAAGlyphScanlineFuncLSBFirst[glyphWidth - 1];
-
-    if ((bg != -1) &&
-        ((infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY) ||
-         ((infoRec->TEGlyphRendererFlags & RGB_EQUAL) &&
-          (!CHECK_RGB_EQUAL(bg))))) {
-        (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask);
-        (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h);
-        bg = -1;
-    }
-
-    (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg, rop,
-                                                            planemask);
-
-    if (skipleft) {
-        /* draw the first character only */
-
-        int count = h, line = startline;
-        int width = glyphWidth - skipleft;
-        CARD32 bits;
-
-        if (width > w)
-            width = w;
-
-        (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, x, y,
-                                                                  width, h, 0);
-
-        bufferNo = 0;
-
-        while (count--) {
-            base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo];
-            bits = SHIFT_R(glyphs[0][line++], skipleft);
-            if (width >= 22) {
-                WRITE_BITS3(bits);
-            }
-            else if (width >= 11) {
-                WRITE_BITS2(bits);
-            }
-            else {
-                WRITE_BITS1(bits);
-            }
-            (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++);
-            if (bufferNo >= infoRec->NumScanlineColorExpandBuffers)
-                bufferNo = 0;
-        }
-
-        w -= width;
-        if (!w)
-            goto THE_END;
-        glyphs++;
-        x += width;
-        skipleft = 0;           /* nicely aligned again */
-    }
-
-    w += skipleft;
-    x -= skipleft;
-    mem = (CARD32 *) malloc(((w + 31) >> 3) * sizeof(char));
-    if (!mem)
-        return;
-
-    (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, x, y, w, h,
-                                                              skipleft);
-
-    bufferNo = 0;
-
-    while (h--) {
-        base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo];
-        (*GlyphFunc) (mem, glyphs, startline++, w, glyphWidth);
-        DrawTextScanline3(base, mem, w);
-        (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++);
-        if (bufferNo >= infoRec->NumScanlineColorExpandBuffers)
-            bufferNo = 0;
-    }
-
-    free(mem);
-
- THE_END:
-
-    SET_SYNC_FLAG(infoRec);
-}
-
-#endif
-
-/********************************************************************
-
-   TRIPLE_BITS_24BPP scanline rendering code.
-
-********************************************************************/
-
-static CARD32 *
-DrawTextScanline3(CARD32 *base, CARD32 *mem, int width)
-{
-
-    while (width > 32) {
-        WRITE_BITS3(*mem);
-        mem++;
-        width -= 32;
-    }
-    if (width) {
-        if (width >= 22) {
-            WRITE_BITS3(*mem);
-        }
-        else if (width >= 11) {
-            WRITE_BITS2(*mem);
-        }
-        else {
-            WRITE_BITS1(*mem);
-        }
-    }
-
-    return base;
-}
-
-/********************************************************************
-
-   Generic TE scanline rendering code.
-
-********************************************************************/
-
-static CARD32 *
-DrawTETextScanlineGeneric(CARD32 *base,
-                          unsigned int **glyphp,
-                          int line, int width, int glyphwidth)
-{
-    CARD32 bits = (*glyphp)[line];
-    int shift = glyphwidth;
-
-    while (width > 32) {
-        while (shift < 32) {
-            glyphp++;
-            bits |= SHIFT_L((*glyphp)[line], shift);
-            shift += glyphwidth;
-        }
-        WRITE_BITS(bits);
-        shift &= 31;
-        if (shift)
-            bits = SHIFT_R((*glyphp)[line], (glyphwidth - shift));
-        else
-            bits = 0;
-        width -= 32;
-    }
-
-    if (width) {
-        width -= shift;
-        while (width > 0) {
-            glyphp++;
-            bits |= SHIFT_L((*glyphp)[line], shift);
-            shift += glyphwidth;
-            width -= glyphwidth;
-        }
-        WRITE_BITS(bits);
-    }
-
-    return base;
-}
-
-/********************************************************************
-
-   Loop unrolled TE font scanline rendering code
-
-********************************************************************/
-
-#ifndef USEASSEMBLER
-static CARD32 *
-DrawTETextScanlineWidth6(CARD32 *base,
-                         unsigned int **glyphp,
-                         int line, int width, int glyphwidth)
-{
-    while (1) {
-        unsigned int bits;
-
-        bits = glyphp[0][line];
-        bits |= SHIFT_L(glyphp[1][line], 6);
-        bits |= SHIFT_L(glyphp[2][line], 12);
-        bits |= SHIFT_L(glyphp[3][line], 18);
-        bits |= SHIFT_L(glyphp[4][line], 24);
-        bits |= SHIFT_L(glyphp[5][line], 30);
-        WRITE_IN_BITORDER(base, 0, bits);
-        CHECKRETURN(1);
-        bits = SHIFT_R(glyphp[5][line], 2);
-        bits |= SHIFT_L(glyphp[6][line], 4);
-        bits |= SHIFT_L(glyphp[7][line], 10);
-        bits |= SHIFT_L(glyphp[8][line], 16);
-        bits |= SHIFT_L(glyphp[9][line], 22);
-        bits |= SHIFT_L(glyphp[10][line], 28);
-        WRITE_IN_BITORDER(base, 1, bits);
-        CHECKRETURN(2);
-        bits = SHIFT_R(glyphp[10][line], 4);
-        bits |= SHIFT_L(glyphp[11][line], 2);
-        bits |= SHIFT_L(glyphp[12][line], 8);
-        bits |= SHIFT_L(glyphp[13][line], 14);
-        bits |= SHIFT_L(glyphp[14][line], 20);
-        bits |= SHIFT_L(glyphp[15][line], 26);
-        WRITE_IN_BITORDER(base, 2, bits);
-        CHECKRETURN(3);
-#ifndef FIXEDBASE
-        base += 3;
-#endif
-        width -= 96;
-        glyphp += 16;
-    }
-    return base;
-}
-#endif
-
-static CARD32 *
-DrawTETextScanlineWidth7(CARD32 *base,
-                         unsigned int **glyphp,
-                         int line, int width, int glyphwidth)
-{
-    while (1) {
-        unsigned int bits;
-
-        bits = glyphp[0][line];
-        bits |= SHIFT_L(glyphp[1][line], 7);
-        bits |= SHIFT_L(glyphp[2][line], 14);
-        bits |= SHIFT_L(glyphp[3][line], 21);
-        bits |= SHIFT_L(glyphp[4][line], 28);
-        WRITE_IN_BITORDER(base, 0, bits);
-        CHECKRETURN(1);
-        bits = SHIFT_R(glyphp[4][line], 4);
-        bits |= SHIFT_L(glyphp[5][line], 3);
-        bits |= SHIFT_L(glyphp[6][line], 10);
-        bits |= SHIFT_L(glyphp[7][line], 17);
-        bits |= SHIFT_L(glyphp[8][line], 24);
-        bits |= SHIFT_L(glyphp[9][line], 31);
-        WRITE_IN_BITORDER(base, 1, bits);
-        CHECKRETURN(2);
-        bits = SHIFT_R(glyphp[9][line], 1);
-        bits |= SHIFT_L(glyphp[10][line], 6);
-        bits |= SHIFT_L(glyphp[11][line], 13);
-        bits |= SHIFT_L(glyphp[12][line], 20);
-        bits |= SHIFT_L(glyphp[13][line], 27);
-        WRITE_IN_BITORDER(base, 2, bits);
-        CHECKRETURN(3);
-        bits = SHIFT_R(glyphp[13][line], 5);
-        bits |= SHIFT_L(glyphp[14][line], 2);
-        bits |= SHIFT_L(glyphp[15][line], 9);
-        bits |= SHIFT_L(glyphp[16][line], 16);
-        bits |= SHIFT_L(glyphp[17][line], 23);
-        bits |= SHIFT_L(glyphp[18][line], 30);
-        WRITE_IN_BITORDER(base, 3, bits);
-        CHECKRETURN(4);
-        bits = SHIFT_R(glyphp[18][line], 2);
-        bits |= SHIFT_L(glyphp[19][line], 5);
-        bits |= SHIFT_L(glyphp[20][line], 12);
-        bits |= SHIFT_L(glyphp[21][line], 19);
-        bits |= SHIFT_L(glyphp[22][line], 26);
-        WRITE_IN_BITORDER(base, 4, bits);
-        CHECKRETURN(5);
-        bits = SHIFT_R(glyphp[22][line], 6);
-        bits |= SHIFT_L(glyphp[23][line], 1);
-        bits |= SHIFT_L(glyphp[24][line], 8);
-        bits |= SHIFT_L(glyphp[25][line], 15);
-        bits |= SHIFT_L(glyphp[26][line], 22);
-        bits |= SHIFT_L(glyphp[27][line], 29);
-        WRITE_IN_BITORDER(base, 5, bits);
-        CHECKRETURN(6);
-        bits = SHIFT_R(glyphp[27][line], 3);
-        bits |= SHIFT_L(glyphp[28][line], 4);
-        bits |= SHIFT_L(glyphp[29][line], 11);
-        bits |= SHIFT_L(glyphp[30][line], 18);
-        bits |= SHIFT_L(glyphp[31][line], 25);
-        WRITE_IN_BITORDER(base, 6, bits);
-        CHECKRETURN(7);
-#ifndef FIXEDBASE
-        base += 7;
-#endif
-        width -= 224;
-        glyphp += 32;
-    }
-    return base;
-}
-
-#ifndef USEASSEMBLER
-static CARD32 *
-DrawTETextScanlineWidth8(CARD32 *base,
-                         unsigned int **glyphp,
-                         int line, int width, int glyphwidth)
-{
-    while (1) {
-        unsigned int bits;
-
-        bits = glyphp[0][line];
-        bits |= SHIFT_L(glyphp[1][line], 8);
-        bits |= SHIFT_L(glyphp[2][line], 16);
-        bits |= SHIFT_L(glyphp[3][line], 24);
-        WRITE_IN_BITORDER(base, 0, bits);
-        CHECKRETURN(1);
-        bits = glyphp[4][line];
-        bits |= SHIFT_L(glyphp[5][line], 8);
-        bits |= SHIFT_L(glyphp[6][line], 16);
-        bits |= SHIFT_L(glyphp[7][line], 24);
-        WRITE_IN_BITORDER(base, 1, bits);
-        CHECKRETURN(2);
-#ifndef FIXEDBASE
-        base += 2;
-#endif
-        width -= 64;
-        glyphp += 8;
-    }
-    return base;
-}
-#endif
-
-#ifndef USEASSEMBLER
-static CARD32 *
-DrawTETextScanlineWidth9(CARD32 *base,
-                         unsigned int **glyphp,
-                         int line, int width, int glyphwidth)
-{
-    while (1) {
-        unsigned int bits;
-
-        bits = glyphp[0][line];
-        bits |= SHIFT_L(glyphp[1][line], 9);
-        bits |= SHIFT_L(glyphp[2][line], 18);
-        bits |= SHIFT_L(glyphp[3][line], 27);
-        WRITE_IN_BITORDER(base, 0, bits);
-        CHECKRETURN(1);
-        bits = SHIFT_R(glyphp[3][line], 5);
-        bits |= SHIFT_L(glyphp[4][line], 4);
-        bits |= SHIFT_L(glyphp[5][line], 13);
-        bits |= SHIFT_L(glyphp[6][line], 22);
-        bits |= SHIFT_L(glyphp[7][line], 31);
-        WRITE_IN_BITORDER(base, 1, bits);
-        CHECKRETURN(2);
-        bits = SHIFT_R(glyphp[7][line], 1);
-        bits |= SHIFT_L(glyphp[8][line], 8);
-        bits |= SHIFT_L(glyphp[9][line], 17);
-        bits |= SHIFT_L(glyphp[10][line], 26);
-        WRITE_IN_BITORDER(base, 2, bits);
-        CHECKRETURN(3);
-        bits = SHIFT_R(glyphp[10][line], 6);
-        bits |= SHIFT_L(glyphp[11][line], 3);
-        bits |= SHIFT_L(glyphp[12][line], 12);
-        bits |= SHIFT_L(glyphp[13][line], 21);
-        bits |= SHIFT_L(glyphp[14][line], 30);
-        WRITE_IN_BITORDER(base, 3, bits);
-        CHECKRETURN(4);
-        bits = SHIFT_R(glyphp[14][line], 2);
-        bits |= SHIFT_L(glyphp[15][line], 7);
-        bits |= SHIFT_L(glyphp[16][line], 16);
-        bits |= SHIFT_L(glyphp[17][line], 25);
-        WRITE_IN_BITORDER(base, 4, bits);
-        CHECKRETURN(5);
-        bits = SHIFT_R(glyphp[17][line], 7);
-        bits |= SHIFT_L(glyphp[18][line], 2);
-        bits |= SHIFT_L(glyphp[19][line], 11);
-        bits |= SHIFT_L(glyphp[20][line], 20);
-        bits |= SHIFT_L(glyphp[21][line], 29);
-        WRITE_IN_BITORDER(base, 5, bits);
-        CHECKRETURN(6);
-        bits = SHIFT_R(glyphp[21][line], 3);
-        bits |= SHIFT_L(glyphp[22][line], 6);
-        bits |= SHIFT_L(glyphp[23][line], 15);
-        bits |= SHIFT_L(glyphp[24][line], 24);
-        WRITE_IN_BITORDER(base, 6, bits);
-        CHECKRETURN(7);
-        bits = SHIFT_R(glyphp[24][line], 8);
-        bits |= SHIFT_L(glyphp[25][line], 1);
-        bits |= SHIFT_L(glyphp[26][line], 10);
-        bits |= SHIFT_L(glyphp[27][line], 19);
-        bits |= SHIFT_L(glyphp[28][line], 28);
-        WRITE_IN_BITORDER(base, 7, bits);
-        CHECKRETURN(8);
-        bits = SHIFT_R(glyphp[28][line], 4);
-        bits |= SHIFT_L(glyphp[29][line], 5);
-        bits |= SHIFT_L(glyphp[30][line], 14);
-        bits |= SHIFT_L(glyphp[31][line], 23);
-        WRITE_IN_BITORDER(base, 8, bits);
-        CHECKRETURN(9);
-#ifndef FIXEDBASE
-        base += 9;
-#endif
-        width -= 288;
-        glyphp += 32;
-    }
-    return base;
-}
-#endif
-
-static CARD32 *
-DrawTETextScanlineWidth10(CARD32 *base,
-                          unsigned int **glyphp,
-                          int line, int width, int glyphwidth)
-{
-    while (1) {
-        unsigned int bits;
-
-        bits = glyphp[0][line];
-        bits |= SHIFT_L(glyphp[1][line], 10);
-        bits |= SHIFT_L(glyphp[2][line], 20);
-        bits |= SHIFT_L(glyphp[3][line], 30);
-        WRITE_IN_BITORDER(base, 0, bits);
-        CHECKRETURN(1);
-        bits = SHIFT_R(glyphp[3][line], 2);
-        bits |= SHIFT_L(glyphp[4][line], 8);
-        bits |= SHIFT_L(glyphp[5][line], 18);
-        bits |= SHIFT_L(glyphp[6][line], 28);
-        WRITE_IN_BITORDER(base, 1, bits);
-        CHECKRETURN(2);
-        bits = SHIFT_R(glyphp[6][line], 4);
-        bits |= SHIFT_L(glyphp[7][line], 6);
-        bits |= SHIFT_L(glyphp[8][line], 16);
-        bits |= SHIFT_L(glyphp[9][line], 26);
-        WRITE_IN_BITORDER(base, 2, bits);
-        CHECKRETURN(3);
-        bits = SHIFT_R(glyphp[9][line], 6);
-        bits |= SHIFT_L(glyphp[10][line], 4);
-        bits |= SHIFT_L(glyphp[11][line], 14);
-        bits |= SHIFT_L(glyphp[12][line], 24);
-        WRITE_IN_BITORDER(base, 3, bits);
-        CHECKRETURN(4);
-        bits = SHIFT_R(glyphp[12][line], 8);
-        bits |= SHIFT_L(glyphp[13][line], 2);
-        bits |= SHIFT_L(glyphp[14][line], 12);
-        bits |= SHIFT_L(glyphp[15][line], 22);
-        WRITE_IN_BITORDER(base, 4, bits);
-        CHECKRETURN(5);
-#ifndef FIXEDBASE
-        base += 5;
-#endif
-        width -= 160;
-        glyphp += 16;
-    }
-    return base;
-}
-
-static CARD32 *
-DrawTETextScanlineWidth12(CARD32 *base,
-                          unsigned int **glyphp,
-                          int line, int width, int glyphwidth)
-{
-    while (1) {
-        unsigned int bits;
-
-        bits = glyphp[0][line];
-        bits |= SHIFT_L(glyphp[1][line], 12);
-        bits |= SHIFT_L(glyphp[2][line], 24);
-        WRITE_IN_BITORDER(base, 0, bits);
-        CHECKRETURN(1);
-        bits = SHIFT_R(glyphp[2][line], 8);
-        bits |= SHIFT_L(glyphp[3][line], 4);
-        bits |= SHIFT_L(glyphp[4][line], 16);
-        bits |= SHIFT_L(glyphp[5][line], 28);
-        WRITE_IN_BITORDER(base, 1, bits);
-        CHECKRETURN(2);
-        bits = SHIFT_R(glyphp[5][line], 4);
-        bits |= SHIFT_L(glyphp[6][line], 8);
-        bits |= SHIFT_L(glyphp[7][line], 20);
-        WRITE_IN_BITORDER(base, 2, bits);
-        CHECKRETURN(3);
-#ifndef FIXEDBASE
-        base += 3;
-#endif
-        width -= 96;
-        glyphp += 8;
-    }
-    return base;
-}
-
-static CARD32 *
-DrawTETextScanlineWidth14(CARD32 *base,
-                          unsigned int **glyphp,
-                          int line, int width, int glyphwidth)
-{
-    while (1) {
-        unsigned int bits;
-
-        bits = glyphp[0][line];
-        bits |= SHIFT_L(glyphp[1][line], 14);
-        bits |= SHIFT_L(glyphp[2][line], 28);
-        WRITE_IN_BITORDER(base, 0, bits);
-        CHECKRETURN(1);
-        bits = SHIFT_R(glyphp[2][line], 4);
-        bits |= SHIFT_L(glyphp[3][line], 10);
-        bits |= SHIFT_L(glyphp[4][line], 24);
-        WRITE_IN_BITORDER(base, 1, bits);
-        CHECKRETURN(2);
-        bits = SHIFT_R(glyphp[4][line], 8);
-        bits |= SHIFT_L(glyphp[5][line], 6);
-        bits |= SHIFT_L(glyphp[6][line], 20);
-        WRITE_IN_BITORDER(base, 2, bits);
-        CHECKRETURN(3);
-        bits = SHIFT_R(glyphp[6][line], 12);
-        bits |= SHIFT_L(glyphp[7][line], 2);
-        bits |= SHIFT_L(glyphp[8][line], 16);
-        bits |= SHIFT_L(glyphp[9][line], 30);
-        WRITE_IN_BITORDER(base, 3, bits);
-        CHECKRETURN(4);
-        bits = SHIFT_R(glyphp[9][line], 2);
-        bits |= SHIFT_L(glyphp[10][line], 12);
-        bits |= SHIFT_L(glyphp[11][line], 26);
-        WRITE_IN_BITORDER(base, 4, bits);
-        CHECKRETURN(5);
-        bits = SHIFT_R(glyphp[11][line], 6);
-        bits |= SHIFT_L(glyphp[12][line], 8);
-        bits |= SHIFT_L(glyphp[13][line], 22);
-        WRITE_IN_BITORDER(base, 5, bits);
-        CHECKRETURN(6);
-        bits = SHIFT_R(glyphp[13][line], 10);
-        bits |= SHIFT_L(glyphp[14][line], 4);
-        bits |= SHIFT_L(glyphp[15][line], 18);
-        WRITE_IN_BITORDER(base, 6, bits);
-        CHECKRETURN(7);
-#ifndef FIXEDBASE
-        base += 7;
-#endif
-        width -= 224;
-        glyphp += 16;
-    }
-    return base;
-}
-
-static CARD32 *
-DrawTETextScanlineWidth16(CARD32 *base,
-                          unsigned int **glyphp,
-                          int line, int width, int glyphwidth)
-{
-    while (1) {
-        unsigned int bits;
-
-        bits = glyphp[0][line];
-        bits |= SHIFT_L(glyphp[1][line], 16);
-        WRITE_IN_BITORDER(base, 0, bits);
-        CHECKRETURN(1);
-        bits = glyphp[2][line];
-        bits |= SHIFT_L(glyphp[3][line], 16);
-        WRITE_IN_BITORDER(base, 1, bits);
-        CHECKRETURN(2);
-        bits = glyphp[4][line];
-        bits |= SHIFT_L(glyphp[5][line], 16);
-        WRITE_IN_BITORDER(base, 2, bits);
-        CHECKRETURN(3);
-        bits = glyphp[6][line];
-        bits |= SHIFT_L(glyphp[7][line], 16);
-        WRITE_IN_BITORDER(base, 3, bits);
-        CHECKRETURN(4);
-#ifndef FIXEDBASE
-        base += 4;
-#endif
-        width -= 128;
-        glyphp += 8;
-    }
-    return base;
-}
-
-static CARD32 *
-DrawTETextScanlineWidth18(CARD32 *base,
-                          unsigned int **glyphp,
-                          int line, int width, int glyphwidth)
-{
-    while (1) {
-        unsigned int bits;
-
-        bits = glyphp[0][line];
-        bits |= SHIFT_L(glyphp[1][line], 18);
-        WRITE_IN_BITORDER(base, 0, bits);
-        CHECKRETURN(1);
-        bits = SHIFT_R(glyphp[1][line], 14);
-        bits |= SHIFT_L(glyphp[2][line], 4);
-        bits |= SHIFT_L(glyphp[3][line], 22);
-        WRITE_IN_BITORDER(base, 1, bits);
-        CHECKRETURN(2);
-        bits = SHIFT_R(glyphp[3][line], 10);
-        bits |= SHIFT_L(glyphp[4][line], 8);
-        bits |= SHIFT_L(glyphp[5][line], 26);
-        WRITE_IN_BITORDER(base, 2, bits);
-        CHECKRETURN(3);
-        bits = SHIFT_R(glyphp[5][line], 6);
-        bits |= SHIFT_L(glyphp[6][line], 12);
-        bits |= SHIFT_L(glyphp[7][line], 30);
-        WRITE_IN_BITORDER(base, 3, bits);
-        CHECKRETURN(4);
-        bits = SHIFT_R(glyphp[7][line], 2);
-        bits |= SHIFT_L(glyphp[8][line], 16);
-        WRITE_IN_BITORDER(base, 4, bits);
-        CHECKRETURN(5);
-        bits = SHIFT_R(glyphp[8][line], 16);
-        bits |= SHIFT_L(glyphp[9][line], 2);
-        bits |= SHIFT_L(glyphp[10][line], 20);
-        WRITE_IN_BITORDER(base, 5, bits);
-        CHECKRETURN(6);
-        bits = SHIFT_R(glyphp[10][line], 12);
-        bits |= SHIFT_L(glyphp[11][line], 6);
-        bits |= SHIFT_L(glyphp[12][line], 24);
-        WRITE_IN_BITORDER(base, 6, bits);
-        CHECKRETURN(7);
-        bits = SHIFT_R(glyphp[12][line], 8);
-        bits |= SHIFT_L(glyphp[13][line], 10);
-        bits |= SHIFT_L(glyphp[14][line], 28);
-        WRITE_IN_BITORDER(base, 7, bits);
-        CHECKRETURN(8);
-        bits = SHIFT_R(glyphp[14][line], 4);
-        bits |= SHIFT_L(glyphp[15][line], 14);
-        WRITE_IN_BITORDER(base, 8, bits);
-        CHECKRETURN(9);
-#ifndef FIXEDBASE
-        base += 9;
-#endif
-        width -= 288;
-        glyphp += 16;
-    }
-    return base;
-}
-
-static CARD32 *
-DrawTETextScanlineWidth24(CARD32 *base,
-                          unsigned int **glyphp,
-                          int line, int width, int glyphwidth)
-{
-    while (1) {
-        unsigned int bits;
-
-        bits = glyphp[0][line];
-        bits |= SHIFT_L(glyphp[1][line], 24);
-        WRITE_IN_BITORDER(base, 0, bits);
-        CHECKRETURN(1);
-        bits = SHIFT_R(glyphp[1][line], 8);
-        bits |= SHIFT_L(glyphp[2][line], 16);
-        WRITE_IN_BITORDER(base, 1, bits);
-        CHECKRETURN(2);
-        bits = SHIFT_R(glyphp[2][line], 16);
-        bits |= SHIFT_L(glyphp[3][line], 8);
-        WRITE_IN_BITORDER(base, 2, bits);
-        CHECKRETURN(3);
-#ifndef FIXEDBASE
-        base += 3;
-#endif
-        width -= 96;
-        glyphp += 4;
-    }
-    return base;
-}
diff --git a/hw/xfree86/xaa/xaaTEText.c b/hw/xfree86/xaa/xaaTEText.c
deleted file mode 100644 (file)
index a5ef447..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-
-/********************************************************************
-
-   In this file we have GC level replacements for PolyText8/16,
-   ImageText8/16, ImageGlyphBlt and PolyGlyphBlt for TE (fixed) fonts.
-   The idea is that everything in this file is device independent.
-   The mentioned GCOps are merely wrappers for XAAGlyphBltTEColorExpansion
-   which calculates the boxes containing arbitrarily clipped text
-   and passes them to the TEGlyphRenderer which will usually be a lower 
-   level XAA function which renders these clipped glyphs using
-   the basic color expansion functions exported by the chipset driver.
-   The TEGlyphRenderer itself may optionally be driver supplied to
-   facilitate work-arounds/optimizations at a higher level than usual.
-
-   v1.0 - Mark Vojkovich (mvojkovi@ucsd.edu)
-
-********************************************************************/
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include <X11/fonts/font.h>
-#include "scrnintstr.h"
-#include "dixfontstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-
-static void XAAGlyphBltTEColorExpansion(ScrnInfoPtr pScrn, int xInit,
-                                        int yInit, FontPtr font, int fg, int bg,
-                                        int rop, unsigned int planemask,
-                                        RegionPtr cclip, int nglyph,
-                                        unsigned char *gBase,
-                                        CharInfoPtr * ppci);
-
-/********************************************************************
-
-   GC level replacements for PolyText8/16 and ImageText8/16
-   for TE fonts when using color expansion.
-
-********************************************************************/
-
-int
-XAAPolyText8TEColorExpansion(DrawablePtr pDraw,
-                             GCPtr pGC, int x, int y, int count, char *chars)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    unsigned long n;
-
-    (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count,
-                              (unsigned char *) chars, Linear8Bit, &n,
-                              infoRec->CharInfo);
-
-    /* we have divorced XAAGlyphBltTEColorExpansion from the drawable */
-    if (n)
-        XAAGlyphBltTEColorExpansion(infoRec->pScrn, x + pDraw->x, y + pDraw->y,
-                                    pGC->font, pGC->fgPixel, -1, pGC->alu,
-                                    pGC->planemask, pGC->pCompositeClip, n,
-                                    FONTGLYPHS(pGC->font), infoRec->CharInfo);
-
-    return (x + (n * FONTMAXBOUNDS(pGC->font, characterWidth)));
-}
-
-int
-XAAPolyText16TEColorExpansion(DrawablePtr pDraw,
-                              GCPtr pGC,
-                              int x, int y, int count, unsigned short *chars)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    unsigned long n;
-
-    (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count,
-                              (unsigned char *) chars,
-                              (FONTLASTROW(pGC->font) ==
-                               0) ? Linear16Bit : TwoD16Bit, &n,
-                              infoRec->CharInfo);
-
-    if (n)
-        XAAGlyphBltTEColorExpansion(infoRec->pScrn, x + pDraw->x, y + pDraw->y,
-                                    pGC->font, pGC->fgPixel, -1, pGC->alu,
-                                    pGC->planemask, pGC->pCompositeClip, n,
-                                    FONTGLYPHS(pGC->font), infoRec->CharInfo);
-
-    return (x + (n * FONTMAXBOUNDS(pGC->font, characterWidth)));
-}
-
-void
-XAAImageText8TEColorExpansion(DrawablePtr pDraw,
-                              GCPtr pGC, int x, int y, int count, char *chars)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    unsigned long n;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count,
-                              (unsigned char *) chars, Linear8Bit, &n,
-                              infoRec->CharInfo);
-
-    if (n)
-        XAAGlyphBltTEColorExpansion(infoRec->pScrn, x + pDraw->x, y + pDraw->y,
-                                    pGC->font, pGC->fgPixel, pGC->bgPixel,
-                                    GXcopy, pGC->planemask, pGC->pCompositeClip,
-                                    n, FONTGLYPHS(pGC->font),
-                                    infoRec->CharInfo);
-}
-
-void
-XAAImageText16TEColorExpansion(DrawablePtr pDraw,
-                               GCPtr pGC,
-                               int x, int y, int count, unsigned short *chars)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    unsigned long n;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count,
-                              (unsigned char *) chars,
-                              (FONTLASTROW(pGC->font) ==
-                               0) ? Linear16Bit : TwoD16Bit, &n,
-                              infoRec->CharInfo);
-
-    if (n)
-        XAAGlyphBltTEColorExpansion(infoRec->pScrn, x + pDraw->x, y + pDraw->y,
-                                    pGC->font, pGC->fgPixel, pGC->bgPixel,
-                                    GXcopy, pGC->planemask, pGC->pCompositeClip,
-                                    n, FONTGLYPHS(pGC->font),
-                                    infoRec->CharInfo);
-}
-
-/********************************************************************
-
-   GC level replacements for ImageGlyphBlt and PolyGlyphBlt for
-   TE fonts when using color expansion.
-
-********************************************************************/
-
-void
-XAAImageGlyphBltTEColorExpansion(DrawablePtr pDrawable,
-                                 GCPtr pGC,
-                                 int xInit, int yInit,
-                                 unsigned int nglyph,
-                                 CharInfoPtr * ppci, pointer pglyphBase)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    XAAGlyphBltTEColorExpansion(infoRec->pScrn, xInit + pDrawable->x,
-                                yInit + pDrawable->y, pGC->font, pGC->fgPixel,
-                                pGC->bgPixel, GXcopy, pGC->planemask,
-                                pGC->pCompositeClip, nglyph,
-                                (unsigned char *) pglyphBase, ppci);
-}
-
-void
-XAAPolyGlyphBltTEColorExpansion(DrawablePtr pDrawable,
-                                GCPtr pGC,
-                                int xInit, int yInit,
-                                unsigned int nglyph,
-                                CharInfoPtr * ppci, pointer pglyphBase)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    XAAGlyphBltTEColorExpansion(infoRec->pScrn, xInit + pDrawable->x,
-                                yInit + pDrawable->y, pGC->font, pGC->fgPixel,
-                                -1, pGC->alu, pGC->planemask,
-                                pGC->pCompositeClip, nglyph,
-                                (unsigned char *) pglyphBase, ppci);
-}
-
-/********************************************************************
-
-   XAAGlyphBltTEColorExpansion -
-
-   This guy computes the clipped pieces of text and sends it to
-   the lower-level function which will handle acceleration of 
-   arbitrarily clipped text.
-  
-********************************************************************/
-
-static void
-XAAGlyphBltTEColorExpansion(ScrnInfoPtr pScrn,
-                            int xInit, int yInit,
-                            FontPtr font,
-                            int fg, int bg,
-                            int rop,
-                            unsigned int planemask,
-                            RegionPtr cclip,
-                            int nglyph,
-                            unsigned char *gBase, CharInfoPtr * ppci)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    int skippix, skipglyphs;
-    int Left, Right, Top, Bottom;
-    int LeftEdge, RightEdge, ytop, ybot;
-    int nbox = RegionNumRects(cclip);
-    BoxPtr pbox = RegionRects(cclip);
-    unsigned int **glyphs = NULL;
-    int glyphWidth = FONTMAXBOUNDS(font, characterWidth);
-
-    /* find the size of the box */
-    Left = xInit;
-    Right = Left + (glyphWidth * nglyph);
-    Top = yInit - FONTASCENT(font);
-    Bottom = yInit + FONTDESCENT(font);
-
-    /* get into the first band that may contain part of our string */
-    while (nbox && (Top >= pbox->y2)) {
-        pbox++;
-        nbox--;
-    }
-
-    /* stop when the lower edge of the box is beyond our string */
-    while (nbox && (Bottom > pbox->y1)) {
-        LeftEdge = max(Left, pbox->x1);
-        RightEdge = min(Right, pbox->x2);
-
-        if (RightEdge > LeftEdge) {     /* we have something to draw */
-            unsigned int *fallbackBits = NULL;
-
-            ytop = max(Top, pbox->y1);
-            ybot = min(Bottom, pbox->y2);
-
-            if ((skippix = LeftEdge - Left)) {
-                skipglyphs = skippix / glyphWidth;
-                skippix %= glyphWidth;
-            }
-            else
-                skipglyphs = 0;
-
-            if (!glyphs) {
-                int count;
-
-                glyphs = (unsigned int **) (infoRec->PreAllocMem);
-
-                for (count = 0; count < nglyph; count++) {
-                    glyphs[count] = (unsigned int *)
-                        FONTGLYPHBITS(gBase, *ppci++);
-                    if (!glyphs[count]) {
-                        /* Glyphs with NULL bits do exist in the wild.
-                           Replace with blank bits in that case */
-
-                        if (!fallbackBits) {
-                            int fontHeight = Bottom - Top + 1;
-
-                            fallbackBits = calloc(glyphWidth * fontHeight, 1);
-                            if (!fallbackBits)
-                                return;
-                        }
-                        glyphs[count] = fallbackBits;
-                    }
-                }
-
-                /* our new unrolled TE code only writes DWORDS at a time 
-                   so it can read up to 6 characters past the last one 
-                   we're displaying */
-                glyphs[count + 0] = glyphs[0];
-                glyphs[count + 1] = glyphs[0];
-                glyphs[count + 2] = glyphs[0];
-                glyphs[count + 3] = glyphs[0];
-                glyphs[count + 4] = glyphs[0];
-                glyphs[count + 5] = glyphs[0];
-            }
-
-            /* x, y, w, h, skipleft, skiptop, glyphp, glyphWidth, fg, bg, rop, pm */
-
-            (*infoRec->TEGlyphRenderer) (pScrn,
-                                         LeftEdge, ytop, RightEdge - LeftEdge,
-                                         ybot - ytop, skippix, ytop - Top,
-                                         glyphs + skipglyphs, glyphWidth, fg,
-                                         bg, rop, planemask);
-
-            free(fallbackBits);
-        }
-
-        nbox--;
-        pbox++;
-    }
-}
diff --git a/hw/xfree86/xaa/xaaTables.c b/hw/xfree86/xaa/xaaTables.c
deleted file mode 100644 (file)
index 35641da..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-#include "xaalocal.h"
-/*
- * This is a table of 24-bit values, indexed with an 8-bit byte value, then
- * expands each bit to three consecutive bits. This is required for color
- * expansion in 24bpp mode with the coprocessor in 8bpp mode, with LSB-first
- * bit order within a byte.
- */
-
-unsigned int byte_expand3[256] = {
-    0x000000, 0x000007, 0x000038, 0x00003F, 0x0001C0, 0x0001C7, 0x0001F8,
-        0x0001FF,
-    0x000E00, 0x000E07, 0x000E38, 0x000E3F, 0x000FC0, 0x000FC7, 0x000FF8,
-        0x000FFF,
-    0x007000, 0x007007, 0x007038, 0x00703F, 0x0071C0, 0x0071C7, 0x0071F8,
-        0x0071FF,
-    0x007E00, 0x007E07, 0x007E38, 0x007E3F, 0x007FC0, 0x007FC7, 0x007FF8,
-        0x007FFF,
-    0x038000, 0x038007, 0x038038, 0x03803F, 0x0381C0, 0x0381C7, 0x0381F8,
-        0x0381FF,
-    0x038E00, 0x038E07, 0x038E38, 0x038E3F, 0x038FC0, 0x038FC7, 0x038FF8,
-        0x038FFF,
-    0x03F000, 0x03F007, 0x03F038, 0x03F03F, 0x03F1C0, 0x03F1C7, 0x03F1F8,
-        0x03F1FF,
-    0x03FE00, 0x03FE07, 0x03FE38, 0x03FE3F, 0x03FFC0, 0x03FFC7, 0x03FFF8,
-        0x03FFFF,
-    0x1C0000, 0x1C0007, 0x1C0038, 0x1C003F, 0x1C01C0, 0x1C01C7, 0x1C01F8,
-        0x1C01FF,
-    0x1C0E00, 0x1C0E07, 0x1C0E38, 0x1C0E3F, 0x1C0FC0, 0x1C0FC7, 0x1C0FF8,
-        0x1C0FFF,
-    0x1C7000, 0x1C7007, 0x1C7038, 0x1C703F, 0x1C71C0, 0x1C71C7, 0x1C71F8,
-        0x1C71FF,
-    0x1C7E00, 0x1C7E07, 0x1C7E38, 0x1C7E3F, 0x1C7FC0, 0x1C7FC7, 0x1C7FF8,
-        0x1C7FFF,
-    0x1F8000, 0x1F8007, 0x1F8038, 0x1F803F, 0x1F81C0, 0x1F81C7, 0x1F81F8,
-        0x1F81FF,
-    0x1F8E00, 0x1F8E07, 0x1F8E38, 0x1F8E3F, 0x1F8FC0, 0x1F8FC7, 0x1F8FF8,
-        0x1F8FFF,
-    0x1FF000, 0x1FF007, 0x1FF038, 0x1FF03F, 0x1FF1C0, 0x1FF1C7, 0x1FF1F8,
-        0x1FF1FF,
-    0x1FFE00, 0x1FFE07, 0x1FFE38, 0x1FFE3F, 0x1FFFC0, 0x1FFFC7, 0x1FFFF8,
-        0x1FFFFF,
-    0xE00000, 0xE00007, 0xE00038, 0xE0003F, 0xE001C0, 0xE001C7, 0xE001F8,
-        0xE001FF,
-    0xE00E00, 0xE00E07, 0xE00E38, 0xE00E3F, 0xE00FC0, 0xE00FC7, 0xE00FF8,
-        0xE00FFF,
-    0xE07000, 0xE07007, 0xE07038, 0xE0703F, 0xE071C0, 0xE071C7, 0xE071F8,
-        0xE071FF,
-    0xE07E00, 0xE07E07, 0xE07E38, 0xE07E3F, 0xE07FC0, 0xE07FC7, 0xE07FF8,
-        0xE07FFF,
-    0xE38000, 0xE38007, 0xE38038, 0xE3803F, 0xE381C0, 0xE381C7, 0xE381F8,
-        0xE381FF,
-    0xE38E00, 0xE38E07, 0xE38E38, 0xE38E3F, 0xE38FC0, 0xE38FC7, 0xE38FF8,
-        0xE38FFF,
-    0xE3F000, 0xE3F007, 0xE3F038, 0xE3F03F, 0xE3F1C0, 0xE3F1C7, 0xE3F1F8,
-        0xE3F1FF,
-    0xE3FE00, 0xE3FE07, 0xE3FE38, 0xE3FE3F, 0xE3FFC0, 0xE3FFC7, 0xE3FFF8,
-        0xE3FFFF,
-    0xFC0000, 0xFC0007, 0xFC0038, 0xFC003F, 0xFC01C0, 0xFC01C7, 0xFC01F8,
-        0xFC01FF,
-    0xFC0E00, 0xFC0E07, 0xFC0E38, 0xFC0E3F, 0xFC0FC0, 0xFC0FC7, 0xFC0FF8,
-        0xFC0FFF,
-    0xFC7000, 0xFC7007, 0xFC7038, 0xFC703F, 0xFC71C0, 0xFC71C7, 0xFC71F8,
-        0xFC71FF,
-    0xFC7E00, 0xFC7E07, 0xFC7E38, 0xFC7E3F, 0xFC7FC0, 0xFC7FC7, 0xFC7FF8,
-        0xFC7FFF,
-    0xFF8000, 0xFF8007, 0xFF8038, 0xFF803F, 0xFF81C0, 0xFF81C7, 0xFF81F8,
-        0xFF81FF,
-    0xFF8E00, 0xFF8E07, 0xFF8E38, 0xFF8E3F, 0xFF8FC0, 0xFF8FC7, 0xFF8FF8,
-        0xFF8FFF,
-    0xFFF000, 0xFFF007, 0xFFF038, 0xFFF03F, 0xFFF1C0, 0xFFF1C7, 0xFFF1F8,
-        0xFFF1FF,
-    0xFFFE00, 0xFFFE07, 0xFFFE38, 0xFFFE3F, 0xFFFFC0, 0xFFFFC7, 0xFFFFF8,
-        0xFFFFFF
-};
-
-/*
- * This is a table of 24-bit values, indexed with an 8-bit byte value,
- * that reverses the bit order of a byte and then expands each bit to three
- * consecutive bits. This is required for color expansion in 24bpp mode
- * with the coprocessor in 8bpp mode, with MSB-first bit order within a
- * byte.
- */
-
-unsigned int byte_reversed_expand3[256] = {
-    0x000000, 0x0000E0, 0x00001C, 0x0000FC, 0x008003, 0x0080E3, 0x00801F,
-        0x0080FF,
-    0x007000, 0x0070E0, 0x00701C, 0x0070FC, 0x00F003, 0x00F0E3, 0x00F01F,
-        0x00F0FF,
-    0x000E00, 0x000EE0, 0x000E1C, 0x000EFC, 0x008E03, 0x008EE3, 0x008E1F,
-        0x008EFF,
-    0x007E00, 0x007EE0, 0x007E1C, 0x007EFC, 0x00FE03, 0x00FEE3, 0x00FE1F,
-        0x00FEFF,
-    0xC00100, 0xC001E0, 0xC0011C, 0xC001FC, 0xC08103, 0xC081E3, 0xC0811F,
-        0xC081FF,
-    0xC07100, 0xC071E0, 0xC0711C, 0xC071FC, 0xC0F103, 0xC0F1E3, 0xC0F11F,
-        0xC0F1FF,
-    0xC00F00, 0xC00FE0, 0xC00F1C, 0xC00FFC, 0xC08F03, 0xC08FE3, 0xC08F1F,
-        0xC08FFF,
-    0xC07F00, 0xC07FE0, 0xC07F1C, 0xC07FFC, 0xC0FF03, 0xC0FFE3, 0xC0FF1F,
-        0xC0FFFF,
-    0x380000, 0x3800E0, 0x38001C, 0x3800FC, 0x388003, 0x3880E3, 0x38801F,
-        0x3880FF,
-    0x387000, 0x3870E0, 0x38701C, 0x3870FC, 0x38F003, 0x38F0E3, 0x38F01F,
-        0x38F0FF,
-    0x380E00, 0x380EE0, 0x380E1C, 0x380EFC, 0x388E03, 0x388EE3, 0x388E1F,
-        0x388EFF,
-    0x387E00, 0x387EE0, 0x387E1C, 0x387EFC, 0x38FE03, 0x38FEE3, 0x38FE1F,
-        0x38FEFF,
-    0xF80100, 0xF801E0, 0xF8011C, 0xF801FC, 0xF88103, 0xF881E3, 0xF8811F,
-        0xF881FF,
-    0xF87100, 0xF871E0, 0xF8711C, 0xF871FC, 0xF8F103, 0xF8F1E3, 0xF8F11F,
-        0xF8F1FF,
-    0xF80F00, 0xF80FE0, 0xF80F1C, 0xF80FFC, 0xF88F03, 0xF88FE3, 0xF88F1F,
-        0xF88FFF,
-    0xF87F00, 0xF87FE0, 0xF87F1C, 0xF87FFC, 0xF8FF03, 0xF8FFE3, 0xF8FF1F,
-        0xF8FFFF,
-    0x070000, 0x0700E0, 0x07001C, 0x0700FC, 0x078003, 0x0780E3, 0x07801F,
-        0x0780FF,
-    0x077000, 0x0770E0, 0x07701C, 0x0770FC, 0x07F003, 0x07F0E3, 0x07F01F,
-        0x07F0FF,
-    0x070E00, 0x070EE0, 0x070E1C, 0x070EFC, 0x078E03, 0x078EE3, 0x078E1F,
-        0x078EFF,
-    0x077E00, 0x077EE0, 0x077E1C, 0x077EFC, 0x07FE03, 0x07FEE3, 0x07FE1F,
-        0x07FEFF,
-    0xC70100, 0xC701E0, 0xC7011C, 0xC701FC, 0xC78103, 0xC781E3, 0xC7811F,
-        0xC781FF,
-    0xC77100, 0xC771E0, 0xC7711C, 0xC771FC, 0xC7F103, 0xC7F1E3, 0xC7F11F,
-        0xC7F1FF,
-    0xC70F00, 0xC70FE0, 0xC70F1C, 0xC70FFC, 0xC78F03, 0xC78FE3, 0xC78F1F,
-        0xC78FFF,
-    0xC77F00, 0xC77FE0, 0xC77F1C, 0xC77FFC, 0xC7FF03, 0xC7FFE3, 0xC7FF1F,
-        0xC7FFFF,
-    0x3F0000, 0x3F00E0, 0x3F001C, 0x3F00FC, 0x3F8003, 0x3F80E3, 0x3F801F,
-        0x3F80FF,
-    0x3F7000, 0x3F70E0, 0x3F701C, 0x3F70FC, 0x3FF003, 0x3FF0E3, 0x3FF01F,
-        0x3FF0FF,
-    0x3F0E00, 0x3F0EE0, 0x3F0E1C, 0x3F0EFC, 0x3F8E03, 0x3F8EE3, 0x3F8E1F,
-        0x3F8EFF,
-    0x3F7E00, 0x3F7EE0, 0x3F7E1C, 0x3F7EFC, 0x3FFE03, 0x3FFEE3, 0x3FFE1F,
-        0x3FFEFF,
-    0xFF0100, 0xFF01E0, 0xFF011C, 0xFF01FC, 0xFF8103, 0xFF81E3, 0xFF811F,
-        0xFF81FF,
-    0xFF7100, 0xFF71E0, 0xFF711C, 0xFF71FC, 0xFFF103, 0xFFF1E3, 0xFFF11F,
-        0xFFF1FF,
-    0xFF0F00, 0xFF0FE0, 0xFF0F1C, 0xFF0FFC, 0xFF8F03, 0xFF8FE3, 0xFF8F1F,
-        0xFF8FFF,
-    0xFF7F00, 0xFF7FE0, 0xFF7F1C, 0xFF7FFC, 0xFFFF03, 0xFFFFE3, 0xFFFF1F,
-        0xFFFFFF,
-};
diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c
deleted file mode 100644 (file)
index b8a53c1..0000000
+++ /dev/null
@@ -1,924 +0,0 @@
-/*
-
-XAAPolylinesWideSolid does not maintain a span list and subsequently does
-not follow the "touch-each-pixel-once" rules for wide lines and arcs.
-This means it can only be used in the case where we have
-miSpansEasyRop(pGC->alu).  Since we clip spans on the fly, we
-limited usage of this function to one rect situations. This
-function is used only for solid lines. 
-
-  Adapted from miWideLine by Mark Vojkovich (mvojkovi@ucsd.edu)
-Original mi code written by Keith Packard.
-
-*/
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <math.h>
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "windowstr.h"
-#include "gcstruct.h"
-#include "regionstr.h"
-#include "miwideline.h"
-#include "mi.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-#define DRAW_POINT(pScrn, x, y) \
-  if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, 1); \
-  else XAAPointHelper(pScrn, x, y)
-
-#define FILL_RECT(pScrn, x, y, w, h) \
-  if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h); \
-  else XAAFillRectHelper(pScrn, x, y, w, h)
-
-#define FILL_SPAN(pScrn, x, y, w) \
-  if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, 1); \
-  else XAASpanHelper(pScrn, x, y, w)
-
-#define CLIPSTEPEDGE(edgey,edge,edgeleft) \
-    if (ybase == edgey) { \
-       if (edgeleft) { \
-           if (edge->x > xcl) \
-               xcl = edge->x; \
-       } else { \
-           if (edge->x < xcr) \
-               xcr = edge->x; \
-       } \
-       edgey++; \
-       edge->x += edge->stepx; \
-       edge->e += edge->dx; \
-       if (edge->e > 0) { \
-           edge->x += edge->signdx; \
-           edge->e -= edge->dy; \
-       } \
-    }
-
-static void
-XAAPointHelper(ScrnInfoPtr pScrn, int x, int y)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    BoxPtr extents = infoRec->ClipBox;
-
-    if ((x >= extents->x1) && (x < extents->x2) &&
-        (y >= extents->y1) && (y < extents->y2))
-        (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, 1, 1);
-}
-
-static void
-XAAFillRectHelper(ScrnInfoPtr pScrn, int x1, int y1, int dx, int dy)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    BoxPtr extents = infoRec->ClipBox;
-    int x2 = x1 + dx;
-    int y2 = y1 + dy;
-
-    if (x1 < extents->x1)
-        x1 = extents->x1;
-    if (x2 >= extents->x2)
-        x2 = extents->x2;
-    if ((dx = x2 - x1) < 1)
-        return;
-    if (y1 < extents->y1)
-        y1 = extents->y1;
-    if (y2 >= extents->y2)
-        y2 = extents->y2;
-    if ((dy = y2 - y1) < 1)
-        return;
-
-    (*infoRec->SubsequentSolidFillRect) (pScrn, x1, y1, dx, dy);
-}
-
-static void
-XAASpanHelper(ScrnInfoPtr pScrn, int x1, int y, int width)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-    BoxPtr extents = infoRec->ClipBox;
-    int x2;
-
-    if ((y < extents->y1) || (y >= extents->y2))
-        return;
-
-    x2 = x1 + width;
-    if (x1 < extents->x1)
-        x1 = extents->x1;
-    if (x2 > extents->x2)
-        x2 = extents->x2;
-    width = x2 - x1;
-
-    if (width > 0)
-        (*infoRec->SubsequentSolidFillRect) (pScrn, x1, y, width, 1);
-
-}
-
-#define FixError(x, dx, dy, e, sign, step, h)  {       \
-          e += (h) * dx;                               \
-          x += (h) * step;                             \
-          if(e > 0) {                                  \
-               x += e * sign/dy;                       \
-               e %= dy;                                \
-               if(e) {                                 \
-                  x += sign;                           \
-                  e -= dy;                             \
-               }                                       \
-          }                                            \
-}
-
-static void
-XAAFillPolyHelper(GCPtr pGC, int y,     /* start y coordinate */
-                  int overall_height,   /* height of entire segment */
-                  PolyEdgePtr left, PolyEdgePtr right,
-                  int left_count, int right_count)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    BoxPtr extents = infoRec->ClipBox;
-    int left_x, left_e, left_stepx, left_signdx, left_dy, left_dx;
-    int right_x, right_e, right_stepx, right_signdx, right_dy, right_dx;
-    int height, left_height, right_height;
-    int xorg;
-    Bool hardClip;
-
-    if ((y >= extents->y2) || ((y + overall_height) <= extents->y1))
-        return;
-
-    /* Muffle compiler */
-    left_x = left_e = left_stepx = left_signdx = left_dy = left_dx = 0;
-    right_x = right_e = right_stepx = right_signdx = right_dy = right_dx = 0;
-
-    left_height = right_height = 0;
-    xorg = 0;
-
-    hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
-
-    while ((left_count || left_height) && (right_count || right_height)) {
-        if (!left_height && left_count) {
-            left_height = left->height;
-            left_x = left->x + xorg;
-            left_stepx = left->stepx;
-            left_signdx = left->signdx;
-            left_e = left->e;
-            left_dy = left->dy;
-            left_dx = left->dx;
-            left_count--;
-            left++;
-        }
-        if (!right_height && right_count) {
-            right_height = right->height;
-            right_x = right->x + xorg + 1;
-            right_stepx = right->stepx;
-            right_signdx = right->signdx;
-            right_e = right->e;
-            right_dy = right->dy;
-            right_dx = right->dx;
-            right_count--;
-            right++;
-        }
-
-        height = (left_height > right_height) ? right_height : left_height;
-
-        left_height -= height;
-        right_height -= height;
-
-        if (hardClip && infoRec->SubsequentSolidFillTrap && (height > 6)) {
-            int right_DX, left_DX;
-
-            right_DX = (right_dx * right_signdx) + (right_stepx * right_dy);
-            left_DX = (left_dx * left_signdx) + (left_stepx * left_dy);
-
-            (*infoRec->SubsequentSolidFillTrap) (infoRec->pScrn, y, height,
-                                                 left_x, left_DX, left_dy,
-                                                 left_e, right_x - 1, right_DX,
-                                                 right_dy, right_e);
-
-            FixError(left_x, left_dx, left_dy, left_e, left_signdx,
-                     left_stepx, height);
-            FixError(right_x, right_dx, right_dy, right_e, right_signdx,
-                     right_stepx, height);
-            y += height;
-            continue;
-        }
-
-        while (height--) {
-            if (right_x > left_x) {
-                FILL_SPAN(infoRec->pScrn, left_x, y, right_x - left_x);
-            }
-            y++;
-
-            left_x += left_stepx;
-            left_e += left_dx;
-            if (left_e > 0) {
-                left_x += left_signdx;
-                left_e -= left_dy;
-            }
-            right_x += right_stepx;
-            right_e += right_dx;
-            if (right_e > 0) {
-                right_x += right_signdx;
-                right_e -= right_dy;
-            }
-
-        }
-    }
-}
-
-static void
-XAAWideSegment(GCPtr pGC,
-               int x1, int y1, int x2, int y2,
-               Bool projectLeft, Bool projectRight,
-               LineFacePtr leftFace, LineFacePtr rightFace)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    double l, L, r;
-    double xa, ya;
-    double projectXoff, projectYoff;
-    double k;
-    double maxy;
-    int x, y;
-    int dx, dy;
-    int finaly;
-    PolyEdgePtr left, right;
-    PolyEdgePtr top, bottom;
-    int lefty, righty, topy, bottomy;
-    int signdx;
-    PolyEdgeRec lefts[2], rights[2];
-    LineFacePtr tface;
-    int lw = pGC->lineWidth;
-    Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
-
-    /* draw top-to-bottom always */
-    if ((y2 < y1) || ((y2 == y1) && (x2 < x1))) {
-        x = x1;
-        x1 = x2;
-        x2 = x;
-
-        y = y1;
-        y1 = y2;
-        y2 = y;
-
-        x = projectLeft;
-        projectLeft = projectRight;
-        projectRight = x;
-
-        tface = leftFace;
-        leftFace = rightFace;
-        rightFace = tface;
-    }
-
-    dy = y2 - y1;
-    signdx = 1;
-    dx = x2 - x1;
-    if (dx < 0)
-        signdx = -1;
-
-    leftFace->x = x1;
-    leftFace->y = y1;
-    leftFace->dx = dx;
-    leftFace->dy = dy;
-
-    rightFace->x = x2;
-    rightFace->y = y2;
-    rightFace->dx = -dx;
-    rightFace->dy = -dy;
-
-    if (!dy) {
-        rightFace->xa = 0;
-        rightFace->ya = (double) lw / 2.0;
-        rightFace->k = -(double) (lw * dx) / 2.0;
-        leftFace->xa = 0;
-        leftFace->ya = -rightFace->ya;
-        leftFace->k = rightFace->k;
-        x = x1;
-        if (projectLeft)
-            x -= (lw >> 1);
-        y = y1 - (lw >> 1);
-        dx = x2 - x;
-        if (projectRight)
-            dx += ((lw + 1) >> 1);
-        dy = lw;
-        FILL_RECT(infoRec->pScrn, x, y, dx, dy);
-    }
-    else if (!dx) {
-        leftFace->xa = (double) lw / 2.0;
-        leftFace->ya = 0;
-        leftFace->k = (double) (lw * dy) / 2.0;
-        rightFace->xa = -leftFace->xa;
-        rightFace->ya = 0;
-        rightFace->k = leftFace->k;
-        y = y1;
-        if (projectLeft)
-            y -= lw >> 1;
-        x = x1 - (lw >> 1);
-        dy = y2 - y;
-        if (projectRight)
-            dy += ((lw + 1) >> 1);
-        dx = lw;
-        FILL_RECT(infoRec->pScrn, x, y, dx, dy);
-    }
-    else {
-        l = ((double) lw) / 2.0;
-        L = sqrt((double) (dx * dx + dy * dy));
-
-        if (dx < 0) {
-            right = &rights[1];
-            left = &lefts[0];
-            top = &rights[0];
-            bottom = &lefts[1];
-        }
-        else {
-            right = &rights[0];
-            left = &lefts[1];
-            top = &lefts[0];
-            bottom = &rights[1];
-        }
-        r = l / L;
-
-        /* coord of upper bound at integral y */
-        ya = -r * dx;
-        xa = r * dy;
-
-        projectXoff = -ya;
-        projectYoff = xa;
-
-        /* xa * dy - ya * dx */
-        k = l * L;
-
-        leftFace->xa = xa;
-        leftFace->ya = ya;
-        leftFace->k = k;
-        rightFace->xa = -xa;
-        rightFace->ya = -ya;
-        rightFace->k = k;
-
-        if (projectLeft)
-            righty = miPolyBuildEdge(xa - projectXoff, ya - projectYoff,
-                                     k, dx, dy, x1, y1, 0, right);
-        else
-            righty = miPolyBuildEdge(xa, ya, k, dx, dy, x1, y1, 0, right);
-
-        /* coord of lower bound at integral y */
-        ya = -ya;
-        xa = -xa;
-
-        /* xa * dy - ya * dx */
-        k = -k;
-
-        if (projectLeft)
-            lefty = miPolyBuildEdge(xa - projectXoff, ya - projectYoff,
-                                    k, dx, dy, x1, y1, 1, left);
-        else
-            lefty = miPolyBuildEdge(xa, ya, k, dx, dy, x1, y1, 1, left);
-
-        /* coord of top face at integral y */
-
-        if (signdx > 0) {
-            ya = -ya;
-            xa = -xa;
-        }
-
-        if (projectLeft) {
-            double xap = xa - projectXoff;
-            double yap = ya - projectYoff;
-
-            topy = miPolyBuildEdge(xap, yap, xap * dx + yap * dy,
-                                   -dy, dx, x1, y1, dx > 0, top);
-        }
-        else
-            topy = miPolyBuildEdge(xa, ya, 0.0, -dy, dx, x1, y1, dx > 0, top);
-
-        /* coord of bottom face at integral y */
-
-        if (projectRight) {
-            double xap = xa + projectXoff;
-            double yap = ya + projectYoff;
-
-            bottomy = miPolyBuildEdge(xap, yap, xap * dx + yap * dy,
-                                      -dy, dx, x2, y2, dx < 0, bottom);
-            maxy = -ya + projectYoff;
-        }
-        else {
-            bottomy = miPolyBuildEdge(xa, ya, 0.0,
-                                      -dy, dx, x2, y2, dx < 0, bottom);
-            maxy = -ya;
-        }
-
-        finaly = ICEIL(maxy) + y2;
-
-        if (dx < 0) {
-            left->height = bottomy - lefty;
-            right->height = finaly - righty;
-            top->height = righty - topy;
-        }
-        else {
-            right->height = bottomy - righty;
-            left->height = finaly - lefty;
-            top->height = lefty - topy;
-        }
-        bottom->height = finaly - bottomy;
-        XAAFillPolyHelper(pGC, topy,
-                          bottom->height + bottomy - topy, lefts, rights, 2, 2);
-    }
-}
-
-static void
-XAALineArcI(GCPtr pGC, int xorg, int yorg)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int x, y, e, ex;
-    int slw = pGC->lineWidth;
-    Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
-
-    y = (slw >> 1) + 1;
-    if (slw & 1)
-        e = -((y << 2) + 3);
-    else
-        e = -(y << 3);
-    ex = -4;
-    x = 0;
-    while (y) {
-        e += (y << 3) - 4;
-        while (e >= 0) {
-            x++;
-            e += (ex = -((x << 3) + 4));
-        }
-        y--;
-        slw = (x << 1) + 1;
-        if ((e == ex) && (slw > 1))
-            slw--;
-
-        FILL_SPAN(infoRec->pScrn, xorg - x, yorg - y, slw);
-
-        if ((y != 0) && ((slw > 1) || (e != ex))) {
-            FILL_SPAN(infoRec->pScrn, xorg - x, yorg + y, slw);
-        }
-    }
-}
-
-static void
-XAALineArcD(GCPtr pGC,
-            double xorg,
-            double yorg,
-            PolyEdgePtr edge1,
-            int edgey1,
-            Bool edgeleft1, PolyEdgePtr edge2, int edgey2, Bool edgeleft2)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    double radius, x0, y0, el, er, yk, xlk, xrk, k;
-    int xbase, ybase, y, boty, xl, xr, xcl, xcr;
-    int ymin, ymax;
-    Bool edge1IsMin, edge2IsMin;
-    int ymin1, ymin2;
-    Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
-
-    xbase = floor(xorg);
-    x0 = xorg - xbase;
-    ybase = ICEIL(yorg);
-    y0 = yorg - ybase;
-
-    xlk = x0 + x0 + 1.0;
-    xrk = x0 + x0 - 1.0;
-    yk = y0 + y0 - 1.0;
-    radius = ((double) pGC->lineWidth) / 2.0;
-    y = floor(radius - y0 + 1.0);
-    ybase -= y;
-    ymin = ybase;
-    ymax = 65536;
-    edge1IsMin = FALSE;
-    ymin1 = edgey1;
-    if (edge1->dy >= 0) {
-        if (!edge1->dy) {
-            if (edgeleft1)
-                edge1IsMin = TRUE;
-            else
-                ymax = edgey1;
-            edgey1 = 65536;
-        }
-        else if ((edge1->signdx < 0) == edgeleft1)
-            edge1IsMin = TRUE;
-    }
-    edge2IsMin = FALSE;
-    ymin2 = edgey2;
-    if (edge2->dy >= 0) {
-        if (!edge2->dy) {
-            if (edgeleft2)
-                edge2IsMin = TRUE;
-            else
-                ymax = edgey2;
-            edgey2 = 65536;
-        }
-        else if ((edge2->signdx < 0) == edgeleft2)
-            edge2IsMin = TRUE;
-    }
-    if (edge1IsMin) {
-        ymin = ymin1;
-        if (edge2IsMin && (ymin1 > ymin2))
-            ymin = ymin2;
-    }
-    else if (edge2IsMin)
-        ymin = ymin2;
-    el = radius * radius - ((y + y0) * (y + y0)) - (x0 * x0);
-    er = el + xrk;
-    xl = 1;
-    xr = 0;
-    if (x0 < 0.5) {
-        xl = 0;
-        el -= xlk;
-    }
-    boty = (y0 < -0.5) ? 1 : 0;
-    if (ybase + y - boty > ymax)
-        boty = ymax - ybase - y;
-    while (y > boty) {
-        k = (y << 1) + yk;
-        er += k;
-        while (er > 0.0) {
-            xr++;
-            er += xrk - (xr << 1);
-        }
-        el += k;
-        while (el >= 0.0) {
-            xl--;
-            el += (xl << 1) - xlk;
-        }
-        y--;
-        ybase++;
-        if (ybase < ymin)
-            continue;
-        xcl = xl + xbase;
-        xcr = xr + xbase;
-        CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
-        CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
-        if (xcr >= xcl) {
-            FILL_SPAN(infoRec->pScrn, xcl, ybase, xcr - xcl + 1);
-        }
-    }
-    er = xrk - (xr << 1) - er;
-    el = (xl << 1) - xlk - el;
-    boty = floor(-y0 - radius + 1.0);
-    if (ybase + y - boty > ymax)
-        boty = ymax - ybase - y;
-    while (y > boty) {
-        k = (y << 1) + yk;
-        er -= k;
-        while ((er >= 0.0) && (xr >= 0)) {
-            xr--;
-            er += xrk - (xr << 1);
-        }
-        el -= k;
-        while ((el > 0.0) && (xl <= 0)) {
-            xl++;
-            el += (xl << 1) - xlk;
-        }
-        y--;
-        ybase++;
-        if (ybase < ymin)
-            continue;
-        xcl = xl + xbase;
-        xcr = xr + xbase;
-        CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
-        CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
-        if (xcr >= xcl) {
-            FILL_SPAN(infoRec->pScrn, xcl, ybase, xcr - xcl + 1);
-        }
-    }
-}
-
-static void
-XAALineArc(GCPtr pGC,
-           LineFacePtr leftFace,
-           LineFacePtr rightFace, double xorg, double yorg, Bool isInt)
-{
-    int xorgi, yorgi;
-    PolyEdgeRec edge1, edge2;
-    int edgey1, edgey2;
-    Bool edgeleft1, edgeleft2;
-
-    if (isInt) {
-        xorgi = leftFace ? leftFace->x : rightFace->x;
-        yorgi = leftFace ? leftFace->y : rightFace->y;
-    }
-    else {                      /* Muffle compiler */
-        xorgi = yorgi = 0;
-    }
-    edgey1 = 65536;
-    edgey2 = 65536;
-    edge1.x = 0;                /* not used, keep memory checkers happy */
-    edge1.dy = -1;
-    edge2.x = 0;                /* not used, keep memory checkers happy */
-    edge2.dy = -1;
-    edgeleft1 = FALSE;
-    edgeleft2 = FALSE;
-
-    if ((pGC->lineWidth > 2) &&
-        ((pGC->capStyle == CapRound && pGC->joinStyle != JoinRound) ||
-         (pGC->joinStyle == JoinRound && pGC->capStyle == CapButt))) {
-        if (isInt) {
-            xorg = (double) xorgi;
-            yorg = (double) yorgi;
-        }
-
-        if (leftFace && rightFace)
-            miRoundJoinClip(leftFace, rightFace, &edge1, &edge2,
-                            &edgey1, &edgey2, &edgeleft1, &edgeleft2);
-        else if (leftFace)
-            edgey1 = miRoundCapClip(leftFace, isInt, &edge1, &edgeleft1);
-        else if (rightFace)
-            edgey2 = miRoundCapClip(rightFace, isInt, &edge2, &edgeleft2);
-
-        isInt = FALSE;
-    }
-
-    if (isInt) {
-        if (pGC->lineWidth == 1) {
-            XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-            Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
-
-            DRAW_POINT(infoRec->pScrn, xorgi, yorgi);
-        }
-        else
-            XAALineArcI(pGC, xorgi, yorgi);
-    }
-    else
-        XAALineArcD(pGC, xorg, yorg, &edge1, edgey1, edgeleft1,
-                    &edge2, edgey2, edgeleft2);
-
-}
-
-static void
-XAALineJoin(GCPtr pGC, LineFacePtr pLeft, LineFacePtr pRight)
-{
-    double mx = 0, my = 0;
-    double denom = 0;
-    PolyVertexRec vertices[4];
-    PolySlopeRec slopes[4];
-    int edgecount;
-    PolyEdgeRec left[4], right[4];
-    int nleft, nright;
-    int y, height;
-    int swapslopes;
-    int joinStyle = pGC->joinStyle;
-    int lw = pGC->lineWidth;
-
-    if (lw == 1) {
-        /* Lines going in the same direction have no join */
-        if ((pLeft->dx >= 0) == (pRight->dx <= 0))
-            return;
-        if (joinStyle != JoinRound) {
-            denom = -pLeft->dx * (double) pRight->dy + pRight->dx *
-                (double) pLeft->dy;
-            if (denom == 0.0)
-                return;         /* no join to draw */
-        }
-        if (joinStyle != JoinMiter) {
-            XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-            Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
-
-            DRAW_POINT(infoRec->pScrn, pLeft->x, pLeft->y);
-            return;
-        }
-    }
-    else {
-        if (joinStyle == JoinRound) {
-            XAALineArc(pGC, pLeft, pRight, (double) 0.0, (double) 0.0, TRUE);
-            return;
-        }
-        denom = -pLeft->dx * (double) pRight->dy + pRight->dx *
-            (double) pLeft->dy;
-        if (denom == 0.0)
-            return;             /* no join to draw */
-    }
-
-    swapslopes = 0;
-    if (denom > 0) {
-        pLeft->xa = -pLeft->xa;
-        pLeft->ya = -pLeft->ya;
-        pLeft->dx = -pLeft->dx;
-        pLeft->dy = -pLeft->dy;
-    }
-    else {
-        swapslopes = 1;
-        pRight->xa = -pRight->xa;
-        pRight->ya = -pRight->ya;
-        pRight->dx = -pRight->dx;
-        pRight->dy = -pRight->dy;
-    }
-
-    vertices[0].x = pRight->xa;
-    vertices[0].y = pRight->ya;
-    slopes[0].dx = -pRight->dy;
-    slopes[0].dy = pRight->dx;
-    slopes[0].k = 0;
-
-    vertices[1].x = 0;
-    vertices[1].y = 0;
-    slopes[1].dx = pLeft->dy;
-    slopes[1].dy = -pLeft->dx;
-    slopes[1].k = 0;
-
-    vertices[2].x = pLeft->xa;
-    vertices[2].y = pLeft->ya;
-
-    if (joinStyle == JoinMiter) {
-        my = (pLeft->dy * (pRight->xa * pRight->dy - pRight->ya * pRight->dx) -
-              pRight->dy * (pLeft->xa * pLeft->dy - pLeft->ya * pLeft->dx)) /
-            denom;
-        if (pLeft->dy != 0)
-            mx = pLeft->xa + (my - pLeft->ya) *
-                (double) pLeft->dx / (double) pLeft->dy;
-        else
-            mx = pRight->xa + (my - pRight->ya) *
-                (double) pRight->dx / (double) pRight->dy;
-
-        /* check miter limit */
-        if ((mx * mx + my * my) * 4 > SQSECANT * lw * lw)
-            joinStyle = JoinBevel;
-    }
-
-    if (joinStyle == JoinMiter) {
-        slopes[2].dx = pLeft->dx;
-        slopes[2].dy = pLeft->dy;
-        slopes[2].k = pLeft->k;
-        if (swapslopes) {
-            slopes[2].dx = -slopes[2].dx;
-            slopes[2].dy = -slopes[2].dy;
-            slopes[2].k = -slopes[2].k;
-        }
-        vertices[3].x = mx;
-        vertices[3].y = my;
-        slopes[3].dx = pRight->dx;
-        slopes[3].dy = pRight->dy;
-        slopes[3].k = pRight->k;
-        if (swapslopes) {
-            slopes[3].dx = -slopes[3].dx;
-            slopes[3].dy = -slopes[3].dy;
-            slopes[3].k = -slopes[3].k;
-        }
-        edgecount = 4;
-    }
-    else {
-        double scale, dx, dy, adx, ady;
-
-        adx = dx = pRight->xa - pLeft->xa;
-        ady = dy = pRight->ya - pLeft->ya;
-        if (adx < 0)
-            adx = -adx;
-        if (ady < 0)
-            ady = -ady;
-        scale = ady;
-        if (adx > ady)
-            scale = adx;
-        slopes[2].dx = (dx * 65536) / scale;
-        slopes[2].dy = (dy * 65536) / scale;
-        slopes[2].k = ((pLeft->xa + pRight->xa) * slopes[2].dy -
-                       (pLeft->ya + pRight->ya) * slopes[2].dx) / 2.0;
-        edgecount = 3;
-    }
-
-    y = miPolyBuildPoly(vertices, slopes, edgecount, pLeft->x, pLeft->y,
-                        left, right, &nleft, &nright, &height);
-    XAAFillPolyHelper(pGC, y, height, left, right, nleft, nright);
-}
-
-void
-XAAPolylinesWideSolid(DrawablePtr pDrawable,
-                      GCPtr pGC, int mode, int npt, DDXPointPtr pPts)
-{
-    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-    int x1, y1, x2, y2;
-    Bool projectLeft, projectRight;
-    LineFaceRec leftFace, rightFace, prevRightFace, firstFace;
-    int first = TRUE;
-    Bool somethingDrawn = FALSE;
-    Bool selfJoin = FALSE;
-    int xorg = pDrawable->x;
-    int yorg = pDrawable->y;
-    Bool hardClip = FALSE;
-
-    if (!RegionNumRects(pGC->pCompositeClip))
-        return;
-
-    if (RegionNumRects(pGC->pCompositeClip) != 1) {
-        miWideLine(pDrawable, pGC, mode, npt, pPts);
-        return;
-    }
-
-    x2 = pPts->x;
-    y2 = pPts->y;
-    if (npt > 1) {
-        if (mode == CoordModePrevious) {
-            int nptTmp;
-            register DDXPointPtr pPtsTmp;
-
-            x1 = x2;
-            y1 = y2;
-            nptTmp = npt;
-            pPtsTmp = pPts + 1;
-            while (--nptTmp) {
-                x1 += pPtsTmp->x;
-                y1 += pPtsTmp->y;
-                ++pPtsTmp;
-            }
-            if ((x2 == x1) && (y2 == y1))
-                selfJoin = TRUE;
-        }
-        else if ((x2 == pPts[npt - 1].x) && (y2 == pPts[npt - 1].y))
-            selfJoin = TRUE;
-    }
-
-    projectLeft = ((pGC->capStyle == CapProjecting) && !selfJoin);
-    projectRight = FALSE;
-
-    (*infoRec->SetupForSolidFill) (infoRec->pScrn, pGC->fgPixel, pGC->alu,
-                                   pGC->planemask);
-
-    infoRec->ClipBox = &pGC->pCompositeClip->extents;
-
-    if (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL) {
-        hardClip = TRUE;
-        (*infoRec->SetClippingRectangle) (infoRec->pScrn,
-                                          infoRec->ClipBox->x1,
-                                          infoRec->ClipBox->y1,
-                                          infoRec->ClipBox->x2 - 1,
-                                          infoRec->ClipBox->y2 - 1);
-    }
-
-    x2 += xorg;
-    y2 += yorg;
-    while (--npt) {
-        x1 = x2;
-        y1 = y2;
-        ++pPts;
-        x2 = pPts->x;
-        y2 = pPts->y;
-        if (mode == CoordModePrevious) {
-            x2 += x1;
-            y2 += y1;
-        }
-        else {
-            x2 += xorg;
-            y2 += yorg;
-        }
-        if ((x1 != x2) || (y1 != y2)) {
-            somethingDrawn = TRUE;
-            if ((npt == 1) && (pGC->capStyle == CapProjecting) && !selfJoin)
-                projectRight = TRUE;
-            XAAWideSegment(pGC, x1, y1, x2, y2,
-                           projectLeft, projectRight, &leftFace, &rightFace);
-            if (first) {
-                if (selfJoin)
-                    firstFace = leftFace;
-                else if (pGC->capStyle == CapRound) {
-                    if (pGC->lineWidth == 1) {
-                        DRAW_POINT(infoRec->pScrn, x1, y1);
-                    }
-                    else
-                        XAALineArc(pGC, &leftFace, (LineFacePtr) NULL,
-                                   (double) 0.0, (double) 0.0, TRUE);
-                }
-            }
-            else
-                XAALineJoin(pGC, &leftFace, &prevRightFace);
-
-            prevRightFace = rightFace;
-            first = FALSE;
-            projectLeft = FALSE;
-        }
-        if (npt == 1 && somethingDrawn) {
-            if (selfJoin)
-                XAALineJoin(pGC, &firstFace, &rightFace);
-            else if (pGC->capStyle == CapRound) {
-                if (pGC->lineWidth == 1) {
-                    DRAW_POINT(infoRec->pScrn, x2, y2);
-                }
-                else
-                    XAALineArc(pGC, (LineFacePtr) NULL, &rightFace,
-                               (double) 0.0, (double) 0.0, TRUE);
-            }
-        }
-    }
-    /* handle crock where all points are coincedent */
-    if (!somethingDrawn) {
-        projectLeft = (pGC->capStyle == CapProjecting);
-        XAAWideSegment(pGC, x2, y2, x2, y2, projectLeft, projectLeft,
-                       &leftFace, &rightFace);
-        if (pGC->capStyle == CapRound) {
-            XAALineArc(pGC, &leftFace, (LineFacePtr) NULL,
-                       (double) 0.0, (double) 0.0, TRUE);
-            rightFace.dx = -1;  /* sleezy hack to make it work */
-            XAALineArc(pGC, (LineFacePtr) NULL, &rightFace,
-                       (double) 0.0, (double) 0.0, TRUE);
-        }
-    }
-
-    infoRec->ClipBox = NULL;
-    if (hardClip)
-        (*infoRec->DisableClipping) (infoRec->pScrn);
-
-    SET_SYNC_FLAG(infoRec);
-}
diff --git a/hw/xfree86/xaa/xaacexp.h b/hw/xfree86/xaa/xaacexp.h
deleted file mode 100644 (file)
index 6fde54c..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/Xarch.h>
-
-#ifndef FIXEDBASE
-#define CHECKRETURN(b) if(width <= ((b) * 32)) return(base + (b))
-#else
-#define CHECKRETURN(b) if(width <= ((b) * 32)) return(base)
-#endif
-
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-#define SHIFT_L(value, shift) ((value) >> (shift))
-#define SHIFT_R(value, shift) ((value) << (shift))
-#else
-#define SHIFT_L(value, shift) ((value) << (shift))
-#define SHIFT_R(value, shift) ((value) >> (shift))
-#endif
-
-#ifndef MSBFIRST
-#ifdef FIXEDBASE
-#define WRITE_IN_BITORDER(dest, offset, data) *(dest) = data;
-#else
-#define WRITE_IN_BITORDER(dest, offset, data) *(dest + offset) = data;
-#endif
-#else
-#ifdef FIXEDBASE
-#define WRITE_IN_BITORDER(dest, offset, data) *(dest) = SWAP_BITS_IN_BYTES(data);
-#else
-#define WRITE_IN_BITORDER(dest, offset, data) *(dest + offset) = SWAP_BITS_IN_BYTES(data)
-#endif
-#endif
-
-#ifdef FIXEDBASE
-#ifdef MSBFIRST
-#define WRITE_BITS(b)   *base = SWAP_BITS_IN_BYTES(b)
-#define WRITE_BITS1(b) { \
-       *base = byte_reversed_expand3[(b) & 0xFF] | \
-               byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; }
-#define WRITE_BITS2(b) { \
-       *base = byte_reversed_expand3[(b) & 0xFF] | \
-               byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
-       *base = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
-               byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; }
-#define WRITE_BITS3(b) { \
-       *base = byte_reversed_expand3[(b) & 0xFF] | \
-               byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
-       *base = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
-               byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \
-       *base = byte_reversed_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
-               byte_reversed_expand3[((b) & 0xFF000000) >> 24] << 8; }
-#else
-#define WRITE_BITS(b)   *base = (b)
-#define WRITE_BITS1(b) { \
-       *base = byte_expand3[(b) & 0xFF] | \
-               byte_expand3[((b) & 0xFF00) >> 8] << 24; }
-#define WRITE_BITS2(b) { \
-       *base = byte_expand3[(b) & 0xFF] | \
-               byte_expand3[((b) & 0xFF00) >> 8] << 24; \
-       *base = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
-               byte_expand3[((b) & 0xFF0000) >> 16] << 16; }
-#define WRITE_BITS3(b) { \
-       *base = byte_expand3[(b) & 0xFF] | \
-               byte_expand3[((b) & 0xFF00) >> 8] << 24; \
-       *base = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
-               byte_expand3[((b) & 0xFF0000) >> 16] << 16; \
-       *base = byte_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
-               byte_expand3[((b) & 0xFF000000) >> 24] << 8; }
-#endif
-#else
-#ifdef MSBFIRST
-#define WRITE_BITS(b)   *(base++) = SWAP_BITS_IN_BYTES(b)
-#define WRITE_BITS1(b) { \
-       *(base++) = byte_reversed_expand3[(b) & 0xFF] | \
-               byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; }
-#define WRITE_BITS2(b) { \
-       *(base) = byte_reversed_expand3[(b) & 0xFF] | \
-               byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
-       *(base + 1) = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
-               byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \
-       base += 2; }
-#define WRITE_BITS3(b) { \
-       *(base) = byte_reversed_expand3[(b) & 0xFF] | \
-               byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
-       *(base + 1) = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
-               byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \
-       *(base + 2) = byte_reversed_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
-               byte_reversed_expand3[((b) & 0xFF000000) >> 24] << 8; \
-       base += 3; }
-#else
-#define WRITE_BITS(b)   *(base++) = (b)
-#define WRITE_BITS1(b) { \
-       *(base++) = byte_expand3[(b) & 0xFF] | \
-               byte_expand3[((b) & 0xFF00) >> 8] << 24; }
-#define WRITE_BITS2(b) { \
-       *(base) = byte_expand3[(b) & 0xFF] | \
-               byte_expand3[((b) & 0xFF00) >> 8] << 24; \
-       *(base + 1) = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
-               byte_expand3[((b) & 0xFF0000) >> 16] << 16; \
-       base += 2; }
-#define WRITE_BITS3(b) { \
-       *(base) = byte_expand3[(b) & 0xFF] | \
-               byte_expand3[((b) & 0xFF00) >> 8] << 24; \
-       *(base + 1) = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
-               byte_expand3[((b) & 0xFF0000) >> 16] << 16; \
-       *(base + 2) = byte_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
-               byte_expand3[((b) & 0xFF000000) >> 24] << 8; \
-       base += 3; }
-#endif
-#endif
-
-#ifdef FIXEDBASE
-#ifdef MSBFIRST
-#define EXPNAME(x) x##MSBFirstFixedBase
-#else
-#define EXPNAME(x) x##LSBFirstFixedBase
-#endif
-#else
-#ifdef MSBFIRST
-#define EXPNAME(x) x##MSBFirst
-#else
-#define EXPNAME(x) x##LSBFirst
-#endif
-#endif
diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h
deleted file mode 100644 (file)
index c028ef0..0000000
+++ /dev/null
@@ -1,1437 +0,0 @@
-
-#ifndef _XAALOCAL_H
-#define _XAALOCAL_H
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-/* This file is very unorganized ! */
-
-#include "gcstruct.h"
-#include "regionstr.h"
-#include "xf86fbman.h"
-#include "xaa.h"
-#include "mi.h"
-#include "picturestr.h"
-
-#define GCWhenForced           (GCArcMode << 1)
-
-#define DO_COLOR_8x8           0x00000001
-#define DO_MONO_8x8            0x00000002
-#define DO_CACHE_BLT           0x00000003
-#define DO_COLOR_EXPAND                0x00000004
-#define DO_CACHE_EXPAND                0x00000005
-#define DO_IMAGE_WRITE         0x00000006
-#define DO_PIXMAP_COPY         0x00000007
-#define DO_SOLID               0x00000008
-
-typedef CARD32 *(*GlyphScanlineFuncPtr) (CARD32 *base, unsigned int **glyphp,
-                                         int line, int nglyph, int width);
-
-typedef CARD32 *(*StippleScanlineProcPtr) (CARD32 *, CARD32 *, int, int, int);
-
-typedef void (*RectFuncPtr) (ScrnInfoPtr, int, int, int, int, int, int,
-                             XAACacheInfoPtr);
-typedef void (*TrapFuncPtr) (ScrnInfoPtr, int, int, int, int, int, int,
-                             int, int, int, int, int, int, XAACacheInfoPtr);
-
-typedef struct _XAAScreen {
-    CreateGCProcPtr CreateGC;
-    CloseScreenProcPtr CloseScreen;
-    GetImageProcPtr GetImage;
-    GetSpansProcPtr GetSpans;
-    CopyWindowProcPtr CopyWindow;
-    WindowExposuresProcPtr WindowExposures;
-    CreatePixmapProcPtr CreatePixmap;
-    DestroyPixmapProcPtr DestroyPixmap;
-    ChangeWindowAttributesProcPtr ChangeWindowAttributes;
-    XAAInfoRecPtr AccelInfoRec;
-    Bool (*EnterVT) (int, int);
-    void (*LeaveVT) (int, int);
-    int (*SetDGAMode) (int, int, DGADevicePtr);
-    void (*EnableDisableFBAccess) (int, Bool);
-    CompositeProcPtr Composite;
-    GlyphsProcPtr Glyphs;
-} XAAScreenRec, *XAAScreenPtr;
-
-#define        OPS_ARE_PIXMAP          0x00000001
-#define OPS_ARE_ACCEL          0x00000002
-
-typedef struct _XAAGC {
-    GCOps *wrapOps;
-    GCFuncs *wrapFuncs;
-    GCOps *XAAOps;
-    int DashLength;
-    unsigned char *DashPattern;
-    unsigned long changes;
-    unsigned long flags;
-} XAAGCRec, *XAAGCPtr;
-
-#define REDUCIBILITY_CHECKED   0x00000001
-#define REDUCIBLE_TO_8x8       0x00000002
-#define REDUCIBLE_TO_2_COLOR   0x00000004
-#define DIRTY                  0x00010000
-#define OFFSCREEN              0x00020000
-#define DGA_PIXMAP             0x00040000
-#define SHARED_PIXMAP          0x00080000
-#define LOCKED_PIXMAP          0x00100000
-
-#define REDUCIBILITY_MASK \
- (REDUCIBILITY_CHECKED | REDUCIBLE_TO_8x8 | REDUCIBLE_TO_2_COLOR)
-
-typedef struct _XAAPixmap {
-    unsigned long flags;
-    CARD32 pattern0;
-    CARD32 pattern1;
-    int fg;
-    int bg;
-    FBAreaPtr offscreenArea;
-    Bool freeData;
-} XAAPixmapRec, *XAAPixmapPtr;
-
-extern _X_EXPORT Bool
- XAACreateGC(GCPtr pGC);
-
-extern _X_EXPORT Bool
- XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec);
-
-extern _X_EXPORT RegionPtr
-
-XAABitBlt(DrawablePtr pSrcDrawable,
-          DrawablePtr pDstDrawable,
-          GC * pGC,
-          int srcx,
-          int srcy,
-          int width,
-          int height,
-          int dstx,
-          int dsty,
-          void (*doBitBlt) (DrawablePtr, DrawablePtr, GCPtr, RegionPtr,
-                            DDXPointPtr), unsigned long bitPlane);
-
-extern _X_EXPORT void
-
-XAAScreenToScreenBitBlt(ScrnInfoPtr pScrn,
-                        int nbox,
-                        DDXPointPtr pptSrc,
-                        BoxPtr pbox,
-                        int xdir, int ydir, int alu, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAADoBitBlt(DrawablePtr pSrc,
-            DrawablePtr pDst, GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc);
-
-extern _X_EXPORT void
-
-XAADoImageWrite(DrawablePtr pSrc,
-                DrawablePtr pDst,
-                GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc);
-
-extern _X_EXPORT void
-
-XAADoImageRead(DrawablePtr pSrc,
-               DrawablePtr pDst,
-               GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc);
-
-extern _X_EXPORT void
- XAACopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
-
-extern _X_EXPORT RegionPtr
-
-XAACopyArea(DrawablePtr pSrcDrawable,
-            DrawablePtr pDstDrawable,
-            GC * pGC,
-            int srcx, int srcy, int width, int height, int dstx, int dsty);
-
-extern _X_EXPORT void
- XAAValidateCopyArea(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-
-extern _X_EXPORT void
- XAAValidatePutImage(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-
-extern _X_EXPORT void
- XAAValidateCopyPlane(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-
-extern _X_EXPORT void
- XAAValidatePushPixels(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-
-extern _X_EXPORT void
- XAAValidateFillSpans(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-
-extern _X_EXPORT void
- XAAValidatePolyGlyphBlt(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-
-extern _X_EXPORT void
- XAAValidateImageGlyphBlt(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-
-extern _X_EXPORT void
- XAAValidatePolylines(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-
-extern _X_EXPORT RegionPtr
-
-XAACopyPlaneColorExpansion(DrawablePtr pSrc,
-                           DrawablePtr pDst,
-                           GCPtr pGC,
-                           int srcx,
-                           int srcy,
-                           int width,
-                           int height,
-                           int dstx, int dsty, unsigned long bitPlane);
-
-extern _X_EXPORT void
-
-XAAPushPixelsSolidColorExpansion(GCPtr pGC,
-                                 PixmapPtr pBitMap,
-                                 DrawablePtr pDrawable,
-                                 int dx, int dy, int xOrg, int yOrg);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapColorExpandMSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                           int x, int y, int w, int h,
-                                           unsigned char *src,
-                                           int srcwidth,
-                                           int skipleft,
-                                           int fg, int bg,
-                                           int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapColorExpand3MSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                            int x, int y, int w, int h,
-                                            unsigned char *src,
-                                            int srcwidth,
-                                            int skipleft,
-                                            int fg, int bg,
-                                            int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapColorExpandMSBFirst(ScrnInfoPtr pScrn,
-                                  int x, int y, int w, int h,
-                                  unsigned char *src,
-                                  int srcwidth,
-                                  int skipleft,
-                                  int fg, int bg,
-                                  int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapColorExpand3MSBFirst(ScrnInfoPtr pScrn,
-                                   int x, int y, int w, int h,
-                                   unsigned char *src,
-                                   int srcwidth,
-                                   int skipleft,
-                                   int fg, int bg,
-                                   int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapColorExpandLSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                           int x, int y, int w, int h,
-                                           unsigned char *src,
-                                           int srcwidth,
-                                           int skipleft,
-                                           int fg, int bg,
-                                           int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapColorExpand3LSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                            int x, int y, int w, int h,
-                                            unsigned char *src,
-                                            int srcwidth,
-                                            int skipleft,
-                                            int fg, int bg,
-                                            int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapColorExpandLSBFirst(ScrnInfoPtr pScrn,
-                                  int x, int y, int w, int h,
-                                  unsigned char *src,
-                                  int srcwidth,
-                                  int skipleft,
-                                  int fg, int bg,
-                                  int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapColorExpand3LSBFirst(ScrnInfoPtr pScrn,
-                                   int x, int y, int w, int h,
-                                   unsigned char *src,
-                                   int srcwidth,
-                                   int skipleft,
-                                   int fg, int bg,
-                                   int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapScanlineColorExpandMSBFirst(ScrnInfoPtr pScrn,
-                                          int x, int y, int w, int h,
-                                          unsigned char *src,
-                                          int srcwidth,
-                                          int skipleft,
-                                          int fg, int bg,
-                                          int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapScanlineColorExpand3MSBFirst(ScrnInfoPtr pScrn,
-                                           int x, int y, int w, int h,
-                                           unsigned char *src,
-                                           int srcwidth,
-                                           int skipleft,
-                                           int fg, int bg,
-                                           int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapScanlineColorExpandMSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                                   int x, int y, int w, int h,
-                                                   unsigned char *src,
-                                                   int srcwidth,
-                                                   int skipleft,
-                                                   int fg, int bg,
-                                                   int rop,
-                                                   unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapScanlineColorExpand3MSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                                    int x, int y, int w, int h,
-                                                    unsigned char *src,
-                                                    int srcwidth,
-                                                    int skipleft,
-                                                    int fg, int bg,
-                                                    int rop,
-                                                    unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapScanlineColorExpandLSBFirst(ScrnInfoPtr pScrn,
-                                          int x, int y, int w, int h,
-                                          unsigned char *src,
-                                          int srcwidth,
-                                          int skipleft,
-                                          int fg, int bg,
-                                          int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapScanlineColorExpand3LSBFirst(ScrnInfoPtr pScrn,
-                                           int x, int y, int w, int h,
-                                           unsigned char *src,
-                                           int srcwidth,
-                                           int skipleft,
-                                           int fg, int bg,
-                                           int rop, unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapScanlineColorExpandLSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                                   int x, int y, int w, int h,
-                                                   unsigned char *src,
-                                                   int srcwidth,
-                                                   int skipleft,
-                                                   int fg, int bg,
-                                                   int rop,
-                                                   unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapScanlineColorExpand3LSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                                    int x, int y, int w, int h,
-                                                    unsigned char *src,
-                                                    int srcwidth,
-                                                    int skipleft,
-                                                    int fg, int bg,
-                                                    int rop,
-                                                    unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAWritePixmap(ScrnInfoPtr pScrn,
-               int x, int y, int w, int h,
-               unsigned char *src,
-               int srcwidth,
-               int rop,
-               unsigned int planemask,
-               int transparency_color, int bpp, int depth);
-
-extern _X_EXPORT void
-
-XAAWritePixmapScanline(ScrnInfoPtr pScrn,
-                       int x, int y, int w, int h,
-                       unsigned char *src,
-                       int srcwidth,
-                       int rop,
-                       unsigned int planemask,
-                       int transparency_color, int bpp, int depth);
-
-typedef void (*ClipAndRenderRectsFunc) (GCPtr, int, BoxPtr, int, int);
-
-extern _X_EXPORT void
-
-XAAClipAndRenderRects(GCPtr pGC,
-                      ClipAndRenderRectsFunc func,
-                      int nrectFill, xRectangle *prectInit, int xorg, int yorg);
-
-typedef void (*ClipAndRenderSpansFunc) (GCPtr, int, DDXPointPtr, int *,
-                                        int, int, int);
-
-extern _X_EXPORT void
-
-XAAClipAndRenderSpans(GCPtr pGC,
-                      DDXPointPtr ppt,
-                      int *pwidth,
-                      int nspans,
-                      int fSorted,
-                      ClipAndRenderSpansFunc func, int xorg, int yorg);
-
-extern _X_EXPORT void
-
-XAAFillSolidRects(ScrnInfoPtr pScrn,
-                  int fg, int rop,
-                  unsigned int planemask, int nBox, BoxPtr pBox);
-
-extern _X_EXPORT void
-
-XAAFillMono8x8PatternRects(ScrnInfoPtr pScrn,
-                           int fg, int bg, int rop,
-                           unsigned int planemask,
-                           int nBox,
-                           BoxPtr pBox, int pat0, int pat1, int xorg, int yorg);
-
-extern _X_EXPORT void
-
-XAAFillMono8x8PatternRectsScreenOrigin(ScrnInfoPtr pScrn,
-                                       int fg, int bg, int rop,
-                                       unsigned int planemask,
-                                       int nBox,
-                                       BoxPtr pBox,
-                                       int pat0, int pat1, int xorg, int yorg);
-
-extern _X_EXPORT void
-
-XAAFillColor8x8PatternRectsScreenOrigin(ScrnInfoPtr pScrn,
-                                        int rop,
-                                        unsigned int planemask,
-                                        int nBox,
-                                        BoxPtr pBox,
-                                        int xorigin, int yorigin,
-                                        XAACacheInfoPtr pCache);
-
-extern _X_EXPORT void
-
-XAAFillColor8x8PatternRects(ScrnInfoPtr pScrn,
-                            int rop,
-                            unsigned int planemask,
-                            int nBox,
-                            BoxPtr pBox,
-                            int xorigin, int yorigin, XAACacheInfoPtr pCache);
-
-extern _X_EXPORT void
-
-XAAFillCacheBltRects(ScrnInfoPtr pScrn,
-                     int rop,
-                     unsigned int planemask,
-                     int nBox,
-                     BoxPtr pBox, int xorg, int yorg, XAACacheInfoPtr pCache);
-
-extern _X_EXPORT void
-
-XAAFillCacheExpandRects(ScrnInfoPtr pScrn,
-                        int fg, int bg, int rop,
-                        unsigned int planemask,
-                        int nBox,
-                        BoxPtr pBox, int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillImageWriteRects(ScrnInfoPtr pScrn,
-                       int rop,
-                       unsigned int planemask,
-                       int nBox,
-                       BoxPtr pBox, int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAPolyFillRect(DrawablePtr pDraw,
-                GCPtr pGC, int nrectFill, xRectangle *prectInit);
-
-extern _X_EXPORT void
-
-XAATEGlyphRendererMSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                    int x, int y, int w, int h, int skipleft,
-                                    int startline, unsigned int **glyphs,
-                                    int glyphWidth, int fg, int bg, int rop,
-                                    unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRenderer3MSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                     int x, int y, int w, int h, int skipleft,
-                                     int startline, unsigned int **glyphs,
-                                     int glyphWidth, int fg, int bg, int rop,
-                                     unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRendererMSBFirst(ScrnInfoPtr pScrn,
-                           int x, int y, int w, int h, int skipleft,
-                           int startline, unsigned int **glyphs, int glyphWidth,
-                           int fg, int bg, int rop, unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRenderer3MSBFirst(ScrnInfoPtr pScrn,
-                            int x, int y, int w, int h, int skipleft,
-                            int startline, unsigned int **glyphs,
-                            int glyphWidth, int fg, int bg, int rop,
-                            unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRendererLSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                    int x, int y, int w, int h, int skipleft,
-                                    int startline, unsigned int **glyphs,
-                                    int glyphWidth, int fg, int bg, int rop,
-                                    unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRenderer3LSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                     int x, int y, int w, int h, int skipleft,
-                                     int startline, unsigned int **glyphs,
-                                     int glyphWidth, int fg, int bg, int rop,
-                                     unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRendererLSBFirst(ScrnInfoPtr pScrn,
-                           int x, int y, int w, int h, int skipleft,
-                           int startline, unsigned int **glyphs, int glyphWidth,
-                           int fg, int bg, int rop, unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRenderer3LSBFirst(ScrnInfoPtr pScrn,
-                            int x, int y, int w, int h, int skipleft,
-                            int startline, unsigned int **glyphs,
-                            int glyphWidth, int fg, int bg, int rop,
-                            unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRendererScanlineMSBFirst(ScrnInfoPtr pScrn,
-                                   int x, int y, int w, int h, int skipleft,
-                                   int startline, unsigned int **glyphs,
-                                   int glyphWidth, int fg, int bg, int rop,
-                                   unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRendererScanline3MSBFirst(ScrnInfoPtr pScrn,
-                                    int x, int y, int w, int h, int skipleft,
-                                    int startline, unsigned int **glyphs,
-                                    int glyphWidth, int fg, int bg, int rop,
-                                    unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRendererScanlineLSBFirst(ScrnInfoPtr pScrn,
-                                   int x, int y, int w, int h, int skipleft,
-                                   int startline, unsigned int **glyphs,
-                                   int glyphWidth, int fg, int bg, int rop,
-                                   unsigned planemask);
-
-extern _X_EXPORT void
-
-XAATEGlyphRendererScanline3LSBFirst(ScrnInfoPtr pScrn,
-                                    int x, int y, int w, int h, int skipleft,
-                                    int startline, unsigned int **glyphs,
-                                    int glyphWidth, int fg, int bg, int rop,
-                                    unsigned planemask);
-
-extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncMSBFirstFixedBase[32]) (CARD32
-                                                                       *base,
-                                                                       unsigned
-                                                                       int
-                                                                       **glyphp,
-                                                                       int line,
-                                                                       int
-                                                                       nglyph,
-                                                                       int
-                                                                       width);
-
-extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncMSBFirst[32]) (CARD32 *base,
-                                                              unsigned int
-                                                              **glyphp,
-                                                              int line,
-                                                              int nglyph,
-                                                              int width);
-
-extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncLSBFirstFixedBase[32]) (CARD32
-                                                                       *base,
-                                                                       unsigned
-                                                                       int
-                                                                       **glyphp,
-                                                                       int line,
-                                                                       int
-                                                                       nglyph,
-                                                                       int
-                                                                       width);
-
-extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncLSBFirst[32]) (CARD32 *base,
-                                                              unsigned int
-                                                              **glyphp,
-                                                              int line,
-                                                              int nglyph,
-                                                              int width);
-
-extern _X_EXPORT GlyphScanlineFuncPtr
-    *XAAGetGlyphScanlineFuncMSBFirstFixedBase(void);
-extern _X_EXPORT GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncMSBFirst(void);
-extern _X_EXPORT GlyphScanlineFuncPtr
-    *XAAGetGlyphScanlineFuncLSBFirstFixedBase(void);
-extern _X_EXPORT GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncLSBFirst(void);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandRectsLSBFirst(ScrnInfoPtr pScrn,
-                                int fg, int bg, int rop,
-                                unsigned int planemask,
-                                int nBox,
-                                BoxPtr pBox,
-                                int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandRects3LSBFirst(ScrnInfoPtr pScrn,
-                                 int fg, int bg, int rop,
-                                 unsigned int planemask,
-                                 int nBox,
-                                 BoxPtr pBox,
-                                 int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandRectsLSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                         int fg, int bg, int rop,
-                                         unsigned int planemask,
-                                         int nBox,
-                                         BoxPtr pBox,
-                                         int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandRects3LSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                          int fg, int bg, int rop,
-                                          unsigned int planemask,
-                                          int nBox,
-                                          BoxPtr pBox,
-                                          int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandRectsMSBFirst(ScrnInfoPtr pScrn,
-                                int fg, int bg, int rop,
-                                unsigned int planemask,
-                                int nBox,
-                                BoxPtr pBox,
-                                int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandRects3MSBFirst(ScrnInfoPtr pScrn,
-                                 int fg, int bg, int rop,
-                                 unsigned int planemask,
-                                 int nBox,
-                                 BoxPtr pBox,
-                                 int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandRectsMSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                         int fg, int bg, int rop,
-                                         unsigned int planemask,
-                                         int nBox,
-                                         BoxPtr pBox,
-                                         int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandRects3MSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                          int fg, int bg, int rop,
-                                          unsigned int planemask,
-                                          int nBox,
-                                          BoxPtr pBox,
-                                          int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillScanlineColorExpandRectsLSBFirst(ScrnInfoPtr pScrn,
-                                        int fg, int bg, int rop,
-                                        unsigned int planemask,
-                                        int nBox,
-                                        BoxPtr pBox,
-                                        int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillScanlineColorExpandRects3LSBFirst(ScrnInfoPtr pScrn,
-                                         int fg, int bg, int rop,
-                                         unsigned int planemask,
-                                         int nBox,
-                                         BoxPtr pBox,
-                                         int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillScanlineColorExpandRectsMSBFirst(ScrnInfoPtr pScrn,
-                                        int fg, int bg, int rop,
-                                        unsigned int planemask,
-                                        int nBox,
-                                        BoxPtr pBox,
-                                        int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillScanlineColorExpandRects3MSBFirst(ScrnInfoPtr pScrn,
-                                         int fg, int bg, int rop,
-                                         unsigned int planemask,
-                                         int nBox,
-                                         BoxPtr pBox,
-                                         int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandSpansLSBFirst(ScrnInfoPtr pScrn,
-                                int fg, int bg, int rop,
-                                unsigned int planemask,
-                                int n,
-                                DDXPointPtr ppt,
-                                int *pwidth,
-                                int fSorted,
-                                int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandSpans3LSBFirst(ScrnInfoPtr pScrn,
-                                 int fg, int bg, int rop,
-                                 unsigned int planemask,
-                                 int n,
-                                 DDXPointPtr ppt,
-                                 int *pwidth,
-                                 int fSorted,
-                                 int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandSpansLSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                         int fg, int bg, int rop,
-                                         unsigned int planemask,
-                                         int n,
-                                         DDXPointPtr ppt,
-                                         int *pwidth,
-                                         int fSorted,
-                                         int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandSpans3LSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                          int fg, int bg, int rop,
-                                          unsigned int planemask,
-                                          int n,
-                                          DDXPointPtr ppt,
-                                          int *pwidth,
-                                          int fSorted,
-                                          int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandSpansMSBFirst(ScrnInfoPtr pScrn,
-                                int fg, int bg, int rop,
-                                unsigned int planemask,
-                                int n,
-                                DDXPointPtr ppt,
-                                int *pwidth,
-                                int fSorted,
-                                int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandSpans3MSBFirst(ScrnInfoPtr pScrn,
-                                 int fg, int bg, int rop,
-                                 unsigned int planemask,
-                                 int n,
-                                 DDXPointPtr ppt,
-                                 int *pwidth,
-                                 int fSorted,
-                                 int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandSpansMSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                         int fg, int bg, int rop,
-                                         unsigned int planemask,
-                                         int n,
-                                         DDXPointPtr ppt,
-                                         int *pwidth,
-                                         int fSorted,
-                                         int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillColorExpandSpans3MSBFirstFixedBase(ScrnInfoPtr pScrn,
-                                          int fg, int bg, int rop,
-                                          unsigned int planemask,
-                                          int n,
-                                          DDXPointPtr ppt,
-                                          int *pwidth,
-                                          int fSorted,
-                                          int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillScanlineColorExpandSpansLSBFirst(ScrnInfoPtr pScrn,
-                                        int fg, int bg, int rop,
-                                        unsigned int planemask,
-                                        int n,
-                                        DDXPointPtr ppt,
-                                        int *pwidth,
-                                        int fSorted,
-                                        int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillScanlineColorExpandSpans3LSBFirst(ScrnInfoPtr pScrn,
-                                         int fg, int bg, int rop,
-                                         unsigned int planemask,
-                                         int n,
-                                         DDXPointPtr ppt,
-                                         int *pwidth,
-                                         int fSorted,
-                                         int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAPutImage(DrawablePtr pDraw,
-            GCPtr pGC,
-            int depth,
-            int x, int y, int w, int h, int leftPad, int format, char *pImage);
-
-extern _X_EXPORT void
-
-XAAFillScanlineColorExpandSpansMSBFirst(ScrnInfoPtr pScrn,
-                                        int fg, int bg, int rop,
-                                        unsigned int planemask,
-                                        int n,
-                                        DDXPointPtr ppt,
-                                        int *pwidth,
-                                        int fSorted,
-                                        int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillScanlineColorExpandSpans3MSBFirst(ScrnInfoPtr pScrn,
-                                         int fg, int bg, int rop,
-                                         unsigned int planemask,
-                                         int n,
-                                         DDXPointPtr ppt,
-                                         int *pwidth,
-                                         int fSorted,
-                                         int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncMSBFirstFixedBase[6]) (CARD32
-                                                                        *base,
-                                                                        CARD32
-                                                                        *src,
-                                                                        int
-                                                                        offset,
-                                                                        int
-                                                                        width,
-                                                                        int
-                                                                        dwords);
-
-extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncMSBFirst[6]) (CARD32 *base,
-                                                               CARD32 *src,
-                                                               int offset,
-                                                               int width,
-                                                               int dwords);
-
-extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncLSBFirstFixedBase[6]) (CARD32
-                                                                        *base,
-                                                                        CARD32
-                                                                        *src,
-                                                                        int
-                                                                        offset,
-                                                                        int
-                                                                        width,
-                                                                        int
-                                                                        dwords);
-
-extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncLSBFirst[6]) (CARD32 *base,
-                                                               CARD32 *src,
-                                                               int offset,
-                                                               int width,
-                                                               int dwords);
-
-extern _X_EXPORT StippleScanlineProcPtr
-    *XAAGetStippleScanlineFuncMSBFirstFixedBase(void);
-extern _X_EXPORT StippleScanlineProcPtr
-    *XAAGetStippleScanlineFuncMSBFirst(void);
-extern _X_EXPORT StippleScanlineProcPtr
-    *XAAGetStippleScanlineFuncLSBFirstFixedBase(void);
-extern _X_EXPORT StippleScanlineProcPtr
-    *XAAGetStippleScanlineFuncLSBFirst(void);
-extern _X_EXPORT StippleScanlineProcPtr
-    *XAAGetStippleScanlineFunc3MSBFirstFixedBase(void);
-extern _X_EXPORT StippleScanlineProcPtr
-    *XAAGetStippleScanlineFunc3MSBFirst(void);
-extern _X_EXPORT StippleScanlineProcPtr
-    *XAAGetStippleScanlineFunc3LSBFirstFixedBase(void);
-extern _X_EXPORT StippleScanlineProcPtr
-    *XAAGetStippleScanlineFunc3LSBFirst(void);
-
-extern _X_EXPORT int
-
-XAAPolyText8TEColorExpansion(DrawablePtr pDraw,
-                             GCPtr pGC, int x, int y, int count, char *chars);
-
-extern _X_EXPORT int
-
-XAAPolyText16TEColorExpansion(DrawablePtr pDraw,
-                              GCPtr pGC,
-                              int x, int y, int count, unsigned short *chars);
-
-extern _X_EXPORT void
-
-XAAImageText8TEColorExpansion(DrawablePtr pDraw,
-                              GCPtr pGC, int x, int y, int count, char *chars);
-
-extern _X_EXPORT void
-
-XAAImageText16TEColorExpansion(DrawablePtr pDraw,
-                               GCPtr pGC,
-                               int x, int y, int count, unsigned short *chars);
-
-extern _X_EXPORT void
-
-XAAImageGlyphBltTEColorExpansion(DrawablePtr pDrawable,
-                                 GCPtr pGC,
-                                 int xInit, int yInit,
-                                 unsigned int nglyph,
-                                 CharInfoPtr * ppci, pointer pglyphBase);
-
-extern _X_EXPORT void
-
-XAAPolyGlyphBltTEColorExpansion(DrawablePtr pDrawable,
-                                GCPtr pGC,
-                                int xInit, int yInit,
-                                unsigned int nglyph,
-                                CharInfoPtr * ppci, pointer pglyphBase);
-
-extern _X_EXPORT int
-
-XAAPolyText8NonTEColorExpansion(DrawablePtr pDraw,
-                                GCPtr pGC,
-                                int x, int y, int count, char *chars);
-
-extern _X_EXPORT int
-
-XAAPolyText16NonTEColorExpansion(DrawablePtr pDraw,
-                                 GCPtr pGC,
-                                 int x, int y,
-                                 int count, unsigned short *chars);
-
-extern _X_EXPORT void
-
-XAAImageText8NonTEColorExpansion(DrawablePtr pDraw,
-                                 GCPtr pGC,
-                                 int x, int y, int count, char *chars);
-
-extern _X_EXPORT void
-
-XAAImageText16NonTEColorExpansion(DrawablePtr pDraw,
-                                  GCPtr pGC,
-                                  int x, int y,
-                                  int count, unsigned short *chars);
-
-extern _X_EXPORT void
-
-XAAImageGlyphBltNonTEColorExpansion(DrawablePtr pDrawable,
-                                    GCPtr pGC,
-                                    int xInit, int yInit,
-                                    unsigned int nglyph,
-                                    CharInfoPtr * ppci, pointer pglyphBase);
-
-extern _X_EXPORT void
-
-XAAPolyGlyphBltNonTEColorExpansion(DrawablePtr pDrawable,
-                                   GCPtr pGC,
-                                   int xInit, int yInit,
-                                   unsigned int nglyph,
-                                   CharInfoPtr * ppci, pointer pglyphBase);
-
-extern _X_EXPORT void XAANonTEGlyphRenderer(ScrnInfoPtr pScrn,
-                                            int x, int y, int n,
-                                            NonTEGlyphPtr glyphs,
-                                            BoxPtr pbox,
-                                            int fg, int rop,
-                                            unsigned int planemask);
-
-extern _X_EXPORT void
-
-XAAFillSolidSpans(ScrnInfoPtr pScrn,
-                  int fg, int rop,
-                  unsigned int planemask,
-                  int n, DDXPointPtr ppt, int *pwidth, int fSorted);
-
-extern _X_EXPORT void
-
-XAAFillMono8x8PatternSpans(ScrnInfoPtr pScrn,
-                           int fg, int bg, int rop,
-                           unsigned int planemask,
-                           int n,
-                           DDXPointPtr ppt,
-                           int *pwidth, int fSorted,
-                           int patx, int paty, int xorg, int yorg);
-
-extern _X_EXPORT void
-
-XAAFillMono8x8PatternSpansScreenOrigin(ScrnInfoPtr pScrn,
-                                       int fg, int bg, int rop,
-                                       unsigned int planemask,
-                                       int n,
-                                       DDXPointPtr ppt,
-                                       int *pwidth, int fSorted,
-                                       int patx, int paty, int xorg, int yorg);
-
-extern _X_EXPORT void
-
-XAAFillColor8x8PatternSpansScreenOrigin(ScrnInfoPtr pScrn,
-                                        int rop,
-                                        unsigned int planemask,
-                                        int n,
-                                        DDXPointPtr ppt,
-                                        int *pwidth, int fSorted,
-                                        XAACacheInfoPtr,
-                                        int xorigin, int yorigin);
-
-extern _X_EXPORT void
-
-XAAFillColor8x8PatternSpans(ScrnInfoPtr pScrn,
-                            int rop,
-                            unsigned int planemask,
-                            int n,
-                            DDXPointPtr ppt,
-                            int *pwidth, int fSorted,
-                            XAACacheInfoPtr, int xorigin, int yorigin);
-
-extern _X_EXPORT void
-
-XAAFillCacheBltSpans(ScrnInfoPtr pScrn,
-                     int rop,
-                     unsigned int planemask,
-                     int n,
-                     DDXPointPtr points,
-                     int *widths,
-                     int fSorted, XAACacheInfoPtr pCache, int xorg, int yorg);
-
-extern _X_EXPORT void
-
-XAAFillCacheExpandSpans(ScrnInfoPtr pScrn,
-                        int fg, int bg, int rop,
-                        unsigned int planemask,
-                        int n,
-                        DDXPointPtr ppt,
-                        int *pwidth,
-                        int fSorted, int xorg, int yorg, PixmapPtr pPix);
-
-extern _X_EXPORT void
-
-XAAFillSpans(DrawablePtr pDrawable,
-             GC * pGC,
-             int nInit, DDXPointPtr pptInit, int *pwidth, int fSorted);
-
-extern _X_EXPORT void
- XAAInitPixmapCache(ScreenPtr pScreen, RegionPtr areas, pointer data);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapToCache(ScrnInfoPtr pScrn,
-                      int x, int y, int w, int h,
-                      unsigned char *src, int srcwidth, int fg, int bg);
-
-extern _X_EXPORT void
-
-XAAWriteBitmapToCacheLinear(ScrnInfoPtr pScrn,
-                            int x, int y, int w, int h,
-                            unsigned char *src, int srcwidth, int fg, int bg);
-
-extern _X_EXPORT void
-
-XAAWritePixmapToCache(ScrnInfoPtr pScrn,
-                      int x, int y, int w, int h,
-                      unsigned char *src, int srcwidth, int bpp, int depth);
-
-extern _X_EXPORT void
-
-XAAWritePixmapToCacheLinear(ScrnInfoPtr pScrn,
-                            int x, int y, int w, int h,
-                            unsigned char *src,
-                            int srcwidth, int bpp, int depth);
-
-extern _X_EXPORT void
- XAASolidHorVertLineAsRects(ScrnInfoPtr pScrn, int x, int y, int len, int dir);
-
-extern _X_EXPORT void
-
-XAASolidHorVertLineAsTwoPoint(ScrnInfoPtr pScrn,
-                              int x, int y, int len, int dir);
-
-extern _X_EXPORT void
-
-XAASolidHorVertLineAsBresenham(ScrnInfoPtr pScrn,
-                               int x, int y, int len, int dir);
-
-extern _X_EXPORT void
-
-XAAPolyRectangleThinSolid(DrawablePtr pDrawable,
-                          GCPtr pGC, int nRectsInit, xRectangle *pRectsInit);
-
-extern _X_EXPORT void
-
-XAAPolylinesWideSolid(DrawablePtr pDrawable,
-                      GCPtr pGC, int mode, int npt, DDXPointPtr pPts);
-
-extern _X_EXPORT void
-
-XAAFillPolygonSolid(DrawablePtr pDrawable,
-                    GCPtr pGC,
-                    int shape, int mode, int count, DDXPointPtr ptsIn);
-
-extern _X_EXPORT void
-
-XAAFillPolygonStippled(DrawablePtr pDrawable,
-                       GCPtr pGC,
-                       int shape, int mode, int count, DDXPointPtr ptsIn);
-
-extern _X_EXPORT void
-
-XAAFillPolygonTiled(DrawablePtr pDrawable,
-                    GCPtr pGC,
-                    int shape, int mode, int count, DDXPointPtr ptsIn);
-
-extern _X_EXPORT int
-
-XAAIsEasyPolygon(DDXPointPtr ptsIn,
-                 int count,
-                 BoxPtr extents,
-                 int origin,
-                 DDXPointPtr * topPoint, int *topY, int *bottomY, int shape);
-
-extern _X_EXPORT void
-
-XAAFillPolygonHelper(ScrnInfoPtr pScrn,
-                     DDXPointPtr ptsIn,
-                     int count,
-                     DDXPointPtr topPoint,
-                     int y,
-                     int maxy,
-                     int origin,
-                     RectFuncPtr RectFunc,
-                     TrapFuncPtr TrapFunc,
-                     int xorg, int yorg, XAACacheInfoPtr pCache);
-
-extern _X_EXPORT void
- XAAPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg);
-
-extern _X_EXPORT void
-
-XAAPolyLines(DrawablePtr pDrawable,
-             GCPtr pGC, int mode, int npt, DDXPointPtr pptInit);
-
-extern _X_EXPORT void
-
-XAAPolySegmentDashed(DrawablePtr pDrawable,
-                     GCPtr pGC, int nseg, xSegment * pSeg);
-
-extern _X_EXPORT void
-
-XAAPolyLinesDashed(DrawablePtr pDrawable,
-                   GCPtr pGC, int mode, int npt, DDXPointPtr pptInit);
-
-extern _X_EXPORT void
- XAAWriteMono8x8PatternToCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache);
-
-extern _X_EXPORT void
-
-XAAWriteColor8x8PatternToCache(ScrnInfoPtr pScrn,
-                               PixmapPtr pPix, XAACacheInfoPtr pCache);
-
-extern _X_EXPORT void
-
-XAARotateMonoPattern(int *pat0, int *pat1,
-                     int xoffset, int yoffset, Bool msbfirst);
-
-extern _X_EXPORT void XAAComputeDash(GCPtr pGC);
-
-extern _X_EXPORT void XAAMoveDWORDS_FixedBase(register CARD32 *dest,
-                                              register CARD32 *src,
-                                              register int dwords);
-
-extern _X_EXPORT void XAAMoveDWORDS_FixedSrc(register CARD32 *dest,
-                                             register CARD32 *src,
-                                             register int dwords);
-
-extern _X_EXPORT void XAAMoveDWORDS(register CARD32 *dest,
-                                    register CARD32 *src, register int dwords);
-
-extern _X_EXPORT int
-
-XAAGetRectClipBoxes(GCPtr pGC,
-                    BoxPtr pboxClippedBase,
-                    int nrectFill, xRectangle *prectInit);
-
-extern _X_EXPORT void
- XAASetupOverlay8_32Planar(ScreenPtr);
-
-extern _X_EXPORT void
- XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs);
-
-extern _X_EXPORT XAACacheInfoPtr XAACacheTile(ScrnInfoPtr Scrn, PixmapPtr pPix);
-
-extern _X_EXPORT XAACacheInfoPtr
-XAACacheMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix);
-
-extern _X_EXPORT XAACacheInfoPtr
-XAACachePlanarMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix);
-
-typedef XAACacheInfoPtr(*XAACachePlanarMonoStippleProc) (ScrnInfoPtr,
-                                                         PixmapPtr);
-extern _X_EXPORT XAACachePlanarMonoStippleProc
-XAAGetCachePlanarMonoStipple(void);
-
-extern _X_EXPORT XAACacheInfoPtr
-XAACacheStipple(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg);
-
-extern _X_EXPORT XAACacheInfoPtr
-XAACacheMono8x8Pattern(ScrnInfoPtr Scrn, int pat0, int pat1);
-
-extern _X_EXPORT XAACacheInfoPtr
-XAACacheColor8x8Pattern(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg);
-
-extern _X_EXPORT void
- XAATileCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache, int w, int h);
-
-extern _X_EXPORT void XAAClosePixmapCache(ScreenPtr pScreen);
-void XAAInvalidatePixmapCache(ScreenPtr pScreen);
-
-extern _X_EXPORT Bool XAACheckStippleReducibility(PixmapPtr pPixmap);
-extern _X_EXPORT Bool XAACheckTileReducibility(PixmapPtr pPixmap,
-                                               Bool checkMono);
-
-extern _X_EXPORT int XAAStippledFillChooser(GCPtr pGC);
-extern _X_EXPORT int XAAOpaqueStippledFillChooser(GCPtr pGC);
-extern _X_EXPORT int XAATiledFillChooser(GCPtr pGC);
-
-extern _X_EXPORT void XAAMoveInOffscreenPixmaps(ScreenPtr pScreen);
-extern _X_EXPORT void XAAMoveOutOffscreenPixmaps(ScreenPtr pScreen);
-extern _X_EXPORT void XAARemoveAreaCallback(FBAreaPtr area);
-extern _X_EXPORT void XAAMoveOutOffscreenPixmap(PixmapPtr pPix);
-extern _X_EXPORT Bool XAAInitStateWrap(ScreenPtr pScreen,
-                                       XAAInfoRecPtr infoRec);
-
-extern _X_EXPORT void
-
-XAAComposite(CARD8 op,
-             PicturePtr pSrc,
-             PicturePtr pMask,
-             PicturePtr pDst,
-             INT16 xSrc,
-             INT16 ySrc,
-             INT16 xMask,
-             INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
-
-extern _X_EXPORT Bool
-
-XAADoComposite(CARD8 op,
-               PicturePtr pSrc,
-               PicturePtr pMask,
-               PicturePtr pDst,
-               INT16 xSrc,
-               INT16 ySrc,
-               INT16 xMask,
-               INT16 yMask,
-               INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
-
-extern _X_EXPORT void
-
-XAAGlyphs(CARD8 op,
-          PicturePtr pSrc,
-          PicturePtr pDst,
-          PictFormatPtr maskFormat,
-          INT16 xSrc,
-          INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs);
-
-extern _X_EXPORT Bool
-
-XAADoGlyphs(CARD8 op,
-            PicturePtr pSrc,
-            PicturePtr pDst,
-            PictFormatPtr maskFormat,
-            INT16 xSrc,
-            INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs);
-
-/* helpers */
-extern _X_EXPORT void
- XAA_888_plus_PICT_a8_to_8888(CARD32 color, CARD8 *alphaPtr,    /* in bytes */
-                              int alphaPitch, CARD32 *dstPtr, int dstPitch,     /* in dwords */
-                              int width, int height);
-
-extern _X_EXPORT Bool
-
-XAAGetRGBAFromPixel(CARD32 pixel,
-                    CARD16 *red,
-                    CARD16 *green, CARD16 *blue, CARD16 *alpha, CARD32 format);
-
-extern _X_EXPORT Bool
-
-XAAGetPixelFromRGBA(CARD32 *pixel,
-                    CARD16 red,
-                    CARD16 green, CARD16 blue, CARD16 alpha, CARD32 format);
-
-/* XXX should be static */
-extern _X_EXPORT GCOps XAAFallbackOps;
-extern _X_EXPORT GCOps *XAAGetFallbackOps(void);
-extern _X_EXPORT GCFuncs XAAGCFuncs;
-extern _X_EXPORT DevPrivateKey XAAGetScreenKey(void);
-extern _X_EXPORT DevPrivateKey XAAGetGCKey(void);
-extern _X_EXPORT DevPrivateKey XAAGetPixmapKey(void);
-
-extern _X_EXPORT unsigned int XAAShiftMasks[32];
-
-extern _X_EXPORT unsigned int byte_expand3[256], byte_reversed_expand3[256];
-
-extern _X_EXPORT CARD32 XAAReverseBitOrder(CARD32 data);
-
-#define GET_XAASCREENPTR_FROM_SCREEN(pScreen)\
-    dixLookupPrivate(&(pScreen)->devPrivates, XAAGetScreenKey())
-
-#define GET_XAASCREENPTR_FROM_GC(pGC)\
-    dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAGetScreenKey())
-
-#define GET_XAASCREENPTR_FROM_DRAWABLE(pDraw)\
-    dixLookupPrivate(&(pDraw)->pScreen->devPrivates, XAAGetScreenKey())
-
-#define GET_XAAINFORECPTR_FROM_SCREEN(pScreen)\
-((XAAScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAGetScreenKey()))->AccelInfoRec
-
-#define GET_XAAINFORECPTR_FROM_GC(pGC)\
-((XAAScreenPtr)dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec
-
-#define GET_XAAINFORECPTR_FROM_DRAWABLE(pDraw)\
-((XAAScreenPtr)dixLookupPrivate(&(pDraw)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec
-
-#define GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn)\
-((XAAScreenPtr)dixLookupPrivate(&(pScrn)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec
-
-#define XAA_GET_PIXMAP_PRIVATE(pix)\
-    (XAAPixmapPtr)dixLookupPrivate(&(pix)->devPrivates, XAAGetPixmapKey())
-
-#define CHECK_RGB_EQUAL(c) (!((((c) >> 8) ^ (c)) & 0xffff))
-
-#define CHECK_FG(pGC, flags) \
-       (!(flags & RGB_EQUAL) || CHECK_RGB_EQUAL(pGC->fgPixel))
-
-#define CHECK_BG(pGC, flags) \
-       (!(flags & RGB_EQUAL) || CHECK_RGB_EQUAL(pGC->bgPixel))
-
-#define CHECK_ROP(pGC, flags) \
-       (!(flags & GXCOPY_ONLY) || (pGC->alu == GXcopy))
-
-#define CHECK_ROPSRC(pGC, flags) \
-       (!(flags & ROP_NEEDS_SOURCE) || ((pGC->alu != GXclear) && \
-       (pGC->alu != GXnoop) && (pGC->alu != GXinvert) && \
-       (pGC->alu != GXset)))
-
-#define CHECK_PLANEMASK(pGC, flags) \
-       (!(flags & NO_PLANEMASK) || \
-       ((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) == \
-          infoRec->FullPlanemasks[pGC->depth - 1]))
-
-#define CHECK_COLORS(pGC, flags) \
-       (!(flags & RGB_EQUAL) || \
-       (CHECK_RGB_EQUAL(pGC->fgPixel) && CHECK_RGB_EQUAL(pGC->bgPixel)))
-
-#define CHECK_NO_GXCOPY(pGC, flags) \
-       ((pGC->alu != GXcopy) || !(flags & NO_GXCOPY) || \
-       ((pGC->planemask & infoRec->FullPlanemask) != infoRec->FullPlanemask))
-
-#define IS_OFFSCREEN_PIXMAP(pPix)\
-        ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->offscreenArea)
-
-#define PIXMAP_IS_SHARED(pPix)\
-        ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->flags & SHARED_PIXMAP)
-
-#define OFFSCREEN_PIXMAP_LOCKED(pPix)\
-        ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->flags & LOCKED_PIXMAP)
-
-#define XAA_DEPTH_BUG(pGC) \
-        ((pGC->depth == 32) && (pGC->bgPixel == 0xffffffff))
-
-#define DELIST_OFFSCREEN_PIXMAP(pPix) { \
-       PixmapLinkPtr _pLink, _prev; \
-       _pLink = infoRec->OffscreenPixmaps; \
-       _prev = NULL; \
-       while(_pLink) { \
-           if(_pLink->pPix == pPix) { \
-               if(_prev) _prev->next = _pLink->next; \
-               else infoRec->OffscreenPixmaps = _pLink->next; \
-               free(_pLink); \
-               break; \
-           } \
-           _prev = _pLink; \
-           _pLink = _pLink->next; \
-        }}
-
-#define SWAP_BITS_IN_BYTES(v) \
- (((0x01010101 & (v)) << 7) | ((0x02020202 & (v)) << 5) | \
-  ((0x04040404 & (v)) << 3) | ((0x08080808 & (v)) << 1) | \
-  ((0x10101010 & (v)) >> 1) | ((0x20202020 & (v)) >> 3) | \
-  ((0x40404040 & (v)) >> 5) | ((0x80808080 & (v)) >> 7))
-
-/*
- * Moved XAAPixmapCachePrivate here from xaaPCache.c, since driver
- * replacements for CacheMonoStipple need access to it
- */
-
-typedef struct {
-    int Num512x512;
-    int Current512;
-    XAACacheInfoPtr Info512;
-    int Num256x256;
-    int Current256;
-    XAACacheInfoPtr Info256;
-    int Num128x128;
-    int Current128;
-    XAACacheInfoPtr Info128;
-    int NumMono;
-    int CurrentMono;
-    XAACacheInfoPtr InfoMono;
-    int NumColor;
-    int CurrentColor;
-    XAACacheInfoPtr InfoColor;
-    int NumPartial;
-    int CurrentPartial;
-    XAACacheInfoPtr InfoPartial;
-    DDXPointRec MonoOffsets[64];
-    DDXPointRec ColorOffsets[64];
-} XAAPixmapCachePrivate, *XAAPixmapCachePrivatePtr;
-
-#endif                          /* _XAALOCAL_H */
diff --git a/hw/xfree86/xaa/xaawrap.h b/hw/xfree86/xaa/xaawrap.h
deleted file mode 100644 (file)
index 2d2d788..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-
-#define XAA_SCREEN_PROLOGUE(pScreen, field)\
-  ((pScreen)->field = \
-   ((XAAScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAGetScreenKey()))->field)
-
-#define XAA_SCREEN_EPILOGUE(pScreen, field, wrapper)\
-    ((pScreen)->field = wrapper)
-
-#define XAA_GC_FUNC_PROLOGUE(pGC)\
-    XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \
-    (pGC)->funcs = pGCPriv->wrapFuncs;\
-    if(pGCPriv->flags)\
-       (pGC)->ops = pGCPriv->wrapOps
-
-#define XAA_GC_FUNC_EPILOGUE(pGC)\
-    pGCPriv->wrapFuncs = (pGC)->funcs;\
-    (pGC)->funcs = &XAAGCFuncs;\
-    if(pGCPriv->flags) {\
-       pGCPriv->wrapOps = (pGC)->ops;\
-       (pGC)->ops = (pGCPriv->flags & OPS_ARE_ACCEL) ? pGCPriv->XAAOps :\
-                               &XAAPixmapOps;\
-    }
-
-#define XAA_GC_OP_PROLOGUE(pGC)\
-    XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \
-    GCFuncs *oldFuncs = pGC->funcs;\
-    pGC->funcs = pGCPriv->wrapFuncs;\
-    pGC->ops = pGCPriv->wrapOps
-
-#define XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC)\
-    XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \
-    GCFuncs *oldFuncs = pGC->funcs;\
-    if(!RegionNumRects(pGC->pCompositeClip)) return; \
-    pGC->funcs = pGCPriv->wrapFuncs;\
-    pGC->ops = pGCPriv->wrapOps
-
-#define XAA_GC_OP_EPILOGUE(pGC)\
-    pGCPriv->wrapOps = pGC->ops;\
-    pGC->funcs = oldFuncs;\
-    pGC->ops   = pGCPriv->XAAOps
-
-#define XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw)\
-    XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \
-    XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDraw));\
-    GCFuncs *oldFuncs = pGC->funcs;\
-    pGC->funcs = pGCPriv->wrapFuncs;\
-    pGC->ops = pGCPriv->wrapOps; \
-    SYNC_CHECK(pGC)
-
-#define XAA_PIXMAP_OP_EPILOGUE(pGC)\
-    pGCPriv->wrapOps = pGC->ops;\
-    pGC->funcs = oldFuncs;\
-    pGC->ops   = &XAAPixmapOps;\
-    pixPriv->flags |= DIRTY
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#define XAA_RENDER_PROLOGUE(pScreen,field)\
-    (GetPictureScreen(pScreen)->field = \
-     ((XAAScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAGetScreenKey()))->field)
-
-#define XAA_RENDER_EPILOGUE(pScreen, field, wrapper)\
-    (GetPictureScreen(pScreen)->field = wrapper)
-
-/* This also works fine for drawables */
-
-#define SYNC_CHECK(pGC) {\
-     XAAInfoRecPtr infoRec =\
-((XAAScreenPtr)dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec;       \
-    if(infoRec->NeedToSync) {\
-       (*infoRec->Sync)(infoRec->pScrn);\
-       infoRec->NeedToSync = FALSE;\
-    }}
index 0909826..330b8ca 100644 (file)
@@ -142,7 +142,7 @@ OsVendorInit(void)
 }
 
 void
-OsVendorFatalError(void)
+OsVendorFatalError(const char *f, va_list args)
 {
     return;
 }
index c395b4d..3c099cd 100644 (file)
@@ -4,7 +4,6 @@ bin_PROGRAMS = Xnest
 noinst_LIBRARIES = libfbcmap.a
 
 AM_CFLAGS = -DHAVE_XNEST_CONFIG_H \
-            -DNO_HW_ONLY_EXTS \
             $(DIX_CFLAGS) \
             $(XNESTMODULES_CFLAGS)
 
index dd76cb8..7b3c1b3 100644 (file)
@@ -129,7 +129,7 @@ static miPointerSpriteFuncRec xnestPointerSpriteFuncs = {
 };
 
 Bool
-xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
+xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
 {
     VisualPtr visuals;
     DepthPtr depths;
@@ -309,8 +309,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
 
     pScreen->BlockHandler = (ScreenBlockHandlerProcPtr) NoopDDA;
     pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr) NoopDDA;
-    pScreen->blockData = NULL;
-    pScreen->wakeupData = NULL;
 
     miDCInitialize(pScreen, &xnestPointerCursorFuncs);  /* init SW rendering */
     PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
@@ -409,7 +407,7 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
 }
 
 Bool
-xnestCloseScreen(int index, ScreenPtr pScreen)
+xnestCloseScreen(ScreenPtr pScreen)
 {
     int i;
 
index 1d255d7..17c514a 100644 (file)
@@ -19,7 +19,7 @@ extern Window xnestDefaultWindows[MAXSCREENS];
 extern Window xnestScreenSaverWindows[MAXSCREENS];
 
 ScreenPtr xnestScreen(Window window);
-Bool xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]);
-Bool xnestCloseScreen(int index, ScreenPtr pScreen);
+Bool xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]);
+Bool xnestCloseScreen(ScreenPtr pScreen);
 
 #endif                          /* XNESTSCREEN_H */
diff --git a/hw/xquartz/GL/glcontextmodes.c b/hw/xquartz/GL/glcontextmodes.c
new file mode 100644 (file)
index 0000000..dc97f89
--- /dev/null
@@ -0,0 +1,587 @@
+/*
+ * (C) Copyright IBM Corporation 2003
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+ * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file glcontextmodes.c
+ * Utility routines for working with \c __GLcontextModes structures.  At
+ * some point most or all of these functions will be moved to the Mesa
+ * code base.
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+
+#if defined(IN_MINI_GLX)
+#include <GL/gl.h>
+#else
+#if defined(HAVE_DIX_CONFIG_H)
+#include <dix-config.h>
+#endif
+#include <X11/X.h>
+#include <GL/glx.h>
+#include "GL/glxint.h"
+#endif
+
+/* Memory macros */
+#if defined(IN_MINI_GLX)
+#include <stdlib.h>
+#include <string.h>
+#define _mesa_malloc(b) malloc(b)
+#define _mesa_free(m)   free(m)
+#define _mesa_memset memset
+#else
+#ifdef XFree86Server
+#include <os.h>
+#include <string.h>
+#define _mesa_malloc(b) malloc(b)
+#define _mesa_free(m)   free(m)
+#define _mesa_memset memset
+#else
+#include <X11/Xlibint.h>
+#define _mesa_memset memset
+#define _mesa_malloc(b) Xmalloc(b)
+#define _mesa_free(m)   free(m)
+#endif  /* XFree86Server */
+#endif /* !defined(IN_MINI_GLX) */
+
+#include "glcontextmodes.h"
+
+#if !defined(IN_MINI_GLX)
+#define NUM_VISUAL_TYPES 6
+
+/**
+ * Convert an X visual type to a GLX visual type.
+ *
+ * \param visualType X visual type (i.e., \c TrueColor, \c StaticGray, etc.)
+ *        to be converted.
+ * \return If \c visualType is a valid X visual type, a GLX visual type will
+ *         be returned.  Otherwise \c GLX_NONE will be returned.
+ */
+GLint
+_gl_convert_from_x_visual_type(int visualType)
+{
+    static const int glx_visual_types[NUM_VISUAL_TYPES] = {
+        GLX_STATIC_GRAY,  GLX_GRAY_SCALE,
+        GLX_STATIC_COLOR, GLX_PSEUDO_COLOR,
+        GLX_TRUE_COLOR,   GLX_DIRECT_COLOR
+    };
+
+    return ((unsigned)visualType < NUM_VISUAL_TYPES)
+           ? glx_visual_types[visualType] : GLX_NONE;
+}
+
+/**
+ * Convert a GLX visual type to an X visual type.
+ *
+ * \param visualType GLX visual type (i.e., \c GLX_TRUE_COLOR,
+ *                   \c GLX_STATIC_GRAY, etc.) to be converted.
+ * \return If \c visualType is a valid GLX visual type, an X visual type will
+ *         be returned.  Otherwise -1 will be returned.
+ */
+GLint
+_gl_convert_to_x_visual_type(int visualType)
+{
+    static const int x_visual_types[NUM_VISUAL_TYPES] = {
+        TrueColor,   DirectColor,
+        PseudoColor, StaticColor,
+        GrayScale,   StaticGray
+    };
+
+    return ((unsigned)(visualType - GLX_TRUE_COLOR) < NUM_VISUAL_TYPES)
+           ? x_visual_types[visualType - GLX_TRUE_COLOR] : -1;
+}
+
+/**
+ * Copy a GLX visual config structure to a GL context mode structure.  All
+ * of the fields in \c config are copied to \c mode.  Additional fields in
+ * \c mode that can be derrived from the fields of \c config (i.e.,
+ * \c haveDepthBuffer) are also filled in.  The remaining fields in \c mode
+ * that cannot be derived are set to default values.
+ *
+ * \param mode   Destination GL context mode.
+ * \param config Source GLX visual config.
+ *
+ * \note
+ * The \c fbconfigID and \c visualID fields of the \c __GLcontextModes
+ * structure will be set to the \c vid of the \c __GLXvisualConfig structure.
+ */
+void
+_gl_copy_visual_to_context_mode(__GLcontextModes * mode,
+                                const __GLXvisualConfig * config)
+{
+    __GLcontextModes * const next = mode->next;
+
+    (void)_mesa_memset(mode, 0, sizeof(__GLcontextModes));
+    mode->next = next;
+
+    mode->visualID = config->vid;
+    mode->visualType = _gl_convert_from_x_visual_type(config->class);
+    mode->xRenderable = GL_TRUE;
+    mode->fbconfigID = config->vid;
+    mode->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
+
+    mode->rgbMode = (config->rgba != 0);
+    mode->renderType = (mode->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
+
+    mode->colorIndexMode = !(mode->rgbMode);
+    mode->doubleBufferMode = (config->doubleBuffer != 0);
+    mode->stereoMode = (config->stereo != 0);
+
+    mode->haveAccumBuffer = ((config->accumRedSize +
+                              config->accumGreenSize +
+                              config->accumBlueSize +
+                              config->accumAlphaSize) > 0);
+    mode->haveDepthBuffer = (config->depthSize > 0);
+    mode->haveStencilBuffer = (config->stencilSize > 0);
+
+    mode->redBits = config->redSize;
+    mode->greenBits = config->greenSize;
+    mode->blueBits = config->blueSize;
+    mode->alphaBits = config->alphaSize;
+    mode->redMask = config->redMask;
+    mode->greenMask = config->greenMask;
+    mode->blueMask = config->blueMask;
+    mode->alphaMask = config->alphaMask;
+    mode->rgbBits = mode->rgbMode ? config->bufferSize : 0;
+    mode->indexBits = mode->colorIndexMode ? config->bufferSize : 0;
+
+    mode->accumRedBits = config->accumRedSize;
+    mode->accumGreenBits = config->accumGreenSize;
+    mode->accumBlueBits = config->accumBlueSize;
+    mode->accumAlphaBits = config->accumAlphaSize;
+    mode->depthBits = config->depthSize;
+    mode->stencilBits = config->stencilSize;
+
+    mode->numAuxBuffers = config->auxBuffers;
+    mode->level = config->level;
+
+    mode->visualRating = config->visualRating;
+    mode->transparentPixel = config->transparentPixel;
+    mode->transparentRed = config->transparentRed;
+    mode->transparentGreen = config->transparentGreen;
+    mode->transparentBlue = config->transparentBlue;
+    mode->transparentAlpha = config->transparentAlpha;
+    mode->transparentIndex = config->transparentIndex;
+    mode->samples = config->multiSampleSize;
+    mode->sampleBuffers = config->nMultiSampleBuffers;
+    /* mode->visualSelectGroup = config->visualSelectGroup; ? */
+
+    mode->swapMethod = GLX_SWAP_UNDEFINED_OML;
+
+    mode->bindToTextureRgb = (mode->rgbMode) ? GL_TRUE : GL_FALSE;
+    mode->bindToTextureRgba = (mode->rgbMode && mode->alphaBits) ?
+                              GL_TRUE : GL_FALSE;
+    mode->bindToMipmapTexture = mode->rgbMode ? GL_TRUE : GL_FALSE;
+    mode->bindToTextureTargets = mode->rgbMode ?
+                                 GLX_TEXTURE_1D_BIT_EXT |
+                                 GLX_TEXTURE_2D_BIT_EXT |
+                                 GLX_TEXTURE_RECTANGLE_BIT_EXT : 0;
+    mode->yInverted = GL_FALSE;
+}
+
+/**
+ * Get data from a GL context mode.
+ *
+ * \param mode         GL context mode whose data is to be returned.
+ * \param attribute    Attribute of \c mode that is to be returned.
+ * \param value_return Location to store the data member of \c mode.
+ * \return  If \c attribute is a valid attribute of \c mode, zero is
+ *          returned.  Otherwise \c GLX_BAD_ATTRIBUTE is returned.
+ */
+int
+_gl_get_context_mode_data(const __GLcontextModes *mode, int attribute,
+                          int *value_return)
+{
+    switch (attribute) {
+    case GLX_USE_GL:
+        *value_return = GL_TRUE;
+        return 0;
+
+    case GLX_BUFFER_SIZE:
+        *value_return = mode->rgbBits;
+        return 0;
+
+    case GLX_RGBA:
+        *value_return = mode->rgbMode;
+        return 0;
+
+    case GLX_RED_SIZE:
+        *value_return = mode->redBits;
+        return 0;
+
+    case GLX_GREEN_SIZE:
+        *value_return = mode->greenBits;
+        return 0;
+
+    case GLX_BLUE_SIZE:
+        *value_return = mode->blueBits;
+        return 0;
+
+    case GLX_ALPHA_SIZE:
+        *value_return = mode->alphaBits;
+        return 0;
+
+    case GLX_DOUBLEBUFFER:
+        *value_return = mode->doubleBufferMode;
+        return 0;
+
+    case GLX_STEREO:
+        *value_return = mode->stereoMode;
+        return 0;
+
+    case GLX_AUX_BUFFERS:
+        *value_return = mode->numAuxBuffers;
+        return 0;
+
+    case GLX_DEPTH_SIZE:
+        *value_return = mode->depthBits;
+        return 0;
+
+    case GLX_STENCIL_SIZE:
+        *value_return = mode->stencilBits;
+        return 0;
+
+    case GLX_ACCUM_RED_SIZE:
+        *value_return = mode->accumRedBits;
+        return 0;
+
+    case GLX_ACCUM_GREEN_SIZE:
+        *value_return = mode->accumGreenBits;
+        return 0;
+
+    case GLX_ACCUM_BLUE_SIZE:
+        *value_return = mode->accumBlueBits;
+        return 0;
+
+    case GLX_ACCUM_ALPHA_SIZE:
+        *value_return = mode->accumAlphaBits;
+        return 0;
+
+    case GLX_LEVEL:
+        *value_return = mode->level;
+        return 0;
+
+    case GLX_TRANSPARENT_TYPE_EXT:
+        *value_return = mode->transparentPixel;
+        return 0;
+
+    case GLX_TRANSPARENT_RED_VALUE:
+        *value_return = mode->transparentRed;
+        return 0;
+
+    case GLX_TRANSPARENT_GREEN_VALUE:
+        *value_return = mode->transparentGreen;
+        return 0;
+
+    case GLX_TRANSPARENT_BLUE_VALUE:
+        *value_return = mode->transparentBlue;
+        return 0;
+
+    case GLX_TRANSPARENT_ALPHA_VALUE:
+        *value_return = mode->transparentAlpha;
+        return 0;
+
+    case GLX_TRANSPARENT_INDEX_VALUE:
+        *value_return = mode->transparentIndex;
+        return 0;
+
+    case GLX_X_VISUAL_TYPE:
+        *value_return = mode->visualType;
+        return 0;
+
+    case GLX_CONFIG_CAVEAT:
+        *value_return = mode->visualRating;
+        return 0;
+
+    case GLX_VISUAL_ID:
+        *value_return = mode->visualID;
+        return 0;
+
+    case GLX_DRAWABLE_TYPE:
+        *value_return = mode->drawableType;
+        return 0;
+
+    case GLX_RENDER_TYPE:
+        *value_return = mode->renderType;
+        return 0;
+
+    case GLX_X_RENDERABLE:
+        *value_return = mode->xRenderable;
+        return 0;
+
+    case GLX_FBCONFIG_ID:
+        *value_return = mode->fbconfigID;
+        return 0;
+
+    case GLX_MAX_PBUFFER_WIDTH:
+        *value_return = mode->maxPbufferWidth;
+        return 0;
+
+    case GLX_MAX_PBUFFER_HEIGHT:
+        *value_return = mode->maxPbufferHeight;
+        return 0;
+
+    case GLX_MAX_PBUFFER_PIXELS:
+        *value_return = mode->maxPbufferPixels;
+        return 0;
+
+    case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX:
+        *value_return = mode->optimalPbufferWidth;
+        return 0;
+
+    case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX:
+        *value_return = mode->optimalPbufferHeight;
+        return 0;
+
+    case GLX_SWAP_METHOD_OML:
+        *value_return = mode->swapMethod;
+        return 0;
+
+    case GLX_SAMPLE_BUFFERS_SGIS:
+        *value_return = mode->sampleBuffers;
+        return 0;
+
+    case GLX_SAMPLES_SGIS:
+        *value_return = mode->samples;
+        return 0;
+
+    case GLX_BIND_TO_TEXTURE_RGB_EXT:
+        *value_return = mode->bindToTextureRgb;
+        return 0;
+
+    case GLX_BIND_TO_TEXTURE_RGBA_EXT:
+        *value_return = mode->bindToTextureRgba;
+        return 0;
+
+    case GLX_BIND_TO_MIPMAP_TEXTURE_EXT:
+        *value_return = mode->bindToMipmapTexture == GL_TRUE ? GL_TRUE :
+                        GL_FALSE;
+        return 0;
+
+    case GLX_BIND_TO_TEXTURE_TARGETS_EXT:
+        *value_return = mode->bindToTextureTargets;
+        return 0;
+
+    case GLX_Y_INVERTED_EXT:
+        *value_return = mode->yInverted;
+        return 0;
+
+    /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX.
+     * It is ONLY for communication between the GLX client and the GLX
+     * server.
+     */
+    case GLX_VISUAL_SELECT_GROUP_SGIX:
+    default:
+        return GLX_BAD_ATTRIBUTE;
+    }
+}
+#endif /* !defined(IN_MINI_GLX) */
+
+/**
+ * Allocate a linked list of \c __GLcontextModes structures.  The fields of
+ * each structure will be initialized to "reasonable" default values.  In
+ * most cases this is the default value defined by table 3.4 of the GLX
+ * 1.3 specification.  This means that most values are either initialized to
+ * zero or \c GLX_DONT_CARE (which is -1).  As support for additional
+ * extensions is added, the new values will be initialized to appropriate
+ * values from the extension specification.
+ *
+ * \param count         Number of structures to allocate.
+ * \param minimum_size  Minimum size of a structure to allocate.  This allows
+ *                      for differences in the version of the
+ *                      \c __GLcontextModes stucture used in libGL and in a
+ *                      DRI-based driver.
+ * \returns A pointer to the first element in a linked list of \c count
+ *          stuctures on success, or \c NULL on failure.
+ *
+ * \warning Use of \c minimum_size does \b not guarantee binary compatibility.
+ *          The fundamental assumption is that if the \c minimum_size
+ *          specified by the driver and the size of the \c __GLcontextModes
+ *          structure in libGL is the same, then the meaning of each byte in
+ *          the structure is the same in both places.  \b Be \b careful!
+ *          Basically this means that fields have to be added in libGL and
+ *          then propagated to drivers.  Drivers should \b never arbitrarilly
+ *          extend the \c __GLcontextModes data-structure.
+ */
+__GLcontextModes *
+_gl_context_modes_create(unsigned count, size_t minimum_size)
+{
+    const size_t size = (minimum_size > sizeof(__GLcontextModes))
+                        ? minimum_size : sizeof(__GLcontextModes);
+    __GLcontextModes * base = NULL;
+    __GLcontextModes ** next;
+    unsigned i;
+
+    next = &base;
+    for (i = 0; i < count; i++) {
+        *next = (__GLcontextModes *)_mesa_malloc(size);
+        if (*next == NULL) {
+            _gl_context_modes_destroy(base);
+            base = NULL;
+            break;
+        }
+
+        (void)_mesa_memset(*next, 0, size);
+        (*next)->visualID = GLX_DONT_CARE;
+        (*next)->visualType = GLX_DONT_CARE;
+        (*next)->visualRating = GLX_NONE;
+        (*next)->transparentPixel = GLX_NONE;
+        (*next)->transparentRed = GLX_DONT_CARE;
+        (*next)->transparentGreen = GLX_DONT_CARE;
+        (*next)->transparentBlue = GLX_DONT_CARE;
+        (*next)->transparentAlpha = GLX_DONT_CARE;
+        (*next)->transparentIndex = GLX_DONT_CARE;
+        (*next)->xRenderable = GLX_DONT_CARE;
+        (*next)->fbconfigID = GLX_DONT_CARE;
+        (*next)->swapMethod = GLX_SWAP_UNDEFINED_OML;
+        (*next)->bindToTextureRgb = GLX_DONT_CARE;
+        (*next)->bindToTextureRgba = GLX_DONT_CARE;
+        (*next)->bindToMipmapTexture = GLX_DONT_CARE;
+        (*next)->bindToTextureTargets = GLX_DONT_CARE;
+        (*next)->yInverted = GLX_DONT_CARE;
+
+        next = &((*next)->next);
+    }
+
+    return base;
+}
+
+/**
+ * Destroy a linked list of \c __GLcontextModes structures created by
+ * \c _gl_context_modes_create.
+ *
+ * \param modes  Linked list of structures to be destroyed.  All structres
+ *               in the list will be freed.
+ */
+void
+_gl_context_modes_destroy(__GLcontextModes * modes)
+{
+    while (modes != NULL) {
+        __GLcontextModes * const next = modes->next;
+
+        _mesa_free(modes);
+        modes = next;
+    }
+}
+
+/**
+ * Find a context mode matching a Visual ID.
+ *
+ * \param modes  List list of context-mode structures to be searched.
+ * \param vid    Visual ID to be found.
+ * \returns A pointer to a context-mode in \c modes if \c vid was found in
+ *          the list, or \c NULL if it was not.
+ */
+
+__GLcontextModes *
+_gl_context_modes_find_visual(__GLcontextModes *modes, int vid)
+{
+    __GLcontextModes *m;
+
+    for (m = modes; m != NULL; m = m->next)
+        if (m->visualID == vid)
+            return m;
+
+    return NULL;
+}
+
+__GLcontextModes *
+_gl_context_modes_find_fbconfig(__GLcontextModes *modes, int fbid)
+{
+    __GLcontextModes *m;
+
+    for (m = modes; m != NULL; m = m->next)
+        if (m->fbconfigID == fbid)
+            return m;
+
+    return NULL;
+}
+
+/**
+ * Determine if two context-modes are the same.  This is intended to be used
+ * by libGL implementations to compare to sets of driver generated FBconfigs.
+ *
+ * \param a  Context-mode to be compared.
+ * \param b  Context-mode to be compared.
+ * \returns \c GL_TRUE if the two context-modes are the same.  \c GL_FALSE is
+ *          returned otherwise.
+ */
+GLboolean
+_gl_context_modes_are_same(const __GLcontextModes * a,
+                           const __GLcontextModes * b)
+{
+    return ((a->rgbMode == b->rgbMode) &&
+            (a->floatMode == b->floatMode) &&
+            (a->colorIndexMode == b->colorIndexMode) &&
+            (a->doubleBufferMode == b->doubleBufferMode) &&
+            (a->stereoMode == b->stereoMode) &&
+            (a->redBits == b->redBits) &&
+            (a->greenBits == b->greenBits) &&
+            (a->blueBits == b->blueBits) &&
+            (a->alphaBits == b->alphaBits) &&
+#if 0 /* For some reason these don't get set on the client-side in libGL. */
+            (a->redMask == b->redMask) &&
+            (a->greenMask == b->greenMask) &&
+            (a->blueMask == b->blueMask) &&
+            (a->alphaMask == b->alphaMask) &&
+#endif
+            (a->rgbBits == b->rgbBits) &&
+            (a->indexBits == b->indexBits) &&
+            (a->accumRedBits == b->accumRedBits) &&
+            (a->accumGreenBits == b->accumGreenBits) &&
+            (a->accumBlueBits == b->accumBlueBits) &&
+            (a->accumAlphaBits == b->accumAlphaBits) &&
+            (a->depthBits == b->depthBits) &&
+            (a->stencilBits == b->stencilBits) &&
+            (a->numAuxBuffers == b->numAuxBuffers) &&
+            (a->level == b->level) &&
+            (a->pixmapMode == b->pixmapMode) &&
+            (a->visualRating == b->visualRating) &&
+
+            (a->transparentPixel == b->transparentPixel) &&
+
+            ((a->transparentPixel != GLX_TRANSPARENT_RGB) ||
+             ((a->transparentRed == b->transparentRed) &&
+              (a->transparentGreen == b->transparentGreen) &&
+              (a->transparentBlue == b->transparentBlue) &&
+              (a->transparentAlpha == b->transparentAlpha))) &&
+
+            ((a->transparentPixel != GLX_TRANSPARENT_INDEX) ||
+             (a->transparentIndex == b->transparentIndex)) &&
+
+            (a->sampleBuffers == b->sampleBuffers) &&
+            (a->samples == b->samples) &&
+            ((a->drawableType & b->drawableType) != 0) &&
+            (a->renderType == b->renderType) &&
+            (a->maxPbufferWidth == b->maxPbufferWidth) &&
+            (a->maxPbufferHeight == b->maxPbufferHeight) &&
+            (a->maxPbufferPixels == b->maxPbufferPixels) &&
+            (a->optimalPbufferWidth == b->optimalPbufferWidth) &&
+            (a->optimalPbufferHeight == b->optimalPbufferHeight) &&
+            (a->swapMethod == b->swapMethod) &&
+            (a->bindToTextureRgb == b->bindToTextureRgb) &&
+            (a->bindToTextureRgba == b->bindToTextureRgba) &&
+            (a->bindToMipmapTexture == b->bindToMipmapTexture) &&
+            (a->bindToTextureTargets == b->bindToTextureTargets) &&
+            (a->yInverted == b->yInverted));
+}
diff --git a/hw/xquartz/GL/glcontextmodes.h b/hw/xquartz/GL/glcontextmodes.h
new file mode 100644 (file)
index 0000000..7237ccc
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * (C) Copyright IBM Corporation 2003
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+ * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file glcontextmodes.h
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+
+#ifndef GLCONTEXTMODES_H
+#define GLCONTEXTMODES_H
+
+#include "GL/internal/glcore.h"
+
+#if !defined(IN_MINI_GLX)
+extern GLint
+_gl_convert_from_x_visual_type(int visualType);
+extern GLint
+_gl_convert_to_x_visual_type(int visualType);
+extern void
+_gl_copy_visual_to_context_mode(__GLcontextModes * mode,
+                                const __GLXvisualConfig * config);
+extern int
+_gl_get_context_mode_data(const __GLcontextModes *mode, int attribute,
+                          int *value_return);
+#endif /* !defined(IN_MINI_GLX) */
+
+extern __GLcontextModes *
+_gl_context_modes_create(unsigned count, size_t minimum_size);
+extern void
+_gl_context_modes_destroy(__GLcontextModes * modes);
+extern __GLcontextModes *
+_gl_context_modes_find_visual(__GLcontextModes *modes, int vid);
+extern __GLcontextModes *
+_gl_context_modes_find_fbconfig(__GLcontextModes *modes, int fbid);
+extern GLboolean
+_gl_context_modes_are_same(const __GLcontextModes * a,
+                           const __GLcontextModes * b);
+
+#endif /* GLCONTEXTMODES_H */
index d9dc2a1..c4999b5 100644 (file)
@@ -135,12 +135,20 @@ struct __GLXAquaDrawable {
 static __GLXcontext *
 __glXAquaScreenCreateContext(__GLXscreen *screen,
                              __GLXconfig *conf,
-                             __GLXcontext *baseShareContext)
+                             __GLXcontext *baseShareContext,
+                             unsigned num_attribs,
+                             const uint32_t *attribs,
+                             int *error)
 {
     __GLXAquaContext *context;
     __GLXAquaContext *shareContext = (__GLXAquaContext *)baseShareContext;
     CGLError gl_err;
 
+    /* Unused (for now?) */
+    (void)num_attribs;
+    (void)attribs;
+    (void)error;
+
     GLAQUA_DEBUG_MSG("glXAquaScreenCreateContext\n");
 
     context = calloc(1, sizeof(__GLXAquaContext));
index 740a807..87cba6d 100644 (file)
@@ -87,6 +87,9 @@ Bool
 X11ApplicationCanEnterRandR(void);
 
 void
+X11ApplicationFatalError(const char *f, va_list args) __printflike(1, 0);
+
+void
 X11ApplicationMain(int argc, char **argv, char **envp);
 
 #define PREFS_APPSMENU                "apps_menu"
index b686b00..1f9b05d 100644 (file)
@@ -72,6 +72,7 @@ static dispatch_queue_t eventTranslationQueue;
 
 extern Bool noTestExtensions;
 extern Bool noRenderExtension;
+extern BOOL serverRunning;
 
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
 static TISInputSourceRef last_key_layout;
@@ -1073,6 +1074,53 @@ X11ApplicationCanEnterRandR(void)
     }
 }
 
+void
+X11ApplicationFatalError(const char *f, va_list args)
+{
+#ifdef HAVE_LIBDISPATCH
+    NSString *title, *msg;
+    char *error_msg;
+
+    /* This is called by FatalError() in the server thread just before
+     * we would abort.  If the server never got off the ground, We should
+     * inform the user of the error rather than letting the ever-so-friendly
+     * CrashReporter do it for us.
+     *
+     * This also has the benefit of forcing user interaction rather than
+     * allowing an infinite throttled-restart if the crash occurs before
+     * we can drain the launchd socket.
+     */
+
+    if (serverRunning) {
+        return;
+    }
+
+    title = NSLocalizedString(@"The application X11 could not be opened.",
+                              @"Dialog title when encountering a fatal error");
+    msg = NSLocalizedString(
+        @"An error occurred while starting the X11 server: \"%s\"\n\nClick Quit to quit X11. Click Report to see more details or send a report to Apple.",
+        @"Dialog when encountering a fatal error");
+
+    vasprintf(&error_msg, f, args);
+    msg = [NSString stringWithFormat:msg, error_msg];
+
+    /* We want the AppKit thread to actually service the alert or we will race [NSApp run] and create an
+     * 'NSInternalInconsistencyException', reason: 'NSApp with wrong _running count'
+     */
+    dispatch_sync(dispatch_get_main_queue(), ^{
+                      if (NSAlertDefaultReturn ==
+                          NSRunAlertPanel (title, msg,
+                                           NSLocalizedString (@"Quit", @""),
+                                           NSLocalizedString (
+                                               @"Report...", @""), nil)) {
+                          exit (EXIT_FAILURE);
+                      }
+                  });
+
+    /* fall back to caller to do the abort() in the DIX */
+#endif
+}
+
 static void
 check_xinitrc(void)
 {
@@ -1281,6 +1329,11 @@ untrusted_str(NSEvent *e)
 }
 #endif
 
+extern void
+darwinEvents_lock(void);
+extern void
+darwinEvents_unlock(void);
+
 - (void) sendX11NSEvent:(NSEvent *)e
 {
     NSPoint location = NSZeroPoint;
@@ -1293,18 +1346,15 @@ untrusted_str(NSEvent *e)
     int modifierFlags;
     BOOL isMouseOrTabletEvent, isTabletEvent;
 
-#ifdef HAVE_LIBDISPATCH
-    static dispatch_once_t once_pred;
-    dispatch_once(&once_pred, ^{
-                      tilt = NSZeroPoint;
-                      darwinTabletCurrent = darwinTabletStylus;
-                  });
-#else
     if (!darwinTabletCurrent) {
+        /* Ensure that the event system is initialized */
+        darwinEvents_lock();
+        darwinEvents_unlock();
+        assert(darwinTabletStylus);
+
         tilt = NSZeroPoint;
         darwinTabletCurrent = darwinTabletStylus;
     }
-#endif
 
     isMouseOrTabletEvent = [e type] == NSLeftMouseDown ||
                            [e type] == NSOtherMouseDown ||
@@ -1593,6 +1643,11 @@ handle_mouse:
 
     case NSScrollWheel:
     {
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
+        float deltaX = [e deltaX];
+        float deltaY = [e deltaY];
+        BOOL isContinuous = NO;
+#else
         CGFloat deltaX = [e deltaX];
         CGFloat deltaY = [e deltaY];
         CGEventRef cge = [e CGEvent];
@@ -1614,6 +1669,7 @@ handle_mouse:
             deltaY *= lineHeight / 5.0;
         }
 #endif
+#endif
         
 #if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION == 0
         /* If we're in the background, we need to send a MotionNotify event
index 393bc1a..737db42 100644 (file)
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <asl.h>
+#include <stdlib.h>
+
+extern aslclient aslc;
+extern char *bundle_id_prefix;
 
 @implementation X11Controller
 
     const char *newargv[4];
     char buf[128];
     char *s;
+#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+    int stdout_pipe[2];
+    int stderr_pipe[2];
+#endif
 
-    newargv[0] =
-        [X11App prefs_get_string:@PREFS_LOGIN_SHELL default:"/bin/sh"];
+    newargv[0] = [X11App prefs_get_string:@PREFS_LOGIN_SHELL default:"/bin/sh"];
     newargv[1] = "-c";
     newargv[2] = [filename UTF8String];
     newargv[3] = NULL;
         setenv("DISPLAY", buf, TRUE);
     }
 
+#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+    if (asl_log_descriptor) {
+        char *asl_sender;
+        aslmsg amsg = asl_new(ASL_TYPE_MSG);
+        assert(amsg);
+
+        asprintf(&asl_sender, "%s.%s", bundle_id_prefix, newargv[2]);
+        assert(asl_sender);
+        for(s = asl_sender + strlen(bundle_id_prefix) + 1; *s; s++) {
+            if(! ((*s >= 'a' && *s <= 'z') ||
+                  (*s >= 'A' && *s <= 'Z') ||
+                  (*s >= '0' && *s <= '9'))) {
+                *s = '_';
+            }
+        }
+
+        (void)asl_set(amsg, ASL_KEY_SENDER, asl_sender);
+        free(asl_sender);
+
+        assert(0 == pipe(stdout_pipe));
+        fcntl(stdout_pipe[0], F_SETFD, FD_CLOEXEC);
+        fcntl(stdout_pipe[0], F_SETFL, O_NONBLOCK);
+
+        assert(0 == pipe(stderr_pipe));
+        fcntl(stderr_pipe[0], F_SETFD, FD_CLOEXEC);
+        fcntl(stderr_pipe[0], F_SETFL, O_NONBLOCK);
+
+        asl_log_descriptor(aslc, amsg, ASL_LEVEL_INFO, stdout_pipe[0], ASL_LOG_DESCRIPTOR_READ);
+        asl_log_descriptor(aslc, amsg, ASL_LEVEL_NOTICE, stderr_pipe[0], ASL_LOG_DESCRIPTOR_READ);
+
+        asl_free(amsg);
+    }
+#endif
+
     /* Do the fork-twice trick to avoid having to reap zombies */
     child1 = fork();
     switch (child1) {
             _exit(1);
 
         case 0:                                     /* child2 */
+#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+            if (asl_log_descriptor) {
+                /* Replace our stdout/stderr */
+                dup2(stdout_pipe[1], STDOUT_FILENO);
+                dup2(stderr_pipe[1], STDERR_FILENO);
+            }
+#endif
+
             /* close all open files except for standard streams */
             max_files = sysconf(_SC_OPEN_MAX);
             for (i = 3; i < max_files; i++)
     default:                                    /* parent */
         waitpid(child1, &status, 0);
     }
+
+#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+    if (asl_log_descriptor) {
+        /* Close the write ends of the pipe */
+        close(stdout_pipe[1]);
+        close(stderr_pipe[1]);
+    }
+#endif
 }
 
 - (void) app_selected:sender
index 81db13e..d41a81d 100644 (file)
@@ -157,7 +157,7 @@ ProcAppleWMQueryVersion(register ClientPtr client)
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
     }
-    WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep);
+    WriteToClient(client, sizeof(xAppleWMQueryVersionReply),&rep);
     return Success;
 }
 
@@ -533,7 +533,7 @@ ProcAppleWMFrameGetRect(register ClientPtr client)
     rep.w = rr.x2 - rr.x1;
     rep.h = rr.y2 - rr.y1;
 
-    WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep);
+    WriteToClient(client, sizeof(xAppleWMFrameGetRectReply),&rep);
     return Success;
 }
 
@@ -560,7 +560,7 @@ ProcAppleWMFrameHitTest(register ClientPtr client)
 
     rep.ret = ret;
 
-    WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep);
+    WriteToClient(client, sizeof(xAppleWMFrameHitTestReply),&rep);
     return Success;
 }
 
index 4b6d9d1..f76c5fc 100644 (file)
@@ -19,9 +19,9 @@
        <key>CFBundlePackageType</key>
                <string>APPL</string>
        <key>CFBundleShortVersionString</key>
-               <string>2.7.2</string>
+               <string>2.7.4</string>
        <key>CFBundleVersion</key>
-               <string>2.7.2</string>
+               <string>2.7.4</string>
        <key>CFBundleSignature</key>
                <string>x11a</string>
        <key>CSResourcesFileMapped</key>
index bf2089c..36ae0ff 100644 (file)
Binary files a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings and b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings differ
index 1e0e56b..8fdce46 100644 (file)
@@ -110,27 +110,33 @@ _read_redirect(int fd, int flush)
         /* Increment our returned number read */
         total_read += nbytes;
 
-        nbytes += (aslr->w - aslr->buf);
-        aslr->buf[nbytes] = '\0';
+        /* Increment our write location */
+        aslr->w += nbytes;
+        aslr->w[0] = '\0';
 
         /* One line at a time */
-        for (p = aslr->buf; *p && (p - aslr->buf) < nbytes; p = s + 1) {
+        for (p = aslr->buf; p < aslr->w; p = s + 1) {
             // Find null or \n
             for (s = p; *s && *s != '\n'; s++) ;
             if (*s == '\n') {
                 *s = '\0';
+            }
+
+            if (s < aslr->w || aslr->buf == p) {
+                /* Either the first of multiple messages or one message which is larger than our buffer */
                 asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p);
             }
-            else if (aslr->buf != p) {
+            else {
+                /* We reached the end of the buffer, move this chunk to the start. */
                 memmove(aslr->buf, p, BUF_SIZE - (p - aslr->buf));
                 aslr->w = aslr->buf + (s - p);
                 break;
             }
-            else if (nbytes == BUF_SIZE - 1) {
-                asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p);
-                aslr->w = aslr->buf;
-                break;
-            }
+        }
+
+        if (p == aslr->w) {
+            /* Start writing at the beginning in the case where we flushed */
+            aslr->w = aslr->buf;
         }
     }
 
@@ -310,6 +316,20 @@ xq_asl_init(void)
     atexit(redirect_atexit);
 }
 
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
+#define fls(v) xq_fls(v)
+
+static inline int fls(int value) {
+    unsigned int b, v;
+
+    v = *((unsigned int *)&value);
+
+    for(b=0 ; v ; v >>= 1 , b++);
+
+    return b;
+}
+#endif
+
 int
 xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd)
 {
@@ -345,8 +365,8 @@ xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd)
                               BLOCK_DONE;
                           }
                           redirect_fds = new_array;
-                          memset(redirect_fds + n_redirect_fds, 0, new_n -
-                                 n_redirect_fds);
+                          memset(redirect_fds + n_redirect_fds, 0, (new_n -
+                                 n_redirect_fds) * sizeof(*redirect_fds));
                           n_redirect_fds = new_n;
                       }
 
index 74e11fe..d26f18a 100644 (file)
@@ -78,6 +78,8 @@
 #include "quartzKeyboard.h"
 #include "quartz.h"
 
+#include "X11Application.h"
+
 aslclient aslc;
 
 void
@@ -191,7 +193,7 @@ DarwinSaveScreen(ScreenPtr pScreen, int on)
  *  Initialize the screen and communicate information about it back to dix.
  */
 static Bool
-DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
+DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv)
 {
     int dpi;
     static int foundIndex = 0;
@@ -202,7 +204,7 @@ DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
         return FALSE;
 
     // reset index of found screens for each server generation
-    if (index == 0) {
+    if (pScreen->myNum == 0) {
         foundIndex = 0;
 
         // reset the visual list
@@ -273,7 +275,7 @@ DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
     pScreen->SaveScreen = DarwinSaveScreen;
 
     // finish mode dependent screen setup including cursor support
-    if (!QuartzSetupScreen(index, pScreen)) {
+    if (!QuartzSetupScreen(pScreen->myNum, pScreen)) {
         return FALSE;
     }
 
@@ -670,9 +672,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
  * OsVendorFatalError
  */
 void
-OsVendorFatalError(void)
+OsVendorFatalError(const char *f, va_list args)
 {
-    ErrorF("   OsVendorFatalError\n");
+    X11ApplicationFatalError(f, args);
 }
 
 /*
index cabdf1e..b403662 100644 (file)
@@ -563,8 +563,25 @@ setup_console_redirect(const char *bundle_id)
     free(asl_facility);
 
     asl_set_filter(aslc, ASL_FILTER_MASK_UPTO(ASL_LEVEL_WARNING));
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+# if MAC_OS_X_VERSION_MIN_REQUIRED < 1080
+    if (asl_log_descriptor)
+# endif
+    {
+        asl_log_descriptor(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO, ASL_LOG_DESCRIPTOR_WRITE);
+        asl_log_descriptor(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO, ASL_LOG_DESCRIPTOR_WRITE);
+    }
+# if MAC_OS_X_VERSION_MIN_REQUIRED < 1080
+    else {
+        xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO);
+        xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO);
+    }
+# endif
+#else
     xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO);
     xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO);
+#endif
 }
 
 static void
index 13d5e13..57ddb74 100644 (file)
@@ -1499,7 +1499,7 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete,
 
 /* Allocation */
 
-- init
+- (id) init
 {
     unsigned long pixel;
 
index 8bb7f2d..23dbc73 100644 (file)
 #include <dix-config.h>
 #endif
 
-#include "darwin.h"
 #include "pseudoramiX.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include "dixstruct.h"
 #include "window.h"
 #include <X11/extensions/panoramiXproto.h>
 #include "globals.h"
 
+#define TRACE PseudoramiXTrace("TRACE " __FILE__ ":%s",__FUNCTION__)
+#define DEBUG_LOG PseudoramiXDebug
+
 Bool noPseudoramiXExtension = FALSE;
 
 extern int
@@ -95,6 +98,26 @@ static int pseudoramiXScreensAllocated = 0;
 static int pseudoramiXNumScreens = 0;
 static unsigned long pseudoramiXGeneration = 0;
 
+static void
+PseudoramiXTrace(const char *format, ...)
+{
+    va_list ap;
+
+    va_start(ap, format);
+    LogVMessageVerb(X_NONE, 10, format, ap);
+    va_end(ap);
+}
+
+static void
+PseudoramiXDebug(const char *format, ...)
+{
+    va_list ap;
+
+    va_start(ap, format);
+    LogVMessageVerb(X_NONE, 3, format, ap);
+    va_end(ap);
+}
+
 // Add a PseudoramiX screen.
 // The rest of the X server will know nothing about this screen.
 // Can be called before or after extension init.
@@ -125,14 +148,14 @@ PseudoramiXAddScreen(int x, int y, int w, int h)
 // Initialize PseudoramiX.
 // Copied from PanoramiXExtensionInit
 void
-PseudoramiXExtensionInit(int argc, char *argv[])
+PseudoramiXExtensionInit(void)
 {
     Bool success = FALSE;
     ExtensionEntry      *extEntry;
 
     if (noPseudoramiXExtension) return;
 
-    TRACE();
+    TRACE;
 
     /* Even with only one screen we need to enable PseudoramiX to allow
        dynamic screen configuration changes. */
@@ -169,7 +192,7 @@ PseudoramiXExtensionInit(int argc, char *argv[])
 void
 PseudoramiXResetScreens(void)
 {
-    TRACE();
+    TRACE;
 
     pseudoramiXNumScreens = 0;
 }
@@ -177,7 +200,7 @@ PseudoramiXResetScreens(void)
 static void
 PseudoramiXResetProc(ExtensionEntry *extEntry)
 {
-    TRACE();
+    TRACE;
 
     PseudoramiXResetScreens();
 }
@@ -186,7 +209,7 @@ PseudoramiXResetProc(ExtensionEntry *extEntry)
 static int
 ProcPseudoramiXQueryVersion(ClientPtr client)
 {
-    TRACE();
+    TRACE;
 
     return ProcPanoramiXQueryVersion(client);
 }
@@ -200,7 +223,7 @@ ProcPseudoramiXGetState(ClientPtr client)
     xPanoramiXGetStateReply rep;
     register int rc;
 
-    TRACE();
+    TRACE;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -211,12 +234,13 @@ ProcPseudoramiXGetState(ClientPtr client)
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
     rep.state = !noPseudoramiXExtension;
+    rep.window = stuff->window;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
-        swaps(&rep.state);
+        swapl(&rep.window);
     }
-    WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep);
+    WriteToClient(client, sizeof(xPanoramiXGetStateReply),&rep);
     return Success;
 }
 
@@ -229,7 +253,7 @@ ProcPseudoramiXGetScreenCount(ClientPtr client)
     xPanoramiXGetScreenCountReply rep;
     register int rc;
 
-    TRACE();
+    TRACE;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -240,12 +264,13 @@ ProcPseudoramiXGetScreenCount(ClientPtr client)
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
     rep.ScreenCount = pseudoramiXNumScreens;
+    rep.window = stuff->window;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
-        swaps(&rep.ScreenCount);
+        swapl(&rep.window);
     }
-    WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
+    WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply),&rep);
     return Success;
 }
 
@@ -256,9 +281,12 @@ ProcPseudoramiXGetScreenSize(ClientPtr client)
     REQUEST(xPanoramiXGetScreenSizeReq);
     WindowPtr pWin;
     xPanoramiXGetScreenSizeReply rep;
-    register int n, rc;
+    register int rc;
+
+    TRACE;
 
-    TRACE();
+    if (stuff->screen >= pseudoramiXNumScreens)
+      return BadMatch;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -273,13 +301,17 @@ ProcPseudoramiXGetScreenSize(ClientPtr client)
     // was screenInfo.screens[stuff->screen]->width;
     rep.height = pseudoramiXScreens[stuff->screen].h;
     // was screenInfo.screens[stuff->screen]->height;
+    rep.window = stuff->window;
+    rep.screen = stuff->screen;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
-        swaps(&rep.width);
-        swaps(&rep.height);
+        swapl(&rep.width);
+        swapl(&rep.height);
+        swapl(&rep.window);
+        swapl(&rep.screen);
     }
-    WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
+    WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply),&rep);
     return Success;
 }
 
@@ -290,7 +322,7 @@ ProcPseudoramiXIsActive(ClientPtr client)
     /* REQUEST(xXineramaIsActiveReq); */
     xXineramaIsActiveReply rep;
 
-    TRACE();
+    TRACE;
 
     REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
 
@@ -303,7 +335,7 @@ ProcPseudoramiXIsActive(ClientPtr client)
         swapl(&rep.length);
         swapl(&rep.state);
     }
-    WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *)&rep);
+    WriteToClient(client, sizeof(xXineramaIsActiveReply),&rep);
     return Success;
 }
 
@@ -329,7 +361,7 @@ ProcPseudoramiXQueryScreens(ClientPtr client)
         swapl(&rep.length);
         swapl(&rep.number);
     }
-    WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep);
+    WriteToClient(client, sizeof(xXineramaQueryScreensReply),&rep);
 
     if (!noPseudoramiXExtension) {
         xXineramaScreenInfo scratch;
@@ -347,7 +379,7 @@ ProcPseudoramiXQueryScreens(ClientPtr client)
                 swaps(&scratch.width);
                 swaps(&scratch.height);
             }
-            WriteToClient(client, sz_XineramaScreenInfo, (char *)&scratch);
+            WriteToClient(client, sz_XineramaScreenInfo,&scratch);
         }
     }
 
@@ -359,7 +391,7 @@ static int
 ProcPseudoramiXDispatch(ClientPtr client)
 {
     REQUEST(xReq);
-    TRACE();
+    TRACE;
     switch (stuff->data) {
     case X_PanoramiXQueryVersion:
         return ProcPseudoramiXQueryVersion(client);
@@ -387,7 +419,7 @@ SProcPseudoramiXQueryVersion(ClientPtr client)
 {
     REQUEST(xPanoramiXQueryVersionReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
@@ -399,7 +431,7 @@ SProcPseudoramiXGetState(ClientPtr client)
 {
     REQUEST(xPanoramiXGetStateReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
@@ -411,7 +443,7 @@ SProcPseudoramiXGetScreenCount(ClientPtr client)
 {
     REQUEST(xPanoramiXGetScreenCountReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
@@ -423,7 +455,7 @@ SProcPseudoramiXGetScreenSize(ClientPtr client)
 {
     REQUEST(xPanoramiXGetScreenSizeReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
@@ -435,7 +467,7 @@ SProcPseudoramiXIsActive(ClientPtr client)
 {
     REQUEST(xXineramaIsActiveReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
@@ -447,7 +479,7 @@ SProcPseudoramiXQueryScreens(ClientPtr client)
 {
     REQUEST(xXineramaQueryScreensReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
@@ -459,7 +491,7 @@ SProcPseudoramiXDispatch(ClientPtr client)
 {
     REQUEST(xReq);
 
-    TRACE();
+    TRACE;
 
     switch (stuff->data) {
     case X_PanoramiXQueryVersion:
index f41b5cb..f063919 100644 (file)
@@ -6,6 +6,5 @@ extern int noPseudoramiXExtension;
 
 void
 PseudoramiXAddScreen(int x, int y, int w, int h);
-void PseudoramiXExtensionInit(int argc, char *argv[]);
 void
 PseudoramiXResetScreens(void);
index ebaa567..31b0e61 100644 (file)
@@ -42,6 +42,8 @@
 #include "darwin.h"
 #include "darwinEvents.h"
 #include "pseudoramiX.h"
+#include "extension.h"
+#include "glx_extinit.h"
 #define _APPLEWM_SERVER_
 #include "applewmExt.h"
 
 #include <rootlessCommon.h>
 #include <Xplugin.h>
 
+/* Work around a bug on Leopard's headers */
+#if defined (__LP64__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 && MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+extern OSErr UpdateSystemActivity(UInt8 activity);
+#define OverallAct 0
+#endif
+
 DevPrivateKeyRec quartzScreenKeyRec;
 int aquaMenuBarHeight = 0;
 QuartzModeProcsPtr quartzProcs = NULL;
@@ -137,6 +145,28 @@ QuartzSetupScreen(int index,
     return TRUE;
 }
 
+static ExtensionModule quartzExtensions[] = {
+    /* PseudoramiX needs to be done before RandR, so
+     * it is in miinitext.c until it can be reordered.
+     * { PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension },
+     */
+#ifdef GLXEXT
+    {GlxExtensionInit, "GLX", &noGlxExtension},
+#endif
+};
+
+/*
+ * QuartzExtensionInit
+ * Initialises XQuartz-specific extensions.
+ */
+static void QuartzExtensionInit(void)
+{
+    int i;
+
+    for (i = 0; i < ARRAY_SIZE(quartzExtensions); i++)
+        LoadExtension(&quartzExtensions[i], TRUE);
+}
+
 /*
  * QuartzInitOutput
  *  Quartz display initialization.
@@ -176,6 +206,8 @@ QuartzInitOutput(int argc,
 
     // Do display mode specific initialization
     quartzProcs->DisplayInit();
+
+    QuartzExtensionInit();
 }
 
 /*
index 1bb8379..f77848f 100644 (file)
@@ -105,7 +105,7 @@ ProcAppleDRIQueryVersion(register ClientPtr client)
         swaps(&rep.minorVersion);
         swapl(&rep.patchVersion);
     }
-    WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep);
+    WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), &rep);
     return Success;
 }
 
@@ -139,7 +139,7 @@ ProcAppleDRIQueryDirectRenderingCapable(register ClientPtr client)
 
     WriteToClient(client,
                   sizeof(xAppleDRIQueryDirectRenderingCapableReply),
-                  (char *)&rep);
+                  &rep);
     return Success;
 }
 
@@ -168,7 +168,7 @@ ProcAppleDRIAuthConnection(register ClientPtr client)
         swapl(&rep.authenticated); /* Yes, this is a CARD32 ... sigh */
     }
 
-    WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep);
+    WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), &rep);
     return Success;
 }
 
@@ -232,7 +232,7 @@ ProcAppleDRICreateSurface(ClientPtr client)
         swapl(&rep.uid);
     }
 
-    WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep);
+    WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), &rep);
     return Success;
 }
 
index 002ec94..03af163 100644 (file)
 #include <dix-config.h>
 #endif
 
-#ifdef XFree86LOADER
-#include "xf86.h"
-#include "xf86_ansic.h"
-#else
 #include <sys/time.h>
 #include <unistd.h>
-#endif
 
 #include <X11/X.h>
 #include <X11/Xproto.h>
@@ -55,6 +50,7 @@
 #include "misc.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "scrnintstr.h"
index 106a919..398177c 100644 (file)
 #include <sys/uio.h>
 #include <unistd.h>
 
+#ifdef HAVE_LIBDISPATCH
+#include <dispatch/dispatch.h>
+#endif
+
 #include "rootlessWindow.h"
 #include "xprEvent.h"
 
@@ -72,7 +76,25 @@ QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev)
 
     case kXquartzBringAllToFront:
         DEBUG_LOG("kXquartzBringAllToFront\n");
+        /* There's no need to do xp_window_bring_all_to_front on Leopard,
+         * and we don't care about the result, so just do it async.
+         */
+#if defined(HAVE_LIBDISPATCH) && defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 6
+#  if defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED < 6
+        if (&xp_window_bring_all_to_front) {
+#  endif
+            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                xp_window_bring_all_to_front();
+            });
+#  if defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED < 6
+        } else {
+            RootlessOrderAllWindows(e->data[0]);
+        }
+#  endif
+#else
         RootlessOrderAllWindows(e->data[0]);
+#endif
+
         return TRUE;
 
     default:
index 4d0df11..37cd8b3 100644 (file)
@@ -55,6 +55,7 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
                                               DWORD dwFlags, LPTSTR pszPath);
 #endif
 
+#include "glx_extinit.h"
 /*
  * References to external symbols
  */
@@ -147,15 +148,30 @@ winClipboardShutdown(void)
 }
 #endif
 
-void
-ddxPushProviders(void)
+static const ExtensionModule xwinExtensions[] = {
+#ifdef GLXEXT
+  { GlxExtensionInit, "GLX", &noGlxExtension },
+#endif
+};
+
+/*
+ * XwinExtensionInit
+ * Initialises Xwin-specific extensions.
+ */
+static
+void XwinExtensionInit(void)
 {
+    int i;
+
 #ifdef XWIN_GLX_WINDOWS
-    if (g_fNativeGl) {
+    if ((g_fNativeGl) && (serverGeneration == 1)) {
         /* install the native GL provider */
         glxWinPushNativeProvider();
     }
 #endif
+
+    for (i = 0; i < ARRAY_SIZE(xwinExtensions); i++)
+        LoadExtension(&xwinExtensions[i], TRUE);
 }
 
 #if defined(DDXBEFORERESET)
@@ -885,6 +901,8 @@ InitOutput(ScreenInfo * screenInfo, int argc, char *argv[])
 {
     int i;
 
+    XwinExtensionInit();
+
     /* Log the command line */
     winLogCommandLine(argc, argv);
 
index c490163..4c2f04e 100644 (file)
@@ -5,7 +5,6 @@ SRCS_CLIPBOARD = \
        winclipboardinit.c \
        winclipboardtextconv.c \
        winclipboardthread.c \
-       winclipboardunicode.c \
        winclipboardwndproc.c \
        winclipboardwrappers.c \
        winclipboardxevents.c
diff --git a/hw/xwin/README b/hw/xwin/README
deleted file mode 100644 (file)
index 219fd13..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-Cygwin/X Release Notes
-======================
-
-Release X11R6.7
-===============
-
-Cygwin/X has continued its rapid pace of development that it has sustained
-since Spring 2001 and this release shows it, we now have: a stable and fast
-multi-window mode, seamless clipboard integration, a configurable tray menu
-icon, popups on error messages pointing users to the log file and our mailing
-list, the beginnings of indirect 3D acceleration for OpenGL applications,
-improved non-US keyboard and clipboard support, and only a handful of bugs
-that continue to be reported.
-
-Between the XFree86 4.3.0 release and the X.Org X11R6.7 release the Cyg-
-win/XFree86 project broke away from The XFree86 Project, Inc. due to a lack
-of support from the XFree86 project.  As such, the Cygwin/XFree86 project was
-renamed to the Cygwin/X project and the upstream source code tree that Cyg-
-win/X pulls from and pushes to is now the tree managed by the X.Org Founda-
-tion.  The Cygwin/X project has seen a rush of development and interest in
-the project since the split; one metric showing this is that the number of
-CVS committers we have has gone from zero to six.
-
-The most outstanding features of this release are
-
-   o Major multi-window mode improvements. (Takuma Murakami, Earle F. 
-     Philhower III)
-
-   o Initial work of accelerated OpenGL using the windows OpenGL drivers. 
-     (Alexander Gottwald)
-
-   o Massive rework of clipboard integration with windows. (Harold L Hunt II,
-     Kensuke Matsuzaki)
-
-   o Improved Japanese clipboard and keyboard support. (Kensuke Matsuzaki,
-     Takuma Murakami, Alexander Gottwald)
-
-   o Customizable tray menu icon allowing shortcuts to start programs,
-     etc.(Earle F. Philhower III)
-
-   o New icons. (Jehan Bing, Michael Bax, Benjamin Rienfenstahl)
-
-   o Fix some multi-monitor problems.(Takuma Murakami)
-
-   o Fix repeated key strokes. (Ivan Pascal)
-
-   o Automatic keyboard layouts for the most frequently used keyboard lay-
-     outs. (Alexander Gottwald)
-
-   o Built in SHM support with detection of the SHM engine (cygserver).
-     (Ralf Habacker, Harold L Hunt II)
-
-   o Merged in work on the NativeGDI engine. (Alan Hourihane)
-
-OpenGL with Cygwin/X
-====================
-
-Cygwin/X has supported GLX only with software rendering provided by the Mesa
-library. Starting with X11R6.7 we add support for hardware accelerated OpenGL.
-
-This support is still under development and still has some bigger problems. 
-To provide both versions (the stable software rendering and the new hardware
-accelerated) we ship to binaries. XWin.exe contains the software rendering 
-and XWin_GL.exe uses the hardware acceleration provided by the windows drivers.
-
-The known problems with hardware accelerated OpenGL are:
-
-   o Only multiwindow mode is useful. In the other modes the OpenGL output 
-     does not align with the X11 windows.
-
-   o Using two programs which require different visuals will fail. For example
-     glxgears and glxinfo will not work without restarting XWin_GL.exe.
-
-   o OpenGL extensions and functions from OpenGL 1.2 and later should work 
-     but are not completely tested.
-
-   o The standard Windows OpenGL driver will produce no output. Use the one 
-     from your video adapter vendor.  
-
-If you notice problems with some programs please send a message with the 
-logfile /tmp/XWin.log and a short error description to <cygwin-xfree@cygwin.com>
-
-The hardware accelerated OpenGL was tested using: 
-
-   o glxgears
-   o glxinfo
-   o blender
-   o tuxkart
-   o GLUT demos (some did fail)
-   o tuxracer (currently not working)
-
-    
-Release X11R6.8
-===============
-
-Having reached a quite mature state in release X11R6.7 the development 
-has slowed down a little bit. Some of the former active developers have
-retired or cut their work for the Cygwin/X project due to conflicts with 
-job, study and family. 
-
-The X11R6.8 release now includes major improvements from the xserver project.
-This includes the XFixes, Damage, Composite and XEVIE extension which is a 
-major step towards allowing Cygwin/X to have real transparency. 
-
-But at the current state Composite is not working with Cygwin/X. Not all code
-in the Cygwin/X Server has been updated to support the Composite feature and
-using it will even crash the xserver. But as a second problem nearly all
-functions required for compositing are lacking acceleration in Cygwin/X so
-the feature would not be very useful if it would work. So it is disabled by
-default. 
-
-OpenGL with Cygwin/X
-====================
-
-The OpenGL support has lost some of it's limitations from the last release 
-and should be much more stable. But due to missing wide spread testing in 
-the community it is still available in a separate program. XWin still uses 
-the old software OpenGL which is known to be stable.
-
-The known problems with hardware accelerated OpenGL are:
-
-   o Only multiwindow mode is useful. In the other modes the OpenGL output 
-     does not align with the X11 windows.
-
-   o OpenGL extensions and functions from OpenGL 1.2 and later should work 
-     but are not completely tested.
-
-   o The standard Windows OpenGL driver will produce no output. Use the one 
-     from your video adapter vendor.  
-
-If you notice problems with some programs please send a message with the 
-logfile /tmp/XWin.log and a short error description to <cygwin-xfree@cygwin.com>
-
-The hardware accelerated OpenGL was tested using: 
-
-   o glxgears
-   o glxinfo
-   o blender
-   o tuxkart
-   o GLUT demos (some did fail)
-
index 6b840ba..7222a9f 100644 (file)
@@ -32,10 +32,10 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
 if XWIN_GLX_WINDOWS
 
 generated_gl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.spec $(KHRONOS_SPEC_DIR)/gl.tm
-       $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c
+       $(AM_V_GEN)$(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c
 
 generated_wgl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wglext.spec $(KHRONOS_SPEC_DIR)/wgl.tm
-       $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c
+       $(AM_V_GEN)$(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c
 endif
 
 BUILT_SOURCES = generated_gl_wrappers.c generated_wgl_wrappers.c
index e2d960e..15f7ef8 100755 (executable)
@@ -67,7 +67,7 @@ if dispatchheader :
         fh = open(dispatchheader)
         dispatchh = fh.readlines()
 
-        dispatch_regex = re.compile(r'#define\sSET_(\S*)\(')
+        dispatch_regex = re.compile(r'^SET_(\S*)\(')
 
         for line in dispatchh :
                 line = line.strip()
@@ -308,12 +308,20 @@ for w in sorted(wrappers.keys()) :
 if dispatchheader :
         print 'void glWinSetupDispatchTable(void)'
         print '{'
-        print '  struct _glapi_table *disp = _glapi_get_dispatch();'
+        print '  static struct _glapi_table *disp = NULL;'
+        print ''
+        print '  if (!disp)'
+        print '    {'
+        print '      disp = calloc(sizeof(void *), _glapi_get_dispatch_table_size());'
+        print '      assert(disp);'
 
         for d in sorted(dispatch.keys()) :
                 if wrappers.has_key(d) :
-                        print '  SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);'
+                        print '      SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);'
                 else :
                         print '#warning  No wrapper for ' + prefix + d + ' !'
 
+        print '    }'
+        print ''
+        print '  _glapi_set_dispatch(disp);'
         print '}'
index 56f677a..97b6045 100644 (file)
@@ -398,7 +398,9 @@ fbConfigsDump(unsigned int n, __GLXconfig * c)
 static __GLXscreen *glxWinScreenProbe(ScreenPtr pScreen);
 static __GLXcontext *glxWinCreateContext(__GLXscreen * screen,
                                          __GLXconfig * modes,
-                                         __GLXcontext * baseShareContext);
+                                         __GLXcontext * baseShareContext,
+                                         unsigned num_attribs,
+                                         const uint32_t * attribs, int *error);
 static __GLXdrawable *glxWinCreateDrawable(ClientPtr client,
                                            __GLXscreen * screen,
                                            DrawablePtr pDraw,
@@ -473,7 +475,7 @@ static void
 glxLogExtensions(const char *prefix, const char *extensions)
 {
     int length = 0;
-    char *strl;
+    const char *strl;
     char *str = strdup(extensions);
 
     if (str == NULL) {
@@ -482,6 +484,8 @@ glxLogExtensions(const char *prefix, const char *extensions)
     }
 
     strl = strtok(str, " ");
+    if (strl == NULL)
+        strl = "";
     ErrorF("%s%s", prefix, strl);
     length = strlen(prefix) + strlen(strl);
 
@@ -515,6 +519,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
 {
     glxWinScreen *screen;
     const char *gl_extensions;
+    const char *gl_renderer;
     const char *wgl_extensions;
     HWND hwnd;
     HDC hdc;
@@ -538,14 +543,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
     if (NULL == screen)
         return NULL;
 
-    /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */
-    screen->RealizeWindow = pScreen->RealizeWindow;
-    pScreen->RealizeWindow = glxWinRealizeWindow;
-    screen->UnrealizeWindow = pScreen->UnrealizeWindow;
-    pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
-    screen->CopyWindow = pScreen->CopyWindow;
-    pScreen->CopyWindow = glxWinCopyWindow;
-
     /* Dump out some useful information about the native renderer */
 
     // create window class
@@ -595,7 +592,8 @@ glxWinScreenProbe(ScreenPtr pScreen)
 
     ErrorF("GL_VERSION:     %s\n", glGetStringWrapperNonstatic(GL_VERSION));
     ErrorF("GL_VENDOR:      %s\n", glGetStringWrapperNonstatic(GL_VENDOR));
-    ErrorF("GL_RENDERER:    %s\n", glGetStringWrapperNonstatic(GL_RENDERER));
+    gl_renderer = (const char *) glGetStringWrapperNonstatic(GL_RENDERER);
+    ErrorF("GL_RENDERER:    %s\n", gl_renderer);
     gl_extensions = (const char *) glGetStringWrapperNonstatic(GL_EXTENSIONS);
     glxLogExtensions("GL_EXTENSIONS:  ", gl_extensions);
     wgl_extensions = wglGetExtensionsStringARBWrapper(hdc);
@@ -603,6 +601,13 @@ glxWinScreenProbe(ScreenPtr pScreen)
         wgl_extensions = "";
     glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions);
 
+    if (strcasecmp(gl_renderer, "GDI Generic") == 0) {
+        free(screen);
+        LogMessage(X_ERROR,
+                   "AIGLX: Won't use generic native renderer as it is not accelerated\n");
+        return NULL;
+    }
+
     // Can you see the problem here?  The extensions string is DC specific
     // Different DCs for windows on a multimonitor system driven by multiple cards
     // might have completely different capabilities.  Of course, good luck getting
@@ -720,9 +725,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
 
         __glXScreenInit(&screen->base, pScreen);
 
-        // dump out fbConfigs now fbConfigIds and visualIDs have been assigned
-        fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
-
         // Override the GL extensions string set by __glXScreenInit()
         screen->base.GLextensions = strdup(gl_extensions);
 
@@ -765,6 +767,17 @@ glxWinScreenProbe(ScreenPtr pScreen)
     ReleaseDC(hwnd, hdc);
     DestroyWindow(hwnd);
 
+    // dump out fbConfigs now fbConfigIds and visualIDs have been assigned
+    fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
+
+    /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */
+    screen->RealizeWindow = pScreen->RealizeWindow;
+    pScreen->RealizeWindow = glxWinRealizeWindow;
+    screen->UnrealizeWindow = pScreen->UnrealizeWindow;
+    pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
+    screen->CopyWindow = pScreen->CopyWindow;
+    pScreen->CopyWindow = glxWinCopyWindow;
+
     return &screen->base;
 }
 
@@ -1571,7 +1584,8 @@ glxWinContextDestroy(__GLXcontext * base)
 
 static __GLXcontext *
 glxWinCreateContext(__GLXscreen * screen,
-                    __GLXconfig * modes, __GLXcontext * baseShareContext)
+                    __GLXconfig * modes, __GLXcontext * baseShareContext,
+                    unsigned num_attribs, const uint32_t * attribs, int *error)
 {
     __GLXWinContext *context;
     __GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext;
@@ -1612,6 +1626,18 @@ glxWinCreateContext(__GLXscreen * screen,
  */
 
 static int
+GetShift(int Mask)
+{
+    int Shift = 0;
+
+    while ((Mask &1) == 0) {
+        Shift++;
+        Mask >>=1;
+    }
+    return Shift;
+}
+
+static int
 fbConfigToPixelFormat(__GLXconfig * mode, PIXELFORMATDESCRIPTOR * pfdret,
                       int drawableTypeOverride)
 {
@@ -1647,16 +1673,26 @@ fbConfigToPixelFormat(__GLXconfig * mode, PIXELFORMATDESCRIPTOR * pfdret,
         pfd.dwFlags |= PFD_DOUBLEBUFFER;
     }
 
-    pfd.iPixelType = PFD_TYPE_RGBA;
     pfd.cColorBits = mode->redBits + mode->greenBits + mode->blueBits;
     pfd.cRedBits = mode->redBits;
-    pfd.cRedShift = 0;          /* FIXME */
+    pfd.cRedShift = GetShift(mode->redMask);
     pfd.cGreenBits = mode->greenBits;
-    pfd.cGreenShift = 0;        /* FIXME  */
+    pfd.cGreenShift = GetShift(mode->greenMask);
     pfd.cBlueBits = mode->blueBits;
-    pfd.cBlueShift = 0;         /* FIXME */
+    pfd.cBlueShift = GetShift(mode->blueMask);
     pfd.cAlphaBits = mode->alphaBits;
-    pfd.cAlphaShift = 0;        /* FIXME */
+    pfd.cAlphaShift = GetShift(mode->alphaMask);
+
+    if (mode->visualType == GLX_TRUE_COLOR) {
+        pfd.iPixelType = PFD_TYPE_RGBA;
+        pfd.dwVisibleMask =
+            (pfd.cRedBits << pfd.cRedShift) | (pfd.cGreenBits << pfd.cGreenShift) |
+            (pfd.cBlueBits << pfd.cBlueShift) | (pfd.cAlphaBits << pfd.cAlphaShift);
+    }
+    else {
+        pfd.iPixelType = PFD_TYPE_COLORINDEX;
+        pfd.dwVisibleMask = mode->transparentIndex;
+    }
 
     pfd.cAccumBits =
         mode->accumRedBits + mode->accumGreenBits + mode->accumBlueBits +
@@ -1896,25 +1932,27 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen)
         /* EXT_visual_info / GLX 1.2 */
         if (pfd.iPixelType == PFD_TYPE_COLORINDEX) {
             c->base.visualType = GLX_STATIC_COLOR;
-
-            if (!getenv("GLWIN_ENABLE_COLORINDEX_FBCONFIGS")) {
-                GLWIN_DEBUG_MSG
-                    ("pixelFormat %d is PFD_TYPE_COLORINDEX, skipping", i + 1);
-                continue;
-            }
+            c->base.transparentRed = GLX_NONE;
+            c->base.transparentGreen = GLX_NONE;
+            c->base.transparentBlue = GLX_NONE;
+            c->base.transparentAlpha = GLX_NONE;
+            c->base.transparentIndex = pfd.dwVisibleMask;
+            c->base.transparentPixel = GLX_TRANSPARENT_INDEX;
         }
         else {
             c->base.visualType = GLX_TRUE_COLOR;
+            c->base.transparentRed =
+                (pfd.dwVisibleMask & c->base.redMask) >> pfd.cRedShift;
+            c->base.transparentGreen =
+                (pfd.dwVisibleMask & c->base.greenMask) >> pfd.cGreenShift;
+            c->base.transparentBlue =
+                (pfd.dwVisibleMask & c->base.blueMask) >> pfd.cBlueShift;
+            c->base.transparentAlpha =
+                (pfd.dwVisibleMask & c->base.alphaMask) >> pfd.cAlphaShift;
+            c->base.transparentIndex = GLX_NONE;
+            c->base.transparentPixel = GLX_TRANSPARENT_RGB;
         }
 
-        // pfd.dwVisibleMask; ???
-        c->base.transparentPixel = GLX_NONE;
-        c->base.transparentRed = GLX_NONE;
-        c->base.transparentGreen = GLX_NONE;
-        c->base.transparentBlue = GLX_NONE;
-        c->base.transparentAlpha = GLX_NONE;
-        c->base.transparentIndex = GLX_NONE;
-
         /* ARB_multisample / SGIS_multisample */
         c->base.sampleBuffers = 0;
         c->base.samples = 0;
@@ -2166,14 +2204,6 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen)
             c->base.indexBits = ATTR_VALUE(WGL_COLOR_BITS_ARB, 0);
             c->base.rgbBits = 0;
             c->base.visualType = GLX_STATIC_COLOR;
-
-            if (!getenv("GLWIN_ENABLE_COLORINDEX_FBCONFIGS")) {
-                GLWIN_DEBUG_MSG
-                    ("pixelFormat %d is WGL_TYPE_COLORINDEX_ARB, skipping",
-                     i + 1);
-                continue;
-            }
-
             break;
 
         case WGL_TYPE_RGBA_FLOAT_ARB:
diff --git a/hw/xwin/glx/wgl_ext_api.h b/hw/xwin/glx/wgl_ext_api.h
new file mode 100644 (file)
index 0000000..b7231eb
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * File: wgl_ext_api.h
+ * Purpose: Wrapper functions for Win32 OpenGL wgl extension functions
+ *
+ * Authors: Jon TURNEY
+ *
+ * Copyright (c) Jon TURNEY 2009
+ *
+ *
+ * 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.
+ */
+
+#ifndef wgl_ext_api_h
+#define wgl_ext_api_h
+
+#include <GL/wglext.h>
+
+void wglResolveExtensionProcs(void);
+
+/*
+  Prototypes for wrapper functions we actually use
+  XXX: should be automatically generated as well
+*/
+
+const char *wglGetExtensionsStringARBWrapper(HDC hdc);
+BOOL wglMakeContextCurrentARBWrapper(HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+HDC wglGetCurrentReadDCARBWrapper(VOID);
+
+BOOL wglGetPixelFormatAttribivARBWrapper(HDC hdc,
+                                         int iPixelFormat,
+                                         int iLayerPlane,
+                                         UINT nAttributes,
+                                         const int *piAttributes,
+                                         int *piValues);
+
+BOOL wglGetPixelFormatAttribfvARBWrapper(HDC hdc,
+                                         int iPixelFormat,
+                                         int iLayerPlane,
+                                         UINT nAttributes,
+                                         const int *piAttributes,
+                                         FLOAT * pfValues);
+
+BOOL wglChoosePixelFormatARBWrapper(HDC hdc,
+                                    const int *piAttribIList,
+                                    const FLOAT * pfAttribFList,
+                                    UINT nMaxFormats,
+                                    int *piFormats, UINT * nNumFormats);
+
+HPBUFFERARB wglCreatePbufferARBWrapper(HDC hDC,
+                                       int iPixelFormat,
+                                       int iWidth,
+                                       int iHeight, const int *piAttribList);
+
+HDC wglGetPbufferDCARBWrapper(HPBUFFERARB hPbuffer);
+
+int wglReleasePbufferDCARBWrapper(HPBUFFERARB hPbuffer, HDC hDC);
+
+BOOL wglDestroyPbufferARBWrapper(HPBUFFERARB hPbuffer);
+
+BOOL wglQueryPbufferARBWrapper(HPBUFFERARB hPbuffer,
+                               int iAttribute, int *piValue);
+
+BOOL wglSwapIntervalEXTWrapper(int interval);
+
+int wglGetSwapIntervalEXTWrapper(void);
+
+#endif                          /* wgl_ext_api_h */
index d03a365..dbadad6 100644 (file)
@@ -313,18 +313,22 @@ exit silently and don't display any error message.
 .B "\-xkbvariant \fIvariant\fp"
 These options configure the xkeyboard extension to load
 a particular keyboard map as the X server starts.  The behavior is similar
-to the \fIsetxkbmap\fP program.  The layout data is located at \fI
-__datadir__/X11/xkb/\fP.  Additional information is found in the
-README files therein and in the man page of \fIsetxkbmap\fP.  For example
-in order to load a German layout for a pc105 keyboard one uses
-the options:
+to the \fIsetxkbmap\fP(1) program.
+
+See the \fIxkeyboard-config\fP(__miscmansuffix__) manual page for a list of
+keyboard configurations.
+
+The keyboard layout data is located at \fI__datadir__/X11/xkb/\fP.  Additional information
+can be found in the README files there and in the \fIsetxkbmap\fP(1) manual page.
+
+For example, in order to load a German layout for a pc105 keyboard, use the options:
 .br
 .I " \-xkblayout de \-xkbmodel pc105"
 
-Alternatively one may use the \fIsetxkbmap\fP program after \fIXWin\fP is
+Alternatively, you can use the \fIsetxkbmap\fP(1) program after \fIXWin\fP is
 running.
 
-The default is to select a configuration matching your current layout as
+The default is to select a keyboard configuration matching your current layout as
 reported by \fIWindows\fP, if known, or the default X server configuration
 if no matching keyboard configuration was found.
 
@@ -370,7 +374,7 @@ window, in both the generic case and for particular programs.
 * To change the style that is associated to the \fIWindows\fP window that
 \fXWin I-multiwindow\fP produces for each top-level X window.
 .PP
-The format of the \fI.XWinrc\fP file is given in the man page XWinrc(5).
+The format of the \fI.XWinrc\fP file is given in the XWinrc(5) manual page.
 
 .SH EXAMPLES
 Need some examples
@@ -378,15 +382,15 @@ Need some examples
 
 .SH "SEE ALSO"
 X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(__filemansuffix__),
-setxkbmap(1), xkeyboard-config (__miscmansuffix__).
+setxkbmap(1), xkeyboard-config(__miscmansuffix__).
 
 
 .SH BUGS
 .I XWin
-and this man page still have many limitations.
+and this manual page still have many limitations.
 
 The \fIXWin\fP software is continuously developing; it is therefore possible that
-this man page is not up to date.  It is always prudent to
+this manual page is not up to date.  It is always prudent to
 look also at the output of \fIXWin -help\fP in order to
 check the options that are operative.
 
index ce90d05..89e2a38 100644 (file)
@@ -275,7 +275,7 @@ typedef void (*winShadowUpdateProcPtr) (ScreenPtr, shadowBufPtr);
 
 typedef Bool (*winInitScreenProcPtr) (ScreenPtr);
 
-typedef Bool (*winCloseScreenProcPtr) (int, ScreenPtr);
+typedef Bool (*winCloseScreenProcPtr) (ScreenPtr);
 
 typedef Bool (*winInitVisualsProcPtr) (ScreenPtr);
 
@@ -388,6 +388,7 @@ typedef struct {
     DWORD dwScreen;
 
     int iMonitor;
+    HMONITOR hMonitor;
     DWORD dwUserWidth;
     DWORD dwUserHeight;
     DWORD dwWidth;
@@ -578,7 +579,6 @@ typedef struct _winPrivScreenRec {
     UnrealizeWindowProcPtr UnrealizeWindow;
     ValidateTreeProcPtr ValidateTree;
     PostValidateTreeProcPtr PostValidateTree;
-    WindowExposuresProcPtr WindowExposures;
     CopyWindowProcPtr CopyWindow;
     ClearToBackgroundProcPtr ClearToBackground;
     ClipNotifyProcPtr ClipNotify;
@@ -779,8 +779,8 @@ void winSetAuthorization(void);
 
 void
 
-winBlockHandler(int nScreen,
-                pointer pBlockData, pointer pTimeout, pointer pReadMask);
+winBlockHandler(ScreenPtr pScreen,
+                pointer pTimeout, pointer pReadMask);
 
 #ifdef XWIN_NATIVEGDI
 /*
@@ -1070,7 +1070,7 @@ winPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable,
  */
 
 Bool
- winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv);
+ winScreenInit(ScreenPtr pScreen, int argc, char **argv);
 
 Bool
  winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv);
@@ -1122,8 +1122,7 @@ Bool
 
 void
 
-winWakeupHandler(int nScreen,
-                 pointer pWakeupData,
+winWakeupHandler(ScreenPtr pScreen,
                  unsigned long ulResult, pointer pReadmask);
 
 /*
@@ -1175,15 +1174,6 @@ Bool
 void
  winSetShapeRootless(WindowPtr pWindow, int kind);
 
-/*
- * winmultiwindowicons.c - Used by both multi-window and Win32Rootless
- */
-
-HICON winXIconToHICON(WindowPtr pWin, int iconSize);
-
-void
- winSelectIcons(WindowPtr pWin, HICON * pIcon, HICON * pSmallIcon);
-
 #ifdef XWIN_MULTIWINDOW
 /*
  * winmultiwindowshape.c
index c18d080..480e3bd 100644 (file)
 
 /* See Porting Layer Definition - p. 6 */
 void
-winBlockHandler(int nScreen,
-                pointer pBlockData, pointer pTimeout, pointer pReadMask)
+winBlockHandler(ScreenPtr pScreen,
+                pointer pTimeout, pointer pReadMask)
 {
 #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
-    winScreenPriv((ScreenPtr) pBlockData);
+    winScreenPriv(pScreen);
 #endif
     MSG msg;
 
@@ -58,7 +58,7 @@ winBlockHandler(int nScreen,
     if (pScreenPriv != NULL && !pScreenPriv->fServerStarted) {
         int iReturn;
 
-        winDebug("winBlockHandler - Releasing pmServerStarted\n");
+        ErrorF("winBlockHandler - pthread_mutex_unlock()\n");
 
         /* Flag that modules are to be started */
         pScreenPriv->fServerStarted = TRUE;
index 203a963..27eb2f9 100644 (file)
@@ -112,13 +112,6 @@ void
  winDeinitClipboard(void);
 
 /*
- * winclipboardunicode.c
- */
-
-Bool
- winClipboardDetectUnicodeSupport(void);
-
-/*
  * winclipboardwndproc.c
  */
 
index 696d9e2..304e6df 100644 (file)
@@ -58,7 +58,7 @@ extern HWND g_hwndClipboard;
 Bool
 winInitClipboard(void)
 {
-    ErrorF("winInitClipboard ()\n");
+    winDebug("winInitClipboard ()\n");
 
     /* Wrap some internal server functions */
     if (ProcVector[X_SetSelectionOwner] != winProcSetSelectionOwner) {
index 181cb72..f2e8e6d 100644 (file)
@@ -64,7 +64,6 @@ static int clipboardRestarts = 0;
 static XIOErrorHandler g_winClipboardOldIOErrorHandler;
 static pthread_t g_winClipboardProcThread;
 
-Bool g_fUnicodeSupport = FALSE;
 Bool g_fUseUnicode = FALSE;
 
 /*
@@ -103,14 +102,11 @@ winClipboardProc(void *pvNotUsed)
     char szDisplay[512];
     int iSelectError;
 
-    ErrorF("winClipboardProc - Hello\n");
+    winDebug("winClipboardProc - Hello\n");
     ++clipboardRestarts;
 
-    /* Do we have Unicode support? */
-    g_fUnicodeSupport = winClipboardDetectUnicodeSupport();
-
     /* Do we use Unicode clipboard? */
-    fUseUnicode = g_fUnicodeClipboard && g_fUnicodeSupport;
+    fUseUnicode = g_fUnicodeClipboard;
 
     /* Save the Unicode support flag in a global */
     g_fUseUnicode = fUseUnicode;
diff --git a/hw/xwin/winclipboardunicode.c b/hw/xwin/winclipboardunicode.c
deleted file mode 100644 (file)
index 9c06f7b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *Copyright (C) 2003-2004 Harold L Hunt II 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 HAROLD L HUNT II 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 Harold L Hunt II
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from Harold L Hunt II.
- *
- * Authors:    Harold L Hunt II
- */
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "winclipboard.h"
-
-/*
- * Determine whether we suport Unicode or not.
- * NOTE: Currently, just check if we are on an NT-based platform or not.
- */
-
-Bool
-winClipboardDetectUnicodeSupport(void)
-{
-    Bool fReturn = FALSE;
-    OSVERSIONINFO osvi = { 0 };
-
-    /* Get operating system version information */
-    osvi.dwOSVersionInfoSize = sizeof(osvi);
-    GetVersionEx(&osvi);
-
-    /* Branch on platform ID */
-    switch (osvi.dwPlatformId) {
-    case VER_PLATFORM_WIN32_NT:
-        /* Unicode supported on NT only */
-        fReturn = TRUE;
-        break;
-
-    case VER_PLATFORM_WIN32_WINDOWS:
-        /* Unicode is not supported on non-NT */
-        fReturn = FALSE;
-        break;
-    }
-
-    return fReturn;
-}
index 78b0615..e19f678 100644 (file)
@@ -49,7 +49,6 @@
  */
 
 extern Bool g_fUseUnicode;
-extern Bool g_fUnicodeSupport;
 extern void *g_pClipboardDisplay;
 extern Window g_iClipboardWindow;
 extern Atom g_atomLastOwnedSelection;
@@ -60,6 +59,7 @@ extern Atom g_atomLastOwnedSelection;
 
 static int
 
+
 winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay,
                          Bool fUseUnicode, int iTimeoutSec);
 
@@ -74,10 +74,10 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay,
     int iConnNumber;
     struct timeval tv;
     int iReturn;
-    DWORD dwStopTime = (GetTickCount() / 1000) + iTimeoutSec;
+    DWORD dwStopTime = GetTickCount() + iTimeoutSec * 1000;
 
-    /* We need to ensure that all pending events are processed */
-    XSync(pDisplay, FALSE);
+    winDebug("winProcessXEventsTimeout () - pumping X events for %d seconds\n",
+             iTimeoutSec);
 
     /* Get our connection number */
     iConnNumber = ConnectionNumber(pDisplay);
@@ -85,17 +85,24 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay,
     /* Loop for X events */
     while (1) {
         fd_set fdsRead;
+        long remainingTime;
+
+        /* We need to ensure that all pending events are processed */
+        XSync(pDisplay, FALSE);
 
         /* Setup the file descriptor set */
         FD_ZERO(&fdsRead);
         FD_SET(iConnNumber, &fdsRead);
 
         /* Adjust timeout */
-        tv.tv_sec = dwStopTime - (GetTickCount() / 1000);
-        tv.tv_usec = 0;
+        remainingTime = dwStopTime - GetTickCount();
+        tv.tv_sec = remainingTime / 1000;
+        tv.tv_usec = (remainingTime % 1000) * 1000;
+        winDebug("winProcessXEventsTimeout () - %d milliseconds left\n",
+                 remainingTime);
 
         /* Break out if no time left */
-        if (tv.tv_sec < 0)
+        if (remainingTime <= 0)
             return WIN_XEVENTS_SUCCESS;
 
         /* Wait for an X event */
@@ -103,7 +110,7 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay,
                          &fdsRead,      /* Read mask */
                          NULL,  /* No write mask */
                          NULL,  /* No exception mask */
-                         &tv);  /* No timeout */
+                         &tv);  /* Timeout */
         if (iReturn < 0) {
             ErrorF("winProcessXEventsTimeout - Call to select () failed: %d.  "
                    "Bailing.\n", iReturn);
@@ -116,11 +123,19 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay,
             /* Exit when we see that server is shutting down */
             iReturn = winClipboardFlushXEvents(hwnd,
                                                iWindow, pDisplay, fUseUnicode);
+
+            winDebug
+                ("winProcessXEventsTimeout () - winClipboardFlushXEvents returned %d\n",
+                 iReturn);
+
             if (WIN_XEVENTS_NOTIFY == iReturn) {
                 /* Bail out if notify processed */
                 return iReturn;
             }
         }
+        else {
+            winDebug("winProcessXEventsTimeout - Spurious wake\n");
+        }
     }
 
     return WIN_XEVENTS_SUCCESS;
@@ -415,7 +430,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         if (message == WM_RENDERALLFORMATS)
             fConvertToUnicode = FALSE;
         else
-            fConvertToUnicode = g_fUnicodeSupport && (CF_UNICODETEXT == wParam);
+            fConvertToUnicode = (CF_UNICODETEXT == wParam);
 
         /* Request the selection contents */
         iReturn = XConvertSelection(pDisplay,
@@ -470,8 +485,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
          */
         if (WIN_XEVENTS_NOTIFY != iReturn) {
             /* Paste no data, to satisfy required call to SetClipboardData */
-            if (g_fUnicodeSupport)
-                SetClipboardData(CF_UNICODETEXT, NULL);
+            SetClipboardData(CF_UNICODETEXT, NULL);
             SetClipboardData(CF_TEXT, NULL);
 
             ErrorF
index 53b419e..1118f4f 100644 (file)
@@ -60,7 +60,6 @@ DISPATCH_PROC(winProcSetSelectionOwner);
  * References to external symbols
  */
 
-extern Bool g_fUnicodeSupport;
 extern int g_iNumScreens;
 extern unsigned int g_uiAuthDataLen;
 extern char *g_pAuthData;
@@ -90,7 +89,7 @@ winProcEstablishConnection(ClientPtr client)
     static unsigned long s_ulServerGeneration = 0;
 
     if (s_iCallCount == 0)
-        ErrorF("winProcEstablishConnection - Hello\n");
+        winDebug("winProcEstablishConnection - Hello\n");
 
     /* Do nothing if clipboard is not enabled */
     if (!g_fClipboard) {
@@ -362,11 +361,8 @@ winProcSetSelectionOwner(ClientPtr client)
         goto winProcSetSelectionOwner_Done;
     }
 
-    /* Advertise Unicode if we support it */
-    if (g_fUnicodeSupport)
-        SetClipboardData(CF_UNICODETEXT, NULL);
-
-    /* Always advertise regular text */
+    /* Advertise regular text and unicode */
+    SetClipboardData(CF_UNICODETEXT, NULL);
     SetClipboardData(CF_TEXT, NULL);
 
     /* Save handle to last owned selection */
index 59b1f07..ce533c5 100644 (file)
 #include "misc.h"
 
 /*
- * References to external symbols
- */
-
-extern Bool g_fUnicodeSupport;
-
-/*
  * Process any pending X events
  */
 
@@ -228,10 +222,6 @@ winClipboardFlushXEvents(HWND hwnd,
             else
                 xiccesStyle = XStringStyle;
 
-            /*
-             * FIXME: Can't pass CF_UNICODETEXT on Windows 95/98/Me
-             */
-
             /* Get a pointer to the clipboard text, in desired format */
             if (fUseUnicode) {
                 /* Retrieve clipboard data */
@@ -687,10 +677,10 @@ winClipboardFlushXEvents(HWND hwnd,
             free(pwszUnicodeStr);
             if (hGlobal && pszGlobalData)
                 GlobalUnlock(hGlobal);
-            if (fSetClipboardData && g_fUnicodeSupport)
+            if (fSetClipboardData) {
                 SetClipboardData(CF_UNICODETEXT, NULL);
-            if (fSetClipboardData)
                 SetClipboardData(CF_TEXT, NULL);
+            }
             return WIN_XEVENTS_NOTIFY;
 
         case SelectionClear:
index 0a18a6a..6732dcb 100644 (file)
 #include "win.h"
 #include "shellapi.h"
 
-#ifndef ABS_AUTOHIDE
-#define ABS_AUTOHIDE 1
-#endif
-
 /*
  * Local function prototypes
  */
@@ -46,7 +42,7 @@ static Bool
  winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo);
 
 static Bool
- winAdjustForAutoHide(RECT * prcWorkArea);
+ winAdjustForAutoHide(RECT * prcWorkArea, winScreenInfo * pScreenInfo);
 
 /*
  * Create a full screen window
@@ -218,7 +214,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
     winGetWorkArea(&rcWorkArea, pScreenInfo);
 
     /* Adjust for auto-hide taskbars */
-    winAdjustForAutoHide(&rcWorkArea);
+    winAdjustForAutoHide(&rcWorkArea, pScreenInfo);
 
     /* Did the user specify a position? */
     if (pScreenInfo->fUserGavePosition) {
@@ -501,14 +497,32 @@ winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo)
     int iLeft, iTop;
     int iPrimaryNonWorkAreaWidth, iPrimaryNonWorkAreaHeight;
 
-    /* SPI_GETWORKAREA only gets the work area of the primary screen. */
-    SystemParametersInfo(SPI_GETWORKAREA, 0, prcWorkArea, 0);
+    /* Use GetMonitorInfo to get work area for monitor */
+    if (!pScreenInfo->fMultipleMonitors) {
+        MONITORINFO mi;
+
+        mi.cbSize = sizeof(MONITORINFO);
+        if (GetMonitorInfo(pScreenInfo->hMonitor, &mi)) {
+            *prcWorkArea = mi.rcWork;
 
-    /* Bail out here if we aren't using multiple monitors */
-    if (!pScreenInfo->fMultipleMonitors)
+            winDebug("winGetWorkArea - Monitor %d WorkArea: %d %d %d %d\n",
+                     pScreenInfo->iMonitor,
+                     (int) prcWorkArea->top, (int) prcWorkArea->left,
+                     (int) prcWorkArea->bottom, (int) prcWorkArea->right);
+        }
+        else {
+            ErrorF("winGetWorkArea - GetMonitorInfo() failed for monitor %d\n",
+                   pScreenInfo->iMonitor);
+        }
+
+        /* Bail out here if we aren't using multiple monitors */
         return TRUE;
+    }
 
-    winDebug("winGetWorkArea - Original WorkArea: %d %d %d %d\n",
+    /* SPI_GETWORKAREA only gets the work area of the primary screen. */
+    SystemParametersInfo(SPI_GETWORKAREA, 0, prcWorkArea, 0);
+
+    winDebug("winGetWorkArea - Primary Monitor WorkArea: %d %d %d %d\n",
              (int) prcWorkArea->top, (int) prcWorkArea->left,
              (int) prcWorkArea->bottom, (int) prcWorkArea->right);
 
@@ -556,16 +570,39 @@ winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo)
     return TRUE;
 }
 
+static Bool
+winTaskbarOnScreenEdge(unsigned int uEdge, winScreenInfo * pScreenInfo)
+{
+    APPBARDATA abd;
+    HWND hwndAutoHide;
+
+    ZeroMemory(&abd, sizeof(abd));
+    abd.cbSize = sizeof(abd);
+    abd.uEdge = uEdge;
+
+    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
+    if (hwndAutoHide != NULL) {
+        /*
+           Found an autohide taskbar on that edge, but is it on the
+           same monitor as the screen window?
+         */
+        if (pScreenInfo->fMultipleMonitors ||
+            (MonitorFromWindow(hwndAutoHide, MONITOR_DEFAULTTONULL) ==
+             pScreenInfo->hMonitor))
+            return TRUE;
+    }
+    return FALSE;
+}
+
 /*
  * Adjust the client area so that any auto-hide toolbars
  * will work correctly.
  */
 
 static Bool
-winAdjustForAutoHide(RECT * prcWorkArea)
+winAdjustForAutoHide(RECT * prcWorkArea, winScreenInfo * pScreenInfo)
 {
     APPBARDATA abd;
-    HWND hwndAutoHide;
 
     winDebug("winAdjustForAutoHide - Original WorkArea: %d %d %d %d\n",
              (int) prcWorkArea->top, (int) prcWorkArea->left,
@@ -577,34 +614,31 @@ winAdjustForAutoHide(RECT * prcWorkArea)
     if (SHAppBarMessage(ABM_GETSTATE, &abd) & ABS_AUTOHIDE)
         winDebug("winAdjustForAutoHide - Taskbar is auto hide\n");
 
+    /*
+       Despite the forgoing, we are checking for any AppBar
+       hiding along a monitor edge, not just the Windows TaskBar.
+     */
+
     /* Look for a TOP auto-hide taskbar */
-    abd.uEdge = ABE_TOP;
-    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
-    if (hwndAutoHide != NULL) {
+    if (winTaskbarOnScreenEdge(ABE_TOP, pScreenInfo)) {
         winDebug("winAdjustForAutoHide - Found TOP auto-hide taskbar\n");
         prcWorkArea->top += 1;
     }
 
     /* Look for a LEFT auto-hide taskbar */
-    abd.uEdge = ABE_LEFT;
-    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
-    if (hwndAutoHide != NULL) {
+    if (winTaskbarOnScreenEdge(ABE_LEFT, pScreenInfo)) {
         winDebug("winAdjustForAutoHide - Found LEFT auto-hide taskbar\n");
         prcWorkArea->left += 1;
     }
 
     /* Look for a BOTTOM auto-hide taskbar */
-    abd.uEdge = ABE_BOTTOM;
-    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
-    if (hwndAutoHide != NULL) {
+    if (winTaskbarOnScreenEdge(ABE_BOTTOM, pScreenInfo)) {
         winDebug("winAdjustForAutoHide - Found BOTTOM auto-hide taskbar\n");
         prcWorkArea->bottom -= 1;
     }
 
     /* Look for a RIGHT auto-hide taskbar */
-    abd.uEdge = ABE_RIGHT;
-    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
-    if (hwndAutoHide != NULL) {
+    if (winTaskbarOnScreenEdge(ABE_RIGHT, pScreenInfo)) {
         winDebug("winAdjustForAutoHide - Found RIGHT auto-hide taskbar\n");
         prcWorkArea->right -= 1;
     }
@@ -613,14 +647,5 @@ winAdjustForAutoHide(RECT * prcWorkArea)
              (int) prcWorkArea->top, (int) prcWorkArea->left,
              (int) prcWorkArea->bottom, (int) prcWorkArea->right);
 
-#if 0
-    /* Obtain the task bar window dimensions */
-    abd.hWnd = hwndAutoHide;
-    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETTASKBARPOS, &abd);
-    winDebug("hwndAutoHide %08x abd.hWnd %08x %d %d %d %d\n",
-             hwndAutoHide, abd.hWnd,
-             abd.rc.top, abd.rc.left, abd.rc.bottom, abd.rc.right);
-#endif
-
     return TRUE;
 }
index c62b5db..a02146e 100644 (file)
@@ -492,7 +492,7 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message,
         switch (LOWORD(wParam)) {
         case IDOK:
         case IDCANCEL:
-            ErrorF("winChangeDepthDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
+            winDebug("winChangeDepthDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
 
             /* 
              * User dismissed the dialog, hide it until the
@@ -504,7 +504,7 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message,
         break;
 
     case WM_CLOSE:
-        ErrorF("winChangeDepthDlgProc - WM_CLOSE\n");
+        winDebug("winChangeDepthDlgProc - WM_CLOSE\n");
 
         DestroyWindow(g_hDlgAbout);
         g_hDlgAbout = NULL;
@@ -609,7 +609,7 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
         switch (LOWORD(wParam)) {
         case IDOK:
         case IDCANCEL:
-            ErrorF("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
+            winDebug("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
 
             DestroyWindow(g_hDlgAbout);
             g_hDlgAbout = NULL;
@@ -699,7 +699,7 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
         break;
 
     case WM_CLOSE:
-        ErrorF("winAboutDlgProc - WM_CLOSE\n");
+        winDebug("winAboutDlgProc - WM_CLOSE\n");
 
         DestroyWindow(g_hDlgAbout);
         g_hDlgAbout = NULL;
index 4049e97..56c1e34 100644 (file)
@@ -70,7 +70,7 @@ OsVendorVErrorF(const char *pszFormat, va_list va_args)
  * Attempt to do last-ditch, safe, important cleanup here.
  */
 void
-OsVendorFatalError(void)
+OsVendorFatalError(const char *f, va_list args)
 {
     /* Don't give duplicate warning if UseMsg was called */
     if (g_fSilentFatalError)
@@ -111,7 +111,7 @@ winMessageBoxF(const char *pszError, UINT uType, ...)
 #define MESSAGEBOXF \
        "%s\n" \
        "Vendor: %s\n" \
-       "Release: %d.%d.%d.%d (%d)\n" \
+       "Release: %d.%d.%d.%d\n" \
        "Contact: %s\n" \
        "%s\n\n" \
        "XWin was started with the following command-line:\n\n" \
@@ -120,7 +120,7 @@ winMessageBoxF(const char *pszError, UINT uType, ...)
     size = asprintf(&pszMsgBox, MESSAGEBOXF,
                     pszErrorF, XVENDORNAME,
                     XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH,
-                    XORG_VERSION_SNAP, XORG_VERSION_CURRENT,
+                    XORG_VERSION_SNAP,
                     BUILDERADDR, BUILDERSTRING, g_pszCommandLine);
 
     if (size == -1) {
diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h
new file mode 100644 (file)
index 0000000..2edf957
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+  File: winglobals.h
+  Purpose: declarations for global variables
+
+  Permission is hereby granted, free of charge, to any person obtaining a
+  copy of this software and associated documentation files (the "Software"),
+  to deal in the Software without restriction, including without limitation
+  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+  and/or sell copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice (including the next
+  paragraph) shall be included in all copies or substantial portions of the
+  Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+  DEALINGS IN THE SOFTWARE.
+
+*/
+
+#ifndef WINGLOBALS_H
+#define WINGLOBALS_H
+
+/*
+ * References to external symbols
+ */
+
+extern int g_iNumScreens;
+extern int g_iLastScreen;
+extern char *g_pszCommandLine;
+extern Bool g_fSilentFatalError;
+extern const char *g_pszLogFile;
+
+#ifdef RELOCATE_PROJECTROOT
+extern Bool g_fLogFileChanged;
+#endif
+extern int g_iLogVerbose;
+extern Bool g_fLogInited;
+
+extern Bool g_fAuthEnabled;
+extern Bool g_fXdmcpEnabled;
+
+extern Bool g_fNoHelpMessageBox;
+extern Bool g_fSilentDupError;
+extern Bool g_fNativeGl;
+
+extern HWND g_hDlgDepthChange;
+extern HWND g_hDlgExit;
+extern HWND g_hDlgAbout;
+
+extern Bool g_fSoftwareCursor;
+extern Bool g_fCursor;
+
+#ifdef XWIN_CLIPBOARD
+
+/* Typedef for DIX wrapper functions */
+typedef int (*winDispatchProcPtr) (ClientPtr);
+
+/*
+ * Wrapped DIX functions
+ */
+extern winDispatchProcPtr winProcEstablishConnectionOrig;
+extern winDispatchProcPtr winProcQueryTreeOrig;
+extern winDispatchProcPtr winProcSetSelectionOwnerOrig;
+#endif
+
+/* The global X default icons */
+#if defined(XWIN_MULTIWINDOW)
+extern HICON g_hIconX;
+extern HICON g_hSmallIconX;
+#endif
+
+#ifdef XWIN_MULTIWINDOW
+extern DWORD g_dwCurrentThreadID;
+#endif
+
+extern Bool g_fKeyboardHookLL;
+extern Bool g_fButton[3];
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+extern Bool g_fNoConfigureWindow;
+#endif
+
+#endif                          /* WINGLOBALS_H */
index 1241508..fe77b21 100644 (file)
@@ -133,24 +133,6 @@ winKeyboardMessageHookLL(int iCode, WPARAM wParam, LPARAM lParam)
 Bool
 winInstallKeyboardHookLL(void)
 {
-    OSVERSIONINFO osvi = { 0 };
-
-    /* Get operating system version information */
-    osvi.dwOSVersionInfoSize = sizeof(osvi);
-    GetVersionEx(&osvi);
-
-    /* Branch on platform ID */
-    switch (osvi.dwPlatformId) {
-    case VER_PLATFORM_WIN32_NT:
-        /* Low-level is supported on NT 4.0 SP3+ only */
-        /* TODO: Return FALSE on NT 4.0 with no SP, SP1, or SP2 */
-        break;
-
-    case VER_PLATFORM_WIN32_WINDOWS:
-        /* Low-level hook is not supported on non-NT */
-        return FALSE;
-    }
-
     /* Install the hook only once */
     if (!g_hhookKeyboardLL)
         g_hhookKeyboardLL = SetWindowsHookEx(WH_KEYBOARD_LL,
index 26e20b7..07532f6 100644 (file)
@@ -48,6 +48,7 @@ getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data)
         data->monitorOffsetY = rect->top;
         data->monitorHeight = rect->bottom - rect->top;
         data->monitorWidth = rect->right - rect->left;
+        data->monitorHandle = hMonitor;
         return FALSE;
     }
     return TRUE;
@@ -63,5 +64,7 @@ QueryMonitor(int index, struct GetMonitorInfoData *data)
     data->requestedMonitor = index;
 
     /* query information */
-    return EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data);
+    EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data);
+
+    return TRUE;
 }
diff --git a/hw/xwin/winmonitors.h b/hw/xwin/winmonitors.h
new file mode 100644 (file)
index 0000000..8201e47
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+
+Copyright 1993, 1998  The Open Group
+Copyright (C) Colin Harrison 2005-2008
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+/* data returned for monitor information */
+struct GetMonitorInfoData {
+    int requestedMonitor;
+    int monitorNum;
+    Bool bUserSpecifiedMonitor;
+    Bool bMonitorSpecifiedExists;
+    int monitorOffsetX;
+    int monitorOffsetY;
+    int monitorHeight;
+    int monitorWidth;
+    HMONITOR monitorHandle;
+};
+
+Bool QueryMonitor(int index, struct GetMonitorInfoData *data);
index df59f60..b8357e7 100644 (file)
 #ifdef HAVE_XWIN_CONFIG_H
 #include <xwin-config.h>
 #endif
-#include "win.h"
-#include "dixevents.h"
-#include "winmultiwindowclass.h"
-#include "winprefs.h"
 
-#include "propertyst.h"
-#include "windowstr.h"
+#ifndef WINVER
+#define WINVER 0x0500
+#endif
+
+#include <X11/Xwindows.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
 
+#include "winresource.h"
+#include "winprefs.h"
+#include "winmsg.h"
+#include "winmultiwindowicons.h"
+#include "winglobals.h"
 /*
- * Prototypes for local functions
+ * global variables
  */
-
-static void
-
-winScaleXBitmapToWindows(int iconSize, int effBPP,
-                         PixmapPtr pixmap, unsigned char *image);
+extern HINSTANCE g_hInstance;
 
 /*
- * Scale an X icon bitmap into a Windoze icon bitmap
+ * Scale an X icon ZPixmap into a Windoze icon bitmap
  */
 
 static void
-winScaleXBitmapToWindows(int iconSize,
-                         int effBPP, PixmapPtr pixmap, unsigned char *image)
+winScaleXImageToWindowsIcon(int iconSize,
+                            int effBPP,
+                            int stride, XImage * pixmap, unsigned char *image)
 {
     int row, column, effXBPP, effXDepth;
     unsigned char *outPtr;
-    char *iconData = 0;
-    int stride, xStride;
+    unsigned char *iconData = 0;
+    int xStride;
     float factX, factY;
     int posX, posY;
     unsigned char *ptr;
     unsigned int zero;
     unsigned int color;
 
-    effXBPP = BitsPerPixel(pixmap->drawable.depth);
-    effXDepth = pixmap->drawable.depth;
-
-    if (pixmap->drawable.bitsPerPixel == 15)
+    effXBPP = pixmap->bits_per_pixel;
+    if (pixmap->bits_per_pixel == 15)
         effXBPP = 16;
 
-    if (pixmap->drawable.depth == 15)
+    effXDepth = pixmap->depth;
+    if (pixmap->depth == 15)
         effXDepth = 16;
 
-    /* Need 16-bit aligned rows for DDBitmaps */
-    stride = ((iconSize * effBPP + 15) & (~15)) / 8;
-    xStride = PixmapBytePad(pixmap->drawable.width, pixmap->drawable.depth);
+    xStride = pixmap->bytes_per_line;
     if (stride == 0 || xStride == 0) {
         ErrorF("winScaleXBitmapToWindows - stride or xStride is zero.  "
                "Bailing.\n");
         return;
     }
 
-    /* Allocate memory for icon data */
-    iconData = malloc(xStride * pixmap->drawable.height);
-    if (!iconData) {
-        ErrorF("winScaleXBitmapToWindows - malloc failed for iconData.  "
-               "Bailing.\n");
-        return;
-    }
-
     /* Get icon data */
-    miGetImage((DrawablePtr) &(pixmap->drawable), 0, 0,
-               pixmap->drawable.width, pixmap->drawable.height,
-               ZPixmap, 0xffffffff, iconData);
+    iconData = (unsigned char *) pixmap->data;
 
     /* Keep aspect ratio */
-    factX = ((float) pixmap->drawable.width) / ((float) iconSize);
-    factY = ((float) pixmap->drawable.height) / ((float) iconSize);
+    factX = ((float) pixmap->width) / ((float) iconSize);
+    factY = ((float) pixmap->height) / ((float) iconSize);
     if (factX > factY)
         factY = factX;
     else
@@ -119,8 +109,7 @@ winScaleXBitmapToWindows(int iconSize,
                 ptr += posX / 8;
 
                 /* Out of X icon bounds, leave space blank */
-                if (posX >= pixmap->drawable.width
-                    || posY >= pixmap->drawable.height)
+                if (posX >= pixmap->width || posY >= pixmap->height)
                     ptr = (unsigned char *) &zero;
 
                 if ((*ptr) & (1 << (posX & 7)))
@@ -162,8 +151,7 @@ winScaleXBitmapToWindows(int iconSize,
                 ptr += posX * (effXBPP / 8);
 
                 /* Out of X icon bounds, leave space blank */
-                if (posX >= pixmap->drawable.width
-                    || posY >= pixmap->drawable.height)
+                if (posX >= pixmap->width || posY >= pixmap->height)
                     ptr = (unsigned char *) &zero;
                 color = (((*ptr) << 16)
                          + ((*(ptr + 1)) << 8)
@@ -203,8 +191,7 @@ winScaleXBitmapToWindows(int iconSize,
                 ptr += posX * (effXBPP / 8);
 
                 /* Out of X icon bounds, leave space blank */
-                if (posX >= pixmap->drawable.width
-                    || posY >= pixmap->drawable.height)
+                if (posX >= pixmap->width || posY >= pixmap->height)
                     ptr = (unsigned char *) &zero;
                 color = ((*ptr) << 8) + (*(ptr + 1));
                 switch (effBPP) {
@@ -238,7 +225,6 @@ winScaleXBitmapToWindows(int iconSize,
             }                   /* end if effxbpp==16) */
         }                       /* end for column */
     }                           /* end for row */
-    free(iconData);
 }
 
 static HICON
@@ -250,7 +236,7 @@ NetWMToWinIconAlpha(uint32_t * icon)
     HICON result;
     HDC hdc = GetDC(NULL);
     uint32_t *DIB_pixels;
-    ICONINFO ii = { TRUE };
+    ICONINFO ii;
     BITMAPV4HEADER bmh = { sizeof(bmh) };
 
     /* Define an ARGB pixel format used for Color+Alpha icons */
@@ -264,6 +250,9 @@ NetWMToWinIconAlpha(uint32_t * icon)
     bmh.bV4GreenMask = 0x0000FF00;
     bmh.bV4BlueMask = 0x000000FF;
 
+    ii.fIcon = TRUE;
+    ii.xHotspot = 0;            /* ignored */
+    ii.yHotspot = 0;            /* ignored */
     ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO *) & bmh,
                                    DIB_RGB_COLORS, (void **) &DIB_pixels, NULL,
                                    0);
@@ -291,12 +280,15 @@ NetWMToWinIconThreshold(uint32_t * icon)
     uint32_t *pixels = &icon[2];
     int row, col;
     HICON result;
-    ICONINFO ii = { TRUE };
+    ICONINFO ii;
 
     HDC hdc = GetDC(NULL);
     HDC xorDC = CreateCompatibleDC(hdc);
     HDC andDC = CreateCompatibleDC(hdc);
 
+    ii.fIcon = TRUE;
+    ii.xHotspot = 0;            /* ignored */
+    ii.yHotspot = 0;            /* ignored */
     ii.hbmColor = CreateCompatibleBitmap(hdc, width, height);
     ii.hbmMask = CreateCompatibleBitmap(hdc, width, height);
     ReleaseDC(NULL, hdc);
@@ -365,202 +357,220 @@ NetWMToWinIcon(int bpp, uint32_t * icon)
         return NetWMToWinIconThreshold(icon);
 }
 
-static pointer
-GetWindowProp(WindowPtr pWin, Atom name, long int *size_return)
-{
-    struct _Window *pwin;
-    struct _Property *prop;
-
-    if (!pWin || !name) {
-        ErrorF("GetWindowProp - pWin or name was NULL\n");
-        return 0;
-    }
-    pwin = (struct _Window *) pWin;
-    if (!pwin->optional)
-        return NULL;
-    for (prop = (struct _Property *) pwin->optional->userProps;
-         prop; prop = prop->next) {
-        if (prop->propertyName == name) {
-            *size_return = prop->size;
-            return prop->data;
-        }
-    }
-    return NULL;
-}
-
 /*
  * Attempt to create a custom icon from the WM_HINTS bitmaps
  */
 
-HICON
-winXIconToHICON(WindowPtr pWin, int iconSize)
+static
+ HICON
+winXIconToHICON(Display * pDisplay, Window id, int iconSize)
 {
-    unsigned char *mask, *image, *imageMask;
+    unsigned char *mask, *image = NULL, *imageMask;
     unsigned char *dst, *src;
-    PixmapPtr iconPtr;
-    PixmapPtr maskPtr;
-    int planes, bpp, effBPP, stride, maskStride, i;
+    int planes, bpp, i;
     int biggest_size = 0;
     HDC hDC;
     ICONINFO ii;
-    WinXWMHints hints;
+    XWMHints *hints;
     HICON hIcon = NULL;
     uint32_t *biggest_icon = NULL;
 
-    /* Try to get _NET_WM_ICON icons first */
     static Atom _XA_NET_WM_ICON;
     static int generation;
     uint32_t *icon, *icon_data = NULL;
-    long int size = 0;
+    unsigned long int size;
+    unsigned long int type;
+    int format;
+    unsigned long int left;
 
     hDC = GetDC(GetDesktopWindow());
     planes = GetDeviceCaps(hDC, PLANES);
     bpp = GetDeviceCaps(hDC, BITSPIXEL);
     ReleaseDC(GetDesktopWindow(), hDC);
 
+    /* Always prefer _NET_WM_ICON icons */
     if (generation != serverGeneration) {
         generation = serverGeneration;
-        _XA_NET_WM_ICON = MakeAtom("_NET_WM_ICON", 12, TRUE);
+        _XA_NET_WM_ICON = XInternAtom(pDisplay, "_NET_WM_ICON", FALSE);
     }
 
-    if (_XA_NET_WM_ICON)
-        icon_data = GetWindowProp(pWin, _XA_NET_WM_ICON, &size);
-    if (icon_data) {
-        for (icon = icon_data;
-             icon < &icon_data[size] && *icon;
+    if ((XGetWindowProperty(pDisplay, id, _XA_NET_WM_ICON,
+                            0, MAXINT, FALSE,
+                            AnyPropertyType, &type, &format, &size, &left,
+                            (unsigned char **) &icon_data) == Success) &&
+        (icon_data != NULL)) {
+        for (icon = icon_data; icon < &icon_data[size] && *icon;
              icon = &icon[icon[0] * icon[1] + 2]) {
-            if (icon[0] == iconSize && icon[1] == iconSize)
-                return NetWMToWinIcon(bpp, icon);
-            /* Find the biggest icon and let Windows scale the size */
+            /* Find an exact match to the size we require...  */
+            if (icon[0] == iconSize && icon[1] == iconSize) {
+                winDebug("winXIconToHICON: found %lu x %lu NetIcon\n", icon[0],
+                         icon[1]);
+                hIcon = NetWMToWinIcon(bpp, icon);
+                break;
+            }
+            /* Otherwise, find the biggest icon and let Windows scale the size */
             else if (biggest_size < icon[0]) {
                 biggest_icon = icon;
                 biggest_size = icon[0];
             }
         }
-        if (biggest_icon)
-            return NetWMToWinIcon(bpp, biggest_icon);
-    }
-    winDebug("winXIconToHICON - pWin %x: no suitable NetIcon\n", (int) pWin,
-             iconSize);
 
-    winMultiWindowGetWMHints(pWin, &hints);
-    if (!hints.icon_pixmap)
-        return NULL;
+        if (!hIcon && biggest_icon) {
+            winDebug
+                ("winXIconToHICON: selected %lu x %lu NetIcon for scaling to %u x %u\n",
+                 biggest_icon[0], biggest_icon[1], iconSize, iconSize);
+
+            hIcon = NetWMToWinIcon(bpp, biggest_icon);
+        }
 
-    dixLookupResourceByType((pointer) &iconPtr, hints.icon_pixmap, RT_PIXMAP,
-                            NullClient, DixUnknownAccess);
+        XFree(icon_data);
+    }
 
-    if (!iconPtr)
-        return NULL;
+    if (!hIcon) {
+        winDebug("winXIconToHICON: no suitable NetIcon\n");
+
+        hints = XGetWMHints(pDisplay, id);
+        if (hints) {
+            winDebug("winXIconToHICON: id 0x%x icon_pixmap hint %x\n", id,
+                     hints->icon_pixmap);
+
+            if (hints->icon_pixmap) {
+                Window root;
+                int x, y;
+                unsigned int width, height, border_width, depth;
+                XImage *xImageIcon;
+                XImage *xImageMask = NULL;
+
+                XGetGeometry(pDisplay, hints->icon_pixmap, &root, &x, &y,
+                             &width, &height, &border_width, &depth);
+
+                xImageIcon =
+                    XGetImage(pDisplay, hints->icon_pixmap, 0, 0, width, height,
+                              0xFFFFFFFF, ZPixmap);
+                winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%x\n", id,
+                         xImageIcon);
+
+                if (hints->icon_mask)
+                    xImageMask =
+                        XGetImage(pDisplay, hints->icon_mask, 0, 0, width,
+                                  height, 0xFFFFFFFF, ZPixmap);
+
+                if (xImageIcon) {
+                    int effBPP, stride, maskStride;
+
+                    /* 15 BPP is really 16BPP as far as we care */
+                    if (bpp == 15)
+                        effBPP = 16;
+                    else
+                        effBPP = bpp;
 
-    /* 15 BPP is really 16BPP as far as we care */
-    if (bpp == 15)
-        effBPP = 16;
-    else
-        effBPP = bpp;
+                    /* Need 16-bit aligned rows for DDBitmaps */
+                    stride = ((iconSize * effBPP + 15) & (~15)) / 8;
 
-    /* Need 16-bit aligned rows for DDBitmaps */
-    stride = ((iconSize * effBPP + 15) & (~15)) / 8;
+                    /* Mask is 1-bit deep */
+                    maskStride = ((iconSize * 1 + 15) & (~15)) / 8;
 
-    /* Mask is 1-bit deep */
-    maskStride = ((iconSize * 1 + 15) & (~15)) / 8;
+                    image = malloc(stride * iconSize);
+                    imageMask = malloc(stride * iconSize);
+                    mask = malloc(maskStride * iconSize);
 
-    image = malloc(stride * iconSize);
-    imageMask = malloc(stride * iconSize);
-    /* Default to a completely black mask */
-    mask = calloc(maskStride, iconSize);
+                    /* Default to a completely black mask */
+                    memset(imageMask, 0, stride * iconSize);
+                    memset(mask, 0, maskStride * iconSize);
 
-    winScaleXBitmapToWindows(iconSize, effBPP, iconPtr, image);
-    dixLookupResourceByType((pointer) &maskPtr, hints.icon_mask, RT_PIXMAP,
-                            NullClient, DixUnknownAccess);
+                    winScaleXImageToWindowsIcon(iconSize, effBPP, stride,
+                                                xImageIcon, image);
 
-    if (maskPtr) {
-        winScaleXBitmapToWindows(iconSize, 1, maskPtr, mask);
+                    if (xImageMask) {
+                        winScaleXImageToWindowsIcon(iconSize, 1, maskStride,
+                                                    xImageMask, mask);
+                        winScaleXImageToWindowsIcon(iconSize, effBPP, stride,
+                                                    xImageMask, imageMask);
+                    }
 
-        winScaleXBitmapToWindows(iconSize, effBPP, maskPtr, imageMask);
+                    /* Now we need to set all bits of the icon which are not masked */
+                    /* on to 0 because Color is really an XOR, not an OR function */
+                    dst = image;
+                    src = imageMask;
 
-        /* Now we need to set all bits of the icon which are not masked */
-        /* on to 0 because Color is really an XOR, not an OR function */
-        dst = image;
-        src = imageMask;
+                    for (i = 0; i < (stride * iconSize); i++)
+                        if ((*(src++)))
+                            *(dst++) = 0;
+                        else
+                            dst++;
 
-        for (i = 0; i < (stride * iconSize); i++)
-            if ((*(src++)))
-                *(dst++) = 0;
-            else
-                dst++;
-    }
+                    ii.fIcon = TRUE;
+                    ii.xHotspot = 0;    /* ignored */
+                    ii.yHotspot = 0;    /* ignored */
 
-    ii.fIcon = TRUE;
-    ii.xHotspot = 0;            /* ignored */
-    ii.yHotspot = 0;            /* ignored */
+                    /* Create Win32 mask from pixmap shape */
+                    ii.hbmMask =
+                        CreateBitmap(iconSize, iconSize, planes, 1, mask);
 
-    /* Create Win32 mask from pixmap shape */
-    ii.hbmMask = CreateBitmap(iconSize, iconSize, planes, 1, mask);
+                    /* Create Win32 bitmap from pixmap */
+                    ii.hbmColor =
+                        CreateBitmap(iconSize, iconSize, planes, bpp, image);
 
-    /* Create Win32 bitmap from pixmap */
-    ii.hbmColor = CreateBitmap(iconSize, iconSize, planes, bpp, image);
+                    /* Merge Win32 mask and bitmap into icon */
+                    hIcon = CreateIconIndirect(&ii);
 
-    /* Merge Win32 mask and bitmap into icon */
-    hIcon = CreateIconIndirect(&ii);
+                    /* Release Win32 mask and bitmap */
+                    DeleteObject(ii.hbmMask);
+                    DeleteObject(ii.hbmColor);
 
-    /* Release Win32 mask and bitmap */
-    DeleteObject(ii.hbmMask);
-    DeleteObject(ii.hbmColor);
+                    /* Free X mask and bitmap */
+                    free(mask);
+                    free(image);
+                    free(imageMask);
 
-    /* Free X mask and bitmap */
-    free(mask);
-    free(image);
-    free(imageMask);
+                    if (xImageMask)
+                        XDestroyImage(xImageMask);
 
+                    XDestroyImage(xImageIcon);
+                }
+            }
+            XFree(hints);
+        }
+    }
     return hIcon;
 }
 
 /*
- * Change the Windows window icon 
+ * Change the Windows window icon
  */
 
 #ifdef XWIN_MULTIWINDOW
 void
-winUpdateIcon(Window id)
+winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew)
 {
-    WindowPtr pWin;
     HICON hIcon, hIconSmall = NULL, hIconOld;
 
-    dixLookupResourceByType((pointer) &pWin, id, RT_WINDOW, NullClient,
-                            DixUnknownAccess);
-    if (pWin) {
-        winWindowPriv(pWin);
-        if (pWinPriv->hWnd) {
-            hIcon = winOverrideIcon((unsigned long) pWin);
-            if (!hIcon) {
-                hIcon = winXIconToHICON(pWin, GetSystemMetrics(SM_CXICON));
-                if (!hIcon) {
-                    hIcon = g_hIconX;
-                    hIconSmall = g_hSmallIconX;
-                }
-                else {
-                    /* Leave undefined if not found */
-                    hIconSmall =
-                        winXIconToHICON(pWin, GetSystemMetrics(SM_CXSMICON));
-                }
-            }
+    /* Start with the icon from preferences, if any */
+    hIcon = hIconNew;
+    hIconSmall = hIconNew;
 
-            /* Set the large icon */
-            hIconOld = (HICON) SendMessage(pWinPriv->hWnd,
-                                           WM_SETICON, ICON_BIG,
-                                           (LPARAM) hIcon);
+    /* If we still need an icon, try and get the icon from WM_HINTS */
+    if (!hIcon)
+        hIcon = winXIconToHICON(pDisplay, id, GetSystemMetrics(SM_CXICON));
+    if (!hIconSmall)
+        hIconSmall =
+            winXIconToHICON(pDisplay, id, GetSystemMetrics(SM_CXSMICON));
 
-            /* Delete the icon if its not the default */
-            winDestroyIcon(hIconOld);
-
-            /* Same for the small icon */
-            hIconOld = (HICON) SendMessage(pWinPriv->hWnd,
-                                           WM_SETICON, ICON_SMALL,
-                                           (LPARAM) hIconSmall);
-            winDestroyIcon(hIconOld);
-        }
+    /* If we got the small, but not the large one swap them */
+    if (!hIcon && hIconSmall) {
+        hIcon = hIconSmall;
+        hIconSmall = NULL;
     }
+
+    /* Set the large icon */
+    hIconOld = (HICON) SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
+    /* Delete the old icon if its not the default */
+    winDestroyIcon(hIconOld);
+
+    /* Same for the small icon */
+    hIconOld =
+        (HICON) SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
+    winDestroyIcon(hIconOld);
 }
 
 void
@@ -591,37 +601,21 @@ winInitGlobalIcons(void)
 }
 
 void
-winSelectIcons(WindowPtr pWin, HICON * pIcon, HICON * pSmallIcon)
+winSelectIcons(HICON * pIcon, HICON * pSmallIcon)
 {
     HICON hIcon, hSmallIcon;
 
     winInitGlobalIcons();
 
-    /* Try and get the icon from WM_HINTS */
-    hIcon = winXIconToHICON(pWin, GetSystemMetrics(SM_CXICON));
-    hSmallIcon = winXIconToHICON(pWin, GetSystemMetrics(SM_CXSMICON));
-
-    /* If we got the small, but not the large one swap them */
-    if (!hIcon && hSmallIcon) {
-        hIcon = hSmallIcon;
-        hSmallIcon = NULL;
-    }
-
-    /* Use default X icon if no icon loaded from WM_HINTS */
-    if (!hIcon) {
-        hIcon = g_hIconX;
-        hSmallIcon = g_hSmallIconX;
-    }
+    /* Use default X icon */
+    hIcon = g_hIconX;
+    hSmallIcon = g_hSmallIconX;
 
     if (pIcon)
         *pIcon = hIcon;
-    else
-        winDestroyIcon(hIcon);
 
     if (pSmallIcon)
         *pSmallIcon = hSmallIcon;
-    else
-        winDestroyIcon(hSmallIcon);
 }
 
 void
diff --git a/hw/xwin/winmultiwindowicons.h b/hw/xwin/winmultiwindowicons.h
new file mode 100644 (file)
index 0000000..bf7f6ed
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * File: winmultiwindowicons.h
+ * Purpose: interface for multiwindow mode icon functions
+ *
+ * Copyright (c) Jon TURNEY 2012
+ *
+ *
+ * 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.
+ */
+
+#ifndef WINMULTIWINDOWICONS_H
+#define WINMULTIWINDOWICONS_H
+
+void
+ winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew);
+
+void
+ winInitGlobalIcons(void);
+
+void
+ winDestroyIcon(HICON hIcon);
+
+void
+ winSelectIcons(HICON * pIcon, HICON * pSmallIcon);
+
+#endif                          /* WINMULTIWINDOWICONS_H */
index 0093fcb..c0c7db2 100644 (file)
@@ -63,6 +63,11 @@ winInitMultiWindowClass(void)
     WNDCLASSEX wcx;
 
     if (atomXWinClass == 0) {
+        HICON hIcon, hIconSmall;
+
+        /* Load the default icons */
+        winSelectIcons(&hIcon, &hIconSmall);
+
         /* Setup our window class */
         wcx.cbSize = sizeof(WNDCLASSEX);
         wcx.style = CS_HREDRAW | CS_VREDRAW | (g_fNativeGl ? CS_OWNDC : 0);
@@ -70,12 +75,12 @@ winInitMultiWindowClass(void)
         wcx.cbClsExtra = 0;
         wcx.cbWndExtra = 0;
         wcx.hInstance = g_hInstance;
-        wcx.hIcon = g_hIconX;
+        wcx.hIcon = hIcon;
         wcx.hCursor = 0;
         wcx.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
         wcx.lpszMenuName = NULL;
         wcx.lpszClassName = WINDOW_CLASS_X;
-        wcx.hIconSm = g_hSmallIconX;
+        wcx.hIconSm = hIconSmall;
 
 #if CYGMULTIWINDOW_DEBUG
         ErrorF("winCreateWindowsWindow - Creating class: %s\n", WINDOW_CLASS_X);
@@ -479,8 +484,6 @@ winCreateWindowsWindow(WindowPtr pWin)
     HWND hFore = NULL;
 
     winWindowPriv(pWin);
-    HICON hIcon;
-    HICON hIconSmall;
     winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
     WinXSizeHints hints;
     WindowPtr pDaddy;
@@ -574,13 +577,6 @@ winCreateWindowsWindow(WindowPtr pWin)
     }
     pWinPriv->hWnd = hWnd;
 
-    /* Set application or .XWinrc defined Icons */
-    winSelectIcons(pWin, &hIcon, &hIconSmall);
-    if (hIcon)
-        SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
-    if (hIconSmall)
-        SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
-
     /* Change style back to popup, already placed... */
     SetWindowLongPtr(hWnd, GWL_STYLE,
                      WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
index c355e89..ffb7c2d 100644 (file)
@@ -151,7 +151,7 @@ static Bool
  InitQueue(WMMsgQueuePtr pQueue);
 
 static void
- GetWindowName(Display * pDpy, Window iWin, wchar_t ** ppName);
+ GetWindowName(Display * pDpy, Window iWin, char **ppWindowName);
 
 static int
  SendXMessage(Display * pDisplay, Window iWin, Atom atmType, long nData);
@@ -380,57 +380,38 @@ InitQueue(WMMsgQueuePtr pQueue)
     pQueue->nQueueSize = 0;
 
 #if CYGMULTIWINDOW_DEBUG
-    ErrorF("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize,
-           QueueSize(pQueue));
+    winDebug("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize,
+             QueueSize(pQueue));
 #endif
 
-    ErrorF("InitQueue - Calling pthread_mutex_init\n");
+    winDebug("InitQueue - Calling pthread_mutex_init\n");
 
     /* Create synchronization objects */
     pthread_mutex_init(&pQueue->pmMutex, NULL);
 
-    ErrorF("InitQueue - pthread_mutex_init returned\n");
-    ErrorF("InitQueue - Calling pthread_cond_init\n");
+    winDebug("InitQueue - pthread_mutex_init returned\n");
+    winDebug("InitQueue - Calling pthread_cond_init\n");
 
     pthread_cond_init(&pQueue->pcNotEmpty, NULL);
 
-    ErrorF("InitQueue - pthread_cond_init returned\n");
+    winDebug("InitQueue - pthread_cond_init returned\n");
 
     return TRUE;
 }
 
-/*
- * GetWindowName - Retrieve the title of an X Window
- */
-
-static void
-GetWindowName(Display * pDisplay, Window iWin, wchar_t ** ppName)
+static
+char *
+Xutf8TextPropertyToString(Display * pDisplay, XTextProperty * xtp)
 {
-    int nResult, nNum;
+    int nNum;
     char **ppList;
     char *pszReturnData;
-    int iLen, i;
-    XTextProperty xtpName;
-
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("GetWindowName\n");
-#endif
-
-    /* Intialize ppName to NULL */
-    *ppName = NULL;
 
-    /* Try to get --- */
-    nResult = XGetWMName(pDisplay, iWin, &xtpName);
-    if (!nResult || !xtpName.value || !xtpName.nitems) {
-#if CYGMULTIWINDOW_DEBUG
-        ErrorF("GetWindowName - XGetWMName failed.  No name.\n");
-#endif
-        return;
-    }
+    if (Xutf8TextPropertyToTextList(pDisplay, xtp, &ppList, &nNum) >= Success &&
+        nNum > 0 && *ppList) {
+        int i;
+        int iLen = 0;
 
-    if (Xutf8TextPropertyToTextList(pDisplay, &xtpName, &ppList, &nNum) >=
-        Success && nNum > 0 && *ppList) {
-        iLen = 0;
         for (i = 0; i < nNum; i++)
             iLen += strlen(ppList[i]);
         pszReturnData = (char *) malloc(iLen + 1);
@@ -444,15 +425,40 @@ GetWindowName(Display * pDisplay, Window iWin, wchar_t ** ppName)
         pszReturnData = (char *) malloc(1);
         pszReturnData[0] = '\0';
     }
-    iLen = MultiByteToWideChar(CP_UTF8, 0, pszReturnData, -1, NULL, 0);
-    *ppName = (wchar_t *) malloc(sizeof(wchar_t) * (iLen + 1));
-    MultiByteToWideChar(CP_UTF8, 0, pszReturnData, -1, *ppName, iLen);
-    XFree(xtpName.value);
-    free(pszReturnData);
 
+    return pszReturnData;
+}
+
+/*
+ * GetWindowName - Retrieve the title of an X Window
+ */
+
+static void
+GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName)
+{
+    int nResult;
+    XTextProperty xtpWindowName;
+    char *pszWindowName;
+
+#if CYGMULTIWINDOW_DEBUG
+    ErrorF("GetWindowName\n");
+#endif
+
+    /* Intialize ppWindowName to NULL */
+    *ppWindowName = NULL;
+
+    /* Try to get window name */
+    nResult = XGetWMName(pDisplay, iWin, &xtpWindowName);
+    if (!nResult || !xtpWindowName.value || !xtpWindowName.nitems) {
 #if CYGMULTIWINDOW_DEBUG
-    ErrorF("GetWindowName - Returning\n");
+        ErrorF("GetWindowName - XGetWMName failed.  No name.\n");
 #endif
+        return;
+    }
+
+    pszWindowName = Xutf8TextPropertyToString(pDisplay, &xtpWindowName);
+    XFree(xtpWindowName.value);
+    *ppWindowName = pszWindowName;
 }
 
 /*
@@ -477,23 +483,23 @@ SendXMessage(Display * pDisplay, Window iWin, Atom atmType, long nData)
 }
 
 /*
- * Updates the name of a HWND according to its X WM_NAME property
+ * See if we can get the stored HWND for this window...
  */
-
-static void
-UpdateName(WMInfoPtr pWMInfo, Window iWindow)
+static HWND
+getHwnd(WMInfoPtr pWMInfo, Window iWindow)
 {
-    wchar_t *pszName;
     Atom atmType;
     int fmtRet;
     unsigned long items, remain;
-    HWND *retHwnd, hWnd;
-    XWindowAttributes attr;
-
-    hWnd = 0;
-
-    /* See if we can get the cached HWND for this window... */
-    if (XGetWindowProperty(pWMInfo->pDisplay, iWindow, pWMInfo->atmPrivMap, 0, 1, False, XA_INTEGER,    //pWMInfo->atmPrivMap,
+    HWND *retHwnd, hWnd = NULL;
+
+    if (XGetWindowProperty(pWMInfo->pDisplay,
+                           iWindow,
+                           pWMInfo->atmPrivMap,
+                           0,
+                           1,
+                           False,
+                           XA_INTEGER,
                            &atmType,
                            &fmtRet,
                            &items,
@@ -506,22 +512,92 @@ UpdateName(WMInfoPtr pWMInfo, Window iWindow)
 
     /* Some sanity checks */
     if (!hWnd)
-        return;
+        return NULL;
     if (!IsWindow(hWnd))
+        return NULL;
+
+    return hWnd;
+}
+
+/*
+ * Updates the name of a HWND according to its X WM_NAME property
+ */
+
+static void
+UpdateName(WMInfoPtr pWMInfo, Window iWindow)
+{
+    wchar_t *pszName;
+    HWND hWnd;
+    XWindowAttributes attr;
+
+    hWnd = getHwnd(pWMInfo, iWindow);
+    if (!hWnd)
         return;
 
-    /* Set the Windows window name */
-    GetWindowName(pWMInfo->pDisplay, iWindow, &pszName);
-    if (pszName) {
-        /* Get the window attributes */
-        XGetWindowAttributes(pWMInfo->pDisplay, iWindow, &attr);
-        if (!attr.override_redirect) {
-            SetWindowTextW(hWnd, pszName);
-            winUpdateIcon(iWindow);
+    /* If window isn't override-redirect */
+    XGetWindowAttributes(pWMInfo->pDisplay, iWindow, &attr);
+    if (!attr.override_redirect) {
+        char *pszWindowName;
+
+        /* Get the X windows window name */
+        GetWindowName(pWMInfo->pDisplay, iWindow, &pszWindowName);
+
+        if (pszWindowName) {
+            /* Convert from UTF-8 to wide char */
+            int iLen =
+                MultiByteToWideChar(CP_UTF8, 0, pszWindowName, -1, NULL, 0);
+            wchar_t *pwszWideWindowName =
+                (wchar_t *) malloc(sizeof(wchar_t) * (iLen + 1));
+            MultiByteToWideChar(CP_UTF8, 0, pszWindowName, -1,
+                                pwszWideWindowName, iLen);
+
+            /* Set the Windows window name */
+            SetWindowTextW(hWnd, pwszWideWindowName);
+
+            free(pwszWideWindowName);
+            free(pszWindowName);
         }
+    }
+}
+
+/*
+ * Updates the icon of a HWND according to its X icon properties
+ */
+
+static void
+UpdateIcon(WMInfoPtr pWMInfo, Window iWindow)
+{
+    HWND hWnd;
+    HICON hIconNew = NULL;
+    XWindowAttributes attr;
 
-        free(pszName);
+    hWnd = getHwnd(pWMInfo, iWindow);
+    if (!hWnd)
+        return;
+
+    /* If window isn't override-redirect */
+    XGetWindowAttributes(pWMInfo->pDisplay, iWindow, &attr);
+    if (!attr.override_redirect) {
+        XClassHint class_hint = { 0, 0 };
+        char *window_name = 0;
+
+        if (XGetClassHint(pWMInfo->pDisplay, iWindow, &class_hint)) {
+            XFetchName(pWMInfo->pDisplay, iWindow, &window_name);
+
+            hIconNew =
+                (HICON) winOverrideIcon(class_hint.res_name,
+                                        class_hint.res_class, window_name);
+
+            if (class_hint.res_name)
+                XFree(class_hint.res_name);
+            if (class_hint.res_class)
+                XFree(class_hint.res_class);
+            if (window_name)
+                XFree(window_name);
+        }
     }
+
+    winUpdateIcon(hWnd, pWMInfo->pDisplay, iWindow, hIconNew);
 }
 
 #if 0
@@ -532,27 +608,12 @@ UpdateName(WMInfoPtr pWMInfo, Window iWindow)
 static void
 PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction)
 {
-    Atom atmType;
-    int fmtRet;
-    unsigned long items, remain;
-    HWND hWnd, *retHwnd;
+    HWND hWnd;
     DWORD myWinProcID, winProcID;
     Window xWindow;
     WINDOWPLACEMENT wndPlace;
 
-    hWnd = NULL;
-    /* See if we can get the cached HWND for this window... */
-    if (XGetWindowProperty(pWMInfo->pDisplay, iWindow, pWMInfo->atmPrivMap, 0, 1, False, XA_INTEGER,    //pWMInfo->atmPrivMap,
-                           &atmType,
-                           &fmtRet,
-                           &items,
-                           &remain, (unsigned char **) &retHwnd) == Success) {
-        if (retHwnd) {
-            hWnd = *retHwnd;
-            XFree(retHwnd);
-        }
-    }
-
+    hWnd = getHwnd(pWMInfo, iWindow);
     if (!hWnd)
         return;
 
@@ -662,7 +723,7 @@ winMultiWindowWMProc(void *pArg)
                             PropModeReplace,
                             (unsigned char *) &(pNode->msg.hwndWindow), 1);
             UpdateName(pWMInfo, pNode->msg.iWindow);
-            winUpdateIcon(pNode->msg.iWindow);
+            UpdateIcon(pWMInfo, pNode->msg.iWindow);
             break;
 
         case WM_WM_MAP2:
@@ -685,7 +746,7 @@ winMultiWindowWMProc(void *pArg)
                             PropModeReplace,
                             (unsigned char *) &(pNode->msg.hwndWindow), 1);
             UpdateName(pWMInfo, pNode->msg.iWindow);
-            winUpdateIcon(pNode->msg.iWindow);
+            UpdateIcon(pWMInfo, pNode->msg.iWindow);
             {
                 HWND zstyle = HWND_NOTOPMOST;
 
@@ -747,8 +808,8 @@ winMultiWindowWMProc(void *pArg)
             UpdateName(pWMInfo, pNode->msg.iWindow);
             break;
 
-        case WM_WM_HINTS_EVENT:
-            winUpdateIcon(pNode->msg.iWindow);
+        case WM_WM_ICON_EVENT:
+            UpdateIcon(pWMInfo, pNode->msg.iWindow);
             break;
 
         case WM_WM_CHANGE_STATE:
@@ -799,10 +860,11 @@ winMultiWindowXMsgProc(void *pArg)
     Atom atmWmName;
     Atom atmWmHints;
     Atom atmWmChange;
+    Atom atmNetWmIcon;
     int iReturn;
     XIconSize *xis;
 
-    ErrorF("winMultiWindowXMsgProc - Hello\n");
+    winDebug("winMultiWindowXMsgProc - Hello\n");
 
     /* Check that argument pointer is not invalid */
     if (pProcArg == NULL) {
@@ -924,6 +986,7 @@ winMultiWindowXMsgProc(void *pArg)
     atmWmName = XInternAtom(pProcArg->pDisplay, "WM_NAME", False);
     atmWmHints = XInternAtom(pProcArg->pDisplay, "WM_HINTS", False);
     atmWmChange = XInternAtom(pProcArg->pDisplay, "WM_CHANGE_STATE", False);
+    atmNetWmIcon = XInternAtom(pProcArg->pDisplay, "_NET_WM_ICON", False);
 
     /*
        iiimxcf had a bug until 2009-04-27, assuming that the
@@ -1051,25 +1114,25 @@ winMultiWindowXMsgProc(void *pArg)
                            True, StructureNotifyMask, &event_send);
             }
         }
-        else if (event.type == PropertyNotify
-                 && event.xproperty.atom == atmWmName) {
-            memset(&msg, 0, sizeof(msg));
-
-            msg.msg = WM_WM_NAME_EVENT;
-            msg.iWindow = event.xproperty.window;
-
-            /* Other fields ignored */
-            winSendMessageToWM(pProcArg->pWMInfo, &msg);
-        }
-        else if (event.type == PropertyNotify
-                 && event.xproperty.atom == atmWmHints) {
-            memset(&msg, 0, sizeof(msg));
+        else if (event.type == PropertyNotify) {
+            if (event.xproperty.atom == atmWmName) {
+                memset(&msg, 0, sizeof(msg));
 
-            msg.msg = WM_WM_HINTS_EVENT;
-            msg.iWindow = event.xproperty.window;
+                msg.msg = WM_WM_NAME_EVENT;
+                msg.iWindow = event.xproperty.window;
 
-            /* Other fields ignored */
-            winSendMessageToWM(pProcArg->pWMInfo, &msg);
+                /* Other fields ignored */
+                winSendMessageToWM(pProcArg->pWMInfo, &msg);
+            }
+            else if ((event.xproperty.atom == atmWmHints) ||
+                     (event.xproperty.atom == atmNetWmIcon)) {
+                memset(&msg, 0, sizeof(msg));
+                msg.msg = WM_WM_ICON_EVENT;
+                msg.iWindow = event.xproperty.window;
+
+                /* Other fields ignored */
+                winSendMessageToWM(pProcArg->pWMInfo, &msg);
+            }
         }
         else if (event.type == ClientMessage
                  && event.xclient.message_type == atmWmChange
@@ -1172,7 +1235,7 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
     char pszDisplay[512];
     int iReturn;
 
-    ErrorF("winInitMultiWindowWM - Hello\n");
+    winDebug("winInitMultiWindowWM - Hello\n");
 
     /* Check that argument pointer is not invalid */
     if (pProcArg == NULL) {
@@ -1680,13 +1743,11 @@ winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle)
     /* Setup a rectangle with the X window position and size */
     SetRect(&rcNew, iX, iY, iX + iWidth, iY + iHeight);
 
-#if 0
-    ErrorF("winUpdateWindowPosition - (%d, %d)-(%d, %d)\n",
-           rcNew.left, rcNew.top, rcNew.right, rcNew.bottom);
-#endif
+    winDebug("winUpdateWindowPosition - drawable extent (%d, %d)-(%d, %d)\n",
+             rcNew.left, rcNew.top, rcNew.right, rcNew.bottom);
 
     AdjustWindowRectEx(&rcNew, GetWindowLongPtr(hWnd, GWL_STYLE), FALSE,
-                       WS_EX_APPWINDOW);
+                       GetWindowLongPtr(hWnd, GWL_EXSTYLE));
 
     /* Don't allow window decoration to disappear off to top-left as a result of this adjustment */
     if (rcNew.left < GetSystemMetrics(SM_XVIRTUALSCREEN)) {
@@ -1701,10 +1762,8 @@ winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle)
         rcNew.bottom += iDy;
     }
 
-#if 0
-    ErrorF("winUpdateWindowPosition - (%d, %d)-(%d, %d)\n",
-           rcNew.left, rcNew.top, rcNew.right, rcNew.bottom);
-#endif
+    winDebug("winUpdateWindowPosition - Window extent (%d, %d)-(%d, %d)\n",
+             rcNew.left, rcNew.top, rcNew.right, rcNew.bottom);
 
     /* Position the Windows window */
     SetWindowPos(hWnd, *zstyle, rcNew.left, rcNew.top,
index 8a1455b..a2a5123 100644 (file)
@@ -44,7 +44,7 @@ static void
  winShadowUpdateNativeGDI(ScreenPtr pScreen, shadowBufPtr pBuf);
 
 static Bool
- winCloseScreenNativeGDI(int nIndex, ScreenPtr pScreen);
+ winCloseScreenNativeGDI(ScreenPtr pScreen);
 
 static Bool
  winInitVisualsNativeGDI(ScreenPtr pScreen);
@@ -104,7 +104,7 @@ winInitScreenNativeGDI(ScreenPtr pScreen)
  */
 
 static Bool
-winCloseScreenNativeGDI(int nIndex, ScreenPtr pScreen)
+winCloseScreenNativeGDI(ScreenPtr pScreen)
 {
     winScreenPriv(pScreen);
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
index 3fddd85..0fd0efe 100644 (file)
@@ -44,7 +44,7 @@ static Bool
  winAllocateFBPrimaryDD(ScreenPtr pScreen);
 
 static Bool
- winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen);
+ winCloseScreenPrimaryDD(ScreenPtr pScreen);
 
 static Bool
  winInitVisualsPrimaryDD(ScreenPtr pScreen);
@@ -264,7 +264,7 @@ winInitScreenPrimaryDD(ScreenPtr pScreen)
  */
 
 static Bool
-winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen)
+winCloseScreenPrimaryDD(ScreenPtr pScreen)
 {
     winScreenPriv(pScreen);
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
@@ -279,7 +279,7 @@ winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen)
     /* Call the wrapped CloseScreen procedure */
     WIN_UNWRAP(CloseScreen);
     if (pScreen->CloseScreen)
-        fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+        fReturn = (*pScreen->CloseScreen) (pScreen);
 
     /* Delete the window property */
     RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP);
index 86a7882..faa97c3 100644 (file)
@@ -148,7 +148,6 @@ static wBOOL CALLBACK
 ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam)
 {
     HICON hicon;
-    Window wid;
 
     if (!hwnd) {
         ErrorF("ReloadEnumWindowsProc: hwnd==NULL!\n");
@@ -173,10 +172,23 @@ ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam)
         /* This window is now clean of our taint (but with undefined icons) */
     }
     else {
-        /* winUpdateIcon() will set the icon default, dynamic, or from xwinrc */
-        wid = (Window) GetProp(hwnd, WIN_WID_PROP);
-        if (wid)
-            winUpdateIcon(wid);
+        /* Send a message to WM thread telling it re-evaluate the icon for this window */
+        {
+            winWMMessageRec wmMsg;
+
+            WindowPtr pWin = GetProp(hwnd, WIN_WINDOW_PROP);
+
+            if (pWin) {
+                winPrivWinPtr pWinPriv = winGetWindowPriv(pWin);
+                winPrivScreenPtr s_pScreenPriv = pWinPriv->pScreenPriv;
+
+                wmMsg.msg = WM_WM_ICON_EVENT;
+                wmMsg.hwndWindow = hwnd;
+                wmMsg.iWindow = (Window) GetProp(hwnd, WIN_WID_PROP);
+
+                winSendMessageToWM(s_pScreenPriv->pWMInfo, &wmMsg);
+            }
+        }
 
         /* Update the system menu for this window */
         SetupSysMenu((unsigned long) hwnd);
@@ -577,31 +589,15 @@ LoadImageComma(char *fname, int sx, int sy, int flags)
  * ICONS{} section in the prefs file, and load the icon from a file
  */
 HICON
-winOverrideIcon(unsigned long longWin)
+winOverrideIcon(char *res_name, char *res_class, char *wmName)
 {
-    WindowPtr pWin = (WindowPtr) longWin;
-    char *res_name, *res_class;
     int i;
     HICON hicon;
-    char *wmName;
-
-    if (pWin == NULL)
-        return 0;
-
-    /* If we can't find the class, we can't override from default! */
-    if (!winMultiWindowGetClassHint(pWin, &res_name, &res_class))
-        return 0;
-
-    winMultiWindowGetWMName(pWin, &wmName);
 
     for (i = 0; i < pref.iconItems; i++) {
-        if (!strcmp(pref.icon[i].match, res_name) ||
-            !strcmp(pref.icon[i].match, res_class) ||
+        if ((res_name && !strcmp(pref.icon[i].match, res_name)) ||
+            (res_class && !strcmp(pref.icon[i].match, res_class)) ||
             (wmName && strstr(wmName, pref.icon[i].match))) {
-            free(res_name);
-            free(res_class);
-            free(wmName);
-
             if (pref.icon[i].hicon)
                 return pref.icon[i].hicon;
 
@@ -616,10 +612,6 @@ winOverrideIcon(unsigned long longWin)
     }
 
     /* Didn't find the icon, fail gracefully */
-    free(res_name);
-    free(res_class);
-    free(wmName);
-
     return 0;
 }
 
index fcce8d8..5de5719 100644 (file)
@@ -164,7 +164,7 @@ Bool
 int
  winIconIsOverride(unsigned hiconIn);
 
-HICON winOverrideIcon(unsigned long longpWin);
+HICON winOverrideIcon(char *res_name, char *res_class, char *wmName);
 
 unsigned long
  winOverrideStyle(char *res_name, char *res_class, char *wmName);
diff --git a/hw/xwin/winprefslex.c b/hw/xwin/winprefslex.c
deleted file mode 100644 (file)
index 921a41d..0000000
+++ /dev/null
@@ -1,2181 +0,0 @@
-
-#line 3 "winprefslex.c"
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else  /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN (yy_start) = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START (((yy_start) - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin  )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-extern yy_size_t yyleng;
-
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
-     *       access to the local variable yy_act. Since yyless() is a macro, it would break
-     *       existing scanners that call yyless() from OUTSIDE yylex. 
-     *       One obvious solution it to make yy_act a global. I tried that, and saw
-     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
-     *       normally declared as a register variable-- so it is not worth it.
-     */
-    #define  YY_LESS_LINENO(n) \
-            do { \
-                yy_size_t yyl;\
-                for ( yyl = n; yyl < yyleng; ++yyl )\
-                    if ( yytext[yyl] == '\n' )\
-                        --yylineno;\
-            }while(0)
-    
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-               *yy_cp = (yy_hold_char); \
-               YY_RESTORE_YY_MORE_OFFSET \
-               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-               YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-               } \
-       while ( 0 )
-
-#define unput(c) yyunput( c, (yytext_ptr)  )
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-       {
-       FILE *yy_input_file;
-
-       char *yy_ch_buf;                /* input buffer */
-       char *yy_buf_pos;               /* current position in input buffer */
-
-       /* Size of input buffer in bytes, not including room for EOB
-        * characters.
-        */
-       yy_size_t yy_buf_size;
-
-       /* Number of characters read into yy_ch_buf, not including EOB
-        * characters.
-        */
-       yy_size_t yy_n_chars;
-
-       /* Whether we "own" the buffer - i.e., we know we created it,
-        * and can realloc() it to grow it, and should free() it to
-        * delete it.
-        */
-       int yy_is_our_buffer;
-
-       /* Whether this is an "interactive" input source; if so, and
-        * if we're using stdio for input, then we want to use getc()
-        * instead of fread(), to make sure we stop fetching input after
-        * each newline.
-        */
-       int yy_is_interactive;
-
-       /* Whether we're considered to be at the beginning of a line.
-        * If so, '^' rules will be active on the next match, otherwise
-        * not.
-        */
-       int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-    
-       /* Whether to try to fill the input buffer when we reach the
-        * end of it.
-        */
-       int yy_fill_buffer;
-
-       int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-       /* When an EOF's been seen but there's still some text to process
-        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-        * shouldn't try reading from the input source any more.  We might
-        * still have a bunch of tokens to match, though, because of
-        * possible backing-up.
-        *
-        * When we actually see the EOF, we change the status to "new"
-        * (via yyrestart()), so that the user can continue scanning by
-        * just pointing yyin at a new input file.
-        */
-#define YY_BUFFER_EOF_PENDING 2
-
-       };
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* Stack of input buffers. */
-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
-                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
-                          : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-static yy_size_t yy_n_chars;           /* number of characters read into yy_ch_buf */
-yy_size_t yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0;                /* whether we need to initialize */
-static int yy_start = 0;       /* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart (FILE *input_file  );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
-void yy_delete_buffer (YY_BUFFER_STATE b  );
-void yy_flush_buffer (YY_BUFFER_STATE b  );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
-void yypop_buffer_state (void );
-
-static void yyensure_buffer_stack (void );
-static void yy_load_buffer_state (void );
-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
-
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
-
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  );
-
-void *yyalloc (yy_size_t  );
-void *yyrealloc (void *,yy_size_t  );
-void yyfree (void *  );
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-       { \
-       if ( ! YY_CURRENT_BUFFER ){ \
-        yyensure_buffer_stack (); \
-               YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ); \
-       } \
-       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-       }
-
-#define yy_set_bol(at_bol) \
-       { \
-       if ( ! YY_CURRENT_BUFFER ){\
-        yyensure_buffer_stack (); \
-               YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ); \
-       } \
-       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-       }
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-typedef unsigned char YY_CHAR;
-
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-
-typedef int yy_state_type;
-
-extern int yylineno;
-
-int yylineno = 1;
-
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
-static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[]  );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
-       (yytext_ptr) = yy_bp; \
-       yyleng = (yy_size_t) (yy_cp - yy_bp); \
-       (yy_hold_char) = *yy_cp; \
-       *yy_cp = '\0'; \
-       (yy_c_buf_p) = yy_cp;
-
-#define YY_NUM_RULES 33
-#define YY_END_OF_BUFFER 34
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-       {
-       flex_int32_t yy_verify;
-       flex_int32_t yy_nxt;
-       };
-static yyconst flex_int16_t yy_accept[186] =
-    {   0,
-        0,    0,   34,   32,    4,    3,   32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       29,   30,   32,    4,   32,    0,   32,    0,    1,    1,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       31,   31,   32,    0,    2,    2,   32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,   32,   32,   32,   23,   32,   32,    5,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-
-       32,   22,   32,   32,   25,   32,   32,    8,   32,   32,
-       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
-       32,   32,   32,   13,   32,   32,   32,   32,   32,   32,
-       32,   26,   32,   32,   32,    9,   32,   32,   32,   32,
-       21,   32,   32,   32,   32,   16,   14,   15,   32,   32,
-       32,   19,   10,   32,   32,   32,   32,   32,   11,   12,
-       17,   32,   32,   27,   32,   32,   32,   32,   20,   32,
-       32,   32,   32,   32,   28,   24,    7,   32,   32,   32,
-       32,   32,    6,   18,    0
-    } ;
-
-static yyconst flex_int32_t yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    1,    5,    6,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    7,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    8,    9,   10,   11,   12,   13,
-       14,    1,   15,    1,    1,   16,   17,   18,   19,   20,
-        1,   21,   22,   23,   24,    1,   25,   26,   27,   28,
-        1,    1,    1,    1,    1,    1,   29,   30,   31,   32,
-
-       33,   34,   35,    1,   36,    1,    1,   37,   38,   39,
-       40,   41,    1,   42,   43,   44,   45,    1,   46,   47,
-       48,   49,   50,    1,   51,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst flex_int32_t yy_meta[52] =
-    {   0,
-        1,    2,    3,    3,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1
-    } ;
-
-static yyconst flex_int16_t yy_base[193] =
-    {   0,
-        0,    0,  373,    0,  370,  403,   50,   54,  363,   37,
-       35,   47,   35,   52,   55,   45,   41,   54,   83,   50,
-        0,    0,    0,  367,   74,  362,   97,   74,  403,   93,
-      100,   43,   93,   49,   98,   96,   90,   86,   95,   96,
-      124,   94,  102,  101,  101,  106,   96,  102,  105,  132,
-        0,  403,  146,  148,  403,  150,  147,  138,  134,  136,
-      136,  154,  153,  146,  150,  142,  152,  148,  155,  155,
-      153,  150,  166,  163,  163,  165,  172,  170,  171,  188,
-      193,  183,  190,  181,    0,  195,  190,    0,  191,  201,
-      188,  197,  205,  197,  194,  198,  209,  212,  212,  224,
-
-      218,    0,  220,  226,    0,  228,  231,    0,  232,  233,
-      232,  234,  233,  242,  242,  247,  233,  235,  240,  237,
-      253,  247,  250,    0,  258,  261,  255,  257,  274,  276,
-      277,    0,  272,  268,  280,    0,  269,  272,  277,  279,
-        0,  283,  287,  288,  289,    0,    0,    0,  284,  296,
-      297,    0,    0,  306,  302,  317,  301,  320,    0,    0,
-        0,  310,  317,    0,  314,  315,  313,  314,    0,  315,
-      319,  322,  324,  323,    0,    0,    0,  331,  326,  332,
-      330,  341,    0,    0,  403,  365,  386,  388,  391,  393,
-      396,  399
-
-    } ;
-
-static yyconst flex_int16_t yy_def[193] =
-    {   0,
-      185,    1,  185,  186,  185,  185,  187,  188,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  185,  187,  189,  188,  190,  185,  190,
-      191,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  185,  191,  192,  185,  192,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,    0,  185,  185,  185,  185,  185,
-      185,  185
-
-    } ;
-
-static yyconst flex_int16_t yy_nxt[455] =
-    {   0,
-        4,    5,    6,    6,    7,    8,    9,   10,   11,    4,
-       12,   13,    4,    4,   14,    4,   15,   16,   17,    4,
-       18,   19,   20,    4,    4,    4,    4,    4,   10,   11,
-        4,   12,   13,    4,    4,   14,    4,   15,   16,   17,
-        4,   18,   19,   20,    4,    4,    4,    4,    4,   21,
-       22,   26,   32,   34,   23,   28,   29,   30,   35,   33,
-       36,   37,   38,   41,   42,   43,   39,   57,   49,   40,
-       50,   60,   44,   32,   34,   26,   29,   30,   51,   35,
-       33,   36,   37,   38,   41,   42,   43,   39,   57,   49,
-       40,   50,   60,   44,   45,   29,   30,   46,   28,   29,
-
-       30,   54,   55,   56,   58,   47,   61,   63,   64,   48,
-       62,   65,   66,   67,   59,   45,   70,   71,   46,   72,
-       73,   74,   75,   76,   77,   58,   47,   61,   63,   64,
-       48,   62,   65,   66,   67,   59,   68,   70,   71,   78,
-       72,   73,   74,   75,   76,   77,   69,   54,   55,   56,
-       55,   56,   55,   56,   79,   80,   81,   68,   82,   83,
-       78,   84,   85,   86,   87,   88,   89,   69,   90,   91,
-       92,   93,   94,   95,   96,   79,   80,   81,   97,   82,
-       83,   98,   84,   85,   86,   87,   88,   89,   99,   90,
-       91,   92,   93,   94,   95,   96,  100,  101,  102,   97,
-
-      103,  104,   98,  105,  106,  107,  109,  110,  111,   99,
-      112,  113,  114,  115,  116,  117,  108,  100,  101,  102,
-      118,  103,  104,  119,  105,  106,  107,  109,  110,  111,
-      120,  112,  113,  114,  115,  116,  117,  108,  121,  122,
-      123,  118,  124,  125,  119,  126,  127,  128,  129,  130,
-      131,  120,  132,  133,  134,  135,  136,  137,  138,  121,
-      122,  123,  139,  124,  125,  140,  126,  127,  128,  129,
-      130,  131,  141,  132,  133,  134,  135,  136,  137,  138,
-      142,  143,  144,  139,  145,  146,  140,  147,  148,  149,
-      150,  151,  152,  141,  153,  154,  155,  156,  158,  159,
-
-      160,  142,  143,  144,  157,  145,  146,  161,  147,  148,
-      149,  150,  151,  152,  162,  153,  154,  155,  156,  158,
-      159,  160,  163,  164,  165,  157,  166,  167,  161,  168,
-      169,  170,  171,  172,  173,  162,  174,  175,  176,  177,
-      178,  179,  180,  163,  164,  165,  181,  166,  167,  182,
-      168,  169,  170,  171,  172,  173,  183,  174,  175,  176,
-      177,  178,  179,  180,  184,   23,   52,  181,   24,   31,
-      182,   24,  185,  185,  185,  185,  185,  183,  185,  185,
-      185,  185,  185,  185,  185,  184,   25,   25,   27,   27,
-       27,   26,   26,   28,   28,   28,   53,   53,   53,   54,
-
-       54,   54,    3,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185
-    } ;
-
-static yyconst flex_int16_t yy_chk[455] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    7,   10,   11,    7,    8,    8,    8,   12,   10,
-       13,   14,   15,   16,   17,   18,   15,   32,   20,   15,
-       20,   34,   18,   10,   11,   25,   28,   28,   25,   12,
-       10,   13,   14,   15,   16,   17,   18,   15,   32,   20,
-       15,   20,   34,   18,   19,   30,   30,   19,   27,   27,
-
-       27,   31,   31,   31,   33,   19,   35,   36,   37,   19,
-       35,   38,   39,   40,   33,   19,   42,   43,   19,   44,
-       45,   46,   47,   48,   49,   33,   19,   35,   36,   37,
-       19,   35,   38,   39,   40,   33,   41,   42,   43,   50,
-       44,   45,   46,   47,   48,   49,   41,   53,   53,   53,
-       54,   54,   56,   56,   57,   58,   59,   41,   60,   61,
-       50,   62,   63,   64,   65,   66,   67,   41,   68,   69,
-       70,   71,   72,   73,   74,   57,   58,   59,   75,   60,
-       61,   76,   62,   63,   64,   65,   66,   67,   77,   68,
-       69,   70,   71,   72,   73,   74,   78,   79,   80,   75,
-
-       81,   82,   76,   83,   84,   86,   87,   89,   90,   77,
-       91,   92,   93,   94,   95,   96,   86,   78,   79,   80,
-       97,   81,   82,   98,   83,   84,   86,   87,   89,   90,
-       99,   91,   92,   93,   94,   95,   96,   86,  100,  101,
-      103,   97,  104,  106,   98,  107,  109,  110,  111,  112,
-      113,   99,  114,  115,  116,  117,  118,  119,  120,  100,
-      101,  103,  121,  104,  106,  122,  107,  109,  110,  111,
-      112,  113,  123,  114,  115,  116,  117,  118,  119,  120,
-      125,  126,  127,  121,  128,  129,  122,  130,  131,  133,
-      134,  135,  137,  123,  138,  139,  140,  142,  143,  144,
-
-      145,  125,  126,  127,  142,  128,  129,  149,  130,  131,
-      133,  134,  135,  137,  150,  138,  139,  140,  142,  143,
-      144,  145,  151,  154,  155,  142,  156,  157,  149,  158,
-      162,  163,  165,  166,  167,  150,  168,  170,  171,  172,
-      173,  174,  178,  151,  154,  155,  179,  156,  157,  180,
-      158,  162,  163,  165,  166,  167,  181,  168,  170,  171,
-      172,  173,  174,  178,  182,  186,   26,  179,   24,    9,
-      180,    5,    3,    0,    0,    0,    0,  181,    0,    0,
-        0,    0,    0,    0,    0,  182,  187,  187,  188,  188,
-      188,  189,  189,  190,  190,  190,  191,  191,  191,  192,
-
-      192,  192,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185
-    } ;
-
-/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[34] =
-    {   0,
-1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     };
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "winprefslex.l"
-#line 2 "winprefslex.l"
-/*
- * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- * Copyright (C) Colin Harrison 2005-2008
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from the XFree86 Project.
- *
- * Authors:     Earle F. Philhower, III
- *              Colin Harrison
- */
-/* $XFree86: $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "winprefsyacc.h"
-
-extern YYSTYPE yylval;
-extern char *yytext;
-extern int yyparse(void);
-
-extern void ErrorF (const char* /*f*/, ...);
-
-int yylineno;
-
-/* Copy the parsed string, must be free()d in yacc parser */
-static char *makestr(char *str)
-{
-  char *ptr;
-  ptr = (char*)malloc (strlen(str)+1);
-  if (!ptr)
-    {
-      ErrorF ("winMultiWindowLex:makestr() out of memory\n");
-      exit (-1);
-    }
-  strcpy(ptr, str);
-  return ptr;
-}
-
-#line 694 "winprefslex.c"
-
-#define INITIAL 0
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-static int yy_init_globals (void );
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int yylex_destroy (void );
-
-int yyget_debug (void );
-
-void yyset_debug (int debug_flag  );
-
-YY_EXTRA_TYPE yyget_extra (void );
-
-void yyset_extra (YY_EXTRA_TYPE user_defined  );
-
-FILE *yyget_in (void );
-
-void yyset_in  (FILE * in_str  );
-
-FILE *yyget_out (void );
-
-void yyset_out  (FILE * out_str  );
-
-yy_size_t yyget_leng (void );
-
-char *yyget_text (void );
-
-int yyget_lineno (void );
-
-void yyset_lineno (int line_number  );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap (void );
-#else
-extern int yywrap (void );
-#endif
-#endif
-
-    static void yyunput (int c,char *buf_ptr  );
-    
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (void );
-#else
-static int input (void );
-#endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-               { \
-               int c = '*'; \
-               yy_size_t n; \
-               for ( n = 0; n < max_size && \
-                            (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-                       buf[n] = (char) c; \
-               if ( c == '\n' ) \
-                       buf[n++] = (char) c; \
-               if ( c == EOF && ferror( yyin ) ) \
-                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
-               result = n; \
-               } \
-       else \
-               { \
-               errno=0; \
-               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-                       { \
-                       if( errno != EINTR) \
-                               { \
-                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
-                               break; \
-                               } \
-                       errno=0; \
-                       clearerr(yyin); \
-                       } \
-               }\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int yylex (void);
-
-#define YY_DECL int yylex (void)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-       YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-       register yy_state_type yy_current_state;
-       register char *yy_cp, *yy_bp;
-       register int yy_act;
-    
-#line 66 "winprefslex.l"
-
-#line 878 "winprefslex.c"
-
-       if ( !(yy_init) )
-               {
-               (yy_init) = 1;
-
-#ifdef YY_USER_INIT
-               YY_USER_INIT;
-#endif
-
-               if ( ! (yy_start) )
-                       (yy_start) = 1; /* first start state */
-
-               if ( ! yyin )
-                       yyin = stdin;
-
-               if ( ! yyout )
-                       yyout = stdout;
-
-               if ( ! YY_CURRENT_BUFFER ) {
-                       yyensure_buffer_stack ();
-                       YY_CURRENT_BUFFER_LVALUE =
-                               yy_create_buffer(yyin,YY_BUF_SIZE );
-               }
-
-               yy_load_buffer_state( );
-               }
-
-       while ( 1 )             /* loops until end-of-file is reached */
-               {
-               yy_cp = (yy_c_buf_p);
-
-               /* Support of yytext. */
-               *yy_cp = (yy_hold_char);
-
-               /* yy_bp points to the position in yy_ch_buf of the start of
-                * the current run.
-                */
-               yy_bp = yy_cp;
-
-               yy_current_state = (yy_start);
-yy_match:
-               do
-                       {
-                       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-                       if ( yy_accept[yy_current_state] )
-                               {
-                               (yy_last_accepting_state) = yy_current_state;
-                               (yy_last_accepting_cpos) = yy_cp;
-                               }
-                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-                               {
-                               yy_current_state = (int) yy_def[yy_current_state];
-                               if ( yy_current_state >= 186 )
-                                       yy_c = yy_meta[(unsigned int) yy_c];
-                               }
-                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-                       ++yy_cp;
-                       }
-               while ( yy_base[yy_current_state] != 403 );
-
-yy_find_action:
-               yy_act = yy_accept[yy_current_state];
-               if ( yy_act == 0 )
-                       { /* have to back up */
-                       yy_cp = (yy_last_accepting_cpos);
-                       yy_current_state = (yy_last_accepting_state);
-                       yy_act = yy_accept[yy_current_state];
-                       }
-
-               YY_DO_BEFORE_ACTION;
-
-               if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
-                       {
-                       yy_size_t yyl;
-                       for ( yyl = 0; yyl < yyleng; ++yyl )
-                               if ( yytext[yyl] == '\n' )
-                                          
-    yylineno++;
-;
-                       }
-
-do_action:     /* This label is used only to access EOF actions. */
-
-               switch ( yy_act )
-       { /* beginning of action switch */
-                       case 0: /* must back up */
-                       /* undo the effects of YY_DO_BEFORE_ACTION */
-                       *yy_cp = (yy_hold_char);
-                       yy_cp = (yy_last_accepting_cpos);
-                       yy_current_state = (yy_last_accepting_state);
-                       goto yy_find_action;
-
-case 1:
-/* rule 1 can match eol */
-YY_RULE_SETUP
-#line 67 "winprefslex.l"
-{ /* comment */ return NEWLINE; }
-       YY_BREAK
-case 2:
-/* rule 2 can match eol */
-YY_RULE_SETUP
-#line 68 "winprefslex.l"
-{ /* comment */ return NEWLINE; }
-       YY_BREAK
-case 3:
-/* rule 3 can match eol */
-YY_RULE_SETUP
-#line 69 "winprefslex.l"
-{ return NEWLINE; }
-       YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 70 "winprefslex.l"
-{ /* ignore whitespace */ }
-       YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 71 "winprefslex.l"
-{ return MENU; }
-       YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 72 "winprefslex.l"
-{ return ICONDIRECTORY; }
-       YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 73 "winprefslex.l"
-{ return DEFAULTICON; }
-       YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 74 "winprefslex.l"
-{ return ICONS; }
-       YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 75 "winprefslex.l"
-{ return STYLES; }
-       YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 76 "winprefslex.l"
-{ return TOPMOST; }
-       YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 77 "winprefslex.l"
-{ return MAXIMIZE; }
-       YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 78 "winprefslex.l"
-{ return MINIMIZE; }
-       YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 79 "winprefslex.l"
-{ return BOTTOM; }
-       YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 80 "winprefslex.l"
-{ return NOTITLE; }
-       YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 81 "winprefslex.l"
-{ return OUTLINE; }
-       YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 82 "winprefslex.l"
-{ return NOFRAME; }
-       YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 83 "winprefslex.l"
-{ return ROOTMENU; }
-       YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 84 "winprefslex.l"
-{ return DEFAULTSYSMENU; }
-       YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 85 "winprefslex.l"
-{ return SYSMENU; }
-       YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 86 "winprefslex.l"
-{ return SEPARATOR; }
-       YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 87 "winprefslex.l"
-{ return ATSTART; }
-       YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 88 "winprefslex.l"
-{ return ATEND; }
-       YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 89 "winprefslex.l"
-{ return EXEC; }
-       YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 90 "winprefslex.l"
-{ return ALWAYSONTOP; }
-       YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 91 "winprefslex.l"
-{ return DEBUGOUTPUT; }
-       YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 92 "winprefslex.l"
-{ return RELOAD; }
-       YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 93 "winprefslex.l"
-{ return TRAYICON; }
-       YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 94 "winprefslex.l"
-{ return SILENTEXIT; }
-       YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 95 "winprefslex.l"
-{ return LB; }
-       YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 96 "winprefslex.l"
-{ return RB; }
-       YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 97 "winprefslex.l"
-{ yylval.sVal = makestr(yytext+1); \
-                          yylval.sVal[strlen(yylval.sVal)-1] = 0; \
-                          return STRING; }
-       YY_BREAK
-case 32:
-YY_RULE_SETUP
-#line 100 "winprefslex.l"
-{ yylval.sVal = makestr(yytext); \
-                          return STRING; }
-       YY_BREAK
-case 33:
-YY_RULE_SETUP
-#line 102 "winprefslex.l"
-ECHO;
-       YY_BREAK
-#line 1142 "winprefslex.c"
-case YY_STATE_EOF(INITIAL):
-       yyterminate();
-
-       case YY_END_OF_BUFFER:
-               {
-               /* Amount of text matched not including the EOB char. */
-               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
-               /* Undo the effects of YY_DO_BEFORE_ACTION. */
-               *yy_cp = (yy_hold_char);
-               YY_RESTORE_YY_MORE_OFFSET
-
-               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-                       {
-                       /* We're scanning a new file or input source.  It's
-                        * possible that this happened because the user
-                        * just pointed yyin at a new source and called
-                        * yylex().  If so, then we have to assure
-                        * consistency between YY_CURRENT_BUFFER and our
-                        * globals.  Here is the right place to do so, because
-                        * this is the first action (other than possibly a
-                        * back-up) that will match for the new input source.
-                        */
-                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-                       }
-
-               /* Note that here we test for yy_c_buf_p "<=" to the position
-                * of the first EOB in the buffer, since yy_c_buf_p will
-                * already have been incremented past the NUL character
-                * (since all states make transitions on EOB to the
-                * end-of-buffer state).  Contrast this with the test
-                * in input().
-                */
-               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-                       { /* This was really a NUL. */
-                       yy_state_type yy_next_state;
-
-                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
-                       yy_current_state = yy_get_previous_state(  );
-
-                       /* Okay, we're now positioned to make the NUL
-                        * transition.  We couldn't have
-                        * yy_get_previous_state() go ahead and do it
-                        * for us because it doesn't know how to deal
-                        * with the possibility of jamming (and we don't
-                        * want to build jamming into it because then it
-                        * will run more slowly).
-                        */
-
-                       yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
-                       if ( yy_next_state )
-                               {
-                               /* Consume the NUL. */
-                               yy_cp = ++(yy_c_buf_p);
-                               yy_current_state = yy_next_state;
-                               goto yy_match;
-                               }
-
-                       else
-                               {
-                               yy_cp = (yy_c_buf_p);
-                               goto yy_find_action;
-                               }
-                       }
-
-               else switch ( yy_get_next_buffer(  ) )
-                       {
-                       case EOB_ACT_END_OF_FILE:
-                               {
-                               (yy_did_buffer_switch_on_eof) = 0;
-
-                               if ( yywrap( ) )
-                                       {
-                                       /* Note: because we've taken care in
-                                        * yy_get_next_buffer() to have set up
-                                        * yytext, we can now set up
-                                        * yy_c_buf_p so that if some total
-                                        * hoser (like flex itself) wants to
-                                        * call the scanner after we return the
-                                        * YY_NULL, it'll still work - another
-                                        * YY_NULL will get returned.
-                                        */
-                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-                                       yy_act = YY_STATE_EOF(YY_START);
-                                       goto do_action;
-                                       }
-
-                               else
-                                       {
-                                       if ( ! (yy_did_buffer_switch_on_eof) )
-                                               YY_NEW_FILE;
-                                       }
-                               break;
-                               }
-
-                       case EOB_ACT_CONTINUE_SCAN:
-                               (yy_c_buf_p) =
-                                       (yytext_ptr) + yy_amount_of_matched_text;
-
-                               yy_current_state = yy_get_previous_state(  );
-
-                               yy_cp = (yy_c_buf_p);
-                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-                               goto yy_match;
-
-                       case EOB_ACT_LAST_MATCH:
-                               (yy_c_buf_p) =
-                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
-                               yy_current_state = yy_get_previous_state(  );
-
-                               yy_cp = (yy_c_buf_p);
-                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-                               goto yy_find_action;
-                       }
-               break;
-               }
-
-       default:
-               YY_FATAL_ERROR(
-                       "fatal flex scanner internal error--no action found" );
-       } /* end of action switch */
-               } /* end of scanning one token */
-} /* end of yylex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *     EOB_ACT_LAST_MATCH -
- *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *     EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (void)
-{
-       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-       register char *source = (yytext_ptr);
-       register int number_to_move, i;
-       int ret_val;
-
-       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
-               YY_FATAL_ERROR(
-               "fatal flex scanner internal error--end of buffer missed" );
-
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-               { /* Don't try to fill the buffer, so this is an EOF. */
-               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
-                       {
-                       /* We matched a single character, the EOB, so
-                        * treat this as a final EOF.
-                        */
-                       return EOB_ACT_END_OF_FILE;
-                       }
-
-               else
-                       {
-                       /* We matched some text prior to the EOB, first
-                        * process it.
-                        */
-                       return EOB_ACT_LAST_MATCH;
-                       }
-               }
-
-       /* Try to read more data. */
-
-       /* First move last chars to start of buffer. */
-       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
-       for ( i = 0; i < number_to_move; ++i )
-               *(dest++) = *(source++);
-
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-               /* don't do the read, it's not guaranteed to return an EOF,
-                * just force an EOF
-                */
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
-       else
-               {
-                       yy_size_t num_to_read =
-                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-               while ( num_to_read <= 0 )
-                       { /* Not enough room in the buffer - grow it. */
-
-                       /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
-                       int yy_c_buf_p_offset =
-                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
-                       if ( b->yy_is_our_buffer )
-                               {
-                               yy_size_t new_size = b->yy_buf_size * 2;
-
-                               if ( new_size <= 0 )
-                                       b->yy_buf_size += b->yy_buf_size / 8;
-                               else
-                                       b->yy_buf_size *= 2;
-
-                               b->yy_ch_buf = (char *)
-                                       /* Include room in for 2 EOB chars. */
-                                       yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
-                               }
-                       else
-                               /* Can't grow it, we don't own it. */
-                               b->yy_ch_buf = 0;
-
-                       if ( ! b->yy_ch_buf )
-                               YY_FATAL_ERROR(
-                               "fatal error - scanner input buffer overflow" );
-
-                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-                                               number_to_move - 1;
-
-                       }
-
-               if ( num_to_read > YY_READ_BUF_SIZE )
-                       num_to_read = YY_READ_BUF_SIZE;
-
-               /* Read in more data. */
-               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-                       (yy_n_chars), num_to_read );
-
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       if ( (yy_n_chars) == 0 )
-               {
-               if ( number_to_move == YY_MORE_ADJ )
-                       {
-                       ret_val = EOB_ACT_END_OF_FILE;
-                       yyrestart(yyin  );
-                       }
-
-               else
-                       {
-                       ret_val = EOB_ACT_LAST_MATCH;
-                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-                               YY_BUFFER_EOF_PENDING;
-                       }
-               }
-
-       else
-               ret_val = EOB_ACT_CONTINUE_SCAN;
-
-       if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-               /* Extend the array by 50%, plus the number we really need. */
-               yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
-               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-       }
-
-       (yy_n_chars) += number_to_move;
-       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
-       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
-       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-       return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-    static yy_state_type yy_get_previous_state (void)
-{
-       register yy_state_type yy_current_state;
-       register char *yy_cp;
-    
-       yy_current_state = (yy_start);
-
-       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-               {
-               register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-               if ( yy_accept[yy_current_state] )
-                       {
-                       (yy_last_accepting_state) = yy_current_state;
-                       (yy_last_accepting_cpos) = yy_cp;
-                       }
-               while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-                       {
-                       yy_current_state = (int) yy_def[yy_current_state];
-                       if ( yy_current_state >= 186 )
-                               yy_c = yy_meta[(unsigned int) yy_c];
-                       }
-               yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-               }
-
-       return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *     next_state = yy_try_NUL_trans( current_state );
- */
-    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
-{
-       register int yy_is_jam;
-       register char *yy_cp = (yy_c_buf_p);
-
-       register YY_CHAR yy_c = 1;
-       if ( yy_accept[yy_current_state] )
-               {
-               (yy_last_accepting_state) = yy_current_state;
-               (yy_last_accepting_cpos) = yy_cp;
-               }
-       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-               {
-               yy_current_state = (int) yy_def[yy_current_state];
-               if ( yy_current_state >= 186 )
-                       yy_c = yy_meta[(unsigned int) yy_c];
-               }
-       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-       yy_is_jam = (yy_current_state == 185);
-
-       return yy_is_jam ? 0 : yy_current_state;
-}
-
-    static void yyunput (int c, register char * yy_bp )
-{
-       register char *yy_cp;
-    
-    yy_cp = (yy_c_buf_p);
-
-       /* undo effects of setting up yytext */
-       *yy_cp = (yy_hold_char);
-
-       if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-               { /* need to shift things up to make room */
-               /* +2 for EOB chars. */
-               register yy_size_t number_to_move = (yy_n_chars) + 2;
-               register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-                                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-               register char *source =
-                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
-               while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-                       *--dest = *--source;
-
-               yy_cp += (int) (dest - source);
-               yy_bp += (int) (dest - source);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
-               if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-                       YY_FATAL_ERROR( "flex scanner push-back overflow" );
-               }
-
-       *--yy_cp = (char) c;
-
-    if ( c == '\n' ){
-        --yylineno;
-    }
-
-       (yytext_ptr) = yy_bp;
-       (yy_hold_char) = *yy_cp;
-       (yy_c_buf_p) = yy_cp;
-}
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-    static int yyinput (void)
-#else
-    static int input  (void)
-#endif
-
-{
-       int c;
-    
-       *(yy_c_buf_p) = (yy_hold_char);
-
-       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-               {
-               /* yy_c_buf_p now points to the character we want to return.
-                * If this occurs *before* the EOB characters, then it's a
-                * valid NUL; if not, then we've hit the end of the buffer.
-                */
-               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-                       /* This was really a NUL. */
-                       *(yy_c_buf_p) = '\0';
-
-               else
-                       { /* need more input */
-                       yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
-                       ++(yy_c_buf_p);
-
-                       switch ( yy_get_next_buffer(  ) )
-                               {
-                               case EOB_ACT_LAST_MATCH:
-                                       /* This happens because yy_g_n_b()
-                                        * sees that we've accumulated a
-                                        * token and flags that we need to
-                                        * try matching the token before
-                                        * proceeding.  But for input(),
-                                        * there's no matching to consider.
-                                        * So convert the EOB_ACT_LAST_MATCH
-                                        * to EOB_ACT_END_OF_FILE.
-                                        */
-
-                                       /* Reset buffer status. */
-                                       yyrestart(yyin );
-
-                                       /*FALLTHROUGH*/
-
-                               case EOB_ACT_END_OF_FILE:
-                                       {
-                                       if ( yywrap( ) )
-                                               return 0;
-
-                                       if ( ! (yy_did_buffer_switch_on_eof) )
-                                               YY_NEW_FILE;
-#ifdef __cplusplus
-                                       return yyinput();
-#else
-                                       return input();
-#endif
-                                       }
-
-                               case EOB_ACT_CONTINUE_SCAN:
-                                       (yy_c_buf_p) = (yytext_ptr) + offset;
-                                       break;
-                               }
-                       }
-               }
-
-       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
-       *(yy_c_buf_p) = '\0';   /* preserve yytext */
-       (yy_hold_char) = *++(yy_c_buf_p);
-
-       if ( c == '\n' )
-                  
-    yylineno++;
-;
-
-       return c;
-}
-#endif /* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * 
- * @note This function does not reset the start condition to @c INITIAL .
- */
-    void yyrestart  (FILE * input_file )
-{
-    
-       if ( ! YY_CURRENT_BUFFER ){
-        yyensure_buffer_stack ();
-               YY_CURRENT_BUFFER_LVALUE =
-            yy_create_buffer(yyin,YY_BUF_SIZE );
-       }
-
-       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
-       yy_load_buffer_state( );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * 
- */
-    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
-{
-    
-       /* TODO. We should be able to replace this entire function body
-        * with
-        *              yypop_buffer_state();
-        *              yypush_buffer_state(new_buffer);
-     */
-       yyensure_buffer_stack ();
-       if ( YY_CURRENT_BUFFER == new_buffer )
-               return;
-
-       if ( YY_CURRENT_BUFFER )
-               {
-               /* Flush out information for old buffer. */
-               *(yy_c_buf_p) = (yy_hold_char);
-               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       YY_CURRENT_BUFFER_LVALUE = new_buffer;
-       yy_load_buffer_state( );
-
-       /* We don't actually know whether we did this switch during
-        * EOF (yywrap()) processing, but the only time this flag
-        * is looked at is after yywrap() is called, so it's safe
-        * to go ahead and always set it.
-        */
-       (yy_did_buffer_switch_on_eof) = 1;
-}
-
-static void yy_load_buffer_state  (void)
-{
-       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-       (yy_hold_char) = *(yy_c_buf_p);
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * 
- * @return the allocated buffer state.
- */
-    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
-{
-       YY_BUFFER_STATE b;
-    
-       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
-       if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-       b->yy_buf_size = size;
-
-       /* yy_ch_buf has to be 2 characters longer than the size given because
-        * we need to put in 2 end-of-buffer characters.
-        */
-       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
-       if ( ! b->yy_ch_buf )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-       b->yy_is_our_buffer = 1;
-
-       yy_init_buffer(b,file );
-
-       return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
- * 
- */
-    void yy_delete_buffer (YY_BUFFER_STATE  b )
-{
-    
-       if ( ! b )
-               return;
-
-       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
-       if ( b->yy_is_our_buffer )
-               yyfree((void *) b->yy_ch_buf  );
-
-       yyfree((void *) b  );
-}
-
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a yyrestart() or at EOF.
- */
-    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
-
-{
-       int oerrno = errno;
-    
-       yy_flush_buffer(b );
-
-       b->yy_input_file = file;
-       b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then yy_init_buffer was _probably_
-     * called from yyrestart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER){
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-    
-       errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * 
- */
-    void yy_flush_buffer (YY_BUFFER_STATE  b )
-{
-       if ( ! b )
-               return;
-
-       b->yy_n_chars = 0;
-
-       /* We always need two end-of-buffer characters.  The first causes
-        * a transition to the end-of-buffer state.  The second causes
-        * a jam in that state.
-        */
-       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-       b->yy_buf_pos = &b->yy_ch_buf[0];
-
-       b->yy_at_bol = 1;
-       b->yy_buffer_status = YY_BUFFER_NEW;
-
-       if ( b == YY_CURRENT_BUFFER )
-               yy_load_buffer_state( );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  
- */
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
-{
-       if (new_buffer == NULL)
-               return;
-
-       yyensure_buffer_stack();
-
-       /* This block is copied from yy_switch_to_buffer. */
-       if ( YY_CURRENT_BUFFER )
-               {
-               /* Flush out information for old buffer. */
-               *(yy_c_buf_p) = (yy_hold_char);
-               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       /* Only push if top exists. Otherwise, replace top. */
-       if (YY_CURRENT_BUFFER)
-               (yy_buffer_stack_top)++;
-       YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-       /* copied from yy_switch_to_buffer. */
-       yy_load_buffer_state( );
-       (yy_did_buffer_switch_on_eof) = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  
- */
-void yypop_buffer_state (void)
-{
-       if (!YY_CURRENT_BUFFER)
-               return;
-
-       yy_delete_buffer(YY_CURRENT_BUFFER );
-       YY_CURRENT_BUFFER_LVALUE = NULL;
-       if ((yy_buffer_stack_top) > 0)
-               --(yy_buffer_stack_top);
-
-       if (YY_CURRENT_BUFFER) {
-               yy_load_buffer_state( );
-               (yy_did_buffer_switch_on_eof) = 1;
-       }
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void yyensure_buffer_stack (void)
-{
-       yy_size_t num_to_alloc;
-    
-       if (!(yy_buffer_stack)) {
-
-               /* First allocation is just for 2 elements, since we don't know if this
-                * scanner will even need a stack. We use 2 instead of 1 to avoid an
-                * immediate realloc on the next call.
-         */
-               num_to_alloc = 1;
-               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
-                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
-                                                               );
-               if ( ! (yy_buffer_stack) )
-                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-                                                                 
-               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-                               
-               (yy_buffer_stack_max) = num_to_alloc;
-               (yy_buffer_stack_top) = 0;
-               return;
-       }
-
-       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
-               /* Increase the buffer to prepare for a possible push. */
-               int grow_size = 8 /* arbitrary grow size */;
-
-               num_to_alloc = (yy_buffer_stack_max) + grow_size;
-               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
-                                                               ((yy_buffer_stack),
-                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
-                                                               );
-               if ( ! (yy_buffer_stack) )
-                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
-               /* zero only the new slots.*/
-               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
-               (yy_buffer_stack_max) = num_to_alloc;
-       }
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * 
- * @return the newly allocated buffer state object. 
- */
-YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
-{
-       YY_BUFFER_STATE b;
-    
-       if ( size < 2 ||
-            base[size-2] != YY_END_OF_BUFFER_CHAR ||
-            base[size-1] != YY_END_OF_BUFFER_CHAR )
-               /* They forgot to leave room for the EOB's. */
-               return 0;
-
-       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
-       if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
-       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
-       b->yy_buf_pos = b->yy_ch_buf = base;
-       b->yy_is_our_buffer = 0;
-       b->yy_input_file = 0;
-       b->yy_n_chars = b->yy_buf_size;
-       b->yy_is_interactive = 0;
-       b->yy_at_bol = 1;
-       b->yy_fill_buffer = 0;
-       b->yy_buffer_status = YY_BUFFER_NEW;
-
-       yy_switch_to_buffer(b  );
-
-       return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to yylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * 
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       yy_scan_bytes() instead.
- */
-YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
-{
-    
-       return yy_scan_bytes(yystr,strlen(yystr) );
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
- * 
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
-{
-       YY_BUFFER_STATE b;
-       char *buf;
-       yy_size_t n, i;
-    
-       /* Get memory for full buffer, including space for trailing EOB's. */
-       n = _yybytes_len + 2;
-       buf = (char *) yyalloc(n  );
-       if ( ! buf )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
-       for ( i = 0; i < _yybytes_len; ++i )
-               buf[i] = yybytes[i];
-
-       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-       b = yy_scan_buffer(buf,n );
-       if ( ! b )
-               YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
-       /* It's okay to grow etc. this buffer, and we should throw it
-        * away when we're done.
-        */
-       b->yy_is_our_buffer = 1;
-
-       return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yy_fatal_error (yyconst char* msg )
-{
-       (void) fprintf( stderr, "%s\n", msg );
-       exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-               yytext[yyleng] = (yy_hold_char); \
-               (yy_c_buf_p) = yytext + yyless_macro_arg; \
-               (yy_hold_char) = *(yy_c_buf_p); \
-               *(yy_c_buf_p) = '\0'; \
-               yyleng = yyless_macro_arg; \
-               } \
-       while ( 0 )
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the current line number.
- * 
- */
-int yyget_lineno  (void)
-{
-        
-    return yylineno;
-}
-
-/** Get the input stream.
- * 
- */
-FILE *yyget_in  (void)
-{
-        return yyin;
-}
-
-/** Get the output stream.
- * 
- */
-FILE *yyget_out  (void)
-{
-        return yyout;
-}
-
-/** Get the length of the current token.
- * 
- */
-yy_size_t yyget_leng  (void)
-{
-        return yyleng;
-}
-
-/** Get the current token.
- * 
- */
-
-char *yyget_text  (void)
-{
-        return yytext;
-}
-
-/** Set the current line number.
- * @param line_number
- * 
- */
-void yyset_lineno (int  line_number )
-{
-    
-    yylineno = line_number;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- * 
- * @see yy_switch_to_buffer
- */
-void yyset_in (FILE *  in_str )
-{
-        yyin = in_str ;
-}
-
-void yyset_out (FILE *  out_str )
-{
-        yyout = out_str ;
-}
-
-int yyget_debug  (void)
-{
-        return yy_flex_debug;
-}
-
-void yyset_debug (int  bdebug )
-{
-        yy_flex_debug = bdebug ;
-}
-
-static int yy_init_globals (void)
-{
-        /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from yylex_destroy(), so don't allocate here.
-     */
-
-    /* We do not touch yylineno unless the option is enabled. */
-    yylineno =  1;
-    
-    (yy_buffer_stack) = 0;
-    (yy_buffer_stack_top) = 0;
-    (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = (char *) 0;
-    (yy_init) = 0;
-    (yy_start) = 0;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
-    yyin = stdin;
-    yyout = stdout;
-#else
-    yyin = (FILE *) 0;
-    yyout = (FILE *) 0;
-#endif
-
-    /* For future reference: Set errno on error, since we are called by
-     * yylex_init()
-     */
-    return 0;
-}
-
-/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-int yylex_destroy  (void)
-{
-    
-    /* Pop the buffer stack, destroying each element. */
-       while(YY_CURRENT_BUFFER){
-               yy_delete_buffer(YY_CURRENT_BUFFER  );
-               YY_CURRENT_BUFFER_LVALUE = NULL;
-               yypop_buffer_state();
-       }
-
-       /* Destroy the stack itself. */
-       yyfree((yy_buffer_stack) );
-       (yy_buffer_stack) = NULL;
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * yylex() is called, initialization will occur. */
-    yy_init_globals( );
-
-    return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
-{
-       register int i;
-       for ( i = 0; i < n; ++i )
-               s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s )
-{
-       register int n;
-       for ( n = 0; s[n]; ++n )
-               ;
-
-       return n;
-}
-#endif
-
-void *yyalloc (yy_size_t  size )
-{
-       return (void *) malloc( size );
-}
-
-void *yyrealloc  (void * ptr, yy_size_t  size )
-{
-       /* The cast to (char *) in the following accommodates both
-        * implementations that use char* generic pointers, and those
-        * that use void* generic pointers.  It works with the latter
-        * because both ANSI C and C++ allow castless assignment from
-        * any pointer type to void*, and deal with argument conversions
-        * as though doing an assignment.
-        */
-       return (void *) realloc( (char *) ptr, size );
-}
-
-void yyfree (void * ptr )
-{
-       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-#line 102 "winprefslex.l"
-
-
-
-/*
- * Run-of-the mill requirement for yacc
- */
-int
-yywrap (void)
-{
-  return 1;
-}
-
-/*
- * Run a file through the yacc parser
- */
-int
-parse_file (FILE *file)
-{
-  int ret;
-
-  if (!file)
-    return 1;
-  
-  yylineno = 1;
-  yyin = file;
-  ret = yyparse ();
-  yylex_destroy ();
-  return ret;
-}
-
-
diff --git a/hw/xwin/winprefsyacc.c b/hw/xwin/winprefsyacc.c
deleted file mode 100644 (file)
index 58da03a..0000000
+++ /dev/null
@@ -1,2174 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.3.  */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
-   simplifying the original so-called "semantic" parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Bison version.  */
-#define YYBISON_VERSION "2.3"
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 0
-
-/* Using locations.  */
-#define YYLSP_NEEDED 0
-
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     NEWLINE = 258,
-     MENU = 259,
-     LB = 260,
-     RB = 261,
-     ICONDIRECTORY = 262,
-     DEFAULTICON = 263,
-     ICONS = 264,
-     STYLES = 265,
-     TOPMOST = 266,
-     MAXIMIZE = 267,
-     MINIMIZE = 268,
-     BOTTOM = 269,
-     NOTITLE = 270,
-     OUTLINE = 271,
-     NOFRAME = 272,
-     DEFAULTSYSMENU = 273,
-     SYSMENU = 274,
-     ROOTMENU = 275,
-     SEPARATOR = 276,
-     ATSTART = 277,
-     ATEND = 278,
-     EXEC = 279,
-     ALWAYSONTOP = 280,
-     DEBUGOUTPUT = 281,
-     RELOAD = 282,
-     TRAYICON = 283,
-     FORCEEXIT = 284,
-     SILENTEXIT = 285,
-     STRING = 286
-   };
-#endif
-/* Tokens.  */
-#define NEWLINE 258
-#define MENU 259
-#define LB 260
-#define RB 261
-#define ICONDIRECTORY 262
-#define DEFAULTICON 263
-#define ICONS 264
-#define STYLES 265
-#define TOPMOST 266
-#define MAXIMIZE 267
-#define MINIMIZE 268
-#define BOTTOM 269
-#define NOTITLE 270
-#define OUTLINE 271
-#define NOFRAME 272
-#define DEFAULTSYSMENU 273
-#define SYSMENU 274
-#define ROOTMENU 275
-#define SEPARATOR 276
-#define ATSTART 277
-#define ATEND 278
-#define EXEC 279
-#define ALWAYSONTOP 280
-#define DEBUGOUTPUT 281
-#define RELOAD 282
-#define TRAYICON 283
-#define FORCEEXIT 284
-#define SILENTEXIT 285
-#define STRING 286
-
-
-
-
-/* Copy the first part of user declarations.  */
-#line 1 "winprefsyacc.y"
-
-/*
- * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- * Copyright (C) Colin Harrison 2005-2008
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from the XFree86 Project.
- *
- * Authors:     Earle F. Philhower, III
- *              Colin Harrison
- */
-/* $XFree86: $ */
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "winprefs.h"
-
-/* The following give better error messages in bison at the cost of a few KB */
-#define YYERROR_VERBOSE 1
-
-/* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */
-#define YYLTYPE_IS_TRIVIAL 1
-#define YYENABLE_NLS 0
-
-/* The global pref settings */
-WINPREFS pref;
-
-/* The working menu */  
-static MENUPARSED menu;
-
-/* Functions for parsing the tokens into out structure */
-/* Defined at the end section of this file */
-
-static void SetIconDirectory (char *path);
-static void SetDefaultIcon (char *fname);
-static void SetRootMenu (char *menu);
-static void SetDefaultSysMenu (char *menu, int pos);
-static void SetTrayIcon (char *fname);
-
-static void OpenMenu(char *menuname);
-static void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param);
-static void CloseMenu(void);
-
-static void OpenIcons(void);
-static void AddIconLine(char *matchstr, char *iconfile);
-static void CloseIcons(void);
-
-static void OpenStyles(void);
-static void AddStyleLine(char *matchstr, unsigned long style);
-static void CloseStyles(void);
-
-static void OpenSysMenu(void);
-static void AddSysMenuLine(char *matchstr, char *menuname, int pos);
-static void CloseSysMenu(void);
-
-static int yyerror (char *s);
-
-extern void ErrorF (const char* /*f*/, ...);
-extern char *yytext;
-extern int yylex(void);
-
-
-
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table.  */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 89 "winprefsyacc.y"
-{
-  char *sVal;
-  unsigned long uVal;
-  int iVal;
-}
-/* Line 193 of yacc.c.  */
-#line 252 "winprefsyacc.c"
-       YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-/* Copy the second part of user declarations.  */
-
-
-/* Line 216 of yacc.c.  */
-#line 265 "winprefsyacc.c"
-
-#ifdef short
-# undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-#  define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-#  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYSIZE_T size_t
-# else
-#  define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
-#  if ENABLE_NLS
-#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YY_(msgid) dgettext ("bison-runtime", msgid)
-#  endif
-# endif
-# ifndef YY_
-#  define YY_(msgid) msgid
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E.  */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
-#else
-# define YYUSE(e) /* empty */
-#endif
-
-/* Identity function, used to suppress warnings about constant conditions.  */
-#ifndef lint
-# define YYID(n) (n)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int i)
-#else
-static int
-YYID (i)
-    int i;
-#endif
-{
-  return i;
-}
-#endif
-
-#if ! defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols.  */
-
-# ifdef YYSTACK_USE_ALLOCA
-#  if YYSTACK_USE_ALLOCA
-#   ifdef __GNUC__
-#    define YYSTACK_ALLOC __builtin_alloca
-#   elif defined __BUILTIN_VA_ARG_INCR
-#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-#   elif defined _AIX
-#    define YYSTACK_ALLOC __alloca
-#   elif defined _MSC_VER
-#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-#    define alloca _alloca
-#   else
-#    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef _STDLIB_H
-#      define _STDLIB_H 1
-#     endif
-#    endif
-#   endif
-#  endif
-# endif
-
-# ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-    /* The OS might guarantee only one guard page at the bottom of the stack,
-       and a page size can be as small as 4096 bytes.  So we cannot safely
-       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
-       to allow for a few compiler-allocated temporary stack slots.  */
-#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-#  endif
-# else
-#  define YYSTACK_ALLOC YYMALLOC
-#  define YYSTACK_FREE YYFREE
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-#  endif
-#  if (defined __cplusplus && ! defined _STDLIB_H \
-       && ! ((defined YYMALLOC || defined malloc) \
-            && (defined YYFREE || defined free)))
-#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef _STDLIB_H
-#    define _STDLIB_H 1
-#   endif
-#  endif
-#  ifndef YYMALLOC
-#   define YYMALLOC malloc
-#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-#  ifndef YYFREE
-#   define YYFREE free
-#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-
-#if (! defined yyoverflow \
-     && (! defined __cplusplus \
-        || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member.  */
-union yyalloc
-{
-  yytype_int16 yyss;
-  YYSTYPE yyvs;
-  };
-
-/* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
-   N elements.  */
-# define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
-      + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)             \
-      do                                       \
-       {                                       \
-         YYSIZE_T yyi;                         \
-         for (yyi = 0; yyi < (Count); yyi++)   \
-           (To)[yyi] = (From)[yyi];            \
-       }                                       \
-      while (YYID (0))
-#  endif
-# endif
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-# define YYSTACK_RELOCATE(Stack)                                       \
-    do                                                                 \
-      {                                                                        \
-       YYSIZE_T yynewbytes;                                            \
-       YYCOPY (&yyptr->Stack, Stack, yysize);                          \
-       Stack = &yyptr->Stack;                                          \
-       yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-       yyptr += yynewbytes / sizeof (*yyptr);                          \
-      }                                                                        \
-    while (YYID (0))
-
-#endif
-
-/* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  2
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   98
-
-/* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  32
-/* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  33
-/* YYNRULES -- Number of rules.  */
-#define YYNRULES  65
-/* YYNRULES -- Number of states.  */
-#define YYNSTATES  121
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
-#define YYUNDEFTOK  2
-#define YYMAXUTOK   286
-
-#define YYTRANSLATE(YYX)                                               \
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const yytype_uint8 yytranslate[] =
-{
-       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
-       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,    27,    28,    29,    30,    31
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const yytype_uint8 yyprhs[] =
-{
-       0,     0,     3,     4,     7,     9,    11,    12,    15,    17,
-      19,    21,    23,    25,    27,    29,    31,    33,    35,    37,
-      39,    43,    47,    52,    56,    60,    64,    69,    75,    81,
-      86,    88,    91,    92,   100,   105,   107,   110,   111,   118,
-     120,   122,   124,   126,   128,   130,   132,   134,   136,   139,
-     142,   147,   149,   152,   153,   160,   161,   163,   165,   171,
-     173,   176,   177,   185,   188,   191
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-static const yytype_int8 yyrhs[] =
-{
-      33,     0,    -1,    -1,    33,    34,    -1,     3,    -1,    36,
-      -1,    -1,     3,    35,    -1,    40,    -1,    41,    -1,    44,
-      -1,    48,    -1,    55,    -1,    60,    -1,    38,    -1,    39,
-      -1,    64,    -1,    37,    -1,    62,    -1,    63,    -1,    28,
-      31,     3,    -1,    20,    31,     3,    -1,    18,    31,    57,
-       3,    -1,     8,    31,     3,    -1,     7,    31,     3,    -1,
-      21,     3,    35,    -1,    31,    25,     3,    35,    -1,    31,
-      24,    31,     3,    35,    -1,    31,     4,    31,     3,    35,
-      -1,    31,    27,     3,    35,    -1,    42,    -1,    42,    43,
-      -1,    -1,     4,    31,     5,    45,    35,    43,     6,    -1,
-      31,    31,     3,    35,    -1,    46,    -1,    46,    47,    -1,
-      -1,     9,     5,    49,    35,    47,     6,    -1,    11,    -1,
-      12,    -1,    13,    -1,    14,    -1,    15,    -1,    16,    -1,
-      17,    -1,    50,    -1,    51,    -1,    50,    51,    -1,    51,
-      50,    -1,    31,    52,     3,    35,    -1,    53,    -1,    53,
-      54,    -1,    -1,    10,     5,    56,    35,    54,     6,    -1,
-      -1,    22,    -1,    23,    -1,    31,    31,    57,     3,    35,
-      -1,    58,    -1,    58,    59,    -1,    -1,    19,     5,     3,
-      61,    35,    59,     6,    -1,    29,     3,    -1,    30,     3,
-      -1,    26,    31,     3,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const yytype_uint8 yyrline[] =
-{
-       0,   132,   132,   133,   136,   137,   141,   142,   145,   146,
-     147,   148,   149,   150,   151,   152,   153,   154,   155,   156,
-     159,   162,   165,   168,   171,   174,   175,   176,   177,   178,
-     181,   182,   185,   185,   188,   191,   192,   195,   195,   198,
-     199,   200,   201,   204,   205,   206,   209,   210,   211,   212,
-     215,   218,   219,   222,   222,   225,   226,   227,   230,   233,
-     234,   237,   237,   240,   243,   246
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
-static const char *const yytname[] =
-{
-  "$end", "error", "$undefined", "NEWLINE", "MENU", "LB", "RB",
-  "ICONDIRECTORY", "DEFAULTICON", "ICONS", "STYLES", "TOPMOST", "MAXIMIZE",
-  "MINIMIZE", "BOTTOM", "NOTITLE", "OUTLINE", "NOFRAME", "DEFAULTSYSMENU",
-  "SYSMENU", "ROOTMENU", "SEPARATOR", "ATSTART", "ATEND", "EXEC",
-  "ALWAYSONTOP", "\"DEBUG\"", "RELOAD", "TRAYICON", "FORCEEXIT",
-  "SILENTEXIT", "STRING", "$accept", "input", "line", "newline_or_nada",
-  "command", "trayicon", "rootmenu", "defaultsysmenu", "defaulticon",
-  "icondirectory", "menuline", "menulist", "menu", "@1", "iconline",
-  "iconlist", "icons", "@2", "group1", "group2", "stylecombo", "styleline",
-  "stylelist", "styles", "@3", "atspot", "sysmenuline", "sysmenulist",
-  "sysmenu", "@4", "forceexit", "silentexit", "debug", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
-static const yytype_uint16 yytoknum[] =
-{
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
-     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
-     285,   286
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
-{
-       0,    32,    33,    33,    34,    34,    35,    35,    36,    36,
-      36,    36,    36,    36,    36,    36,    36,    36,    36,    36,
-      37,    38,    39,    40,    41,    42,    42,    42,    42,    42,
-      43,    43,    45,    44,    46,    47,    47,    49,    48,    50,
-      50,    50,    50,    51,    51,    51,    52,    52,    52,    52,
-      53,    54,    54,    56,    55,    57,    57,    57,    58,    59,
-      59,    61,    60,    62,    63,    64
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
-{
-       0,     2,     0,     2,     1,     1,     0,     2,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       3,     3,     4,     3,     3,     3,     4,     5,     5,     4,
-       1,     2,     0,     7,     4,     1,     2,     0,     6,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     2,     2,
-       4,     1,     2,     0,     6,     0,     1,     1,     5,     1,
-       2,     0,     7,     2,     2,     3
-};
-
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint8 yydefact[] =
-{
-       2,     0,     1,     4,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     3,     5,    17,    14,
-      15,     8,     9,    10,    11,    12,    13,    18,    19,    16,
-       0,     0,     0,    37,    53,    55,     0,     0,     0,     0,
-      63,    64,    32,    24,    23,     6,     6,    56,    57,     0,
-      61,    21,    65,    20,     6,     6,     0,     0,    22,     6,
-       0,     7,     0,    35,     0,     0,    51,     0,     0,     0,
-       0,    30,     0,     0,    36,    38,    39,    40,    41,    42,
-      43,    44,    45,    46,    47,     0,    52,    54,     0,    59,
-       0,     6,     0,     0,     0,     0,    31,    33,     6,    48,
-      49,     6,    55,    60,    62,    25,     0,     0,     6,     6,
-      34,    50,     0,     6,     6,    26,    29,     6,    28,    27,
-      58
-};
-
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int8 yydefgoto[] =
-{
-      -1,     1,    16,    56,    17,    18,    19,    20,    21,    22,
-      71,    72,    23,    54,    63,    64,    24,    45,    83,    84,
-      85,    66,    67,    25,    46,    49,    89,    90,    26,    59,
-      27,    28,    29
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -47
-static const yytype_int8 yypact[] =
-{
-     -47,     7,   -47,   -47,    -1,     0,     1,    18,    29,    15,
-      42,    17,    19,    20,    46,    50,   -47,   -47,   -47,   -47,
-     -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,
-      49,    53,    54,   -47,   -47,     6,    55,    56,    57,    58,
-     -47,   -47,   -47,   -47,   -47,    61,    61,   -47,   -47,    62,
-     -47,   -47,   -47,   -47,    61,    61,    35,    38,   -47,    61,
-     -19,   -47,    39,    35,    66,    27,    38,    67,    43,    72,
-      -3,   -19,    70,    74,   -47,   -47,   -47,   -47,   -47,   -47,
-     -47,   -47,   -47,     3,    -8,    75,   -47,   -47,    48,    43,
-      76,    61,    52,    59,    77,    78,   -47,   -47,    61,   -47,
-     -47,    61,     6,   -47,   -47,   -47,    81,    82,    61,    61,
-     -47,   -47,    83,    61,    61,   -47,   -47,    61,   -47,   -47,
-     -47
-};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yytype_int8 yypgoto[] =
-{
-     -47,   -47,   -47,   -46,   -47,   -47,   -47,   -47,   -47,   -47,
-     -47,    16,   -47,   -47,   -47,    25,   -47,   -47,     5,     8,
-     -47,   -47,    26,   -47,   -47,    -9,   -47,     9,   -47,   -47,
-     -47,   -47,   -47
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -1
-static const yytype_uint8 yytable[] =
-{
-      57,    92,    69,    76,    77,    78,    79,     2,    60,    61,
-       3,     4,    70,    68,     5,     6,     7,     8,    80,    81,
-      82,    93,    94,    33,    95,     9,    10,    11,    47,    48,
-      30,    31,    32,    12,    34,    13,    14,    15,    76,    77,
-      78,    79,    80,    81,    82,   105,    35,    36,    37,    40,
-      38,    39,   110,    41,    42,   111,    43,    44,    50,    51,
-      52,    53,   115,   116,    55,    58,    62,   118,   119,    65,
-      73,   120,    75,    87,    88,    91,    97,    98,   101,   102,
-     108,   109,   104,   106,   113,   114,   117,    96,    74,   100,
-     107,    99,    86,   112,     0,     0,     0,     0,   103
-};
-
-static const yytype_int8 yycheck[] =
-{
-      46,     4,    21,    11,    12,    13,    14,     0,    54,    55,
-       3,     4,    31,    59,     7,     8,     9,    10,    15,    16,
-      17,    24,    25,     5,    27,    18,    19,    20,    22,    23,
-      31,    31,    31,    26,     5,    28,    29,    30,    11,    12,
-      13,    14,    15,    16,    17,    91,    31,     5,    31,     3,
-      31,    31,    98,     3,     5,   101,     3,     3,     3,     3,
-       3,     3,   108,   109,     3,     3,    31,   113,   114,    31,
-      31,   117,     6,     6,    31,     3,     6,     3,     3,    31,
-       3,     3,     6,    31,     3,     3,     3,    71,    63,    84,
-      31,    83,    66,   102,    -1,    -1,    -1,    -1,    89
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
-static const yytype_uint8 yystos[] =
-{
-       0,    33,     0,     3,     4,     7,     8,     9,    10,    18,
-      19,    20,    26,    28,    29,    30,    34,    36,    37,    38,
-      39,    40,    41,    44,    48,    55,    60,    62,    63,    64,
-      31,    31,    31,     5,     5,    31,     5,    31,    31,    31,
-       3,     3,     5,     3,     3,    49,    56,    22,    23,    57,
-       3,     3,     3,     3,    45,     3,    35,    35,     3,    61,
-      35,    35,    31,    46,    47,    31,    53,    54,    35,    21,
-      31,    42,    43,    31,    47,     6,    11,    12,    13,    14,
-      15,    16,    17,    50,    51,    52,    54,     6,    31,    58,
-      59,     3,     4,    24,    25,    27,    43,     6,     3,    51,
-      50,     3,    31,    59,     6,    35,    31,    31,     3,     3,
-      35,    35,    57,     3,     3,    35,    35,     3,    35,    35,
-      35
-};
-
-#define yyerrok                (yyerrstatus = 0)
-#define yyclearin      (yychar = YYEMPTY)
-#define YYEMPTY                (-2)
-#define YYEOF          0
-
-#define YYACCEPT       goto yyacceptlab
-#define YYABORT                goto yyabortlab
-#define YYERROR                goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
-
-#define YYFAIL         goto yyerrlab
-
-#define YYRECOVERING()  (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value)                                 \
-do                                                             \
-  if (yychar == YYEMPTY && yylen == 1)                         \
-    {                                                          \
-      yychar = (Token);                                                \
-      yylval = (Value);                                                \
-      yytoken = YYTRANSLATE (yychar);                          \
-      YYPOPSTACK (1);                                          \
-      goto yybackup;                                           \
-    }                                                          \
-  else                                                         \
-    {                                                          \
-      yyerror (YY_("syntax error: cannot back up")); \
-      YYERROR;                                                 \
-    }                                                          \
-while (YYID (0))
-
-
-#define YYTERROR       1
-#define YYERRCODE      256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
-   If N is 0, then set CURRENT to the empty location which ends
-   the previous symbol: RHS[0] (always defined).  */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)                               \
-    do                                                                 \
-      if (YYID (N))                                                    \
-       {                                                               \
-         (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
-         (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
-         (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
-         (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
-       }                                                               \
-      else                                                             \
-       {                                                               \
-         (Current).first_line   = (Current).last_line   =              \
-           YYRHSLOC (Rhs, 0).last_line;                                \
-         (Current).first_column = (Current).last_column =              \
-           YYRHSLOC (Rhs, 0).last_column;                              \
-       }                                                               \
-    while (YYID (0))
-#endif
-
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
-   This macro was not mandated originally: define only if we know
-   we won't break user code: when these are the locations we know.  */
-
-#ifndef YY_LOCATION_PRINT
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-#  define YY_LOCATION_PRINT(File, Loc)                 \
-     fprintf (File, "%d.%d-%d.%d",                     \
-             (Loc).first_line, (Loc).first_column,     \
-             (Loc).last_line,  (Loc).last_column)
-# else
-#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments.  */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
-#else
-# define YYLEX yylex ()
-#endif
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args)                       \
-do {                                           \
-  if (yydebug)                                 \
-    YYFPRINTF Args;                            \
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                   \
-do {                                                                     \
-  if (yydebug)                                                           \
-    {                                                                    \
-      YYFPRINTF (stderr, "%s ", Title);                                          \
-      yy_symbol_print (stderr,                                           \
-                 Type, Value); \
-      YYFPRINTF (stderr, "\n");                                                  \
-    }                                                                    \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-#endif
-{
-  if (!yyvaluep)
-    return;
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
-  YYUSE (yyoutput);
-# endif
-  switch (yytype)
-    {
-      default:
-       break;
-    }
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-#endif
-{
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
-  YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included).                                                   |
-`------------------------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
-#else
-static void
-yy_stack_print (bottom, top)
-    yytype_int16 *bottom;
-    yytype_int16 *top;
-#endif
-{
-  YYFPRINTF (stderr, "Stack now");
-  for (; bottom <= top; ++bottom)
-    YYFPRINTF (stderr, " %d", *bottom);
-  YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top)                           \
-do {                                                           \
-  if (yydebug)                                                 \
-    yy_stack_print ((Bottom), (Top));                          \
-} while (YYID (0))
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule)
-    YYSTYPE *yyvsp;
-    int yyrule;
-#endif
-{
-  int yynrhs = yyr2[yyrule];
-  int yyi;
-  unsigned long int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-            yyrule - 1, yylno);
-  /* The symbols being reduced.  */
-  for (yyi = 0; yyi < yynrhs; yyi++)
-    {
-      fprintf (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
-                      &(yyvsp[(yyi + 1) - (yynrhs)])
-                                      );
-      fprintf (stderr, "\n");
-    }
-}
-
-# define YY_REDUCE_PRINT(Rule)         \
-do {                                   \
-  if (yydebug)                         \
-    yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
-
-/* Nonzero means print parse trace.  It is left uninitialized so that
-   multiple parsers can coexist.  */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef        YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
-   if the built-in stack extension method is used).
-
-   Do not make this value too large; the results are undefined if
-   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
-   evaluated with infinite-precision integer arithmetic.  */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-\f
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-#  if defined __GLIBC__ && defined _STRING_H
-#   define yystrlen strlen
-#  else
-/* Return the length of YYSTR.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
-    const char *yystr;
-#endif
-{
-  YYSIZE_T yylen;
-  for (yylen = 0; yystr[yylen]; yylen++)
-    continue;
-  return yylen;
-}
-#  endif
-# endif
-
-# ifndef yystpcpy
-#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-#   define yystpcpy stpcpy
-#  else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
-    char *yydest;
-    const char *yysrc;
-#endif
-{
-  char *yyd = yydest;
-  const char *yys = yysrc;
-
-  while ((*yyd++ = *yys++) != '\0')
-    continue;
-
-  return yyd - 1;
-}
-#  endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
-   quotes and backslashes, so that it's suitable for yyerror.  The
-   heuristic is that double-quoting is unnecessary unless the string
-   contains an apostrophe, a comma, or backslash (other than
-   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
-   null, do not copy; instead, return the length of what the result
-   would have been.  */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
-  if (*yystr == '"')
-    {
-      YYSIZE_T yyn = 0;
-      char const *yyp = yystr;
-
-      for (;;)
-       switch (*++yyp)
-         {
-         case '\'':
-         case ',':
-           goto do_not_strip_quotes;
-
-         case '\\':
-           if (*++yyp != '\\')
-             goto do_not_strip_quotes;
-           /* Fall through.  */
-         default:
-           if (yyres)
-             yyres[yyn] = *yyp;
-           yyn++;
-           break;
-
-         case '"':
-           if (yyres)
-             yyres[yyn] = '\0';
-           return yyn;
-         }
-    do_not_strip_quotes: ;
-    }
-
-  if (! yyres)
-    return yystrlen (yystr);
-
-  return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into YYRESULT an error message about the unexpected token
-   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
-   including the terminating null byte.  If YYRESULT is null, do not
-   copy anything; just return the number of bytes that would be
-   copied.  As a special case, return 0 if an ordinary "syntax error"
-   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
-   size calculation.  */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
-  int yyn = yypact[yystate];
-
-  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
-    return 0;
-  else
-    {
-      int yytype = YYTRANSLATE (yychar);
-      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-      YYSIZE_T yysize = yysize0;
-      YYSIZE_T yysize1;
-      int yysize_overflow = 0;
-      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-      int yyx;
-
-# if 0
-      /* This is so xgettext sees the translatable formats that are
-        constructed on the fly.  */
-      YY_("syntax error, unexpected %s");
-      YY_("syntax error, unexpected %s, expecting %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
-      char *yyfmt;
-      char const *yyf;
-      static char const yyunexpected[] = "syntax error, unexpected %s";
-      static char const yyexpecting[] = ", expecting %s";
-      static char const yyor[] = " or %s";
-      char yyformat[sizeof yyunexpected
-                   + sizeof yyexpecting - 1
-                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-                      * (sizeof yyor - 1))];
-      char const *yyprefix = yyexpecting;
-
-      /* Start YYX at -YYN if negative to avoid negative indexes in
-        YYCHECK.  */
-      int yyxbegin = yyn < 0 ? -yyn : 0;
-
-      /* Stay within bounds of both yycheck and yytname.  */
-      int yychecklim = YYLAST - yyn + 1;
-      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-      int yycount = 1;
-
-      yyarg[0] = yytname[yytype];
-      yyfmt = yystpcpy (yyformat, yyunexpected);
-
-      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-       if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-         {
-           if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-             {
-               yycount = 1;
-               yysize = yysize0;
-               yyformat[sizeof yyunexpected - 1] = '\0';
-               break;
-             }
-           yyarg[yycount++] = yytname[yyx];
-           yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-           yysize_overflow |= (yysize1 < yysize);
-           yysize = yysize1;
-           yyfmt = yystpcpy (yyfmt, yyprefix);
-           yyprefix = yyor;
-         }
-
-      yyf = YY_(yyformat);
-      yysize1 = yysize + yystrlen (yyf);
-      yysize_overflow |= (yysize1 < yysize);
-      yysize = yysize1;
-
-      if (yysize_overflow)
-       return YYSIZE_MAXIMUM;
-
-      if (yyresult)
-       {
-         /* Avoid sprintf, as that infringes on the user's name space.
-            Don't have undefined behavior even if the translation
-            produced a string with the wrong number of "%s"s.  */
-         char *yyp = yyresult;
-         int yyi = 0;
-         while ((*yyp = *yyf) != '\0')
-           {
-             if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-               {
-                 yyp += yytnamerr (yyp, yyarg[yyi++]);
-                 yyf += 2;
-               }
-             else
-               {
-                 yyp++;
-                 yyf++;
-               }
-           }
-       }
-      return yysize;
-    }
-}
-#endif /* YYERROR_VERBOSE */
-\f
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep)
-    const char *yymsg;
-    int yytype;
-    YYSTYPE *yyvaluep;
-#endif
-{
-  YYUSE (yyvaluep);
-
-  if (!yymsg)
-    yymsg = "Deleting";
-  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
-  switch (yytype)
-    {
-
-      default:
-       break;
-    }
-}
-\f
-
-/* Prevent warnings from -Wmissing-prototypes.  */
-
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-/* The look-ahead symbol.  */
-int yychar;
-
-/* The semantic value of the look-ahead symbol.  */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far.  */
-int yynerrs;
-
-
-
-/*----------.
-| yyparse.  |
-`----------*/
-
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
-    void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
-{
-  
-  int yystate;
-  int yyn;
-  int yyresult;
-  /* Number of tokens to shift before error messages enabled.  */
-  int yyerrstatus;
-  /* Look-ahead token as an internal (translated) token number.  */
-  int yytoken = 0;
-#if YYERROR_VERBOSE
-  /* Buffer for error messages, and its allocated size.  */
-  char yymsgbuf[128];
-  char *yymsg = yymsgbuf;
-  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-  /* Three stacks and their tools:
-     `yyss': related to states,
-     `yyvs': related to semantic values,
-     `yyls': related to locations.
-
-     Refer to the stacks thru separate pointers, to allow yyoverflow
-     to reallocate them elsewhere.  */
-
-  /* The state stack.  */
-  yytype_int16 yyssa[YYINITDEPTH];
-  yytype_int16 *yyss = yyssa;
-  yytype_int16 *yyssp;
-
-  /* The semantic value stack.  */
-  YYSTYPE yyvsa[YYINITDEPTH];
-  YYSTYPE *yyvs = yyvsa;
-  YYSTYPE *yyvsp;
-
-
-
-#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
-
-  YYSIZE_T yystacksize = YYINITDEPTH;
-
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-
-
-  /* The number of symbols on the RHS of the reduced rule.
-     Keep to zero when no symbol should be popped.  */
-  int yylen = 0;
-
-  YYDPRINTF ((stderr, "Starting parse\n"));
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY;            /* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-
-  yyssp = yyss;
-  yyvsp = yyvs;
-
-  goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
-`------------------------------------------------------------*/
- yynewstate:
-  /* In all cases, when you get here, the value and location stacks
-     have just been pushed.  So pushing a state here evens the stacks.  */
-  yyssp++;
-
- yysetstate:
-  *yyssp = yystate;
-
-  if (yyss + yystacksize - 1 <= yyssp)
-    {
-      /* Get the current used size of the three stacks, in elements.  */
-      YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      {
-       /* Give user a chance to reallocate the stack.  Use copies of
-          these so that the &'s don't force the real ones into
-          memory.  */
-       YYSTYPE *yyvs1 = yyvs;
-       yytype_int16 *yyss1 = yyss;
-
-
-       /* Each stack pointer address is followed by the size of the
-          data in use in that stack, in bytes.  This used to be a
-          conditional around just the two extra args, but that might
-          be undefined if yyoverflow is a macro.  */
-       yyoverflow (YY_("memory exhausted"),
-                   &yyss1, yysize * sizeof (*yyssp),
-                   &yyvs1, yysize * sizeof (*yyvsp),
-
-                   &yystacksize);
-
-       yyss = yyss1;
-       yyvs = yyvs1;
-      }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
-      /* Extend the stack our own way.  */
-      if (YYMAXDEPTH <= yystacksize)
-       goto yyexhaustedlab;
-      yystacksize *= 2;
-      if (YYMAXDEPTH < yystacksize)
-       yystacksize = YYMAXDEPTH;
-
-      {
-       yytype_int16 *yyss1 = yyss;
-       union yyalloc *yyptr =
-         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-       if (! yyptr)
-         goto yyexhaustedlab;
-       YYSTACK_RELOCATE (yyss);
-       YYSTACK_RELOCATE (yyvs);
-
-#  undef YYSTACK_RELOCATE
-       if (yyss1 != yyssa)
-         YYSTACK_FREE (yyss1);
-      }
-# endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + yysize - 1;
-      yyvsp = yyvs + yysize - 1;
-
-
-      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-                 (unsigned long int) yystacksize));
-
-      if (yyss + yystacksize - 1 <= yyssp)
-       YYABORT;
-    }
-
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
-  goto yybackup;
-
-/*-----------.
-| yybackup.  |
-`-----------*/
-yybackup:
-
-  /* Do appropriate processing given the current state.  Read a
-     look-ahead token if we need one and don't already have one.  */
-
-  /* First try to decide what to do without reference to look-ahead token.  */
-  yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
-    goto yydefault;
-
-  /* Not known => get a look-ahead token if don't already have one.  */
-
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
-  if (yychar == YYEMPTY)
-    {
-      YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = YYLEX;
-    }
-
-  if (yychar <= YYEOF)
-    {
-      yychar = yytoken = YYEOF;
-      YYDPRINTF ((stderr, "Now at end of input.\n"));
-    }
-  else
-    {
-      yytoken = YYTRANSLATE (yychar);
-      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
-    }
-
-  /* If the proper action on seeing token YYTOKEN is to reduce or to
-     detect an error, take that action.  */
-  yyn += yytoken;
-  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
-    goto yydefault;
-  yyn = yytable[yyn];
-  if (yyn <= 0)
-    {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
-       goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  /* Shift the look-ahead token.  */
-  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
-  /* Discard the shifted token unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
-
-  yystate = yyn;
-  *++yyvsp = yylval;
-
-  goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state.  |
-`-----------------------------------------------------------*/
-yydefault:
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-  goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction.  |
-`-----------------------------*/
-yyreduce:
-  /* yyn is the number of a rule to reduce with.  */
-  yylen = yyr2[yyn];
-
-  /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
-
-     Otherwise, the following line sets YYVAL to garbage.
-     This behavior is undocumented and Bison
-     users should not rely upon it.  Assigning to YYVAL
-     unconditionally makes the parser a bit smaller, and it avoids a
-     GCC warning that YYVAL may be used uninitialized.  */
-  yyval = yyvsp[1-yylen];
-
-
-  YY_REDUCE_PRINT (yyn);
-  switch (yyn)
-    {
-        case 20:
-#line 159 "winprefsyacc.y"
-    { SetTrayIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
-    break;
-
-  case 21:
-#line 162 "winprefsyacc.y"
-    { SetRootMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
-    break;
-
-  case 22:
-#line 165 "winprefsyacc.y"
-    { SetDefaultSysMenu((yyvsp[(2) - (4)].sVal), (yyvsp[(3) - (4)].iVal)); free((yyvsp[(2) - (4)].sVal)); }
-    break;
-
-  case 23:
-#line 168 "winprefsyacc.y"
-    { SetDefaultIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
-    break;
-
-  case 24:
-#line 171 "winprefsyacc.y"
-    { SetIconDirectory((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
-    break;
-
-  case 25:
-#line 174 "winprefsyacc.y"
-    { AddMenuLine("-", CMD_SEPARATOR, ""); }
-    break;
-
-  case 26:
-#line 175 "winprefsyacc.y"
-    { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_ALWAYSONTOP, ""); free((yyvsp[(1) - (4)].sVal)); }
-    break;
-
-  case 27:
-#line 176 "winprefsyacc.y"
-    { AddMenuLine((yyvsp[(1) - (5)].sVal), CMD_EXEC, (yyvsp[(3) - (5)].sVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(3) - (5)].sVal)); }
-    break;
-
-  case 28:
-#line 177 "winprefsyacc.y"
-    { AddMenuLine((yyvsp[(1) - (5)].sVal), CMD_MENU, (yyvsp[(3) - (5)].sVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(3) - (5)].sVal)); }
-    break;
-
-  case 29:
-#line 178 "winprefsyacc.y"
-    { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_RELOAD, ""); free((yyvsp[(1) - (4)].sVal)); }
-    break;
-
-  case 32:
-#line 185 "winprefsyacc.y"
-    { OpenMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
-    break;
-
-  case 33:
-#line 185 "winprefsyacc.y"
-    {CloseMenu();}
-    break;
-
-  case 34:
-#line 188 "winprefsyacc.y"
-    { AddIconLine((yyvsp[(1) - (4)].sVal), (yyvsp[(2) - (4)].sVal)); free((yyvsp[(1) - (4)].sVal)); free((yyvsp[(2) - (4)].sVal)); }
-    break;
-
-  case 37:
-#line 195 "winprefsyacc.y"
-    {OpenIcons();}
-    break;
-
-  case 38:
-#line 195 "winprefsyacc.y"
-    {CloseIcons();}
-    break;
-
-  case 39:
-#line 198 "winprefsyacc.y"
-    { (yyval.uVal)=STYLE_TOPMOST; }
-    break;
-
-  case 40:
-#line 199 "winprefsyacc.y"
-    { (yyval.uVal)=STYLE_MAXIMIZE; }
-    break;
-
-  case 41:
-#line 200 "winprefsyacc.y"
-    { (yyval.uVal)=STYLE_MINIMIZE; }
-    break;
-
-  case 42:
-#line 201 "winprefsyacc.y"
-    { (yyval.uVal)=STYLE_BOTTOM; }
-    break;
-
-  case 43:
-#line 204 "winprefsyacc.y"
-    { (yyval.uVal)=STYLE_NOTITLE; }
-    break;
-
-  case 44:
-#line 205 "winprefsyacc.y"
-    { (yyval.uVal)=STYLE_OUTLINE; }
-    break;
-
-  case 45:
-#line 206 "winprefsyacc.y"
-    { (yyval.uVal)=STYLE_NOFRAME; }
-    break;
-
-  case 46:
-#line 209 "winprefsyacc.y"
-    { (yyval.uVal)=(yyvsp[(1) - (1)].uVal); }
-    break;
-
-  case 47:
-#line 210 "winprefsyacc.y"
-    { (yyval.uVal)=(yyvsp[(1) - (1)].uVal); }
-    break;
-
-  case 48:
-#line 211 "winprefsyacc.y"
-    { (yyval.uVal)=(yyvsp[(1) - (2)].uVal)|(yyvsp[(2) - (2)].uVal); }
-    break;
-
-  case 49:
-#line 212 "winprefsyacc.y"
-    { (yyval.uVal)=(yyvsp[(1) - (2)].uVal)|(yyvsp[(2) - (2)].uVal); }
-    break;
-
-  case 50:
-#line 215 "winprefsyacc.y"
-    { AddStyleLine((yyvsp[(1) - (4)].sVal), (yyvsp[(2) - (4)].uVal)); free((yyvsp[(1) - (4)].sVal)); }
-    break;
-
-  case 53:
-#line 222 "winprefsyacc.y"
-    {OpenStyles();}
-    break;
-
-  case 54:
-#line 222 "winprefsyacc.y"
-    {CloseStyles();}
-    break;
-
-  case 55:
-#line 225 "winprefsyacc.y"
-    { (yyval.iVal)=AT_END; }
-    break;
-
-  case 56:
-#line 226 "winprefsyacc.y"
-    { (yyval.iVal)=AT_START; }
-    break;
-
-  case 57:
-#line 227 "winprefsyacc.y"
-    { (yyval.iVal)=AT_END; }
-    break;
-
-  case 58:
-#line 230 "winprefsyacc.y"
-    { AddSysMenuLine((yyvsp[(1) - (5)].sVal), (yyvsp[(2) - (5)].sVal), (yyvsp[(3) - (5)].iVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(2) - (5)].sVal)); }
-    break;
-
-  case 61:
-#line 237 "winprefsyacc.y"
-    {OpenSysMenu();}
-    break;
-
-  case 62:
-#line 237 "winprefsyacc.y"
-    {CloseSysMenu();}
-    break;
-
-  case 63:
-#line 240 "winprefsyacc.y"
-    { pref.fForceExit = TRUE; }
-    break;
-
-  case 64:
-#line 243 "winprefsyacc.y"
-    { pref.fSilentExit = TRUE; }
-    break;
-
-  case 65:
-#line 246 "winprefsyacc.y"
-    { ErrorF("LoadPreferences: %s\n", (yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
-    break;
-
-
-/* Line 1267 of yacc.c.  */
-#line 1752 "winprefsyacc.c"
-      default: break;
-    }
-  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-
-  *++yyvsp = yyval;
-
-
-  /* Now `shift' the result of the reduction.  Determine what state
-     that goes to, based on the state we popped back to and the rule
-     number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTOKENS];
-
-  goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
-  /* If not already recovering from an error, report this error.  */
-  if (!yyerrstatus)
-    {
-      ++yynerrs;
-#if ! YYERROR_VERBOSE
-      yyerror (YY_("syntax error"));
-#else
-      {
-       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
-       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
-         {
-           YYSIZE_T yyalloc = 2 * yysize;
-           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
-             yyalloc = YYSTACK_ALLOC_MAXIMUM;
-           if (yymsg != yymsgbuf)
-             YYSTACK_FREE (yymsg);
-           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
-           if (yymsg)
-             yymsg_alloc = yyalloc;
-           else
-             {
-               yymsg = yymsgbuf;
-               yymsg_alloc = sizeof yymsgbuf;
-             }
-         }
-
-       if (0 < yysize && yysize <= yymsg_alloc)
-         {
-           (void) yysyntax_error (yymsg, yystate, yychar);
-           yyerror (yymsg);
-         }
-       else
-         {
-           yyerror (YY_("syntax error"));
-           if (yysize != 0)
-             goto yyexhaustedlab;
-         }
-      }
-#endif
-    }
-
-
-
-  if (yyerrstatus == 3)
-    {
-      /* If just tried and failed to reuse look-ahead token after an
-        error, discard it.  */
-
-      if (yychar <= YYEOF)
-       {
-         /* Return failure if at end of input.  */
-         if (yychar == YYEOF)
-           YYABORT;
-       }
-      else
-       {
-         yydestruct ("Error: discarding",
-                     yytoken, &yylval);
-         yychar = YYEMPTY;
-       }
-    }
-
-  /* Else will try to reuse look-ahead token after shifting the error
-     token.  */
-  goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR.  |
-`---------------------------------------------------*/
-yyerrorlab:
-
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
-
-  /* Do not reclaim the symbols of the rule which action triggered
-     this YYERROR.  */
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-  yystate = *yyssp;
-  goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR.  |
-`-------------------------------------------------------------*/
-yyerrlab1:
-  yyerrstatus = 3;     /* Each real token shifted decrements this.  */
-
-  for (;;)
-    {
-      yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
-       {
-         yyn += YYTERROR;
-         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-           {
-             yyn = yytable[yyn];
-             if (0 < yyn)
-               break;
-           }
-       }
-
-      /* Pop the current state because it cannot handle the error token.  */
-      if (yyssp == yyss)
-       YYABORT;
-
-
-      yydestruct ("Error: popping",
-                 yystos[yystate], yyvsp);
-      YYPOPSTACK (1);
-      yystate = *yyssp;
-      YY_STACK_PRINT (yyss, yyssp);
-    }
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  *++yyvsp = yylval;
-
-
-  /* Shift the error token.  */
-  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
-  yystate = yyn;
-  goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here.  |
-`-------------------------------------*/
-yyacceptlab:
-  yyresult = 0;
-  goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here.  |
-`-----------------------------------*/
-yyabortlab:
-  yyresult = 1;
-  goto yyreturn;
-
-#ifndef yyoverflow
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
-yyexhaustedlab:
-  yyerror (YY_("memory exhausted"));
-  yyresult = 2;
-  /* Fall through.  */
-#endif
-
-yyreturn:
-  if (yychar != YYEOF && yychar != YYEMPTY)
-     yydestruct ("Cleanup: discarding lookahead",
-                yytoken, &yylval);
-  /* Do not reclaim the symbols of the rule which action triggered
-     this YYABORT or YYACCEPT.  */
-  YYPOPSTACK (yylen);
-  YY_STACK_PRINT (yyss, yyssp);
-  while (yyssp != yyss)
-    {
-      yydestruct ("Cleanup: popping",
-                 yystos[*yyssp], yyvsp);
-      YYPOPSTACK (1);
-    }
-#ifndef yyoverflow
-  if (yyss != yyssa)
-    YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
-  if (yymsg != yymsgbuf)
-    YYSTACK_FREE (yymsg);
-#endif
-  /* Make sure YYID is used.  */
-  return YYID (yyresult);
-}
-
-
-#line 250 "winprefsyacc.y"
-
-/*
- * Errors in parsing abort and print log messages
- */
-static int
-yyerror (char *s) 
-{
-  extern int yylineno; /* Handled by flex internally */
-
-  ErrorF("LoadPreferences: %s line %d\n", s, yylineno);
-  return 1;
-}
-
-/* Miscellaneous functions to store TOKENs into the structure */
-static void
-SetIconDirectory (char *path)
-{
-  strncpy (pref.iconDirectory, path, PATH_MAX);
-  pref.iconDirectory[PATH_MAX] = 0;
-}
-
-static void
-SetDefaultIcon (char *fname)
-{
-  strncpy (pref.defaultIconName, fname, NAME_MAX);
-  pref.defaultIconName[NAME_MAX] = 0;
-}
-
-static void
-SetTrayIcon (char *fname)
-{
-  strncpy (pref.trayIconName, fname, NAME_MAX);
-  pref.trayIconName[NAME_MAX] = 0;
-}
-
-static void
-SetRootMenu (char *menu)
-{
-  strncpy (pref.rootMenuName, menu, MENU_MAX);
-  pref.rootMenuName[MENU_MAX] = 0;
-}
-
-static void
-SetDefaultSysMenu (char *menu, int pos)
-{
-  strncpy (pref.defaultSysMenuName, menu, MENU_MAX);
-  pref.defaultSysMenuName[MENU_MAX] = 0;
-  pref.defaultSysMenuPos = pos;
-}
-
-static void
-OpenMenu (char *menuname)
-{
-  if (menu.menuItem) free(menu.menuItem);
-  menu.menuItem = NULL;
-  strncpy(menu.menuName, menuname, MENU_MAX);
-  menu.menuName[MENU_MAX] = 0;
-  menu.menuItems = 0;
-}
-
-static void
-AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param)
-{
-  if (menu.menuItem==NULL)
-    menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM));
-  else
-    menu.menuItem = (MENUITEM*)
-      realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1));
-
-  strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX);
-  menu.menuItem[menu.menuItems].text[MENU_MAX] = 0;
-
-  menu.menuItem[menu.menuItems].cmd = cmd;
-
-  strncpy(menu.menuItem[menu.menuItems].param, param, PARAM_MAX);
-  menu.menuItem[menu.menuItems].param[PARAM_MAX] = 0;
-
-  menu.menuItem[menu.menuItems].commandID = 0;
-
-  menu.menuItems++;
-}
-
-static void
-CloseMenu (void)
-{
-  if (menu.menuItem==NULL || menu.menuItems==0)
-    {
-      ErrorF("LoadPreferences: Empty menu detected\n");
-      return;
-    }
-  
-  if (pref.menuItems)
-    pref.menu = (MENUPARSED*)
-      realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED));
-  else
-    pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED));
-  
-  memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED));
-  pref.menuItems++;
-
-  memset (&menu, 0, sizeof(MENUPARSED));
-}
-
-static void 
-OpenIcons (void)
-{
-  if (pref.icon != NULL) {
-    ErrorF("LoadPreferences: Redefining icon mappings\n");
-    free(pref.icon);
-    pref.icon = NULL;
-  }
-  pref.iconItems = 0;
-}
-
-static void
-AddIconLine (char *matchstr, char *iconfile)
-{
-  if (pref.icon==NULL)
-    pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM));
-  else
-    pref.icon = (ICONITEM*)
-      realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1));
-
-  strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX);
-  pref.icon[pref.iconItems].match[MENU_MAX] = 0;
-
-  strncpy(pref.icon[pref.iconItems].iconFile, iconfile, PATH_MAX+NAME_MAX+1);
-  pref.icon[pref.iconItems].iconFile[PATH_MAX+NAME_MAX+1] = 0;
-
-  pref.icon[pref.iconItems].hicon = 0;
-
-  pref.iconItems++;
-}
-
-static void 
-CloseIcons (void)
-{
-}
-
-static void
-OpenStyles (void)
-{
-  if (pref.style != NULL) {
-    ErrorF("LoadPreferences: Redefining window style\n");
-    free(pref.style);
-    pref.style = NULL;
-  }
-  pref.styleItems = 0;
-}
-
-static void
-AddStyleLine (char *matchstr, unsigned long style)
-{
-  if (pref.style==NULL)
-    pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM));
-  else
-    pref.style = (STYLEITEM*)
-      realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1));
-
-  strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX);
-  pref.style[pref.styleItems].match[MENU_MAX] = 0;
-
-  pref.style[pref.styleItems].type = style;
-
-  pref.styleItems++;
-}
-
-static void
-CloseStyles (void)
-{
-}
-
-static void
-OpenSysMenu (void)
-{
-  if (pref.sysMenu != NULL) {
-    ErrorF("LoadPreferences: Redefining system menu\n");
-    free(pref.sysMenu);
-    pref.sysMenu = NULL;
-  }
-  pref.sysMenuItems = 0;
-}
-
-static void
-AddSysMenuLine (char *matchstr, char *menuname, int pos)
-{
-  if (pref.sysMenu==NULL)
-    pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM));
-  else
-    pref.sysMenu = (SYSMENUITEM*)
-      realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1));
-
-  strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX);
-  pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0;
-
-  strncpy (pref.sysMenu[pref.sysMenuItems].menuName, menuname, MENU_MAX);
-  pref.sysMenu[pref.sysMenuItems].menuName[MENU_MAX] = 0;
-
-  pref.sysMenu[pref.sysMenuItems].menuPos = pos;
-
-  pref.sysMenuItems++;
-}
-
-static void
-CloseSysMenu (void)
-{
-}
-
-
diff --git a/hw/xwin/winprefsyacc.h b/hw/xwin/winprefsyacc.h
deleted file mode 100644 (file)
index 9bd3bf7..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.3.  */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     NEWLINE = 258,
-     MENU = 259,
-     LB = 260,
-     RB = 261,
-     ICONDIRECTORY = 262,
-     DEFAULTICON = 263,
-     ICONS = 264,
-     STYLES = 265,
-     TOPMOST = 266,
-     MAXIMIZE = 267,
-     MINIMIZE = 268,
-     BOTTOM = 269,
-     NOTITLE = 270,
-     OUTLINE = 271,
-     NOFRAME = 272,
-     DEFAULTSYSMENU = 273,
-     SYSMENU = 274,
-     ROOTMENU = 275,
-     SEPARATOR = 276,
-     ATSTART = 277,
-     ATEND = 278,
-     EXEC = 279,
-     ALWAYSONTOP = 280,
-     DEBUGOUTPUT = 281,
-     RELOAD = 282,
-     TRAYICON = 283,
-     FORCEEXIT = 284,
-     SILENTEXIT = 285,
-     STRING = 286
-   };
-#endif
-/* Tokens.  */
-#define NEWLINE 258
-#define MENU 259
-#define LB 260
-#define RB 261
-#define ICONDIRECTORY 262
-#define DEFAULTICON 263
-#define ICONS 264
-#define STYLES 265
-#define TOPMOST 266
-#define MAXIMIZE 267
-#define MINIMIZE 268
-#define BOTTOM 269
-#define NOTITLE 270
-#define OUTLINE 271
-#define NOFRAME 272
-#define DEFAULTSYSMENU 273
-#define SYSMENU 274
-#define ROOTMENU 275
-#define SEPARATOR 276
-#define ATSTART 277
-#define ATEND 278
-#define EXEC 279
-#define ALWAYSONTOP 280
-#define DEBUGOUTPUT 281
-#define RELOAD 282
-#define TRAYICON 283
-#define FORCEEXIT 284
-#define SILENTEXIT 285
-#define STRING 286
-
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 89 "winprefsyacc.y"
-{
-  char *sVal;
-  unsigned long uVal;
-  int iVal;
-}
-/* Line 1529 of yacc.c.  */
-#line 117 "winprefsyacc.h"
-       YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-extern YYSTYPE yylval;
-
index 0f789f0..a5b3c07 100644 (file)
@@ -101,20 +101,22 @@ winInitializeScreenDefaults(void)
             int dpiY = GetDeviceCaps(hdc, LOGPIXELSY);
 
             winErrorFVerb(2,
-                          "winInitializeDefaultScreens - native DPI x %d y %d\n",
+                          "winInitializeScreenDefaults - native DPI x %d y %d\n",
                           dpiX, dpiY);
+
             monitorResolution = dpiY;
             ReleaseDC(NULL, hdc);
         }
         else {
             winErrorFVerb(1,
-                          "winInitializeDefaultScreens - Failed to retrieve native DPI, falling back to default of %d DPI\n",
+                          "winInitializeScreenDefaults - Failed to retrieve native DPI, falling back to default of %d DPI\n",
                           WIN_DEFAULT_DPI);
             monitorResolution = WIN_DEFAULT_DPI;
         }
     }
 
     defaultScreenInfo.iMonitor = 1;
+    defaultScreenInfo.hMonitor = MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY);
     defaultScreenInfo.dwWidth = dwWidth;
     defaultScreenInfo.dwHeight = dwHeight;
     defaultScreenInfo.dwUserWidth = dwWidth;
@@ -159,7 +161,7 @@ winInitializeScreenDefaults(void)
 static void
 winInitializeScreen(int i)
 {
-    winErrorFVerb(2, "winInitializeScreen - %d\n", i);
+    winErrorFVerb(3, "winInitializeScreen - %d\n", i);
 
     /* Initialize default screen values, if needed */
     winInitializeScreenDefaults();
@@ -176,7 +178,7 @@ winInitializeScreens(int maxscreens)
 {
     int i;
 
-    winErrorFVerb(2, "winInitializeScreens - %i\n", maxscreens);
+    winErrorFVerb(3, "winInitializeScreens - %i\n", maxscreens);
 
     if (maxscreens > g_iNumScreens) {
         /* Reallocate the memory for DDX-specific screen info */
@@ -333,6 +335,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
                 g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE;
                 g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE;
                 g_ScreenInfo[nScreenNum].iMonitor = iMonitor;
+                g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle;
                 g_ScreenInfo[nScreenNum].dwWidth = data.monitorWidth;
                 g_ScreenInfo[nScreenNum].dwHeight = data.monitorHeight;
                 g_ScreenInfo[nScreenNum].dwUserWidth = data.monitorWidth;
@@ -383,6 +386,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
                     }
                     else if (data.bMonitorSpecifiedExists == TRUE) {
                         g_ScreenInfo[nScreenNum].iMonitor = iMonitor;
+                        g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle;
                         g_ScreenInfo[nScreenNum].dwInitialX +=
                             data.monitorOffsetX;
                         g_ScreenInfo[nScreenNum].dwInitialY +=
@@ -415,6 +419,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
                                   iMonitor);
                     g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE;
                     g_ScreenInfo[nScreenNum].iMonitor = iMonitor;
+                    g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle;
                     g_ScreenInfo[nScreenNum].dwInitialX = data.monitorOffsetX;
                     g_ScreenInfo[nScreenNum].dwInitialY = data.monitorOffsetY;
                 }
@@ -1158,9 +1163,8 @@ winLogVersionInfo(void)
 
     ErrorF("Welcome to the XWin X Server\n");
     ErrorF("Vendor: %s\n", XVENDORNAME);
-    ErrorF("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR,
-           XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP,
-           XORG_VERSION_CURRENT);
+    ErrorF("Release: %d.%d.%d.%d\n", XORG_VERSION_MAJOR,
+           XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP);
     ErrorF("%s\n\n", BUILDERSTRING);
     ErrorF("Contact: %s\n", BUILDERADDR);
 }
index cf7d2c0..be25f12 100644 (file)
@@ -81,9 +81,9 @@ static Bool
  */
 
 Bool
-winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
+winScreenInit(ScreenPtr pScreen, int argc, char **argv)
 {
-    winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index];
+    winScreenInfoPtr pScreenInfo = &g_ScreenInfo[pScreen->myNum];
     winPrivScreenPtr pScreenPriv;
     HDC hdc;
     DWORD dwInitialBPP;
@@ -202,11 +202,11 @@ winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
     miClearVisualTypes();
 
     /* Call the engine dependent screen initialization procedure */
-    if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv))) {
+    if (!((*pScreenPriv->pwinFinishScreenInit) (pScreen->myNum, pScreen, argc, argv))) {
         ErrorF("winScreenInit - winFinishScreenInit () failed\n");
 
         /* call the engine dependent screen close procedure to clean up from a failure */
-        pScreenPriv->pwinCloseScreen(index, pScreen);
+        pScreenPriv->pwinCloseScreen(pScreen);
 
         return FALSE;
     }
@@ -224,7 +224,7 @@ winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
     pScreen->y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN);
 
     ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n",
-           index, pScreen->x, pScreen->y);
+           pScreen->myNum, pScreen->x, pScreen->y);
 
 #if CYGDEBUG || YES
     winDebug("winScreenInit - returning\n");
@@ -355,8 +355,6 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv)
      */
     pScreen->BlockHandler = winBlockHandler;
     pScreen->WakeupHandler = winWakeupHandler;
-    pScreen->blockData = pScreen;
-    pScreen->wakeupData = pScreen;
 
     /* Render extension initialization, calls miPictureInit */
     if (!fbPictureInit(pScreen, NULL, 0)) {
@@ -434,7 +432,7 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv)
     if (pScreen->a) { \
         pScreenPriv->a = pScreen->a; \
     } else { \
-        ErrorF("null screen fn " #a "\n"); \
+        winDebug("winScreenInit - null screen fn " #a "\n"); \
         pScreenPriv->a = NULL; \
     }
 
@@ -468,7 +466,7 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv)
     if (pScreen->a) { \
         pScreenPriv->a = pScreen->a; \
     } else { \
-        ErrorF("null screen fn " #a "\n"); \
+        winDebug("null screen fn " #a "\n"); \
         pScreenPriv->a = NULL; \
     }
 
@@ -636,8 +634,6 @@ winFinishScreenInitNativeGDI(int index,
      */
     pScreen->BlockHandler = winBlockHandler;
     pScreen->WakeupHandler = winWakeupHandler;
-    pScreen->blockData = pScreen;
-    pScreen->wakeupData = pScreen;
 
     /* Place our save screen function */
     pScreen->SaveScreen = winSaveScreen;
index a2aaa39..4c77cc0 100644 (file)
@@ -65,7 +65,7 @@ static void
  winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf);
 
 static Bool
- winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen);
+ winCloseScreenShadowDD(ScreenPtr pScreen);
 
 static Bool
  winInitVisualsShadowDD(ScreenPtr pScreen);
@@ -648,7 +648,7 @@ winInitScreenShadowDD(ScreenPtr pScreen)
  */
 
 static Bool
-winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen)
+winCloseScreenShadowDD(ScreenPtr pScreen)
 {
     winScreenPriv(pScreen);
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
@@ -665,7 +665,7 @@ winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen)
     /* Call the wrapped CloseScreen procedure */
     WIN_UNWRAP(CloseScreen);
     if (pScreen->CloseScreen)
-        fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+        fReturn = (*pScreen->CloseScreen) (pScreen);
 
     winFreeFBShadowDD(pScreen);
 
index 6e71dd2..c087975 100644 (file)
@@ -67,7 +67,7 @@ static void
  winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf);
 
 static Bool
- winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen);
+ winCloseScreenShadowDDNL(ScreenPtr pScreen);
 
 static Bool
  winInitVisualsShadowDDNL(ScreenPtr pScreen);
@@ -719,7 +719,7 @@ winInitScreenShadowDDNL(ScreenPtr pScreen)
  */
 
 static Bool
-winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen)
+winCloseScreenShadowDDNL(ScreenPtr pScreen)
 {
     winScreenPriv(pScreen);
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
@@ -736,7 +736,7 @@ winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen)
     /* Call the wrapped CloseScreen procedure */
     WIN_UNWRAP(CloseScreen);
     if (pScreen->CloseScreen)
-        fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+        fReturn = (*pScreen->CloseScreen) (pScreen);
 
     winFreeFBShadowDDNL(pScreen);
 
index 3b7b8b5..cdbb46b 100644 (file)
@@ -50,7 +50,7 @@ static void
  winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf);
 
 static Bool
- winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen);
+ winCloseScreenShadowGDI(ScreenPtr pScreen);
 
 static Bool
  winInitVisualsShadowGDI(ScreenPtr pScreen);
@@ -579,7 +579,7 @@ winInitScreenShadowGDI(ScreenPtr pScreen)
  */
 
 static Bool
-winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen)
+winCloseScreenShadowGDI(ScreenPtr pScreen)
 {
     winScreenPriv(pScreen);
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
@@ -596,7 +596,7 @@ winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen)
     /* Call the wrapped CloseScreen procedure */
     WIN_UNWRAP(CloseScreen);
     if (pScreen->CloseScreen)
-        fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+        fReturn = (*pScreen->CloseScreen) (pScreen);
 
     /* Delete the window property */
     RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP);
index 1d2bfed..77c1605 100644 (file)
@@ -38,8 +38,8 @@
 
 /* See Porting Layer Definition - p. 7 */
 void
-winWakeupHandler(int nScreen,
-                 pointer pWakeupData, unsigned long ulResult, pointer pReadmask)
+winWakeupHandler(ScreenPtr pScreen,
+                 unsigned long ulResult, pointer pReadmask)
 {
     MSG msg;
 
index cef49b5..5bf7102 100644 (file)
@@ -231,7 +231,7 @@ winMWExtWMCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
     // Store the implementation private frame ID
     pFrame->wid = (RootlessFrameID) pRLWinPriv;
 
-    winSelectIcons(pFrame->win, &hIcon, &hIconSmall);
+    winSelectIcons(&hIcon, &hIconSmall);
 
     /* Set standard class name prefix so we can identify window easily */
     strncpy(pszClass, WINDOW_CLASS_X, sizeof(pszClass));
index bfba1bf..f2d68cb 100644 (file)
@@ -147,39 +147,8 @@ winMWExtWMMoveResizeXWindow(WindowPtr pWin, int x, int y, int w, int h)
 }
 
 /*
- * winMWExtWMUpdateIcon
- * Change the Windows window icon
- */
-
-void
-winMWExtWMUpdateIcon(Window id)
-{
-    WindowPtr pWin;
-    HICON hIcon, hiconOld;
-
-    dixLookupResourceByType((pointer) &pWin, id, RT_WINDOW, NullClient,
-                            DixUnknownAccess);
-    hIcon = winOverrideIcon((unsigned long) pWin);
-
-    if (!hIcon)
-        hIcon = winXIconToHICON(pWin, GetSystemMetrics(SM_CXICON));
 
-    if (hIcon) {
-        win32RootlessWindowPtr pRLWinPriv
-            = (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE);
 
-        if (pRLWinPriv->hWnd) {
-
-            hiconOld = (HICON) SendMessage(pRLWinPriv->hWnd,
-                                           WM_SETICON, ICON_BIG,
-                                           (LPARAM) hIcon);
-            winDestroyIcon(hiconOld);
-        }
-        hIcon = NULL;
-    }
-}
-
-/*
  * winMWExtWMDecorateWindow - Update window style. Called by EnumWindows.
  */
 
index c357f8d..a5919ee 100644 (file)
@@ -115,7 +115,7 @@ typedef struct _winWMMessageRec {
 #define                WM_WM_KILL              (WM_USER + 7)
 #define                WM_WM_ACTIVATE          (WM_USER + 8)
 #define                WM_WM_NAME_EVENT        (WM_USER + 9)
-#define                WM_WM_HINTS_EVENT       (WM_USER + 10)
+#define                WM_WM_ICON_EVENT        (WM_USER + 10)
 #define                WM_WM_CHANGE_STATE      (WM_USER + 11)
 #define                WM_WM_MAP2              (WM_USER + 12)
 #define                WM_WM_MAP3              (WM_USER + 13)
@@ -157,18 +157,5 @@ void
 void
  winMinimizeWindow(Window id);
 
-/*
- * winmultiwindowicons.c
- */
-
-void
- winUpdateIcon(Window id);
-
-void
- winInitGlobalIcons(void);
-
-void
- winDestroyIcon(HICON hIcon);
-
 #endif                          /* XWIN_MULTIWINDOW */
 #endif
index f67c383..5d513a8 100644 (file)
@@ -95,7 +95,7 @@ ProcWindowsWMQueryVersion(ClientPtr client)
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
     }
-    WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), &rep);
     return Success;
 }
 
@@ -366,7 +366,7 @@ ProcWindowsWMFrameGetRect(ClientPtr client)
            rep.x, rep.y, rep.w, rep.h);
 #endif
 
-    WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), (char *) &rep);
+    WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), &rep);
     return Success;
 }
 
@@ -439,8 +439,6 @@ ProcWindowsWMFrameDraw(ClientPtr client)
 
     ShowWindow(pRLWinPriv->hWnd, nCmdShow);
 
-    winMWExtWMUpdateIcon(pWin->drawable.id);
-
     if (wBoundingShape(pWin) != NULL) {
         /* wBoundingShape is relative to *inner* origin of window.
            Translate by borderWidth to get the outside-relative position. */
index 3f5d66b..fe662b9 100644 (file)
@@ -428,6 +428,13 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     }
         return 0;
 
+    case WM_SYSCOMMAND:
+        if (s_pScreenInfo->iResizeMode == resizeWithRandr &&
+            ((wParam & 0xfff0) == SC_MAXIMIZE ||
+             (wParam & 0xfff0) == SC_RESTORE))
+            PostMessage(hwnd, WM_EXITSIZEMOVE, 0, 0);
+        break;
+
     case WM_ENTERSIZEMOVE:
         ErrorF("winWindowProc - WM_ENTERSIZEMOVE\n");
         break;
index 972f403..33116f2 100644 (file)
@@ -26,6 +26,7 @@ sdk_HEADERS =         \
        gc.h            \
        gcstruct.h      \
        globals.h       \
+       glx_extinit.h   \
        input.h         \
        inputstr.h      \
        list.h          \
index 3fb6413..77681a9 100644 (file)
 /* Define to use CommonCrypto SHA1 functions */
 #undef HAVE_SHA1_IN_COMMONCRYPTO
 
+/* Define to use CryptoAPI SHA1 functions */
+#undef HAVE_SHA1_IN_CRYPTOAPI
+
 /* Define to use libmd SHA1 functions */
 #undef HAVE_SHA1_IN_LIBMD
 
 /* Use libudev for input hotplug */
 #undef CONFIG_UDEV
 
+/* Use libudev for kms enumeration */
+#undef CONFIG_UDEV_KMS
+
 /* Use udev_monitor_filter_add_match_tag() */
 #undef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG
 
index d604e06..74123b5 100644 (file)
@@ -64,6 +64,8 @@ SOFTWARE.
 #define REQUEST(type) \
        type *stuff = (type *)client->requestBuffer
 
+#define ARRAY_SIZE(a)  (sizeof((a)) / sizeof((a)[0]))
+
 #define REQUEST_SIZE_MATCH(req)\
     if ((sizeof(req) >> 2) != client->req_len)\
          return(BadLength)
@@ -102,12 +104,12 @@ SOFTWARE.
    if ((pClient)->swapped) \
       (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \
            (pClient, (int)(size), pReply); \
-      else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); }
+   else WriteToClient(pClient, (int)(size), (pReply)); }
 
 #define WriteSwappedDataToClient(pClient, size, pbuf) \
    if ((pClient)->swapped) \
       (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \
-   else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf));
+   else WriteToClient(pClient, (int)(size), (pbuf));
 
 typedef struct _TimeStamp *TimeStampPtr;
 
@@ -313,7 +315,8 @@ extern _X_EXPORT WindowPtr
 GetSpriteWindow(DeviceIntPtr pDev);
 
 extern _X_EXPORT void
-NoticeEventTime(InternalEvent *ev);
+NoticeEventTime(InternalEvent *ev,
+                DeviceIntPtr dev);
 
 extern void
 EnqueueEvent(InternalEvent * /* ev */ ,
@@ -394,6 +397,8 @@ DeliverTouchEvents(DeviceIntPtr /* dev */ ,
 extern void
 InitializeSprite(DeviceIntPtr /* pDev */ ,
                  WindowPtr /* pWin */ );
+extern void
+FreeSprite(DeviceIntPtr pDev);
 
 extern void
 UpdateSpriteForScreen(DeviceIntPtr /* pDev */ ,
index c8f384e..d472969 100644 (file)
@@ -77,11 +77,4 @@ extern _X_EXPORT int ProcUngrabButton(ClientPtr /* client */ );
 
 extern _X_EXPORT int ProcRecolorCursor(ClientPtr /* client */ );
 
-#ifdef PANORAMIX
-extern _X_EXPORT void PostSyntheticMotion(DeviceIntPtr pDev,
-                                          int x,
-                                          int y,
-                                          int screen, unsigned long time);
-#endif
-
 #endif                          /* DIXEVENTS_H */
index 9333041..3d09eb5 100644 (file)
@@ -117,12 +117,13 @@ extern _X_EXPORT void FreeFonts(void);
 
 extern _X_EXPORT FontPtr find_old_font(XID /*id */ );
 
-extern _X_EXPORT void GetGlyphs(FontPtr /*font */ ,
-                                unsigned long /*count */ ,
-                                unsigned char * /*chars */ ,
-                                FontEncoding /*fontEncoding */ ,
-                                unsigned long * /*glyphcount */ ,
-                                CharInfoPtr * /*glyphs */ );
+#define GetGlyphs dixGetGlyphs
+extern _X_EXPORT void dixGetGlyphs(FontPtr /*font */ ,
+                                   unsigned long /*count */ ,
+                                   unsigned char * /*chars */ ,
+                                   FontEncoding /*fontEncoding */ ,
+                                   unsigned long * /*glyphcount */ ,
+                                   CharInfoPtr * /*glyphs */ );
 
 extern _X_EXPORT void QueryGlyphExtents(FontPtr /*pFont */ ,
                                         CharInfoPtr * /*charinfo */ ,
index 75685a2..b2a168a 100644 (file)
@@ -156,7 +156,7 @@ typedef struct _WorkQueue {
 } WorkQueueRec;
 
 extern _X_EXPORT TimeStamp currentTime;
-extern _X_EXPORT TimeStamp lastDeviceEventTime;
+extern _X_EXPORT TimeStamp lastDeviceEventTime[MAXDEVICES];
 
 extern _X_EXPORT int
 CompareTimeStamps(TimeStamp /*a */ ,
diff --git a/include/do-not-use-config.h.in b/include/do-not-use-config.h.in
deleted file mode 100644 (file)
index 7e0accd..0000000
+++ /dev/null
@@ -1,736 +0,0 @@
-/* include/do-not-use-config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Build AIGLX loader */
-#undef AIGLX
-
-/* Default base font path */
-#undef BASE_FONT_PATH
-
-/* Support BigRequests extension */
-#undef BIGREQS
-
-/* Define to 1 if `struct sockaddr_in' has a `sin_len' member */
-#undef BSD44SOCKETS
-
-/* Builder address */
-#undef BUILDERADDR
-
-/* Builder string */
-#undef BUILDERSTRING
-
-/* Prefix to use for bundle identifiers */
-#undef BUNDLE_ID_PREFIX
-
-/* Support client ID tracking */
-#undef CLIENTIDS
-
-/* Default font path */
-#undef COMPILEDDEFAULTFONTPATH
-
-/* Support Composite Extension */
-#undef COMPOSITE
-
-/* Use the D-Bus input configuration API */
-#undef CONFIG_DBUS_API
-
-/* Use the HAL hotplug API */
-#undef CONFIG_HAL
-
-/* Use D-Bus for input hotplug */
-#undef CONFIG_NEED_DBUS
-
-/* Use libudev for input hotplug */
-#undef CONFIG_UDEV
-
-/* Use wscons for input auto configuration */
-#undef CONFIG_WSCONS
-
-/* System is BSD-like */
-#undef CSRG_BASED
-
-/* Simple debug messages */
-#undef CYGDEBUG
-
-/* Debug window manager */
-#undef CYGMULTIWINDOW_DEBUG
-
-/* Debug messages for window handling */
-#undef CYGWINDOWING_DEBUG
-
-/* Support Damage extension */
-#undef DAMAGE
-
-/* Support DBE extension */
-#undef DBE
-
-/* Use ddxBeforeReset */
-#undef DDXBEFORERESET
-
-/* Use OsVendorVErrorF */
-#undef DDXOSVERRORF
-
-/* Enable debugging code */
-#undef DEBUG
-
-/* Default library install path */
-#undef DEFAULT_LIBRARY_PATH
-
-/* Default log location */
-#undef DEFAULT_LOGDIR
-
-/* Default log location */
-#undef DEFAULT_LOGPREFIX
-
-/* Default module search path */
-#undef DEFAULT_MODULE_PATH
-
-/* Support DGA extension */
-#undef DGA
-
-/* Support DPMS extension */
-#undef DPMSExtension
-
-/* Build DRI2 extension */
-#undef DRI2
-
-/* Build DRI2 AIGLX loader */
-#undef DRI2_AIGLX
-
-/* Default DRI driver path */
-#undef DRI_DRIVER_PATH
-
-/* Build GLX extension */
-#undef GLXEXT
-
-/* Support XDM-AUTH*-1 */
-#undef HASXDMAUTH
-
-/* System has /dev/xf86 aperture driver */
-#undef HAS_APERTURE_DRV
-
-/* Cygwin has /dev/windows for signaling new win32 messages */
-#undef HAS_DEVWINDOWS
-
-/* Define to 1 if NetBSD built-in MTRR support is available */
-#undef HAS_MTRR_BUILTIN
-
-/* MTRR support available */
-#undef HAS_MTRR_SUPPORT
-
-/* Support SHM */
-#undef HAS_SHM
-
-/* Use Windows sockets */
-#undef HAS_WINSOCK
-
-/* Define to 1 if you have the <asm/mtrr.h> header file. */
-#undef HAVE_ASM_MTRR_H
-
-/* Define to 1 if you have the `authdes_create' function. */
-#undef HAVE_AUTHDES_CREATE
-
-/* Define to 1 if you have the `authdes_seccreate' function. */
-#undef HAVE_AUTHDES_SECCREATE
-
-/* Has backtrace support */
-#undef HAVE_BACKTRACE
-
-/* Define to 1 if you have the <byteswap.h> header file. */
-#undef HAVE_BYTESWAP_H
-
-/* Define to 1 if you have the `cbrt' function. */
-#undef HAVE_CBRT
-
-/* Define to 1 if you have the `clock_gettime' function. */
-#undef HAVE_CLOCK_GETTIME
-
-/* Define to 1 if you have the <dbm.h> header file. */
-#undef HAVE_DBM_H
-
-/* Have D-Bus support */
-#undef HAVE_DBUS
-
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_DIRENT_H
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Have execinfo.h */
-#undef HAVE_EXECINFO_H
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if you have the `ffs' function. */
-#undef HAVE_FFS
-
-/* Define to 1 if you have the <fnmatch.h> header file. */
-#undef HAVE_FNMATCH_H
-
-/* Define to 1 if you have the `getdtablesize' function. */
-#undef HAVE_GETDTABLESIZE
-
-/* Define to 1 if you have the `geteuid' function. */
-#undef HAVE_GETEUID
-
-/* Define to 1 if you have the `getifaddrs' function. */
-#undef HAVE_GETIFADDRS
-
-/* Define to 1 if you have the `getpeereid' function. */
-#undef HAVE_GETPEEREID
-
-/* Define to 1 if you have the `getpeerucred' function. */
-#undef HAVE_GETPEERUCRED
-
-/* Define to 1 if you have the `getresuid' function. */
-#undef HAVE_GETRESUID
-
-/* Define to 1 if you have the `getuid' function. */
-#undef HAVE_GETUID
-
-/* Define to 1 if you have the `getzoneid' function. */
-#undef HAVE_GETZONEID
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `issetugid' function. */
-#undef HAVE_ISSETUGID
-
-/* Define to 1 if you have the `audit' library (-laudit). */
-#undef HAVE_LIBAUDIT
-
-/* Define to 1 if you have the <libaudit.h> header file. */
-#undef HAVE_LIBAUDIT_H
-
-/* Define to 1 if you have the libdispatch (GCD) available */
-#undef HAVE_LIBDISPATCH
-
-/* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
-
-/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
-#undef HAVE_LIBWS2_32
-
-/* Define to 1 if you have the <linux/agpgart.h> header file. */
-#undef HAVE_LINUX_AGPGART_H
-
-/* Define to 1 if you have the <linux/apm_bios.h> header file. */
-#undef HAVE_LINUX_APM_BIOS_H
-
-/* Define to 1 if you have the <linux/fb.h> header file. */
-#undef HAVE_LINUX_FB_H
-
-/* Define to 1 if you have the <machine/mtrr.h> header file. */
-#undef HAVE_MACHINE_MTRR_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `mmap' function. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the <ndbm.h> header file. */
-#undef HAVE_NDBM_H
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-#undef HAVE_NDIR_H
-
-/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
-#undef HAVE_RPCSVC_DBM_H
-
-/* Use CommonCrypto SHA1 functions */
-#undef HAVE_SHA1_IN_COMMONCRYPTO
-
-/* Use libc SHA1 functions */
-#undef HAVE_SHA1_IN_LIBC
-
-/* Use libgcrypt SHA1 functions */
-#undef HAVE_SHA1_IN_LIBGCRYPT
-
-/* Use libmd SHA1 functions */
-#undef HAVE_SHA1_IN_LIBMD
-
-/* Use libsha1 for SHA1 */
-#undef HAVE_SHA1_IN_LIBSHA1
-
-/* Define to 1 if you have the `shmctl64' function. */
-#undef HAVE_SHMCTL64
-
-/* Define to 1 if the system has the type `socklen_t'. */
-#undef HAVE_SOCKLEN_T
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#undef HAVE_STRCASECMP
-
-/* Define to 1 if you have the `strcasestr' function. */
-#undef HAVE_STRCASESTR
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strlcat' function. */
-#undef HAVE_STRLCAT
-
-/* Define to 1 if you have the `strlcpy' function. */
-#undef HAVE_STRLCPY
-
-/* Define to 1 if you have the `strncasecmp' function. */
-#undef HAVE_STRNCASECMP
-
-/* Define to 1 if you have the `strndup' function. */
-#undef HAVE_STRNDUP
-
-/* Define to 1 if you have the <stropts.h> header file. */
-#undef HAVE_STROPTS_H
-
-/* Define to 1 if SYSV IPC is available */
-#undef HAVE_SYSV_IPC
-
-/* Define to 1 if you have the <sys/agpgart.h> header file. */
-#undef HAVE_SYS_AGPGART_H
-
-/* Define to 1 if you have the <sys/agpio.h> header file. */
-#undef HAVE_SYS_AGPIO_H
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_SYS_DIR_H
-
-/* Define to 1 if you have the <sys/kd.h> header file. */
-#undef HAVE_SYS_KD_H
-
-/* Define to 1 if you have the <sys/linker.h> header file. */
-#undef HAVE_SYS_LINKER_H
-
-/* Define to 1 if you have the <sys/memrange.h> header file. */
-#undef HAVE_SYS_MEMRANGE_H
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_SYS_NDIR_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/utsname.h> header file. */
-#undef HAVE_SYS_UTSNAME_H
-
-/* Define to 1 if you have the <sys/vt.h> header file. */
-#undef HAVE_SYS_VT_H
-
-/* Define to 1 if you have the `udev_enumerate_add_match_tag' function. */
-#undef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG
-
-/* Define to 1 if you have the `udev_monitor_filter_add_match_tag' function.
-   */
-#undef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `vasprintf' function. */
-#undef HAVE_VASPRINTF
-
-/* Define to 1 if you have the `vsnprintf' function. */
-#undef HAVE_VSNPRINTF
-
-/* Define to 1 if you have the `walkcontext' function. */
-#undef HAVE_WALKCONTEXT
-
-/* Support IPv6 for TCP connections */
-#undef IPv6
-
-/* Build kdrive ddx */
-#undef KDRIVEDDXACTIONS
-
-/* Build fbdev-based kdrive server */
-#undef KDRIVEFBDEV
-
-/* Build Kdrive X server */
-#undef KDRIVESERVER
-
-/* Enable KDrive evdev driver */
-#undef KDRIVE_EVDEV
-
-/* Enable KDrive kbd driver */
-#undef KDRIVE_KBD
-
-/* Enable KDrive mouse driver */
-#undef KDRIVE_MOUSE
-
-/* Support os-specific local connections */
-#undef LOCALCONN
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#undef LT_OBJDIR
-
-/* Support MIT-SHM extension */
-#undef MITSHM
-
-/* Have monotonic clock from clock_gettime() */
-#undef MONOTONIC_CLOCK
-
-/* Need XFree86 helper functions */
-#undef NEED_XF86_PROTOTYPES
-
-/* Need XFree86 typedefs */
-#undef NEED_XF86_TYPES
-
-/* Define to 1 if modules should avoid the libcwrapper */
-#undef NO_LIBCWRAPPER
-
-/* Operating System Name */
-#undef OSNAME
-
-/* Operating System Vendor */
-#undef OSVENDOR
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Major version of this package */
-#undef PACKAGE_VERSION_MAJOR
-
-/* Minor version of this package */
-#undef PACKAGE_VERSION_MINOR
-
-/* Patch version of this package */
-#undef PACKAGE_VERSION_PATCHLEVEL
-
-/* Internal define for Xinerama */
-#undef PANORAMIX
-
-/* System has PC console */
-#undef PCCONS_SUPPORT
-
-/* Default PCI text file ID path */
-#undef PCI_TXT_IDS_PATH
-
-/* System has PC console */
-#undef PCVT_SUPPORT
-
-/* Overall prefix */
-#undef PROJECTROOT
-
-/* Support RANDR extension */
-#undef RANDR
-
-/* Make PROJECT_ROOT relative to the xserver location */
-#undef RELOCATE_PROJECTROOT
-
-/* Support RENDER extension */
-#undef RENDER
-
-/* Support X resource extension */
-#undef RES
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#undef RETSIGTYPE
-
-/* Build Rootless code */
-#undef ROOTLESS
-
-/* Support MIT-SCREEN-SAVER extension */
-#undef SCREENSAVER
-
-/* Support Secure RPC ("SUN-DES-1") authentication for X11 clients */
-#undef SECURE_RPC
-
-/* Server miscellaneous config path */
-#undef SERVER_MISC_CONFIG_PATH
-
-/* Support SHAPE extension */
-#undef SHAPE
-
-/* The size of `unsigned long', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_LONG
-
-/* Build a standalone xpbproxy */
-#undef STANDALONE_XPBPROXY
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define to 1 on systems derived from System V Release 4 */
-#undef SVR4
-
-/* Location of system.XWinrc */
-#undef SYSCONFDIR
-
-/* System has syscons console */
-#undef SYSCONS_SUPPORT
-
-/* Support TCP socket connections */
-#undef TCPCONN
-
-/* The compiler supported TLS storage class, prefering initial-exec if
-   tls_model is supported */
-#undef TLS
-
-/* Have tslib support */
-#undef TSLIB
-
-/* Support UNIX socket connections */
-#undef UNIXCONN
-
-/* NetBSD PIO alpha IO */
-#undef USE_ALPHA_PIO
-
-/* BSD AMD64 iopl */
-#undef USE_AMD64_IOPL
-
-/* BSD /dev/io */
-#undef USE_DEV_IO
-
-/* BSD i386 iopl */
-#undef USE_I386_IOPL
-
-/* Use SIGIO handlers for input device events by default */
-#undef USE_SIGIO_BY_DEFAULT
-
-/* Define to use byteswap macros from <sys/endian.h> */
-#undef USE_SYS_ENDIAN_H
-
-/* Vendor man version */
-#undef VENDOR_MAN_VERSION
-
-/* Vendor name */
-#undef VENDOR_NAME
-
-/* Vendor name */
-#undef VENDOR_NAME_SHORT
-
-/* Vendor release */
-#undef VENDOR_RELEASE
-
-/* Version number of package */
-#undef VERSION
-
-/* Building with libdrm support */
-#undef WITH_LIBDRM
-
-/* Building vgahw module */
-#undef WITH_VGAHW
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* System has wscons console */
-#undef WSCONS_SUPPORT
-
-/* Build X-ACE extension */
-#undef XACE
-
-/* Support XCMisc extension */
-#undef XCMISC
-
-/* Build Security extension */
-#undef XCSECURITY
-
-/* Support XDM Control Protocol */
-#undef XDMCP
-
-/* Support XF86 Big font extension */
-#undef XF86BIGFONT
-
-/* Name of configuration file */
-#undef XF86CONFIGFILE
-
-/* Build DRI extension */
-#undef XF86DRI
-
-/* Support XFree86 Video Mode extension */
-#undef XF86VIDMODE
-
-/* Support XFixes extension */
-#undef XFIXES
-
-/* Building loadable XFree86 server */
-#undef XFree86LOADER
-
-/* Building XFree86 server */
-#undef XFree86Server
-
-/* Build XDGA support */
-#undef XFreeXDGA
-
-/* Support Xinerama extension */
-#undef XINERAMA
-
-/* Support X Input extension */
-#undef XINPUT
-
-/* Path to XKB data */
-#undef XKB_BASE_DIRECTORY
-
-/* Path to XKB bin dir */
-#undef XKB_BIN_DIRECTORY
-
-/* Default XKB layout */
-#undef XKB_DFLT_LAYOUT
-
-/* Default XKB model */
-#undef XKB_DFLT_MODEL
-
-/* Default XKB options */
-#undef XKB_DFLT_OPTIONS
-
-/* Default XKB ruleset */
-#undef XKB_DFLT_RULES
-
-/* Default XKB variant */
-#undef XKB_DFLT_VARIANT
-
-/* Path to XKB output dir */
-#undef XKM_OUTPUT_DIR
-
-/* Building Xorg server */
-#undef XORGSERVER
-
-/* Vendor release */
-#undef XORG_DATE
-
-/* Vendor man version */
-#undef XORG_MAN_VERSION
-
-/* Building Xorg server */
-#undef XORG_SERVER
-
-/* Current Xorg version */
-#undef XORG_VERSION_CURRENT
-
-/* Have Quartz */
-#undef XQUARTZ
-
-/* Support application updating through sparkle. */
-#undef XQUARTZ_SPARKLE
-
-/* Support Record extension */
-#undef XRECORD
-
-/* Build registry module */
-#undef XREGISTRY
-
-/* Build SELinux extension */
-#undef XSELINUX
-
-/* Define to 1 if the DTrace Xserver provider probes should be built in. */
-#undef XSERVER_DTRACE
-
-/* Use libpciaccess for all pci manipulation */
-#undef XSERVER_LIBPCIACCESS
-
-/* Support XSync extension */
-#undef XSYNC
-
-/* Support XTest extension */
-#undef XTEST
-
-/* Support Xv extension */
-#undef XV
-
-/* Vendor name */
-#undef XVENDORNAME
-
-/* Short vendor name */
-#undef XVENDORNAMESHORT
-
-/* Build Xv extension */
-#undef XvExtension
-
-/* Build XvMC extension */
-#undef XvMCExtension
-
-/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
-   `char[]'. */
-#undef YYTEXT_POINTER
-
-/* Enable large inode numbers on Mac OS X 10.5.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Enable GNU and other extensions to the C environment for glibc */
-#undef _GNU_SOURCE
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if unsigned long is 64 bits. */
-#undef _XSERVER64
-
-/* Vendor web address for support */
-#undef __VENDORDWEBSUPPORT__
-
-/* Name of configuration directory */
-#undef __XCONFIGDIR__
-
-/* Name of configuration file */
-#undef __XCONFIGFILE__
-
-/* Name of X server */
-#undef __XSERVERNAME__
-
-/* Define to 16-bit byteswap macro */
-#undef bswap_16
-
-/* Define to 32-bit byteswap macro */
-#undef bswap_32
-
-/* Define to 64-bit byteswap macro */
-#undef bswap_64
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
index feea170..321fc42 100644 (file)
@@ -162,13 +162,6 @@ extern void
  ProcessOtherEvent(InternalEvent * /* ev */ ,
                    DeviceIntPtr /* other */ );
 
-extern void
- DeviceFocusEvent(DeviceIntPtr /* dev */ ,
-                  int /* type */ ,
-                  int /* mode */ ,
-                  int /* detail */ ,
-                  WindowPtr /* pWin */ );
-
 extern int
  CheckGrabValues(ClientPtr /* client */ ,
                  GrabParameters * /* param */ );
index c7f51b9..0f55d90 100644 (file)
@@ -44,10 +44,47 @@ SOFTWARE.
 
 ******************************************************************/
 
+/*
+ * 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).
+ */
+
 #ifndef EXTENSION_H
 #define EXTENSION_H
 
-_XFUNCPROTOBEGIN
+#include <X11/Xfuncproto.h>
+
+#include "dixstruct.h"
+
+typedef void (*InitExtension) (void);
+
+typedef struct {
+    InitExtension initFunc;
+    const char *name;
+    Bool *disablePtr;
+} ExtensionModule;
 
 extern _X_EXPORT unsigned short StandardMinorOpcode(ClientPtr /*client */ );
 
@@ -60,5 +97,6 @@ extern _X_EXPORT void InitExtensions(int argc, char **argv);
 
 extern _X_EXPORT void CloseDownExtensions(void);
 
-_XFUNCPROTOEND
+extern _X_EXPORT void LoadExtension(ExtensionModule *ext, Bool external);
+
 #endif                          /* EXTENSION_H */
index a048b72..7f4718f 100644 (file)
@@ -23,8 +23,29 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 ********************************************************/
 
-/********************************************************************
- * Interface of extinit.c
+/*
+ * Copyright (C) 1994-2003 The XFree86 Project, Inc.  All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, 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, FIT-
+ * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall not
+ * be used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from the XFree86 Project.
  */
 
 #ifndef EXTINIT_H
@@ -32,14 +53,133 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 #include "extnsionst.h"
 
-extern void
- XInputExtensionInit(void
-    );
+#ifdef COMPOSITE
+extern _X_EXPORT Bool noCompositeExtension;
+extern void CompositeExtensionInit(void);
+#endif
 
-extern _X_EXPORT void
- AssignTypeAndName(DeviceIntPtr /* dev */ ,
-                   Atom /* type */ ,
-                   const char * /* name */
-    );
+#ifdef DAMAGE
+extern _X_EXPORT Bool noDamageExtension;
+extern void DamageExtensionInit(void);
+#endif
 
-#endif                          /* EXTINIT_H */
+#if defined(DBE)
+extern _X_EXPORT Bool noDbeExtension;
+extern void DbeExtensionInit(void);
+#endif
+
+#ifdef DMXEXT
+extern void DMXExtensionInit(void);
+#endif
+
+#if defined(DPMSExtension)
+#include <X11/extensions/dpmsconst.h>
+extern _X_EXPORT Bool noDPMSExtension;
+extern void DPMSExtensionInit(void);
+#endif
+
+extern Bool noGEExtension;
+extern void GEExtensionInit(void);
+
+#ifdef GLXEXT
+extern _X_EXPORT Bool noGlxExtension;
+#endif
+
+#ifdef PANORAMIX
+#include <X11/extensions/panoramiXproto.h>
+extern _X_EXPORT Bool noPanoramiXExtension;
+extern void PanoramiXExtensionInit(void);
+#endif
+
+#ifdef RANDR
+extern _X_EXPORT Bool noRRExtension;
+extern void RRExtensionInit(void);
+#endif
+
+#if defined(XRECORD)
+extern void RecordExtensionInit(void);
+#endif
+
+extern _X_EXPORT Bool noRenderExtension;
+extern void RenderExtensionInit(void);
+
+#if defined(RES)
+#include <X11/extensions/XResproto.h>
+extern _X_EXPORT Bool noResExtension;
+extern void ResExtensionInit(void);
+#endif
+
+#if defined(SCREENSAVER)
+#include <X11/extensions/saver.h>
+extern _X_EXPORT Bool noScreenSaverExtension;
+extern void ScreenSaverExtensionInit(void);
+#endif
+
+#include <X11/extensions/shapeproto.h>
+extern void ShapeExtensionInit(void);
+
+#ifdef MITSHM
+#include <X11/extensions/shm.h>
+#include <X11/extensions/shmproto.h>
+extern _X_EXPORT Bool noMITShmExtension;
+extern void ShmExtensionInit(void);
+#endif
+
+extern void SyncExtensionInit(void);
+
+extern void XCMiscExtensionInit(void);
+
+#ifdef XCSECURITY
+#include <X11/extensions/secur.h>
+#include "securitysrv.h"
+extern _X_EXPORT Bool noSecurityExtension;
+extern void SecurityExtensionInit(void);
+#endif
+
+#ifdef XF86BIGFONT
+#include <X11/extensions/xf86bigfproto.h>
+extern _X_EXPORT Bool noXFree86BigfontExtension;
+extern void XFree86BigfontExtensionInit(void);
+#endif
+
+extern void BigReqExtensionInit(void);
+
+#ifdef XFIXES
+extern _X_EXPORT Bool noXFixesExtension;
+extern void XFixesExtensionInit(void);
+#endif
+
+extern void XInputExtensionInit(void);
+extern _X_EXPORT void AssignTypeAndName(DeviceIntPtr dev,
+                                        Atom type,
+                                        const char *name);
+
+#include <X11/extensions/XKB.h>
+extern void XkbExtensionInit(void);
+
+#if defined(XSELINUX)
+#include "xselinux.h"
+extern _X_EXPORT Bool noSELinuxExtension;
+extern void SELinuxExtensionInit(void);
+#endif
+
+#ifdef XTEST
+#include <X11/extensions/xtestconst.h>
+#include <X11/extensions/xtestproto.h>
+extern void XTestExtensionInit(void);
+#endif
+
+#ifdef INXQUARTZ
+extern _X_EXPORT Bool noPseudoramiXExtension;
+extern void PseudoramiXExtensionInit(void);
+#endif
+
+#if defined(XV)
+#include <X11/extensions/Xv.h>
+#include <X11/extensions/XvMC.h>
+extern _X_EXPORT Bool noXvExtension;
+extern void XvExtensionInit(void);
+extern void XvMCExtensionInit(void);
+#endif
+
+#endif
index d147df9..7786987 100644 (file)
@@ -2,7 +2,10 @@
 #ifndef _XSERV_GLOBAL_H_
 #define _XSERV_GLOBAL_H_
 
+#include <signal.h>
+
 #include "window.h"             /* for WindowPtr */
+#include "extinit.h"
 
 /* Global X server variables that are visible to mi, dix, os, and ddx */
 
@@ -23,6 +26,7 @@ extern _X_EXPORT int GrabInProgress;
 extern _X_EXPORT Bool noTestExtensions;
 extern _X_EXPORT char *SeatId;
 extern _X_EXPORT char *ConnectionInfo;
+extern _X_EXPORT sig_atomic_t inSignalContext;
 
 #ifdef DPMSExtension
 extern _X_EXPORT CARD32 DPMSStandbyTime;
@@ -38,75 +42,7 @@ extern _X_EXPORT Bool DPMSCapableFlag;
 extern _X_EXPORT Bool PanoramiXExtensionDisabledHack;
 #endif
 
-#ifdef COMPOSITE
-extern _X_EXPORT Bool noCompositeExtension;
-#endif
-
-#ifdef DAMAGE
-extern _X_EXPORT Bool noDamageExtension;
-#endif
-
-#ifdef DBE
-extern _X_EXPORT Bool noDbeExtension;
-#endif
-
-#ifdef DPMSExtension
-extern _X_EXPORT Bool noDPMSExtension;
-#endif
-
-#ifdef GLXEXT
-extern _X_EXPORT Bool noGlxExtension;
-#endif
-
-#ifdef SCREENSAVER
-extern _X_EXPORT Bool noScreenSaverExtension;
-#endif
-
-#ifdef MITSHM
-extern _X_EXPORT Bool noMITShmExtension;
-#endif
-
-#ifdef RANDR
-extern _X_EXPORT Bool noRRExtension;
-#endif
-
-extern _X_EXPORT Bool noRenderExtension;
-
-#ifdef XCSECURITY
-extern _X_EXPORT Bool noSecurityExtension;
-#endif
-
-#ifdef RES
-extern _X_EXPORT Bool noResExtension;
-#endif
-
-#ifdef XF86BIGFONT
-extern _X_EXPORT Bool noXFree86BigfontExtension;
-#endif
-
-#ifdef XFreeXDGA
-extern _X_EXPORT Bool noXFree86DGAExtension;
-#endif
-
-#ifdef XF86DRI
-extern _X_EXPORT Bool noXFree86DRIExtension;
-#endif
-
-#ifdef XF86VIDMODE
-extern _X_EXPORT Bool noXFree86VidModeExtension;
-#endif
-
-#ifdef XFIXES
-extern _X_EXPORT Bool noXFixesExtension;
-#endif
-
-#ifdef PANORAMIX
-extern _X_EXPORT Bool noPanoramiXExtension;
-#endif
-
 #ifdef XSELINUX
-extern _X_EXPORT Bool noSELinuxExtension;
-
 #define SELINUX_MODE_DEFAULT    0
 #define SELINUX_MODE_DISABLED   1
 #define SELINUX_MODE_PERMISSIVE 2
@@ -114,12 +50,4 @@ extern _X_EXPORT Bool noSELinuxExtension;
 extern _X_EXPORT int selinuxEnforcingState;
 #endif
 
-#ifdef XV
-extern _X_EXPORT Bool noXvExtension;
-#endif
-
-#ifdef DRI2
-extern _X_EXPORT Bool noDRI2Extension;
-#endif
-
 #endif                          /* !_XSERV_GLOBAL_H_ */
diff --git a/include/glx_extinit.h b/include/glx_extinit.h
new file mode 100644 (file)
index 0000000..ad4741d
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 1994-2003 The XFree86 Project, Inc.  All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, 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, FIT-
+ * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall not
+ * be used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from the XFree86 Project.
+ */
+
+#ifndef GLX_EXT_INIT_H
+#define GLX_EXT_INIT_H
+
+/* this is separate due to sdksyms pulling in extinit.h */
+#ifdef GLXEXT
+extern void GlxExtensionInit(void);
+#endif
+
+#endif
index caa3201..96b078d 100644 (file)
 #ifndef HOTPLUG_H
 #define HOTPLUG_H
 
+#include "list.h"
+
+extern _X_EXPORT void config_pre_init(void);
 extern _X_EXPORT void config_init(void);
 extern _X_EXPORT void config_fini(void);
 
+struct OdevAttribute {
+    struct xorg_list member;
+    int attrib_id;
+    char *attrib_name;
+};
+
+struct OdevAttributes {
+    struct xorg_list list;
+};
+
+struct OdevAttributes *
+config_odev_allocate_attribute_list(void);
+
+void
+config_odev_free_attribute_list(struct OdevAttributes *attribs);
+
+Bool
+config_odev_add_attribute(struct OdevAttributes *attribs, int attrib,
+                          const char *attrib_name);
+
+void
+config_odev_free_attributes(struct OdevAttributes *attribs);
+
+/* path to kernel device node - Linux e.g. /dev/dri/card0 */
+#define ODEV_ATTRIB_PATH 1
+/* system device path - Linux e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 */
+#define ODEV_ATTRIB_SYSPATH 2
+/* DRI-style bus id */
+#define ODEV_ATTRIB_BUSID 3
+
+typedef void (*config_odev_probe_proc_ptr)(struct OdevAttributes *attribs);
+void config_odev_probe(config_odev_probe_proc_ptr probe_callback);
+
+#ifdef CONFIG_UDEV_KMS
+void NewGPUDeviceRequest(struct OdevAttributes *attribs);
+void DeleteGPUDeviceRequest(struct OdevAttributes *attribs);
+#endif
 #endif                          /* HOTPLUG_H */
index 991d648..5747f3c 100644 (file)
@@ -264,7 +264,7 @@ extern _X_EXPORT Bool ActivateDevice(DeviceIntPtr /*device */ ,
 
 extern _X_EXPORT Bool DisableDevice(DeviceIntPtr /*device */ ,
                                     BOOL /* sendevent */ );
-
+extern void DisableAllDevices(void);
 extern int InitAndStartDevices(void);
 
 extern void CloseDownDevices(void);
@@ -472,6 +472,9 @@ extern _X_EXPORT int GetProximityEvents(InternalEvent *events,
 extern _X_EXPORT void QueueProximityEvents(DeviceIntPtr pDev,
                                            int type, const ValuatorMask *mask);
 
+#ifdef PANORAMIX
+_X_EXPORT
+#endif
 extern void PostSyntheticMotion(DeviceIntPtr pDev,
                                 int x, int y, int screen, unsigned long time);
 
index 841e805..5a38924 100644 (file)
@@ -591,6 +591,8 @@ typedef struct _DeviceIntRec {
 
     /* XTest related master device id */
     int xtest_master_id;
+
+    struct _SyncCounter *idle_counter;
 } DeviceIntRec;
 
 typedef struct {
index 96c0bcb..d54a207 100644 (file)
@@ -453,7 +453,7 @@ xorg_list_is_empty(struct xorg_list *head)
 #define nt_list_del(_entry, _list, _type, _member)             \
        do {                                                    \
                _type *__e = _entry;                            \
-               if (__e == NULL) break;                         \
+               if (__e == NULL || _list == NULL) break;        \
                if ((_list) == __e) {                           \
                    _list = __e->_member;                       \
                } else {                                        \
index 41c1333..3487176 100644 (file)
@@ -83,10 +83,14 @@ OF THIS SOFTWARE.
 #ifndef MAXSCREENS
 #define MAXSCREENS     16
 #endif
+#ifndef MAXGPUSCREENS
+#define MAXGPUSCREENS  16
+#endif
 #define MAXCLIENTS     256
 #define MAXEXTENSIONS   128
 #define MAXFORMATS     8
 #define MAXDEVICES     40      /* input devices */
+#define GPU_SCREEN_OFFSET 256
 
 /* 128 event opcodes for core + extension events, excluding GE */
 #define MAXEVENTS       128
@@ -228,7 +232,24 @@ pad_to_int32(const int bytes)
     return (((bytes) + 3) & ~3);
 }
 
+/**
+ * Calculate padding needed to bring the number of bytes to an even
+ * multiple of 4.
+ * @param bytes The minimum number of bytes needed.
+ * @return The bytes of padding needed to arrive at the closest multiple of 4
+ * that is equal or higher than bytes.
+ */
+static inline int
+padding_for_int32(const int bytes)
+{
+    return ((-bytes) & 3);
+}
+
+
 extern char **xstrtokenize(const char *str, const char *separators);
+extern void FormatInt64(int64_t num, char *string);
+extern void FormatUInt64(uint64_t num, char *string);
+extern void FormatUInt64Hex(uint64_t num, char *string);
 
 /**
  * Compare the two version numbers comprising of major.minor.
@@ -369,10 +390,10 @@ extern _X_EXPORT unsigned long serverGeneration;
 /* Don't use this directly, use BUG_WARN or BUG_WARN_MSG instead */
 #define __BUG_WARN_MSG(cond, with_msg, ...)                                \
           do { if (cond) {                                                \
-              ErrorF("BUG: triggered 'if (" #cond ")'\n");                \
-              ErrorF("BUG: %s:%d in %s()\n",                              \
-                      __FILE__, __LINE__, __func__);                      \
-              if (with_msg) ErrorF(__VA_ARGS__);                          \
+              ErrorFSigSafe("BUG: triggered 'if (" #cond ")'\n");          \
+              ErrorFSigSafe("BUG: %s:%u in %s()\n",                        \
+                           __FILE__, __LINE__, __func__);                 \
+              if (with_msg) ErrorFSigSafe(__VA_ARGS__);                    \
               xorg_backtrace();                                           \
           } } while(0)
 
@@ -381,4 +402,16 @@ extern _X_EXPORT unsigned long serverGeneration;
 
 #define BUG_WARN(cond)  __BUG_WARN_MSG(cond, 0, NULL)
 
+#define BUG_RETURN(cond) \
+        do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return; } } while(0)
+
+#define BUG_RETURN_MSG(cond, ...) \
+        do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return; } } while(0)
+
+#define BUG_RETURN_VAL(cond, val) \
+        do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return (val); } } while(0)
+
+#define BUG_RETURN_VAL_MSG(cond, val, ...) \
+        do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return (val); } } while(0)
+
 #endif                          /* MISC_H */
index 9ca408a..b76ab6e 100644 (file)
@@ -50,6 +50,7 @@ extern _X_EXPORT int ScreenSaverAllowExposures;
 extern _X_EXPORT int defaultScreenSaverBlanking;
 extern _X_EXPORT int defaultScreenSaverAllowExposures;
 extern _X_EXPORT char *display;
+extern _X_EXPORT int displayfd;
 
 extern _X_EXPORT int defaultBackingStore;
 extern _X_EXPORT Bool disableBackingStore;
index 4b5b440..9e323f3 100644 (file)
@@ -49,6 +49,7 @@ SOFTWARE.
 
 #include "misc.h"
 #include <stdarg.h>
+#include <stdint.h>
 #include <string.h>
 
 #define SCREEN_SAVER_ON   0
@@ -321,7 +322,8 @@ extern _X_EXPORT void
 OsCleanup(Bool);
 
 extern _X_EXPORT void
-OsVendorFatalError(void);
+OsVendorFatalError(const char *f, va_list args)
+_X_ATTRIBUTE_PRINTF(1, 0);
 
 extern _X_EXPORT void
 OsVendorInit(void);
@@ -332,6 +334,15 @@ OsBlockSignals(void);
 extern _X_EXPORT void
 OsReleaseSignals(void);
 
+extern _X_EXPORT int
+OsBlockSIGIO(void);
+
+extern _X_EXPORT void
+OsReleaseSIGIO(void);
+
+extern void
+OsResetSignals(void);
+
 extern _X_EXPORT void
 OsAbort(void)
     _X_NORETURN;
@@ -348,9 +359,13 @@ Fopen(const char *, const char *);
 extern _X_EXPORT int
 Fclose(pointer);
 #else
-#define System(a) system(a)
-#define Popen(a,b) popen(a,b)
-#define Pclose(a) pclose(a)
+
+extern const char *
+Win32TempDir(void);
+
+extern int
+System(const char *cmdline);
+
 #define Fopen(a,b) fopen(a,b)
 #define Fclose(a) fclose(a)
 #endif
@@ -578,6 +593,7 @@ typedef enum {
     X_INFO,                     /* Informational message */
     X_NONE,                     /* No prefix */
     X_NOT_IMPLEMENTED,          /* Not implemented */
+    X_DEBUG,                    /* Debug message */
     X_UNKNOWN = -1              /* unknown -- this must always be last */
 } MessageType;
 
@@ -602,6 +618,12 @@ _X_ATTRIBUTE_PRINTF(3, 4);
 extern _X_EXPORT void
 LogMessage(MessageType type, const char *format, ...)
 _X_ATTRIBUTE_PRINTF(2, 3);
+extern _X_EXPORT void
+LogMessageVerbSigSafe(MessageType type, int verb, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(3, 4);
+extern _X_EXPORT void
+LogVMessageVerbSigSafe(MessageType type, int verb, const char *format, va_list args)
+_X_ATTRIBUTE_PRINTF(3, 0);
 
 extern _X_EXPORT void
 LogVHdrMessageVerb(MessageType type, int verb,
@@ -647,6 +669,12 @@ extern _X_EXPORT void
 ErrorF(const char *f, ...)
 _X_ATTRIBUTE_PRINTF(1, 2);
 extern _X_EXPORT void
+VErrorFSigSafe(const char *f, va_list args)
+_X_ATTRIBUTE_PRINTF(1, 0);
+extern _X_EXPORT void
+ErrorFSigSafe(const char *f, ...)
+_X_ATTRIBUTE_PRINTF(1, 2);
+extern _X_EXPORT void
 LogPrintMarkers(void);
 
 extern _X_EXPORT void
index 26d737c..921a94d 100644 (file)
@@ -49,6 +49,7 @@ SOFTWARE.
 
 #include "misc.h"
 #include "screenint.h"
+#include "regionstr.h"
 
 /* types for Drawable */
 #define DRAWABLE_WINDOW 0
@@ -73,6 +74,8 @@ SOFTWARE.
 typedef struct _Drawable *DrawablePtr;
 typedef struct _Pixmap *PixmapPtr;
 
+typedef struct _PixmapDirtyUpdate *PixmapDirtyUpdatePtr;
+
 typedef union _PixUnion {
     PixmapPtr pixmap;
     unsigned long pixel;
@@ -100,13 +103,29 @@ extern _X_EXPORT PixmapPtr GetScratchPixmapHeader(ScreenPtr /*pScreen */ ,
 
 extern _X_EXPORT void FreeScratchPixmapHeader(PixmapPtr /*pPixmap */ );
 
-extern _X_EXPORT Bool CreateScratchPixmapsForScreen(int /*scrnum */ );
+extern _X_EXPORT Bool CreateScratchPixmapsForScreen(ScreenPtr /*pScreen */ );
 
-extern _X_EXPORT void FreeScratchPixmapsForScreen(int /*scrnum */ );
+extern _X_EXPORT void FreeScratchPixmapsForScreen(ScreenPtr /*pScreen */ );
 
 extern _X_EXPORT PixmapPtr AllocatePixmap(ScreenPtr /*pScreen */ ,
                                           int /*pixDataSize */ );
 
 extern _X_EXPORT void FreePixmap(PixmapPtr /*pPixmap */ );
 
+extern _X_EXPORT PixmapPtr
+PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave);
+
+extern _X_EXPORT Bool
+PixmapStartDirtyTracking(PixmapPtr src,
+                         PixmapPtr slave_dst,
+                         int x, int y);
+
+extern _X_EXPORT Bool
+PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst);
+
+/* helper function, drivers can do this themselves if they can do it more
+   efficently */
+extern _X_EXPORT Bool
+PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region);
+
 #endif                          /* PIXMAP_H */
index 0800c62..2a1ef9b 100644 (file)
@@ -50,6 +50,7 @@ SOFTWARE.
 #include "screenint.h"
 #include "regionstr.h"
 #include "privates.h"
+#include "damage.h"
 
 typedef struct _Drawable {
     unsigned char type;         /* DRAWABLE_<type> */
@@ -80,6 +81,35 @@ typedef struct _Pixmap {
     short screen_y;
 #endif
     unsigned usage_hint;        /* see CREATE_PIXMAP_USAGE_* */
+
+    PixmapPtr master_pixmap;    /* pointer to master copy of pixmap for pixmap sharing */
 } PixmapRec;
 
+typedef struct _PixmapDirtyUpdate {
+    PixmapPtr src, slave_dst;
+    int x, y;
+    DamagePtr damage;
+    struct xorg_list ent;
+} PixmapDirtyUpdateRec;
+
+static inline void
+PixmapBox(BoxPtr box, PixmapPtr pixmap)
+{
+    box->x1 = 0;
+    box->x2 = pixmap->drawable.width;
+
+    box->y1 = 0;
+    box->y2 = pixmap->drawable.height;
+}
+
+
+static inline void
+PixmapRegionInit(RegionPtr region, PixmapPtr pixmap)
+{
+    BoxRec box;
+
+    PixmapBox(&box, pixmap);
+    RegionInit(region, &box, 1);
+}
+
 #endif                          /* PIXMAPSTRUCT_H */
index c34b951..2c8864b 100644 (file)
@@ -33,9 +33,9 @@ typedef enum {
     PRIVATE_SCREEN,
     PRIVATE_EXTENSION,
     PRIVATE_COLORMAP,
+    PRIVATE_DEVICE,
 
     /* These cannot have any objects before all relevant keys are registered */
-    PRIVATE_DEVICE,
     PRIVATE_CLIENT,
     PRIVATE_PROPERTY,
     PRIVATE_SELECTION,
@@ -66,6 +66,13 @@ typedef struct _DevPrivateKeyRec {
     struct _DevPrivateKeyRec *next;
 } DevPrivateKeyRec, *DevPrivateKey;
 
+typedef struct _DevPrivateSetRec {
+    DevPrivateKey key;
+    unsigned offset;
+    int created;
+    int allocated;
+} DevPrivateSetRec, *DevPrivateSetPtr;
+
 typedef struct _DevScreenPrivateKeyRec {
     DevPrivateKeyRec screenKey;
 } DevScreenPrivateKeyRec, *DevScreenPrivateKey;
@@ -219,6 +226,51 @@ dixLookupScreenPrivateAddr(PrivatePtr *privates, const DevScreenPrivateKey key,
 }
 
 /*
+ * These functions relate to allocations related to a specific screen;
+ * space will only be available for objects allocated for use on that
+ * screen. As such, only objects which are related directly to a specific
+ * screen are candidates for allocation this way, this includes
+ * windows, pixmaps, gcs, pictures and colormaps. This key is
+ * used just like any other key using dixGetPrivate and friends.
+ *
+ * This is distinctly different from the ScreenPrivateKeys above which
+ * allocate space in global objects like cursor bits for a specific
+ * screen, allowing multiple screen-related chunks of storage in a
+ * single global object.
+ */
+
+#define HAVE_SCREEN_SPECIFIC_PRIVATE_KEYS       1
+
+extern _X_EXPORT Bool
+dixRegisterScreenSpecificPrivateKey(ScreenPtr pScreen, DevPrivateKey key,
+                                    DevPrivateType type, unsigned size);
+
+/* Clean up screen-specific privates before CloseScreen */
+extern void
+dixFreeScreenSpecificPrivates(ScreenPtr pScreen);
+
+/* Initialize screen-specific privates in AddScreen */
+extern void
+dixInitScreenSpecificPrivates(ScreenPtr pScreen);
+
+extern _X_EXPORT void *
+_dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen,
+                                     unsigned size,
+                                     unsigned clear,
+                                     unsigned offset,
+                                     DevPrivateType type);
+
+#define dixAllocateScreenObjectWithPrivates(s, t, type) _dixAllocateScreenObjectWithPrivates(s, sizeof(t), sizeof(t), offsetof(t, devPrivates), type)
+
+extern _X_EXPORT int
+dixScreenSpecificPrivatesSize(ScreenPtr pScreen, DevPrivateType type);
+
+extern _X_EXPORT void
+_dixInitScreenPrivates(ScreenPtr pScreen, PrivatePtr *privates, void *addr, DevPrivateType type);
+
+#define dixInitScreenPrivates(s, o, v, type) _dixInitScreenPrivates(s, &(o)->devPrivates, (v), type);
+
+/*
  * Allocates private data separately from main object.
  *
  * For objects created during server initialization, this allows those
@@ -240,7 +292,7 @@ extern _X_EXPORT void
  * Initialize privates by zeroing them
  */
 extern _X_EXPORT void
- _dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type);
+_dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type);
 
 #define dixInitPrivates(o, v, type) _dixInitPrivates(&(o)->devPrivates, (v), type);
 
index fa8ea64..576329a 100644 (file)
 
 /* Resource */
 #define SERVER_XRES_MAJOR_VERSION              1
-#define SERVER_XRES_MINOR_VERSION              0
+#define SERVER_XRES_MINOR_VERSION              2
 
 /* XvMC */
 #define SERVER_XVMC_MAJOR_VERSION              1
index 8778646..3bd982a 100644 (file)
@@ -101,48 +101,43 @@ typedef struct _PredictableAccelSchemeRec {
 } PredictableAccelSchemeRec, *PredictableAccelSchemePtr;
 
 extern _X_EXPORT void
- InitVelocityData(DeviceVelocityPtr vel);
+InitVelocityData(DeviceVelocityPtr vel);
 
 extern _X_EXPORT void
- InitTrackers(DeviceVelocityPtr vel, int ntracker);
+InitTrackers(DeviceVelocityPtr vel, int ntracker);
 
 extern _X_EXPORT BOOL
 ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time);
 
 extern _X_EXPORT double
-
 BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel,
                          double velocity, double threshold, double acc);
 
 extern _X_EXPORT void
- FreeVelocityData(DeviceVelocityPtr vel);
+FreeVelocityData(DeviceVelocityPtr vel);
 
 extern _X_EXPORT int
- SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
+SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
 
 extern _X_EXPORT DeviceVelocityPtr
 GetDevicePredictableAccelData(DeviceIntPtr dev);
 
 extern _X_EXPORT void
-
 SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel,
                                      PointerAccelerationProfileFunc profile);
 
 extern _X_INTERNAL void
- AccelerationDefaultCleanup(DeviceIntPtr dev);
+AccelerationDefaultCleanup(DeviceIntPtr dev);
 
 extern _X_INTERNAL Bool
-
 InitPredictableAccelerationScheme(DeviceIntPtr dev,
                                   struct _ValuatorAccelerationRec *protoScheme);
 
 extern _X_INTERNAL void
-
 acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val,
                              CARD32 evtime);
 
 extern _X_INTERNAL void
-
 acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask *val,
                              CARD32 evtime);
 
index 0680570..4a8dc31 100644 (file)
@@ -152,11 +152,42 @@ typedef Bool (*FindComplexResType) (pointer /*value */ ,
                                     XID /*id */ ,
                                     pointer /*cdata */ );
 
+/* Structure for estimating resource memory usage. Memory usage
+ * consists of space allocated for the resource itself and of
+ * references to other resources. Currently the most important use for
+ * this structure is to estimate pixmap usage of different resources
+ * more accurately. */
+typedef struct {
+    /* Size of resource itself. Zero if not implemented. */
+    unsigned long resourceSize;
+    /* Size attributed to pixmap references from the resource. */
+    unsigned long pixmapRefSize;
+    /* Number of references to this resource; typically 1 */
+    unsigned long refCnt;
+} ResourceSizeRec, *ResourceSizePtr;
+
+typedef void (*SizeType)(pointer /*value*/,
+                         XID /*id*/,
+                         ResourceSizePtr /*size*/);
+
 extern _X_EXPORT RESTYPE CreateNewResourceType(DeleteType /*deleteFunc */ ,
                                                const char * /*name */ );
 
-extern _X_EXPORT void SetResourceTypeErrorValue(RESTYPE /*type */ ,
-                                                int /*errorValue */ );
+typedef void (*FindTypeSubResources)(pointer /* value */,
+                                     FindAllRes /* func */,
+                                     pointer /* cdata */);
+
+extern _X_EXPORT SizeType GetResourceTypeSizeFunc(
+    RESTYPE /*type*/);
+
+extern _X_EXPORT void SetResourceTypeFindSubResFunc(
+    RESTYPE /*type*/, FindTypeSubResources /*findFunc*/);
+
+extern _X_EXPORT void SetResourceTypeSizeFunc(
+    RESTYPE /*type*/, SizeType /*sizeFunc*/);
+
+extern _X_EXPORT void SetResourceTypeErrorValue(
+    RESTYPE /*type*/, int /*errorValue*/);
 
 extern _X_EXPORT RESTYPE CreateNewResourceClass(void);
 
@@ -193,6 +224,15 @@ extern _X_EXPORT void FindAllClientResources(ClientPtr /*client */ ,
                                              FindAllRes /*func */ ,
                                              pointer /*cdata */ );
 
+/** @brief Iterate through all subresources of a resource.
+
+    @note The XID argument provided to the FindAllRes function
+          may be 0 for subresources that don't have an XID */
+extern _X_EXPORT void FindSubResources(pointer /*resource*/,
+                                       RESTYPE /*type*/,
+                                       FindAllRes /*func*/,
+                                       pointer /*cdata*/);
+
 extern _X_EXPORT void FreeClientNeverRetainResources(ClientPtr /*client */ );
 
 extern _X_EXPORT void FreeClientResources(ClientPtr /*client */ );
@@ -231,4 +271,17 @@ extern _X_EXPORT unsigned int GetXIDList(ClientPtr /*client */ ,
 extern _X_EXPORT RESTYPE lastResourceType;
 extern _X_EXPORT RESTYPE TypeMask;
 
-#endif                          /* RESOURCE_H */
+/** @brief A hashing function to be used for hashing resource IDs
+
+    @param id The resource ID to hash
+    @param numBits The number of bits in the resulting hash. Must be >=0.
+
+    @note This function is really only for handling
+    INITHASHSIZE..MAXHASHSIZE bit hashes, but will handle any number
+    of bits by either masking numBits lower bits of the ID or by
+    providing at most MAXHASHSIZE hashes.
+*/
+extern _X_EXPORT int HashResourceID(XID id,
+                                    int numBits);
+
+#endif /* RESOURCE_H */
index 8817471..e61cd33 100644 (file)
@@ -55,7 +55,6 @@ typedef struct _Depth *DepthPtr;
 typedef struct _Screen *ScreenPtr;
 
 extern _X_EXPORT int AddScreen(Bool (* /*pfnInit */ )(
-                                                         int /*index */ ,
                                                          ScreenPtr /*pScreen */
                                                          ,
                                                          int /*argc */ ,
@@ -63,6 +62,32 @@ extern _X_EXPORT int AddScreen(Bool (* /*pfnInit */ )(
                                int /*argc */ ,
                                char ** /*argv */ );
 
+
+extern _X_EXPORT int AddGPUScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ ,
+                                                   int /*argc */ ,
+                                                   char **      /*argv */
+                                                   ),
+                                  int argc, char **argv);
+
+extern _X_EXPORT void RemoveGPUScreen(ScreenPtr pScreen);
+
+extern _X_EXPORT void
+AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr newScreen);
+extern _X_EXPORT void
+DetachUnboundGPU(ScreenPtr unbound);
+
+extern _X_EXPORT void
+AttachOutputGPU(ScreenPtr pScreen, ScreenPtr newScreen);
+
+extern _X_EXPORT void
+DetachOutputGPU(ScreenPtr output);
+
+extern _X_EXPORT void
+AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr newScreen);
+
+extern _X_EXPORT void
+DetachOffloadGPU(ScreenPtr slave);
+
 typedef struct _ColormapRec *ColormapPtr;
 
 #endif                          /* SCREENINT_H */
index 94e3e47..d63768a 100644 (file)
@@ -95,8 +95,7 @@ typedef struct _ScreenSaverStuff {
  *  or as a local variable) can easily do so and retain full type checking.
  */
 
-typedef Bool (*CloseScreenProcPtr) (int /*index */ ,
-                                    ScreenPtr /*pScreen */ );
+typedef Bool (*CloseScreenProcPtr) (ScreenPtr /*pScreen */ );
 
 typedef void (*QueryBestSizeProcPtr) (int /*class */ ,
                                       unsigned short * /*pwidth */ ,
@@ -180,8 +179,10 @@ typedef void (*ClipNotifyProcPtr) (WindowPtr /*pWindow */ ,
 #define CREATE_PIXMAP_USAGE_BACKING_PIXMAP              2
 /* pixmap will contain a glyph */
 #define CREATE_PIXMAP_USAGE_GLYPH_PICTURE               3
+/* pixmap will be shared */
+#define CREATE_PIXMAP_USAGE_SHARED                      4
 /* _F_COMP_OVL_PATCH : pixmap will be the hw overlay pixmap */
-#define CREATE_PIXMAP_USAGE_OVERLAY                                4
+#define CREATE_PIXMAP_USAGE_OVERLAY                                5
 
 typedef PixmapPtr (*CreatePixmapProcPtr) (ScreenPtr /*pScreen */ ,
                                           int /*width */ ,
@@ -260,13 +261,11 @@ typedef void (*SendGraphicsExposeProcPtr) (ClientPtr /*client */ ,
                                            int /*major */ ,
                                            int /*minor */ );
 
-typedef void (*ScreenBlockHandlerProcPtr) (int /*screenNum */ ,
-                                           pointer /*blockData */ ,
+typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr /*pScreen*/ ,
                                            pointer /*pTimeout */ ,
                                            pointer /*pReadmask */ );
 
-typedef void (*ScreenWakeupHandlerProcPtr) (int /*screenNum */ ,
-                                            pointer /*wakeupData */ ,
+typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr /*pScreen*/ ,
                                             unsigned long /*result */ ,
                                             pointer /*pReadMask */ );
 
@@ -344,6 +343,18 @@ typedef void (*DeviceCursorCleanupProcPtr) (DeviceIntPtr /* pDev */ ,
 typedef void (*ConstrainCursorHarderProcPtr) (DeviceIntPtr, ScreenPtr, int,
                                               int *, int *);
 
+
+typedef Bool (*SharePixmapBackingProcPtr)(PixmapPtr, ScreenPtr, void **);
+
+typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *);
+
+typedef Bool (*StartPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr,
+                                           int x, int y);
+
+typedef Bool (*StopPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr);
+
+typedef Bool (*ReplaceScanoutPixmapProcPtr)(DrawablePtr, PixmapPtr, Bool);
+
 typedef struct _Screen {
     int myNum;                  /* index of this instance in Screens[] */
     ATOM id;
@@ -372,6 +383,8 @@ typedef struct _Screen {
     WindowPtr root;
     ScreenSaverStuffRec screensaver;
 
+    DevPrivateSetRec    screenSpecificPrivates[PRIVATE_LAST];
+
     /* Random screen procedures */
 
     CloseScreenProcPtr CloseScreen;
@@ -442,9 +455,6 @@ typedef struct _Screen {
     ScreenBlockHandlerProcPtr BlockHandler;
     ScreenWakeupHandlerProcPtr WakeupHandler;
 
-    pointer blockData;
-    pointer wakeupData;
-
     /* anybody can get a piece of this array */
     PrivateRec *devPrivates;
 
@@ -483,6 +493,28 @@ typedef struct _Screen {
      * malicious users to steal framebuffer's content if that would be the
      * default */
     Bool canDoBGNoneRoot;
+
+    Bool isGPU;
+
+    struct xorg_list unattached_list;
+    struct xorg_list unattached_head;
+
+    ScreenPtr current_master;
+
+    struct xorg_list output_slave_list;
+    struct xorg_list output_head;
+
+    SharePixmapBackingProcPtr SharePixmapBacking;
+    SetSharedPixmapBackingProcPtr SetSharedPixmapBacking;
+
+    StartPixmapTrackingProcPtr StartPixmapTracking;
+    StopPixmapTrackingProcPtr StopPixmapTracking;
+
+    struct xorg_list pixmap_dirty_list;
+    struct xorg_list offload_slave_list;
+    struct xorg_list offload_head;
+
+    ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap;
 } ScreenRec;
 
 static inline RegionPtr
@@ -500,6 +532,8 @@ typedef struct _ScreenInfo {
      PixmapFormatRec formats[MAXFORMATS];
     int numScreens;
     ScreenPtr screens[MAXSCREENS];
+    int numGPUScreens;
+    ScreenPtr gpuscreens[MAXGPUSCREENS];
     int x;                      /* origin */
     int y;                      /* origin */
     int width;                  /* total width of all screens together */
index c31fecd..db771f7 100644 (file)
@@ -221,7 +221,7 @@ extern _X_EXPORT Bool GestureExtensionInit(void);
 extern _X_EXPORT void ShapeExtensionInit(void);
 
 extern _X_EXPORT void SendShapeNotify(WindowPtr /* pWin */ ,
-                                      int /* which */ );
+                                      int /* which */);
 
 extern _X_EXPORT RegionPtr CreateBoundingShape(WindowPtr /* pWin */ );
 
@@ -233,4 +233,5 @@ extern _X_EXPORT void EnableMapUnmapEvents(WindowPtr /* pWin */ );
 extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, Bool enable);
 extern _X_EXPORT void PrintWindowTree(void);
 
+extern _X_EXPORT VisualPtr WindowGetVisual(WindowPtr /*pWin*/);
 #endif                          /* WINDOW_H */
index 3b72885..d584785 100644 (file)
@@ -301,13 +301,15 @@ extern _X_EXPORT const char *XkbBinDirectory;
 extern _X_EXPORT CARD32 xkbDebugFlags;
 
 #define        _XkbLibError(c,l,d)     /* Epoch fail */
+
+/* "a" is a "unique" numeric identifier that just defines which error
+ * code statement it is. _XkbErrCode2(4, foo) means "this is the 4th error
+ * statement in this function". lovely.
+ */
 #define        _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff)))
 #define        _XkbErrCode3(a,b,c)     _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c))
 #define        _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d)))
 
-extern _X_EXPORT int DeviceKeyPress, DeviceKeyRelease, DeviceMotionNotify;
-extern _X_EXPORT int DeviceButtonPress, DeviceButtonRelease;
-
 #define        Status          int
 
 extern _X_EXPORT void XkbUseMsg(void
index 2cc416a..a71b25d 100644 (file)
 /* Have getresuid */
 #undef HAVE_GETRESUID
 
+/* Have X server platform bus support */
+#undef XSERVER_PLATFORM_BUS
+
 #endif /* _XORG_CONFIG_H_ */
index 8086f32..81935be 100644 (file)
 #undef WSCONS_SUPPORT
 
 /* Loadable XFree86 server awesomeness */
-#undef XFree86LOADER
+#define XFree86LOADER
 
 /* Use libpciaccess */
 #undef XSERVER_LIBPCIACCESS
 /* X Access Control Extension */
 #undef XACE
 
+/* Have X server platform bus support */
+#undef XSERVER_PLATFORM_BUS
+
 #ifdef _LP64
 #define _XSERVER64 1
 #endif
diff --git a/m4/libtool.m4 b/m4/libtool.m4
deleted file mode 100644 (file)
index 44e0ecf..0000000
+++ /dev/null
@@ -1,7982 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 57 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
-       [m4_default([$3],
-                  [m4_fatal([Libtool version $1 or higher is required],
-                            63)])],
-       [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
-  *\ * | *\    *)
-    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    _LT_PATH_MAGIC
-  fi
-  ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PREPARE_SED_QUOTE_VARS
-# --------------------------
-# Define a few sed substitution that help us do robust quoting.
-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
-[# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-])
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from `configure', and `config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
-])# _LT_PROG_LTMAIN
-
-
-## ------------------------------------- ##
-## Accumulate code for creating libtool. ##
-## ------------------------------------- ##
-
-# So that we can recreate a full libtool script including additional
-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
-# label.
-
-
-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
-# ----------------------------------------
-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL_INIT],
-[m4_ifval([$1],
-          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
-                     [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
-
-
-# _LT_CONFIG_LIBTOOL([COMMANDS])
-# ------------------------------
-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL],
-[m4_ifval([$1],
-          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
-                     [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
-
-
-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
-# -----------------------------------------------------
-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
-[_LT_CONFIG_LIBTOOL([$1])
-_LT_CONFIG_LIBTOOL_INIT([$2])
-])
-
-
-# _LT_FORMAT_COMMENT([COMMENT])
-# -----------------------------
-# Add leading comment marks to the start of each line, and a trailing
-# full-stop to the whole comment if one is not present already.
-m4_define([_LT_FORMAT_COMMENT],
-[m4_ifval([$1], [
-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
-              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
-)])
-
-
-
-## ------------------------ ##
-## FIXME: Eliminate VARNAME ##
-## ------------------------ ##
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME.  Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
-    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
-       [m4_ifval([$1], [$1], [$2])])
-    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
-    m4_ifval([$4],
-       [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
-    lt_dict_add_subkey([lt_decl_dict], [$2],
-       [tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
-  [0], [m4_fatal([$0: too few arguments: $#])],
-  [1], [m4_fatal([$0: too few arguments: $#: $1])],
-  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
-  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
-  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
-    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
-    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
-     m4_if([$2], [],
-          m4_quote(lt_decl_varnames),
-       m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
-                       lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'.  VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly.  In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
-    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-#    # Some comment about what VAR is for.
-#    visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
-                                          [description])))[]dnl
-m4_pushdef([_libtool_name],
-    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
-    [0], [_libtool_name=[$]$1],
-    [1], [_libtool_name=$lt_[]$1],
-    [2], [_libtool_name=$lt_[]$1],
-    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
-# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
-    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'.  Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
-       dnl If the libtool generation code has been placed in $CONFIG_LT,
-       dnl instead of duplicating it all over again into config.status,
-       dnl then we will have config.status run $CONFIG_LT later, so it
-       dnl needs to know what name is stored there:
-        [AC_CONFIG_COMMANDS([libtool],
-            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
-    dnl If the libtool generation code is destined for config.status,
-    dnl expand the accumulated commands and init code now:
-    [AC_CONFIG_COMMANDS([libtool],
-        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$[]1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
-# ------------------------------------
-# Generate a child script FILE with all initialization necessary to
-# reuse the environment learned by the parent script, and make the
-# file executable.  If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins.  After this
-# macro, additional text can be appended to FILE to form the body of
-# the child script.  The macro ends with non-zero status if the
-# file could not be fully written (such as if the disk is full).
-m4_ifdef([AS_INIT_GENERATED],
-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
-[m4_defun([_LT_GENERATED_FILE_INIT],
-[m4_require([AS_PREPARE])]dnl
-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
-[lt_write_fail=0
-cat >$1 <<_ASEOF || lt_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-$2
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$1 <<\_ASEOF || lt_write_fail=1
-AS_SHELL_SANITIZE
-_AS_PREPARE
-exec AS_MESSAGE_FD>&1
-_ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
-[# Run this file to recreate a libtool stub with the current configuration.])
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-lt_cl_silent=false
-exec AS_MESSAGE_LOG_FD>>config.log
-{
-  echo
-  AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
-  -h, --help      print this help, then exit
-  -V, --version   print version number, then exit
-  -q, --quiet     do not print progress messages
-  -d, --debug     don't remove temporary files
-
-Report bugs to <bug-libtool@gnu.org>."
-
-lt_cl_version="\
-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING.
-
-Copyright (C) 2011 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test $[#] != 0
-do
-  case $[1] in
-    --version | --v* | -V )
-      echo "$lt_cl_version"; exit 0 ;;
-    --help | --h* | -h )
-      echo "$lt_cl_help"; exit 0 ;;
-    --debug | --d* | -d )
-      debug=: ;;
-    --quiet | --q* | --silent | --s* | -q )
-      lt_cl_silent=: ;;
-
-    -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
-
-    *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
-  esac
-  shift
-done
-
-if $lt_cl_silent; then
-  exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure.  Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-lt_cl_success=:
-test "$silent" = yes &&
-  lt_config_lt_args="$lt_config_lt_args --quiet"
-exec AS_MESSAGE_LOG_FD>/dev/null
-$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-exec AS_MESSAGE_LOG_FD>>config.log
-$lt_cl_success || AS_EXIT(1)
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars.  Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
-  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
-  m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options which allow our
-    # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
-      setopt NO_GLOB_SUBST
-    fi
-
-    cfgfile="${ofile}T"
-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
-    $RM "$cfgfile"
-
-    cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
-  case $host_os in
-  aix3*)
-    cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-_LT_EOF
-    ;;
-  esac
-
-  _LT_PROG_LTMAIN
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" \
-     || (rm -f "$cfgfile"; exit 1)
-
-  _LT_PROG_REPLACE_SHELLFNS
-
-   mv -f "$cfgfile" "$ofile" ||
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
-    PACKAGE='$PACKAGE'
-    VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
-    RM='$RM'
-    ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
-  [C],                 [_LT_LANG(C)],
-  [C++],               [_LT_LANG(CXX)],
-  [Go],                        [_LT_LANG(GO)],
-  [Java],              [_LT_LANG(GCJ)],
-  [Fortran 77],                [_LT_LANG(F77)],
-  [Fortran],           [_LT_LANG(FC)],
-  [Windows Resource],  [_LT_LANG(RC)],
-  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
-    [_LT_LANG($1)],
-    [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
-  [LT_SUPPORTED_TAG([$1])dnl
-  m4_append([_LT_TAGS], [$1 ])dnl
-  m4_define([_LT_LANG_]$1[_enabled], [])dnl
-  _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-m4_ifndef([AC_PROG_GO], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-############################################################
-m4_defun([AC_PROG_GO],
-[AC_LANG_PUSH(Go)dnl
-AC_ARG_VAR([GOC],     [Go compiler command])dnl
-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-AC_CHECK_TOOL(GOC, gccgo)
-if test -z "$GOC"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
-  fi
-fi
-if test -z "$GOC"; then
-  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
-fi
-])#m4_defun
-])#m4_ifndef
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
-  [LT_LANG(CXX)],
-  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
-  [LT_LANG(F77)],
-  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
-  [LT_LANG(FC)],
-  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-  [LT_LANG(GCJ)],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-    [LT_LANG(GCJ)],
-    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
-      [LT_LANG(GCJ)],
-      [m4_ifdef([AC_PROG_GCJ],
-       [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([A][M_PROG_GCJ],
-       [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([LT_PROG_GCJ],
-       [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([AC_PROG_GO],
-  [LT_LANG(GO)],
-  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
-  [LT_LANG(RC)],
-  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
-  case $host_os in
-    rhapsody* | darwin*)
-    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
-    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
-    AC_CHECK_TOOL([LIPO], [lipo], [:])
-    AC_CHECK_TOOL([OTOOL], [otool], [:])
-    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
-    _LT_DECL([], [DSYMUTIL], [1],
-      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
-    _LT_DECL([], [NMEDIT], [1],
-      [Tool to change global to local symbols on Mac OS X])
-    _LT_DECL([], [LIPO], [1],
-      [Tool to manipulate fat objects and archives on Mac OS X])
-    _LT_DECL([], [OTOOL], [1],
-      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
-    _LT_DECL([], [OTOOL64], [1],
-      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
-    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
-      [lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-       # By default we will add the -single_module flag. You can override
-       # by either setting the environment variable LT_MULTI_MODULE
-       # non-empty at configure time, or by adding -multi_module to the
-       # link flags.
-       rm -rf libconftest.dylib*
-       echo "int foo(void){return 1;}" > conftest.c
-       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
-       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-       # If there is a non-empty error log, and "single_module"
-       # appears in it, assume the flag caused a linker warning
-        if test -s conftest.err && $GREP single_module conftest.err; then
-         cat conftest.err >&AS_MESSAGE_LOG_FD
-       # Otherwise, if the output was created with a 0 exit code from
-       # the compiler, it worked.
-       elif test -f libconftest.dylib && test $_lt_result -eq 0; then
-         lt_cv_apple_cc_single_mod=yes
-       else
-         cat conftest.err >&AS_MESSAGE_LOG_FD
-       fi
-       rm -rf libconftest.dylib*
-       rm -f conftest.*
-      fi])
-
-    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
-      [lt_cv_ld_exported_symbols_list],
-      [lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-       [lt_cv_ld_exported_symbols_list=yes],
-       [lt_cv_ld_exported_symbols_list=no])
-       LDFLAGS="$save_LDFLAGS"
-    ])
-
-    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
-      [lt_cv_ld_force_load=no
-      cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
-      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
-      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
-      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
-      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
-      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
-      cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
-      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
-      _lt_result=$?
-      if test -s conftest.err && $GREP force_load conftest.err; then
-       cat conftest.err >&AS_MESSAGE_LOG_FD
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
-       lt_cv_ld_force_load=yes
-      else
-       cat conftest.err >&AS_MESSAGE_LOG_FD
-      fi
-        rm -f conftest.err libconftest.a conftest conftest.c
-        rm -rf conftest.dSYM
-    ])
-    case $host_os in
-    rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-       10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-       10.[[012]]*)
-         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-       10.*)
-         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES([TAG])
-# ---------------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
-  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_automatic, $1)=yes
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
-                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
-  else
-    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
-  fi
-  _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=func_echo_all
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    m4_if([$1], [CXX],
-[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-    fi
-],[])
-  else
-  _LT_TAGVAR(ld_shlibs, $1)=no
-  fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
-# ----------------------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-# Store the results from the different compilers for each TAGNAME.
-# Allow to override them for all tags through lt_cv_aix_libpath.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
-  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
-  lt_aix_libpath_sed='[
-      /Import File Strings/,/^$/ {
-         /^0/ {
-             s/^0  *\([^ ]*\) *$/\1/
-             p
-         }
-      }]'
-  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi],[])
-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
-  fi
-  ])
-  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
-fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[m4_divert_text([M4SH-INIT], [$1
-])])# _LT_SHELL_INIT
-
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Find how we can fake an echo command that does not interpret backslash.
-# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-AC_MSG_CHECKING([how to print strings])
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='printf %s\n'
-else
-  # Use this function as a fallback that always works.
-  func_fallback_echo ()
-  {
-    eval 'cat <<_LTECHO_EOF
-$[]1
-_LTECHO_EOF'
-  }
-  ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*" 
-}
-
-case "$ECHO" in
-  printf*) AC_MSG_RESULT([printf]) ;;
-  print*) AC_MSG_RESULT([print -r]) ;;
-  *) AC_MSG_RESULT([cat]) ;;
-esac
-
-m4_ifdef([_AS_DETECT_SUGGESTED],
-[_AS_DETECT_SUGGESTED([
-  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
-    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-    PATH=/empty FPATH=/empty; export PATH FPATH
-    test "X`printf %s $ECHO`" = "X$ECHO" \
-      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
-
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_WITH_SYSROOT
-# ----------------
-AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
-AC_ARG_WITH([sysroot],
-[  --with-sysroot[=DIR] Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).],
-[], [with_sysroot=no])
-
-dnl lt_sysroot will always be passed unquoted.  We quote it here
-dnl in case the user passed a directory name.
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
-   if test "$GCC" = yes; then
-     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-   fi
-   ;; #(
- /*)
-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-   ;; #(
- no|'')
-   ;; #(
- *)
-   AC_MSG_RESULT([${with_sysroot}])
-   AC_MSG_ERROR([The sysroot must be an absolute path.])
-   ;;
-esac
-
- AC_MSG_RESULT([${lt_sysroot:-no}])
-_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-  [AS_HELP_STRING([--disable-libtool-lock],
-    [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-       HPUX_IA64_MODE="32"
-       ;;
-      *ELF-64*)
-       HPUX_IA64_MODE="64"
-       ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
-      case `/usr/bin/file conftest.$ac_objext` in
-       *32-bit*)
-         LD="${LD-ld} -melf32bsmip"
-         ;;
-       *N32*)
-         LD="${LD-ld} -melf32bmipn32"
-         ;;
-       *64-bit*)
-         LD="${LD-ld} -melf64bmip"
-       ;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-       *32-bit*)
-         LD="${LD-ld} -32"
-         ;;
-       *N32*)
-         LD="${LD-ld} -n32"
-         ;;
-       *64-bit*)
-         LD="${LD-ld} -64"
-         ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-       case $host in
-         x86_64-*kfreebsd*-gnu)
-           LD="${LD-ld} -m elf_i386_fbsd"
-           ;;
-         x86_64-*linux*)
-           LD="${LD-ld} -m elf_i386"
-           ;;
-         ppc64-*linux*|powerpc64-*linux*)
-           LD="${LD-ld} -m elf32ppclinux"
-           ;;
-         s390x-*linux*)
-           LD="${LD-ld} -m elf_s390"
-           ;;
-         sparc64-*linux*)
-           LD="${LD-ld} -m elf32_sparc"
-           ;;
-       esac
-       ;;
-      *64-bit*)
-       case $host in
-         x86_64-*kfreebsd*-gnu)
-           LD="${LD-ld} -m elf_x86_64_fbsd"
-           ;;
-         x86_64-*linux*)
-           LD="${LD-ld} -m elf_x86_64"
-           ;;
-         ppc*-*linux*|powerpc*-*linux*)
-           LD="${LD-ld} -m elf64ppc"
-           ;;
-         s390*-*linux*|s390*-*tpf*)
-           LD="${LD-ld} -m elf64_s390"
-           ;;
-         sparc*-*linux*)
-           LD="${LD-ld} -m elf64_sparc"
-           ;;
-       esac
-       ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_PUSH(C)
-     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*)
-        case $host in
-        i?86-*-solaris*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        sparc*-*-solaris*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-        esac
-        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
-        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
-        fi
-        ;;
-      *)
-       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-         LD="${LD-ld} -64"
-       fi
-       ;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
-
-need_locks="$enable_libtool_lock"
-])# _LT_ENABLE_LOCK
-
-
-# _LT_PROG_AR
-# -----------
-m4_defun([_LT_PROG_AR],
-[AC_CHECK_TOOLS(AR, [ar], false)
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-
-AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
-  [lt_cv_ar_at_file=no
-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
-     [echo conftest.$ac_objext > conftest.lst
-      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
-      AC_TRY_EVAL([lt_ar_try])
-      if test "$ac_status" -eq 0; then
-       # Ensure the archiver fails upon bogus file names.
-       rm -f conftest.$ac_objext libconftest.a
-       AC_TRY_EVAL([lt_ar_try])
-       if test "$ac_status" -ne 0; then
-          lt_cv_ar_at_file=@
-        fi
-      fi
-      rm -f conftest.* libconftest.a
-     ])
-  ])
-
-if test "x$lt_cv_ar_at_file" = xno; then
-  archiver_list_spec=
-else
-  archiver_list_spec=$lt_cv_ar_at_file
-fi
-_LT_DECL([], [archiver_list_spec], [1],
-  [How to feed a file listing to the archiver])
-])# _LT_PROG_AR
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[_LT_PROG_AR
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
-    [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
-  darwin*)
-    lock_old_archive_extraction=yes ;;
-  *)
-    lock_old_archive_extraction=no ;;
-esac
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
-    [Commands used to build an old-style archive])
-_LT_DECL([], [lock_old_archive_extraction], [0],
-    [Whether to use a lock for old archive extraction])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $RM conftest*
-])
-
-if test x"[$]$2" = xyes; then
-    m4_if([$5], , :, [$5])
-else
-    m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                  [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $3"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
-    m4_if([$4], , :, [$4])
-else
-    m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
-  i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  mint*)
-    # On MiNT this can take a long time and run out of memory.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  os2*)
-    # The test takes a long time on OS/2.
-    lt_cv_sys_max_cmd_len=8192
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[        ]]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
-                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-             test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
-  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
-  AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
-    [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-[#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW         DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW       RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW     DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW     0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-       }
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}]
-_LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_dlunknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-    ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-    ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    AC_CHECK_LIB([dl], [dlopen],
-               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ])
-    ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-         [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-           [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
-       [AC_CHECK_FUNC([dlopen],
-             [lt_cv_dlopen="dlopen"],
-         [AC_CHECK_LIB([dl], [dlopen],
-               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-           [AC_CHECK_LIB([svld], [dlopen],
-                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-             [AC_CHECK_LIB([dld], [dld_link],
-                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
-             ])
-           ])
-         ])
-       ])
-      ])
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-         lt_cv_dlopen_self, [dnl
-         _LT_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-         lt_cv_dlopen_self_static, [dnl
-         _LT_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
-        [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
-        [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
-        [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-     fi
-   fi
-   chmod u+w . 2>&AS_MESSAGE_LOG_FD
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
-       [Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
-         [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
-  [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
-   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
-   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
-    [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP" ; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      AC_MSG_RESULT([yes])
-    else
-      AC_MSG_RESULT([no])
-    fi
-    ;;
-  *)
-    AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
-       [], [
-if test "$GCC" = yes; then
-  case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
-  esac
-  case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
-  case $lt_search_path_spec in
-  *\;*)
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
-    ;;
-  *)
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
-    ;;
-  esac
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
-      test -d "$lt_sys_path" && \
-       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
-  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
-  # AWK program above erroneously prepends '/' to C:/dos/paths
-  # for these hosts.
-  case $host_os in
-    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
-  esac
-  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[[4-9]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-          echo ' yes '
-          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-       :
-      else
-       can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[[45]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$cc_basename in
-  yes,*)
-    # gcc
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-m4_if([$1], [],[
-      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    dynamic_linker='Win32 ld.exe'
-    ;;
-
-  *,cl*)
-    # Native MSVC
-    libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
-
-    case $build_os in
-    mingw*)
-      sys_lib_search_path_spec=
-      lt_save_ifs=$IFS
-      IFS=';'
-      for lt_path in $LIB
-      do
-        IFS=$lt_save_ifs
-        # Let DOS variable expansion print the short 8.3 style file name.
-        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-      done
-      IFS=$lt_save_ifs
-      # Convert to MSYS style.
-      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
-      ;;
-    cygwin*)
-      # Convert to unix form, then to dos form, then back to unix form
-      # but this time dos style (no spaces!) so that the unix form looks
-      # like /cygdrive/c/PROGRA~1:/cygdr...
-      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      ;;
-    *)
-      sys_lib_search_path_spec="$LIB"
-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      # FIXME: find the short name or the path components, as spaces are
-      # common. (e.g. "Program Files" -> "PROGRA~1")
-      ;;
-    esac
-
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-    dynamic_linker='Win32 link.exe'
-    ;;
-
-  *)
-    # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    dynamic_linker='Win32 ld.exe'
-    ;;
-  esac
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[[23]].*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2.*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
-  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-haiku*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
-  postinstall_cmds='chmod 555 $lib'
-  # or fails outright, so override atomically:
-  install_override_mode=555
-  ;;
-
-interix[[3-9]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux # correct to gnu/linux during the next big refactor
-       else
-               version_type=irix
-       fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-
-  # Some binutils ld are patched to set DT_RUNPATH
-  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
-    [lt_cv_shlibpath_overrides_runpath=no
-    save_LDFLAGS=$LDFLAGS
-    save_libdir=$libdir
-    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
-        LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
-        [lt_cv_shlibpath_overrides_runpath=yes])])
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
-    ])
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-       shlibpath_overrides_runpath=no
-       ;;
-      *)
-       shlibpath_overrides_runpath=yes
-       ;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-       ;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
-    [Variables whose values should be saved in libtool wrapper scripts and
-    restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
-    [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
-    [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
-    [[List of archive names.  First name is the real one, the rest are links.
-    The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
-    [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [install_override_mode], [1],
-    [Permission mode override for installation of shared libraries])
-_LT_DECL([], [postinstall_cmds], [2],
-    [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
-    [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
-    [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
-    [[As "finish_cmds", except a single script fragment to be evaled but
-    not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
-    [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
-    [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
-    [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program which can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="m4_if([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           $EGREP "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
-else
-  AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
-        [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program which can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
-
-AC_ARG_WITH([gnu-ld],
-    [AS_HELP_STRING([--with-gnu-ld],
-       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
-    [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break
-       ;;
-      *)
-       test "$with_gnu_ld" != yes && break
-       ;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
-  lt_cv_ld_reload_flag,
-  [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
-      reload_cmds=false
-    fi
-    ;;
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_TAGDECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[[45]]*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    # Keep this pattern in sync with the one in func_win32_libid.
-    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  ;;
-
-cegcc*)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-haiku*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[[3-9]]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
-  case $host_os in
-  mingw* | pw32*)
-    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-      want_nocaseglob=yes
-    else
-      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
-    fi
-    ;;
-  esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
-    [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
-    [Command to use when deplibs_check_method = "file_magic"])
-_LT_DECL([], [file_magic_glob], [1],
-    [How to find potential files when deplibs_check_method = "file_magic"])
-_LT_DECL([], [want_nocaseglob], [1],
-    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-       # Check to see if the nm accepts a BSD-compat flag.
-       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-       #   nm: unknown option "B" ignored
-       # Tru64's nm complains that /dev/null is an invalid object file
-       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-       */dev/null* | *'Invalid file or object type'*)
-         lt_cv_path_NM="$tmp_nm -B"
-         break
-         ;;
-       *)
-         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-         */dev/null*)
-           lt_cv_path_NM="$tmp_nm -p"
-           break
-           ;;
-         *)
-           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-           continue # so that we can try to find one that supports BSD flags
-           ;;
-         esac
-         ;;
-       esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi])
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$DUMPBIN"; then :
-    # Let the user override the test.
-  else
-    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
-    *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
-      ;;
-    *)
-      DUMPBIN=:
-      ;;
-    esac
-  fi
-  AC_SUBST([DUMPBIN])
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
-  fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
-  [lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
-  cat conftest.out >&AS_MESSAGE_LOG_FD
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-# --------------------------------
-# how to determine the name of the shared library
-# associated with a specific link library.
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-m4_require([_LT_DECL_DLLTOOL])
-AC_CACHE_CHECK([how to associate runtime and link libraries],
-lt_cv_sharedlib_from_linklib_cmd,
-[lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
-  case `$DLLTOOL --help 2>&1` in
-  *--identify-strict*)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-    ;;
-  *)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-    ;;
-  esac
-  ;;
-*)
-  # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-  ;;
-esac
-])
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
-    [Command to associate shared and link libraries])
-])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-
-
-# _LT_PATH_MANIFEST_TOOL
-# ----------------------
-# locate the manifest tool
-m4_defun([_LT_PATH_MANIFEST_TOOL],
-[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
-  [lt_cv_path_mainfest_tool=no
-  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
-  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-    lt_cv_path_mainfest_tool=yes
-  fi
-  rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
-  MANIFEST_TOOL=:
-fi
-_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
-])# _LT_PATH_MANIFEST_TOOL
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
-  # These system don't have libm, or don't need it
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
-  ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
-  case $cc_basename in
-  nvcc*)
-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
-  esac
-
-  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
-    lt_cv_prog_compiler_rtti_exceptions,
-    [-fno-rtti -fno-exceptions], [],
-    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
-       [Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDEGRST]]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
-  ;;
-solaris*)
-  symcode='[[BDRT]]'
-  ;;
-sco3.2v5*)
-  symcode='[[DT]]'
-  ;;
-sysv4.2uw2*)
-  symcode='[[DT]]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[[ABDT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK ['"\
-"     {last_section=section; section=\$ 3};"\
-"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx]"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[    ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-       mv -f "$nlist"T "$nlist"
-      else
-       rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-         cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT@&t@_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data.  */
-# define LT@&t@_DLSYM_CONST
-#else
-# define LT@&t@_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
-         cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols.  */
-LT@&t@_DLSYM_CONST struct {
-  const char *name;
-  void       *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
-  { "@PROGRAM@", (void *) 0 },
-_LT_EOF
-         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-         cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         lt_globsym_save_LIBS=$LIBS
-         lt_globsym_save_CFLAGS=$CFLAGS
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-         if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
-           pipe_works=yes
-         fi
-         LIBS=$lt_globsym_save_LIBS
-         CFLAGS=$lt_globsym_save_CFLAGS
-       else
-         echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
-       fi
-      else
-       echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
-    fi
-  else
-    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
-  nm_file_list_spec='@'
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
-    [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
-    [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_c_name_address],
-    [lt_cv_sys_global_symbol_to_c_name_address], [1],
-    [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
-    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
-    [Transform the output of nm in a C name address pair when lib prefix is needed])
-_LT_DECL([], [nm_file_list_spec], [1],
-    [Specify filename containing input files for $NM])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-m4_if([$1], [CXX], [
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-      ;;
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
-      ;;
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-       ;;
-      *)
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       ;;
-      esac
-      ;;
-    *qnx* | *nto*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[[4-9]]*)
-       # All AIX code is PIC.
-       if test "$host_cpu" = ia64; then
-         # AIX 5 now supports IA64 processor
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-       else
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-       fi
-       ;;
-      chorus*)
-       case $cc_basename in
-       cxch68*)
-         # Green Hills C++ Compiler
-         # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-         ;;
-       esac
-       ;;
-      mingw* | cygwin* | os2* | pw32* | cegcc*)
-       # This hack is so that the source file can tell whether it is being
-       # built for inclusion in a dll (and should export symbols for example).
-       m4_if([$1], [GCJ], [],
-         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-       ;;
-      dgux*)
-       case $cc_basename in
-         ec++*)
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           ;;
-         ghcx*)
-           # Green Hills C++ Compiler
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      freebsd* | dragonfly*)
-       # FreeBSD uses GNU C++
-       ;;
-      hpux9* | hpux10* | hpux11*)
-       case $cc_basename in
-         CC*)
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-           if test "$host_cpu" != ia64; then
-             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-           fi
-           ;;
-         aCC*)
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-           case $host_cpu in
-           hppa*64*|ia64*)
-             # +Z the default
-             ;;
-           *)
-             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-             ;;
-           esac
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      interix*)
-       # This is c89, which is MS Visual C++ (no shared libs)
-       # Anyone wants to do a port?
-       ;;
-      irix5* | irix6* | nonstopux*)
-       case $cc_basename in
-         CC*)
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           # CC pic flag -KPIC is the default.
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-       case $cc_basename in
-         KCC*)
-           # KAI C++ Compiler
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-           ;;
-         ecpc* )
-           # old Intel C++ for x86_64 which still supported -KPIC.
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-           ;;
-         icpc* )
-           # Intel C++, used to be incompatible with GCC.
-           # ICC 10 doesn't accept -KPIC any more.
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-           ;;
-         pgCC* | pgcpp*)
-           # Portland Group C++ compiler
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           ;;
-         cxx*)
-           # Compaq C++
-           # Make sure the PIC flag is empty.  It appears that all Alpha
-           # Linux and Compaq Tru64 Unix objects are PIC.
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           ;;
-         xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
-           # IBM XL 8.0, 9.0 on PPC and BlueGene
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-           ;;
-         *)
-           case `$CC -V 2>&1 | sed 5q` in
-           *Sun\ C*)
-             # Sun C++ 5.9
-             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-             ;;
-           esac
-           ;;
-       esac
-       ;;
-      lynxos*)
-       ;;
-      m88k*)
-       ;;
-      mvs*)
-       case $cc_basename in
-         cxx*)
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      netbsd*)
-       ;;
-      *qnx* | *nto*)
-        # QNX uses GNU C++, but need to define -shared option too, otherwise
-        # it will coredump.
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-        ;;
-      osf3* | osf4* | osf5*)
-       case $cc_basename in
-         KCC*)
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-           ;;
-         RCC*)
-           # Rational C++ 2.4.1
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         cxx*)
-           # Digital/Compaq C++
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           # Make sure the PIC flag is empty.  It appears that all Alpha
-           # Linux and Compaq Tru64 Unix objects are PIC.
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      psos*)
-       ;;
-      solaris*)
-       case $cc_basename in
-         CC* | sunCC*)
-           # Sun C++ 4.2, 5.x and Centerline C++
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-           ;;
-         gcx*)
-           # Green Hills C++ Compiler
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      sunos4*)
-       case $cc_basename in
-         CC*)
-           # Sun C++ 4.x
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           ;;
-         lcc*)
-           # Lucid
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-       case $cc_basename in
-         CC*)
-           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           ;;
-       esac
-       ;;
-      tandem*)
-       case $cc_basename in
-         NCC*)
-           # NonStop-UX NCC 3.20
-           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      vxworks*)
-       ;;
-      *)
-       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-       ;;
-    esac
-  fi
-],
-[
-  if test "$GCC" = yes; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
-      ;;
-
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-       # +Z the default
-       ;;
-      *)
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       ;;
-      esac
-      ;;
-
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-
-    case $cc_basename in
-    nvcc*) # Cuda Compiler Driver 2.2
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
-      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
-      fi
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      m4_if([$1], [GCJ], [],
-       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-       # +Z the default
-       ;;
-      *)
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-       ;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
-      case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
-      ecc*)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
-       ;;
-      nagfor*)
-       # NAG Fortran compiler
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-       ;;
-      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-       # which looks to be a dead project)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      xl* | bgxl* | bgf* | mpixl*)
-       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-       ;;
-      *)
-       case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
-         # Sun Fortran 8.3 passes all unrecognized flags to the linker
-         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-         _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
-         ;;
-       *Sun\ F* | *Sun*Fortran*)
-         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-         ;;
-       *Sun\ C*)
-         # Sun C 5.9
-         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         ;;
-        *Intel*\ [[CF]]*Compiler*)
-         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-         ;;
-       *Portland\ Group*)
-         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-         ;;
-       esac
-       ;;
-      esac
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    rdos*)
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    unicos*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
-])
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
-    ;;
-esac
-
-AC_CACHE_CHECK([for $compiler option to produce PIC],
-  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
-  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
-    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
-    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
-       [Additional compiler flags for building library objects])
-
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
-       [How to pass a linker flag through the compiler])
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
-  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
-  $lt_tmp_static_flag,
-  [],
-  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
-       [Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-  case $host_os in
-  aix[[4-9]]*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
-    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-    ;;
-  cygwin* | mingw* | cegcc*)
-    case $cc_basename in
-    cl*)
-      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-      ;;
-    *)
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-      ;;
-    esac
-    ;;
-  *)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-    ;;
-  esac
-], [
-  runpath_var=
-  _LT_TAGVAR(allow_undefined_flag, $1)=
-  _LT_TAGVAR(always_export_symbols, $1)=no
-  _LT_TAGVAR(archive_cmds, $1)=
-  _LT_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_TAGVAR(compiler_needs_object, $1)=no
-  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  _LT_TAGVAR(hardcode_automatic, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
-  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(inherit_rpath, $1)=no
-  _LT_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_TAGVAR(module_cmds, $1)=
-  _LT_TAGVAR(module_expsym_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_TAGVAR(include_expsyms, $1)=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  _LT_TAGVAR(ld_shlibs, $1)=yes
-
-  # On some targets, GNU ld is compatible enough with the native linker
-  # that we're better off using the native interface for both.
-  lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
-    case $host_os in
-      aix*)
-       # The AIX port of GNU ld has always aspired to compatibility
-       # with the native linker.  However, as the warning in the GNU ld
-       # block says, versions before 2.19.5* couldn't really create working
-       # shared libraries, regardless of the interface used.
-       case `$LD -v 2>&1` in
-         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
-         *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
-         *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
-         *)
-           lt_use_gnu_ld_interface=yes
-           ;;
-       esac
-       ;;
-      *)
-       lt_use_gnu_ld_interface=yes
-       ;;
-    esac
-  fi
-
-  if test "$lt_use_gnu_ld_interface" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>&1` in
-      *GNU\ gold*) supports_anon_versioning=yes ;;
-      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[[3-9]]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-       _LT_TAGVAR(ld_shlibs, $1)=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-       # support --undefined.  This deserves some investigation.  FIXME
-       _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-       _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-      # as there is no search path for DLLs.
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=no
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-
-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-       # If the export-symbols file already is a .def file (1st line
-       # is EXPORTS), use it as is; otherwise, prepend...
-       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-         cp $export_symbols $output_objdir/$soname.def;
-       else
-         echo EXPORTS > $output_objdir/$soname.def;
-         cat $export_symbols >> $output_objdir/$soname.def;
-       fi~
-       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-       _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    haiku*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    interix[[3-9]]*)
-      _LT_TAGVAR(hardcode_direct, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
-      tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
-       case $cc_basename in
-         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
-       esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-        && test "$tmp_diet" = no
-      then
-       tmp_addflag=' $pic_flag'
-       tmp_sharedflag='-shared'
-       case $cc_basename,$host_cpu in
-        pgcc*)                         # Portland Group C compiler
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag'
-         ;;
-       pgf77* | pgf90* | pgf95* | pgfortran*)
-                                       # Portland Group f77 and f90 compilers
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag -Mnomain' ;;
-       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
-         tmp_addflag=' -i_dynamic' ;;
-       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
-         tmp_addflag=' -i_dynamic -nofor_main' ;;
-       ifc* | ifort*)                  # Intel Fortran compiler
-         tmp_addflag=' -nofor_main' ;;
-       lf95*)                          # Lahey Fortran 8.1
-         _LT_TAGVAR(whole_archive_flag_spec, $1)=
-         tmp_sharedflag='--shared' ;;
-       xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
-         tmp_sharedflag='-qmkshrobj'
-         tmp_addflag= ;;
-       nvcc*)  # Cuda Compiler Driver 2.2
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         _LT_TAGVAR(compiler_needs_object, $1)=yes
-         ;;
-       esac
-       case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ C*)                       # Sun C 5.9
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         _LT_TAGVAR(compiler_needs_object, $1)=yes
-         tmp_sharedflag='-G' ;;
-       *Sun\ F*)                       # Sun Fortran 8.3
-         tmp_sharedflag='-G' ;;
-       esac
-       _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-        if test "x$supports_anon_versioning" = xyes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-           echo "local: *; };" >> $output_objdir/$libname.ver~
-           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-        fi
-
-       case $cc_basename in
-       xlf* | bgf* | bgxlf* | mpixlf*)
-         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-         _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-         if test "x$supports_anon_versioning" = xyes; then
-           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-             echo "local: *; };" >> $output_objdir/$libname.ver~
-             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-         fi
-         ;;
-       esac
-      else
-        _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-       wlarc=
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-       _LT_TAGVAR(ld_shlibs, $1)=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
-       _LT_TAGVAR(ld_shlibs, $1)=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-       ;;
-       *)
-         # For security reasons, it is highly recommended that you always
-         # use absolute paths for naming shared libraries, and exclude the
-         # DT_RUNPATH tag from executables and libraries.  But doing so
-         # requires that you compile everything twice, which is a pain.
-         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-         else
-           _LT_TAGVAR(ld_shlibs, $1)=no
-         fi
-       ;;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-
-    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
-      runpath_var=
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-       # Neither direct hardcoding nor static linking is supported with a
-       # broken collect2.
-       _LT_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
-
-    aix[[4-9]]*)
-      if test "$host_cpu" = ia64; then
-       # On IA64, the linker does run time linking by default, so we don't
-       # have to do anything special.
-       aix_use_runtimelinking=no
-       exp_sym_flag='-Bexport'
-       no_entry_flag=""
-      else
-       # If we're using GNU nm, then we don't want the "-C" option.
-       # -C means demangle to AIX nm, but means don't demangle with GNU nm
-       # Also, AIX nm treats weak defined symbols like other global
-       # defined symbols, whereas GNU nm marks them as "W".
-       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-       else
-         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-       fi
-       aix_use_runtimelinking=no
-
-       # Test if we are trying to use run time linking or normal
-       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-       # need to do runtime linking.
-       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-         for ld_flag in $LDFLAGS; do
-         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-           aix_use_runtimelinking=yes
-           break
-         fi
-         done
-         ;;
-       esac
-
-       exp_sym_flag='-bexport'
-       no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      _LT_TAGVAR(archive_cmds, $1)=''
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
-      if test "$GCC" = yes; then
-       case $host_os in aix4.[[012]]|aix4.[[012]].*)
-       # We only want to do this on AIX 4.2 and lower, the check
-       # below for broken collect2 doesn't work under 4.3+
-         collect2name=`${CC} -print-prog-name=collect2`
-         if test -f "$collect2name" &&
-          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-         then
-         # We have reworked collect2
-         :
-         else
-         # We have old collect2
-         _LT_TAGVAR(hardcode_direct, $1)=unsupported
-         # It fails to find uninstalled libraries when the uninstalled
-         # path is not listed in the libpath.  Setting hardcode_minus_L
-         # to unsupported forces relinking
-         _LT_TAGVAR(hardcode_minus_L, $1)=yes
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_TAGVAR(hardcode_libdir_separator, $1)=
-         fi
-         ;;
-       esac
-       shared_flag='-shared'
-       if test "$aix_use_runtimelinking" = yes; then
-         shared_flag="$shared_flag "'${wl}-G'
-       fi
-      else
-       # not using gcc
-       if test "$host_cpu" = ia64; then
-       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-       # chokes on -Wl,-G. The following line is correct:
-         shared_flag='-G'
-       else
-         if test "$aix_use_runtimelinking" = yes; then
-           shared_flag='${wl}-G'
-         else
-           shared_flag='${wl}-bM:SRE'
-         fi
-       fi
-      fi
-
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
-       # Warning - without using the other runtime loading flags (-brtl),
-       # -berok will link without error, but may produce a broken library.
-       _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-      else
-       if test "$host_cpu" = ia64; then
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-         _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-       else
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-         # Warning - without using the other run time loading flags,
-         # -berok will link without error, but may produce a broken library.
-         _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-         _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-         if test "$with_gnu_ld" = yes; then
-           # We only use this code for GNU lds that support --whole-archive.
-           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-         else
-           # Exported symbols can be pulled into shared objects from archives
-           _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-         fi
-         _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-         # This is similar to how AIX traditionally builds its shared libraries.
-         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-       fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[[45]]*)
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      case $cc_basename in
-      cl*)
-       # Native MSVC
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-       _LT_TAGVAR(always_export_symbols, $1)=yes
-       _LT_TAGVAR(file_list_spec, $1)='@'
-       # Tell ltmain to make .lib files, not .a files.
-       libext=lib
-       # Tell ltmain to make .dll files, not .so files.
-       shrext_cmds=".dll"
-       # FIXME: Setting linknames here is a bad hack.
-       _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-         else
-           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-         fi~
-         $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-         linknames='
-       # The linker will not automatically build a static lib if we build a DLL.
-       # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-       _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-       _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-       # Don't use ranlib
-       _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-       _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-         lt_tool_outputfile="@TOOL_OUTPUT@"~
-         case $lt_outputfile in
-           *.exe|*.EXE) ;;
-           *)
-             lt_outputfile="$lt_outputfile.exe"
-             lt_tool_outputfile="$lt_tool_outputfile.exe"
-             ;;
-         esac~
-         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-           $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-           $RM "$lt_outputfile.manifest";
-         fi'
-       ;;
-      *)
-       # Assume MSVC wrapper
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-       # Tell ltmain to make .lib files, not .a files.
-       libext=lib
-       # Tell ltmain to make .dll files, not .so files.
-       shrext_cmds=".dll"
-       # FIXME: Setting linknames here is a bad hack.
-       _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-       # The linker will automatically build a .lib file if we build a DLL.
-       _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-       # FIXME: Should let the user specify the lib program.
-       _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-       ;;
-      esac
-      ;;
-
-    darwin* | rhapsody*)
-      _LT_DARWIN_LINKER_FEATURES($1)
-      ;;
-
-    dgux*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2.*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-       _LT_TAGVAR(hardcode_direct, $1)=yes
-       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-       # hardcode_minus_L: Not really in the search PATH,
-       # but as the default location of the library.
-       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       ia64*)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       esac
-      else
-       case $host_cpu in
-       hppa*64*)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       ia64*)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-       m4_if($1, [], [
-         # Older versions of the 11.00 compiler do not understand -b yet
-         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
-         _LT_LINKER_OPTION([if $CC understands -b],
-           _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-           [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
-           [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
-         [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
-         ;;
-       esac
-      fi
-      if test "$with_gnu_ld" = no; then
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_TAGVAR(hardcode_direct, $1)=no
-         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-         ;;
-       *)
-         _LT_TAGVAR(hardcode_direct, $1)=yes
-         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         _LT_TAGVAR(hardcode_minus_L, $1)=yes
-         ;;
-       esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       # Try to use the -exported_symbol ld option, if it does not
-       # work, assume that -exports_file does not work either and
-       # implicitly export all symbols.
-       # This should be the same for all languages, so no per-tag cache variable.
-       AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
-         [lt_cv_irix_exported_symbol],
-         [save_LDFLAGS="$LDFLAGS"
-          LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-          AC_LINK_IFELSE(
-            [AC_LANG_SOURCE(
-               [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
-                             [C++], [[int foo (void) { return 0; }]],
-                             [Fortran 77], [[
-      subroutine foo
-      end]],
-                             [Fortran], [[
-      subroutine foo
-      end]])])],
-             [lt_cv_irix_exported_symbol=yes],
-             [lt_cv_irix_exported_symbol=no])
-           LDFLAGS="$save_LDFLAGS"])
-       if test "$lt_cv_irix_exported_symbol" = yes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-       fi
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(inherit_rpath, $1)=yes
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-       _LT_TAGVAR(hardcode_direct, $1)=yes
-       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-       else
-         case $host_os in
-          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-            _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-            ;;
-          *)
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-            ;;
-         esac
-       fi
-      else
-       _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    os2*)
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    osf4* | osf5*)     # as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      else
-       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
-       # Both c and cxx compiler support -rpath directly
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test "$GCC" = yes; then
-       wlarc='${wl}'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-       case `$CC -V 2>&1` in
-       *"Compilers 5.0"*)
-         wlarc=''
-         _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-         ;;
-       *)
-         wlarc='${wl}'
-         _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-         ;;
-       esac
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
-       # The compiler driver will combine and reorder linker options,
-       # but understands `-z linker_flag'.  GCC discards it without `$wl',
-       # but is careful enough not to reorder.
-       # Supported since Solaris 2.6 (maybe 2.5.1?)
-       if test "$GCC" = yes; then
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-       else
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-       fi
-       ;;
-      esac
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-       # Use $CC to link under sequent, because it throws in some extra .o
-       # files that make .init and .fini sections work.
-       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-       sni)
-         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-       ;;
-       siemens)
-         ## LD is ld it makes a PLAMLIB
-         ## CC just makes a GrossModule.
-         _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-         _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-         _LT_TAGVAR(hardcode_direct, $1)=no
-        ;;
-       motorola)
-         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-       ;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4.3*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-       runpath_var=LD_RUN_PATH
-       hardcode_runpath_var=yes
-       _LT_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-
-    if test x$host_vendor = xsni; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
-       ;;
-      esac
-    fi
-  fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
-    [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_TAGVAR(archive_cmds, $1) in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
-       [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
-       [$RM conftest*
-       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-         soname=conftest
-         lib=conftest
-         libobjs=conftest.$ac_objext
-         deplibs=
-         wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
-         pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
-         compiler_flags=-v
-         linker_flags=-v
-         verstring=
-         output_objdir=.
-         libname=conftest
-         lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
-         _LT_TAGVAR(allow_undefined_flag, $1)=
-         if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
-         then
-           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-         else
-           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-         fi
-         _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-       else
-         cat conftest.err 1>&5
-       fi
-       $RM conftest*
-       ])
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
-    [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
-    [enable_shared_with_static_runtimes], [0],
-    [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
-    [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
-    [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
-    [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
-    [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
-    [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
-    [Commands used to build a loadable module if different from building
-    a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
-    [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
-    [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
-    [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
-    [Flag to hardcode $libdir into a binary during linking.
-    This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
-    [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-    DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-    DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
-    library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
-    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
-    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
-    [Set to "yes" if building a shared library automatically hardcodes DIR
-    into the library and all subsequent libraries and executables linked
-    against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
-    [Set to yes if linker adds runtime paths of dependent libraries
-    to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
-    [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [always_export_symbols], [0],
-    [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
-    [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
-    [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
-    [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
-    [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [postlink_cmds], [2],
-    [Commands necessary for finishing linking programs])
-_LT_TAGDECL([], [file_list_spec], [1],
-    [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl    [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_SYS_DYNAMIC_LINKER($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-  LT_SYS_DLOPEN_SELF
-  _LT_CMD_STRIPLIB
-
-  # Report which library types will actually be built
-  AC_MSG_CHECKING([if libtool supports shared libraries])
-  AC_MSG_RESULT([$can_build_shared])
-
-  AC_MSG_CHECKING([whether to build shared libraries])
-  test "$can_build_shared" = "no" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test "$enable_shared" = yes && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[[4-9]]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
-    fi
-    ;;
-  esac
-  AC_MSG_RESULT([$enable_shared])
-
-  AC_MSG_CHECKING([whether to build static libraries])
-  # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
-  AC_MSG_RESULT([$enable_static])
-
-  _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC="$lt_save_CC"
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-else
-  _lt_caught_CXX_error=yes
-fi
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="int some_variable = 0;"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_CFLAGS=$CFLAGS
-  lt_save_LD=$LD
-  lt_save_GCC=$GCC
-  GCC=$GXX
-  lt_save_with_gnu_ld=$with_gnu_ld
-  lt_save_path_LD=$lt_cv_path_LD
-  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-  else
-    $as_unset lt_cv_prog_gnu_ld
-  fi
-  if test -n "${lt_cv_path_LDCXX+set}"; then
-    lt_cv_path_LD=$lt_cv_path_LDCXX
-  else
-    $as_unset lt_cv_path_LD
-  fi
-  test -z "${LDCXX+set}" || LD=$LDCXX
-  CC=${CXX-"c++"}
-  CFLAGS=$CXXFLAGS
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    # We don't want -fno-exception when compiling C++ code, so set the
-    # no_builtin_flag separately
-    if test "$GXX" = yes; then
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-    else
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-    fi
-
-    if test "$GXX" = yes; then
-      # Set up default GNU C++ configuration
-
-      LT_PATH_LD
-
-      # Check if GNU C++ uses GNU ld as the underlying linker, since the
-      # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-        # If archive_cmds runs LD, not CC, wlarc should be empty
-        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-        #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
-
-        # ancient GNU ld didn't support --whole-archive et. al.
-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
-         $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-        else
-          _LT_TAGVAR(whole_archive_flag_spec, $1)=
-        fi
-      else
-        with_gnu_ld=no
-        wlarc=
-
-        # A generic and very simple default shared library creation
-        # command for GNU C++ for the case where it uses the native
-        # linker, instead of GNU ld.  If possible, this setting should
-        # overridden to take advantage of the native linker features on
-        # the platform it is being used on.
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      fi
-
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-    else
-      GXX=no
-      with_gnu_ld=no
-      wlarc=
-    fi
-
-    # PORTME: fill in a description of your system's C++ link characteristics
-    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-    _LT_TAGVAR(ld_shlibs, $1)=yes
-    case $host_os in
-      aix3*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-      aix[[4-9]]*)
-        if test "$host_cpu" = ia64; then
-          # On IA64, the linker does run time linking by default, so we don't
-          # have to do anything special.
-          aix_use_runtimelinking=no
-          exp_sym_flag='-Bexport'
-          no_entry_flag=""
-        else
-          aix_use_runtimelinking=no
-
-          # Test if we are trying to use run time linking or normal
-          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
-          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-           for ld_flag in $LDFLAGS; do
-             case $ld_flag in
-             *-brtl*)
-               aix_use_runtimelinking=yes
-               break
-               ;;
-             esac
-           done
-           ;;
-          esac
-
-          exp_sym_flag='-bexport'
-          no_entry_flag='-bnoentry'
-        fi
-
-        # When large executables or shared objects are built, AIX ld can
-        # have problems creating the table of contents.  If linking a library
-        # or program results in "error TOC overflow" add -mminimal-toc to
-        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-        _LT_TAGVAR(archive_cmds, $1)=''
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
-        if test "$GXX" = yes; then
-          case $host_os in aix4.[[012]]|aix4.[[012]].*)
-          # We only want to do this on AIX 4.2 and lower, the check
-          # below for broken collect2 doesn't work under 4.3+
-         collect2name=`${CC} -print-prog-name=collect2`
-         if test -f "$collect2name" &&
-            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-         then
-           # We have reworked collect2
-           :
-         else
-           # We have old collect2
-           _LT_TAGVAR(hardcode_direct, $1)=unsupported
-           # It fails to find uninstalled libraries when the uninstalled
-           # path is not listed in the libpath.  Setting hardcode_minus_L
-           # to unsupported forces relinking
-           _LT_TAGVAR(hardcode_minus_L, $1)=yes
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-           _LT_TAGVAR(hardcode_libdir_separator, $1)=
-         fi
-          esac
-          shared_flag='-shared'
-         if test "$aix_use_runtimelinking" = yes; then
-           shared_flag="$shared_flag "'${wl}-G'
-         fi
-        else
-          # not using gcc
-          if test "$host_cpu" = ia64; then
-         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-         # chokes on -Wl,-G. The following line is correct:
-         shared_flag='-G'
-          else
-           if test "$aix_use_runtimelinking" = yes; then
-             shared_flag='${wl}-G'
-           else
-             shared_flag='${wl}-bM:SRE'
-           fi
-          fi
-        fi
-
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
-        # It seems that -bexpall does not export symbols beginning with
-        # underscore (_), so it is better to generate a list of symbols to
-       # export.
-        _LT_TAGVAR(always_export_symbols, $1)=yes
-        if test "$aix_use_runtimelinking" = yes; then
-          # Warning - without using the other runtime loading flags (-brtl),
-          # -berok will link without error, but may produce a broken library.
-          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-          # Determine the default libpath from the value encoded in an empty
-          # executable.
-          _LT_SYS_MODULE_PATH_AIX([$1])
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-        else
-          if test "$host_cpu" = ia64; then
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-           _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-          else
-           # Determine the default libpath from the value encoded in an
-           # empty executable.
-           _LT_SYS_MODULE_PATH_AIX([$1])
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-           # Warning - without using the other run time loading flags,
-           # -berok will link without error, but may produce a broken library.
-           _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-           _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-           if test "$with_gnu_ld" = yes; then
-             # We only use this code for GNU lds that support --whole-archive.
-             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-           else
-             # Exported symbols can be pulled into shared objects from archives
-             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-           fi
-           _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-           # This is similar to how AIX traditionally builds its shared
-           # libraries.
-           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-          fi
-        fi
-        ;;
-
-      beos*)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-         # support --undefined.  This deserves some investigation.  FIXME
-         _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       else
-         _LT_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-
-      chorus*)
-        case $cc_basename in
-          *)
-         # FIXME: insert proper C++ library support
-         _LT_TAGVAR(ld_shlibs, $1)=no
-         ;;
-        esac
-        ;;
-
-      cygwin* | mingw* | pw32* | cegcc*)
-       case $GXX,$cc_basename in
-       ,cl* | no,cl*)
-         # Native MSVC
-         # hardcode_libdir_flag_spec is actually meaningless, as there is
-         # no search path for DLLs.
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-         _LT_TAGVAR(always_export_symbols, $1)=yes
-         _LT_TAGVAR(file_list_spec, $1)='@'
-         # Tell ltmain to make .lib files, not .a files.
-         libext=lib
-         # Tell ltmain to make .dll files, not .so files.
-         shrext_cmds=".dll"
-         # FIXME: Setting linknames here is a bad hack.
-         _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-             $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-           else
-             $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-           fi~
-           $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-           linknames='
-         # The linker will not automatically build a static lib if we build a DLL.
-         # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-         # Don't use ranlib
-         _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-         _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-           lt_tool_outputfile="@TOOL_OUTPUT@"~
-           case $lt_outputfile in
-             *.exe|*.EXE) ;;
-             *)
-               lt_outputfile="$lt_outputfile.exe"
-               lt_tool_outputfile="$lt_tool_outputfile.exe"
-               ;;
-           esac~
-           func_to_tool_file "$lt_outputfile"~
-           if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-             $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-             $RM "$lt_outputfile.manifest";
-           fi'
-         ;;
-       *)
-         # g++
-         # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-         # as there is no search path for DLLs.
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
-         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-         _LT_TAGVAR(always_export_symbols, $1)=no
-         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-         if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-           # If the export-symbols file already is a .def file (1st line
-           # is EXPORTS), use it as is; otherwise, prepend...
-           _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-             cp $export_symbols $output_objdir/$soname.def;
-           else
-             echo EXPORTS > $output_objdir/$soname.def;
-             cat $export_symbols >> $output_objdir/$soname.def;
-           fi~
-           $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-         else
-           _LT_TAGVAR(ld_shlibs, $1)=no
-         fi
-         ;;
-       esac
-       ;;
-      darwin* | rhapsody*)
-        _LT_DARWIN_LINKER_FEATURES($1)
-       ;;
-
-      dgux*)
-        case $cc_basename in
-          ec++*)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          ghcx*)
-           # Green Hills C++ Compiler
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          *)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-        esac
-        ;;
-
-      freebsd2.*)
-        # C++ shared libraries reported to be fairly broken before
-       # switch to ELF
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      freebsd-elf*)
-        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-        ;;
-
-      freebsd* | dragonfly*)
-        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-        # conventions
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-        ;;
-
-      gnu*)
-        ;;
-
-      haiku*)
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        ;;
-
-      hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-                                            # but as the default
-                                            # location of the library.
-
-        case $cc_basename in
-          CC*)
-            # FIXME: insert proper C++ library support
-            _LT_TAGVAR(ld_shlibs, $1)=no
-            ;;
-          aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            # Commands to make compiler produce verbose output that lists
-            # what "hidden" libraries, object files and flags are used when
-            # linking a shared library.
-            #
-            # There doesn't appear to be a way to prevent this compiler from
-            # explicitly linking system object files so we need to strip them
-            # from the output so that they don't get included in the library
-            # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-            ;;
-          *)
-            if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            else
-              # FIXME: insert proper C++ library support
-              _LT_TAGVAR(ld_shlibs, $1)=no
-            fi
-            ;;
-        esac
-        ;;
-
-      hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-          case $host_cpu in
-            hppa*64*|ia64*)
-              ;;
-            *)
-             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-              ;;
-          esac
-        fi
-        case $host_cpu in
-          hppa*64*|ia64*)
-            _LT_TAGVAR(hardcode_direct, $1)=no
-            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-            ;;
-          *)
-            _LT_TAGVAR(hardcode_direct, $1)=yes
-            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-                                                # but as the default
-                                                # location of the library.
-            ;;
-        esac
-
-        case $cc_basename in
-          CC*)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          aCC*)
-           case $host_cpu in
-             hppa*64*)
-               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-               ;;
-             ia64*)
-               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-               ;;
-             *)
-               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-               ;;
-           esac
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-           ;;
-          *)
-           if test "$GXX" = yes; then
-             if test $with_gnu_ld = no; then
-               case $host_cpu in
-                 hppa*64*)
-                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-                   ;;
-                 ia64*)
-                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-                   ;;
-                 *)
-                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-                   ;;
-               esac
-             fi
-           else
-             # FIXME: insert proper C++ library support
-             _LT_TAGVAR(ld_shlibs, $1)=no
-           fi
-           ;;
-        esac
-        ;;
-
-      interix[[3-9]]*)
-       _LT_TAGVAR(hardcode_direct, $1)=no
-       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-       # Instead, shared libraries are loaded at an image base (0x10000000 by
-       # default) and relocated if they conflict, which is a slow very memory
-       # consuming and fragmenting process.  To avoid this, we pick a random,
-       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-       ;;
-      irix5* | irix6*)
-        case $cc_basename in
-          CC*)
-           # SGI C++
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-
-           # Archives containing C++ object files must be created using
-           # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-           # necessary to make sure instantiated templates are included
-           # in the archive.
-           _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
-           ;;
-          *)
-           if test "$GXX" = yes; then
-             if test "$with_gnu_ld" = no; then
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-             else
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
-             fi
-           fi
-           _LT_TAGVAR(link_all_deplibs, $1)=yes
-           ;;
-        esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(inherit_rpath, $1)=yes
-        ;;
-
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-        case $cc_basename in
-          KCC*)
-           # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-           # KCC will only create a shared library if the output file
-           # ends with ".so" (or ".sl" for HP-UX), so rename the library
-           # to its proper name (with version) after linking.
-           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-           # Archives containing C++ object files must be created using
-           # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-           ;;
-         icpc* | ecpc* )
-           # Intel C++
-           with_gnu_ld=yes
-           # version 8.0 and above of icpc choke on multiply defined symbols
-           # if we add $predep_objects and $postdep_objects, however 7.1 and
-           # earlier do not add the objects themselves.
-           case `$CC -V 2>&1` in
-             *"Version 7."*)
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-               ;;
-             *)  # Version 8.0 or newer
-               tmp_idyn=
-               case $host_cpu in
-                 ia64*) tmp_idyn=' -i_dynamic';;
-               esac
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-               ;;
-           esac
-           _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-           ;;
-          pgCC* | pgcpp*)
-            # Portland Group C++ compiler
-           case `$CC -V` in
-           *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
-             _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
-             _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-               $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-               $RANLIB $oldlib'
-             _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-             _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-             ;;
-           *) # Version 6 and above use weak symbols
-             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-             ;;
-           esac
-
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-            ;;
-         cxx*)
-           # Compaq C++
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-           runpath_var=LD_RUN_PATH
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
-           ;;
-         xl* | mpixl* | bgxl*)
-           # IBM XL 8.0 on PPC, with GNU ld
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-           _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-           if test "x$supports_anon_versioning" = xyes; then
-             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-               cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-               echo "local: *; };" >> $output_objdir/$libname.ver~
-               $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-           fi
-           ;;
-         *)
-           case `$CC -V 2>&1 | sed 5q` in
-           *Sun\ C*)
-             # Sun C++ 5.9
-             _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-             _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-             _LT_TAGVAR(compiler_needs_object, $1)=yes
-
-             # Not sure whether something based on
-             # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-             # would be better.
-             output_verbose_link_cmd='func_echo_all'
-
-             # Archives containing C++ object files must be created using
-             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-             # necessary to make sure instantiated templates are included
-             # in the archive.
-             _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-             ;;
-           esac
-           ;;
-       esac
-       ;;
-
-      lynxos*)
-        # FIXME: insert proper C++ library support
-       _LT_TAGVAR(ld_shlibs, $1)=no
-       ;;
-
-      m88k*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-       ;;
-
-      mvs*)
-        case $cc_basename in
-          cxx*)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-         *)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-       esac
-       ;;
-
-      netbsd*)
-        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-         wlarc=
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-         _LT_TAGVAR(hardcode_direct, $1)=yes
-         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-       fi
-       # Workaround some broken pre-1.5 toolchains
-       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-       ;;
-
-      *nto* | *qnx*)
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-       ;;
-
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-       _LT_TAGVAR(ld_shlibs, $1)=no
-       ;;
-
-      openbsd*)
-       if test -f /usr/libexec/ld.so; then
-         _LT_TAGVAR(hardcode_direct, $1)=yes
-         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-         if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-           _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-         fi
-         output_verbose_link_cmd=func_echo_all
-       else
-         _LT_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-
-      osf3* | osf4* | osf5*)
-        case $cc_basename in
-          KCC*)
-           # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-           # KCC will only create a shared library if the output file
-           # ends with ".so" (or ".sl" for HP-UX), so rename the library
-           # to its proper name (with version) after linking.
-           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-           # Archives containing C++ object files must be created using
-           # the KAI C++ compiler.
-           case $host in
-             osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
-             *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
-           esac
-           ;;
-          RCC*)
-           # Rational C++ 2.4.1
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          cxx*)
-           case $host in
-             osf3*)
-               _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-               ;;
-             *)
-               _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-                 echo "-hidden">> $lib.exp~
-                 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-                 $RM $lib.exp'
-               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-               ;;
-           esac
-
-           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           #
-           # There doesn't appear to be a way to prevent this compiler from
-           # explicitly linking system object files so we need to strip them
-           # from the output so that they don't get included in the library
-           # dependencies.
-           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-           ;;
-         *)
-           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-             _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-             case $host in
-               osf3*)
-                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-                 ;;
-               *)
-                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-                 ;;
-             esac
-
-             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-             # Commands to make compiler produce verbose output that lists
-             # what "hidden" libraries, object files and flags are used when
-             # linking a shared library.
-             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-           else
-             # FIXME: insert proper C++ library support
-             _LT_TAGVAR(ld_shlibs, $1)=no
-           fi
-           ;;
-        esac
-        ;;
-
-      psos*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      sunos4*)
-        case $cc_basename in
-          CC*)
-           # Sun C++ 4.x
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          lcc*)
-           # Lucid
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          *)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-        esac
-        ;;
-
-      solaris*)
-        case $cc_basename in
-          CC* | sunCC*)
-           # Sun C++ 4.2, 5.x and Centerline C++
-            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
-           _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-           _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-             $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-           case $host_os in
-             solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-             *)
-               # The compiler driver will combine and reorder linker options,
-               # but understands `-z linker_flag'.
-               # Supported since Solaris 2.6 (maybe 2.5.1?)
-               _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-               ;;
-           esac
-           _LT_TAGVAR(link_all_deplibs, $1)=yes
-
-           output_verbose_link_cmd='func_echo_all'
-
-           # Archives containing C++ object files must be created using
-           # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-           # necessary to make sure instantiated templates are included
-           # in the archive.
-           _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-           ;;
-          gcx*)
-           # Green Hills C++ Compiler
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-           # The C++ compiler must be used to create the archive.
-           _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-           ;;
-          *)
-           # GNU C++ compiler with Solaris linker
-           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-             _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-             if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-                 $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-               # Commands to make compiler produce verbose output that lists
-               # what "hidden" libraries, object files and flags are used when
-               # linking a shared library.
-               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-             else
-               # g++ 2.7 appears to require `-G' NOT `-shared' on this
-               # platform.
-               _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-               # Commands to make compiler produce verbose output that lists
-               # what "hidden" libraries, object files and flags are used when
-               # linking a shared library.
-               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-             fi
-
-             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-             case $host_os in
-               solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-               *)
-                 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-                 ;;
-             esac
-           fi
-           ;;
-        esac
-        ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      case $cc_basename in
-        CC*)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-      esac
-      ;;
-
-      sysv5* | sco3.2v5* | sco5v6*)
-       # Note: We can NOT use -z defs as we might desire, because we do not
-       # link with -lc, and that would cause any symbols used from libc to
-       # always be unresolved, which means just about no library would
-       # ever link correctly.  If we're not using GNU ld we use -z text
-       # though, which does catch some bad symbols but isn't as heavy-handed
-       # as -z defs.
-       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-       _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
-       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-       _LT_TAGVAR(link_all_deplibs, $1)=yes
-       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-       runpath_var='LD_RUN_PATH'
-
-       case $cc_basename in
-          CC*)
-           _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
-             '"$_LT_TAGVAR(old_archive_cmds, $1)"
-           _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
-             '"$_LT_TAGVAR(reload_cmds, $1)"
-           ;;
-         *)
-           _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-           ;;
-       esac
-      ;;
-
-      tandem*)
-        case $cc_basename in
-          NCC*)
-           # NonStop-UX NCC 3.20
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-          *)
-           # FIXME: insert proper C++ library support
-           _LT_TAGVAR(ld_shlibs, $1)=no
-           ;;
-        esac
-        ;;
-
-      vxworks*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      *)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-    esac
-
-    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-    _LT_TAGVAR(GCC, $1)="$GXX"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_FUNC_STRIPNAME_CNF
-# ----------------------
-# func_stripname_cnf prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-#
-# This function is identical to the (non-XSI) version of func_stripname,
-# except this one can be used by m4 code that may be executed by configure,
-# rather than the libtool script.
-m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
-AC_REQUIRE([_LT_DECL_SED])
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
-func_stripname_cnf ()
-{
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-  esac
-} # func_stripname_cnf
-])# _LT_FUNC_STRIPNAME_CNF
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library.  It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-_LT_EOF
-], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
-package foo
-func foo() {
-}
-_LT_EOF
-])
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
-        prev=$p
-        continue
-       fi
-
-       # Expand the sysroot to ease extracting the directories later.
-       if test -z "$prev"; then
-         case $p in
-         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
-         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
-         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
-         esac
-       fi
-       case $p in
-       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
-       esac
-       if test "$pre_test_object_deps_done" = no; then
-        case ${prev} in
-        -L | -R)
-          # Internal compiler library paths should come after those
-          # provided the user.  The postdeps already come after the
-          # user supplied libs so there is no need to process them.
-          if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-            _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-          else
-            _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
-          fi
-          ;;
-        # The "-l" case would never come before the object being
-        # linked, so don't bother handling this case.
-        esac
-       else
-        if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-          _LT_TAGVAR(postdeps, $1)="${prev}${p}"
-        else
-          _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
-        fi
-       fi
-       prev=
-       ;;
-
-    *.lto.$objext) ;; # Ignore GCC LTO objects
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-        pre_test_object_deps_done=yes
-        continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-        if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-          _LT_TAGVAR(predep_objects, $1)="$p"
-        else
-          _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
-        fi
-       else
-        if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-          _LT_TAGVAR(postdep_objects, $1)="$p"
-        else
-          _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
-        fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  _LT_TAGVAR(predep_objects,$1)=
-  _LT_TAGVAR(postdep_objects,$1)=
-  _LT_TAGVAR(postdeps,$1)=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
-    [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
-    [Dependencies to place before and after the objects being linked to
-    create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
-    [The library search path used internally by the compiler when linking
-    a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
-  _lt_disable_F77=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
-  lt_save_GCC=$GCC
-  lt_save_CFLAGS=$CFLAGS
-  CC=${F77-"f77"}
-  CFLAGS=$FFLAGS
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-  GCC=$G77
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test "$enable_shared" = yes && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-         test "$enable_shared" = yes && enable_static=no
-       fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)="$G77"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-  CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_LANG_PUSH(Fortran)
-
-if test -z "$FC" || test "X$FC" = "Xno"; then
-  _lt_disable_FC=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
-  lt_save_GCC=$GCC
-  lt_save_CFLAGS=$CFLAGS
-  CC=${FC-"f95"}
-  CFLAGS=$FCFLAGS
-  compiler=$CC
-  GCC=$ac_cv_fc_compiler_gnu
-
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test "$enable_shared" = yes && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-         test "$enable_shared" = yes && enable_static=no
-       fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-CFLAGS=$GCJFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-
-  _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_GO_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Go compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GO_CONFIG],
-[AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
-
-# Source file extension for Go test sources.
-ac_ext=go
-
-# Object file extension for compiled Go test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="package main; func main() { }"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='package main; func main() { }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GOC-"gccgo"}
-CFLAGS=$GOFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# Go did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-
-  _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GO_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-CFLAGS=
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
-  :
-  _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
-  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
-    [AC_CHECK_TOOL(GCJ, gcj,)
-      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-      AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_GO
-# ----------
-AC_DEFUN([LT_PROG_GO],
-[AC_CHECK_TOOL(GOC, gccgo,)
-])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-# _LT_DECL_DLLTOOL
-# ----------------
-# Ensure DLLTOOL variable is set.
-m4_defun([_LT_DECL_DLLTOOL],
-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
-AC_SUBST([DLLTOOL])
-])
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
-    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
-    done
-  done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
-  fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([    ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary parameter first.
-    func_stripname_result=${3}
-    func_stripname_result=${func_stripname_result#"${1}"}
-    func_stripname_result=${func_stripname_result%"${2}"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
-    func_split_long_opt_name=${1%%=*}
-    func_split_long_opt_arg=${1#*=}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
-    func_split_short_opt_arg=${1#??}
-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
-    case ${1} in
-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-      *)    func_lo2o_result=${1} ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
-
-  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
-
-  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
-    func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
-    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
-# _LT_PATH_CONVERSION_FUNCTIONS
-# -----------------------------
-# Determine which file name conversion functions should be used by
-# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
-# for certain cross-compile configurations and native mingw.
-m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_MSG_CHECKING([how to convert $build file names to $host format])
-AC_CACHE_VAL(lt_cv_to_host_file_cmd,
-[case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-        ;;
-    esac
-    ;;
-  *-*-cygwin* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_noop
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-        ;;
-    esac
-    ;;
-  * ) # unhandled hosts (and "normal" native builds)
-    lt_cv_to_host_file_cmd=func_convert_file_noop
-    ;;
-esac
-])
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
-_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
-         [0], [convert $build file names to $host format])dnl
-
-AC_MSG_CHECKING([how to convert $build file names to toolchain format])
-AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
-[#assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-        ;;
-    esac
-    ;;
-esac
-])
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
-_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
-         [0], [convert $build files to toolchain format])dnl
-])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
deleted file mode 100644 (file)
index 5d9acd8..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-# Helper functions for option handling.                    -*- Autoconf -*-
-#
-#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-#   Inc.
-#   Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 7 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
-        _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-           [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
-                     [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME.  If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-    [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
-  dnl
-  dnl Simply set some default values (i.e off) if boolean options were not
-  dnl specified:
-  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
-  ])
-  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
-  ])
-  dnl
-  dnl If no reference was made to various pairs of opposing options, then
-  dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
-  dnl archives by default:
-  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
-  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-                  [_LT_ENABLE_FAST_INSTALL])
-  ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## Macros to handle LT_INIT options. ##
-## --------------------------------- ##
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS],      [1], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
-    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-       [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_shared=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
-    _LT_DECL([build_libtool_libs], [enable_shared], [0],
-       [Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
-    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-       [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_static=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
-    _LT_DECL([build_old_libs], [enable_static], [0],
-       [Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
-    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_fast_install=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
-        [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
-       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [lt_p=${PACKAGE-default}
-    case $withval in
-    yes|no) pic_mode=$withval ;;
-    *)
-      pic_mode=default
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for lt_pkg in $withval; do
-       IFS="$lt_save_ifs"
-       if test "X$lt_pkg" = "X$lt_p"; then
-         pic_mode=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-## ----------------- ##
-## LTDL_INIT Options ##
-## ----------------- ##
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
-                [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
-                [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
-                [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
-                [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
-                [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
deleted file mode 100644 (file)
index 9000a05..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
-       [$#], [2], [[$2]],
-       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
-       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
-       [$#], 1, [],
-       [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
-          m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
-       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
-            [m4_foreach([_Lt_suffix],
-               ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
-       [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
-         [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
-                [lt_append([$1], [$2], [$3])$4],
-                [$5])],
-         [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
-       m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
-    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
-       [$5],
-    [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
-  [lt_join(m4_quote(m4_default([$4], [[, ]])),
-           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
-                     [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
deleted file mode 100644 (file)
index 07a8602..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers                      -*- Autoconf -*-
-#
-#   Copyright (C) 2004 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# @configure_input@
-
-# serial 3337 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
deleted file mode 100644 (file)
index c573da9..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
-#
-#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else.  This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION],  [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP],             [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],        [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT],         [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],    [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN],           [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR],             [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL],    [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN],           [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER],       [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK],               [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],        [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],    [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],    [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR],         [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR],            [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],  [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC],             [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU],            [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG],    [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD],   [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP],          [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED],            [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME],           [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE],  [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE],    [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL],          [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP],          [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN],                [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],     [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG],          [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL],   [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX],           [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77],           [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ],           [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],  [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG],      [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG],    [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG],    [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],    [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG],     [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG],         [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C],       [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],        [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP],                [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],        [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH],   [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77],              [AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC],               [AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX],              [AC_DEFUN([_LT_PROG_CXX])])
index 0cd9b94..8d243d6 100644 (file)
@@ -127,6 +127,13 @@ Not obeyed by all servers.
 .B \-core
 causes the server to generate a core dump on fatal errors.
 .TP 8
+.B \-displayfd \fIfd\fP
+specifies a file descriptor in the launching process.  Rather than specify
+a display number, the X server will attempt to listen on successively higher
+display numbers, and upon finding a free one, will write the port number back
+on this file descriptor as a newline-terminated string.  The \-pn option is
+ignored when using \-displayfd.
+.TP 8
 .B \-deferglyphs \fIwhichfonts\fP
 specifies the types of fonts for which the server should attempt to use
 deferred glyph loading.  \fIwhichfonts\fP can be all (all fonts),
diff --git a/mi/mibstore.c b/mi/mibstore.c
new file mode 100644 (file)
index 0000000..6cadb2b
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2007 Red Hat, 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 (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+#include "scrnintstr.h"
+#include "mibstore.h"
+
+/*
+ * There is no longer an mi implementation of backing store.  This function
+ * is only for source compatibility with old drivers.
+ *
+ * Note though that you do get backing store for free if your server has
+ * Composite enabled, since the automatic redirection mechanism provides
+ * essentially the same functionality.  See compChangeWindowAttributes()
+ * for the implementation.
+ */
+
+void
+miInitializeBackingStore(ScreenPtr pScreen)
+{
+}
index 24b9a70..edca969 100644 (file)
@@ -56,14 +56,12 @@ in this Software without prior written authorization from The Open Group.
 static DevPrivateKeyRec miDCScreenKeyRec;
 
 #define miDCScreenKey (&miDCScreenKeyRec)
-static DevScreenPrivateKeyRec miDCCursorBitsKeyRec;
 
-#define miDCCursorBitsKey (&miDCCursorBitsKeyRec)
 static DevScreenPrivateKeyRec miDCDeviceKeyRec;
 
 #define miDCDeviceKey (&miDCDeviceKeyRec)
 
-static Bool miDCCloseScreen(int index, ScreenPtr pScreen);
+static Bool miDCCloseScreen(ScreenPtr pScreen);
 
 /* per device private data */
 typedef struct {
@@ -86,18 +84,15 @@ typedef struct {
  */
 typedef struct {
     CloseScreenProcPtr CloseScreen;
-} miDCScreenRec, *miDCScreenPtr;
-
-#define miGetDCScreen(s)       ((miDCScreenPtr)(dixLookupPrivate(&(s)->devPrivates, miDCScreenKey)))
-
-/* per-cursor per-screen private data */
-typedef struct {
     PixmapPtr sourceBits;       /* source bits */
     PixmapPtr maskBits;         /* mask bits */
 #ifdef ARGB_CURSOR
     PicturePtr pPicture;
 #endif
-} miDCCursorRec, *miDCCursorPtr;
+    CursorPtr pCursor;
+} miDCScreenRec, *miDCScreenPtr;
+
+#define miGetDCScreen(s)       ((miDCScreenPtr)(dixLookupPrivate(&(s)->devPrivates, miDCScreenKey)))
 
 Bool
 miDCInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
@@ -105,13 +100,11 @@ miDCInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
     miDCScreenPtr pScreenPriv;
 
     if (!dixRegisterPrivateKey(&miDCScreenKeyRec, PRIVATE_SCREEN, 0) ||
-        !dixRegisterScreenPrivateKey(&miDCCursorBitsKeyRec, pScreen,
-                                     PRIVATE_CURSOR_BITS, 0) ||
         !dixRegisterScreenPrivateKey(&miDCDeviceKeyRec, pScreen, PRIVATE_DEVICE,
                                      0))
         return FALSE;
 
-    pScreenPriv = malloc(sizeof(miDCScreenRec));
+    pScreenPriv = calloc(1, sizeof(miDCScreenRec));
     if (!pScreenPriv)
         return FALSE;
 
@@ -127,57 +120,60 @@ miDCInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
     return TRUE;
 }
 
+static void
+miDCSwitchScreenCursor(ScreenPtr pScreen, CursorPtr pCursor, PixmapPtr sourceBits, PixmapPtr maskBits, PicturePtr pPicture)
+{
+    miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey);
+
+    if (pScreenPriv->sourceBits)
+        (*pScreen->DestroyPixmap)(pScreenPriv->sourceBits);
+    pScreenPriv->sourceBits = sourceBits;
+
+    if (pScreenPriv->maskBits)
+        (*pScreen->DestroyPixmap)(pScreenPriv->maskBits);
+    pScreenPriv->maskBits = maskBits;
+
+#ifdef ARGB_CURSOR
+    if (pScreenPriv->pPicture)
+        FreePicture(pScreenPriv->pPicture, 0);
+    pScreenPriv->pPicture = pPicture;
+#endif
+
+    pScreenPriv->pCursor = pCursor;
+}
+
 static Bool
-miDCCloseScreen(int index, ScreenPtr pScreen)
+miDCCloseScreen(ScreenPtr pScreen)
 {
     miDCScreenPtr pScreenPriv;
 
     pScreenPriv = (miDCScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                                    miDCScreenKey);
     pScreen->CloseScreen = pScreenPriv->CloseScreen;
+
+    miDCSwitchScreenCursor(pScreen, NULL, NULL, NULL, NULL);
     free((pointer) pScreenPriv);
-    return (*pScreen->CloseScreen) (index, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Bool
 miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
 {
-    if (pCursor->bits->refcnt <= 1)
-        dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey,
-                            pScreen, NULL);
     return TRUE;
 }
 
 #ifdef ARGB_CURSOR
 #define EnsurePicture(picture,draw,win) (picture || miDCMakePicture(&picture,draw,win))
 
-static VisualPtr
-miDCGetWindowVisual(WindowPtr pWin)
-{
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-    VisualID vid = wVisual(pWin);
-    int i;
-
-    for (i = 0; i < pScreen->numVisuals; i++)
-        if (pScreen->visuals[i].vid == vid)
-            return &pScreen->visuals[i];
-    return 0;
-}
-
 static PicturePtr
 miDCMakePicture(PicturePtr * ppPicture, DrawablePtr pDraw, WindowPtr pWin)
 {
-    ScreenPtr pScreen = pDraw->pScreen;
-    VisualPtr pVisual;
     PictFormatPtr pFormat;
     XID subwindow_mode = IncludeInferiors;
     PicturePtr pPicture;
     int error;
 
-    pVisual = miDCGetWindowVisual(pWin);
-    if (!pVisual)
-        return 0;
-    pFormat = PictureMatchVisual(pScreen, pDraw->depth, pVisual);
+    pFormat = PictureWindowFormat(pWin);
     if (!pFormat)
         return 0;
     pPicture = CreatePicture(0, pDraw, pFormat,
@@ -188,42 +184,39 @@ miDCMakePicture(PicturePtr * ppPicture, DrawablePtr pDraw, WindowPtr pWin)
 }
 #endif
 
-static miDCCursorPtr
+static Bool
 miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
 {
-    miDCCursorPtr pPriv;
+    miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey);
     GCPtr pGC;
     ChangeGCVal gcvals;
+    PixmapPtr   sourceBits, maskBits;
+
+    if (pScreenPriv->pCursor == pCursor)
+        return TRUE;
 
-    pPriv = malloc(sizeof(miDCCursorRec));
-    if (!pPriv)
-        return NULL;
 #ifdef ARGB_CURSOR
+
     if (pCursor->bits->argb) {
         PixmapPtr pPixmap;
         PictFormatPtr pFormat;
         int error;
+        PicturePtr  pPicture;
 
         pFormat = PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8);
-        if (!pFormat) {
-            free((pointer) pPriv);
-            return NULL;
-        }
+        if (!pFormat)
+            return FALSE;
 
-        pPriv->sourceBits = 0;
-        pPriv->maskBits = 0;
         pPixmap = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
                                             pCursor->bits->height, 32,
                                             CREATE_PIXMAP_USAGE_SCRATCH);
-        if (!pPixmap) {
-            free((pointer) pPriv);
-            return NULL;
-        }
+        if (!pPixmap)
+            return FALSE;
+
         pGC = GetScratchGC(32, pScreen);
         if (!pGC) {
             (*pScreen->DestroyPixmap) (pPixmap);
-            free((pointer) pPriv);
-            return NULL;
+            return FALSE;
         }
         ValidateGC(&pPixmap->drawable, pGC);
         (*pGC->ops->PutImage) (&pPixmap->drawable, pGC, 32,
@@ -231,105 +224,86 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
                                pCursor->bits->height,
                                0, ZPixmap, (char *) pCursor->bits->argb);
         FreeScratchGC(pGC);
-        pPriv->pPicture = CreatePicture(0, &pPixmap->drawable,
-                                        pFormat, 0, 0, serverClient, &error);
+        pPicture = CreatePicture(0, &pPixmap->drawable,
+                                 pFormat, 0, 0, serverClient, &error);
         (*pScreen->DestroyPixmap) (pPixmap);
-        if (!pPriv->pPicture) {
-            free((pointer) pPriv);
-            return NULL;
-        }
-        dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey,
-                            pScreen, pPriv);
-        return pPriv;
+        if (!pPicture)
+            return FALSE;
+
+        miDCSwitchScreenCursor(pScreen, pCursor, NULL, NULL, pPicture);
+        return TRUE;
     }
-    pPriv->pPicture = 0;
 #endif
-    pPriv->sourceBits =
-        (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
-                                  pCursor->bits->height, 1, 0);
-    if (!pPriv->sourceBits) {
-        free((pointer) pPriv);
-        return NULL;
-    }
-    pPriv->maskBits =
-        (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
-                                  pCursor->bits->height, 1, 0);
-    if (!pPriv->maskBits) {
-        (*pScreen->DestroyPixmap) (pPriv->sourceBits);
-        free((pointer) pPriv);
-        return NULL;
+    sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
+                                           pCursor->bits->height, 1, 0);
+    if (!sourceBits)
+        return FALSE;
+
+    maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
+                                         pCursor->bits->height, 1, 0);
+    if (!maskBits) {
+        (*pScreen->DestroyPixmap) (sourceBits);
+        return FALSE;
     }
-    dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey, pScreen,
-                        pPriv);
 
     /* create the two sets of bits, clipping as appropriate */
 
     pGC = GetScratchGC(1, pScreen);
     if (!pGC) {
-        (void) miDCUnrealizeCursor(pScreen, pCursor);
-        return NULL;
+        (*pScreen->DestroyPixmap) (sourceBits);
+        (*pScreen->DestroyPixmap) (maskBits);
+        return FALSE;
     }
 
-    ValidateGC((DrawablePtr) pPriv->sourceBits, pGC);
-    (*pGC->ops->PutImage) ((DrawablePtr) pPriv->sourceBits, pGC, 1,
+    ValidateGC((DrawablePtr) sourceBits, pGC);
+    (*pGC->ops->PutImage) ((DrawablePtr) sourceBits, pGC, 1,
                            0, 0, pCursor->bits->width, pCursor->bits->height,
                            0, XYPixmap, (char *) pCursor->bits->source);
     gcvals.val = GXand;
     ChangeGC(NullClient, pGC, GCFunction, &gcvals);
-    ValidateGC((DrawablePtr) pPriv->sourceBits, pGC);
-    (*pGC->ops->PutImage) ((DrawablePtr) pPriv->sourceBits, pGC, 1,
+    ValidateGC((DrawablePtr) sourceBits, pGC);
+    (*pGC->ops->PutImage) ((DrawablePtr) sourceBits, pGC, 1,
                            0, 0, pCursor->bits->width, pCursor->bits->height,
                            0, XYPixmap, (char *) pCursor->bits->mask);
 
     /* mask bits -- pCursor->mask & ~pCursor->source */
     gcvals.val = GXcopy;
     ChangeGC(NullClient, pGC, GCFunction, &gcvals);
-    ValidateGC((DrawablePtr) pPriv->maskBits, pGC);
-    (*pGC->ops->PutImage) ((DrawablePtr) pPriv->maskBits, pGC, 1,
+    ValidateGC((DrawablePtr) maskBits, pGC);
+    (*pGC->ops->PutImage) ((DrawablePtr) maskBits, pGC, 1,
                            0, 0, pCursor->bits->width, pCursor->bits->height,
                            0, XYPixmap, (char *) pCursor->bits->mask);
     gcvals.val = GXandInverted;
     ChangeGC(NullClient, pGC, GCFunction, &gcvals);
-    ValidateGC((DrawablePtr) pPriv->maskBits, pGC);
-    (*pGC->ops->PutImage) ((DrawablePtr) pPriv->maskBits, pGC, 1,
+    ValidateGC((DrawablePtr) maskBits, pGC);
+    (*pGC->ops->PutImage) ((DrawablePtr) maskBits, pGC, 1,
                            0, 0, pCursor->bits->width, pCursor->bits->height,
                            0, XYPixmap, (char *) pCursor->bits->source);
     FreeScratchGC(pGC);
-    return pPriv;
+
+    miDCSwitchScreenCursor(pScreen, pCursor, sourceBits, maskBits, NULL);
+    return TRUE;
 }
 
 Bool
 miDCUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
 {
-    miDCCursorPtr pPriv;
-
-    pPriv = (miDCCursorPtr) dixLookupScreenPrivate(&pCursor->bits->devPrivates,
-                                                   miDCCursorBitsKey, pScreen);
-    if (pPriv && (pCursor->bits->refcnt <= 1)) {
-        if (pPriv->sourceBits)
-            (*pScreen->DestroyPixmap) (pPriv->sourceBits);
-        if (pPriv->maskBits)
-            (*pScreen->DestroyPixmap) (pPriv->maskBits);
-#ifdef ARGB_CURSOR
-        if (pPriv->pPicture)
-            FreePicture(pPriv->pPicture, 0);
-#endif
-        free((pointer) pPriv);
-        dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey,
-                            pScreen, NULL);
-    }
+    miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey);
+
+    if (pCursor == pScreenPriv->pCursor)
+        miDCSwitchScreenCursor(pScreen, NULL, NULL, NULL, NULL);
     return TRUE;
 }
 
 static void
 miDCPutBits(DrawablePtr pDrawable,
-            miDCCursorPtr pPriv,
             GCPtr sourceGC,
             GCPtr maskGC,
             int x_org,
             int y_org,
             unsigned w, unsigned h, unsigned long source, unsigned long mask)
 {
+    miDCScreenPtr pScreenPriv = dixLookupPrivate(&pDrawable->pScreen->devPrivates, miDCScreenKey);
     ChangeGCVal gcval;
     int x, y;
 
@@ -349,7 +323,7 @@ miDCPutBits(DrawablePtr pDrawable,
         y = y_org;
     }
 
-    (*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h,
+    (*sourceGC->ops->PushPixels) (sourceGC, pScreenPriv->sourceBits, pDrawable, w, h,
                                   x, y);
     if (maskGC->fgPixel != mask) {
         gcval.val = mask;
@@ -367,7 +341,7 @@ miDCPutBits(DrawablePtr pDrawable,
         y = y_org;
     }
 
-    (*maskGC->ops->PushPixels) (maskGC, pPriv->maskBits, pDrawable, w, h, x, y);
+    (*maskGC->ops->PushPixels) (maskGC, pScreenPriv->maskBits, pDrawable, w, h, x, y);
 }
 
 static GCPtr
@@ -389,27 +363,22 @@ Bool
 miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
                 int x, int y, unsigned long source, unsigned long mask)
 {
-    miDCCursorPtr pPriv;
+    miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey);
     miDCBufferPtr pBuffer;
     WindowPtr pWin;
 
-    pPriv = (miDCCursorPtr) dixLookupScreenPrivate(&pCursor->bits->devPrivates,
-                                                   miDCCursorBitsKey, pScreen);
-    if (!pPriv) {
-        pPriv = miDCRealize(pScreen, pCursor);
-        if (!pPriv)
-            return FALSE;
-    }
+    if (!miDCRealize(pScreen, pCursor))
+        return FALSE;
 
     pWin = pScreen->root;
     pBuffer = miGetDCDevice(pDev, pScreen);
 
 #ifdef ARGB_CURSOR
-    if (pPriv->pPicture) {
+    if (pScreenPriv->pPicture) {
         if (!EnsurePicture(pBuffer->pRootPicture, &pWin->drawable, pWin))
             return FALSE;
         CompositePicture(PictOpOver,
-                         pPriv->pPicture,
+                         pScreenPriv->pPicture,
                          NULL,
                          pBuffer->pRootPicture,
                          0, 0, 0, 0,
@@ -418,7 +387,7 @@ miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
     else
 #endif
     {
-        miDCPutBits((DrawablePtr) pWin, pPriv,
+        miDCPutBits((DrawablePtr) pWin,
                     pBuffer->pSourceGC, pBuffer->pMaskGC,
                     x, y, pCursor->bits->width, pCursor->bits->height,
                     source, mask);
index 4361a33..f90a885 100644 (file)
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -276,23 +276,22 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e)
          */
         miEventQueue.dropped++;
         if (miEventQueue.dropped == 1) {
-            ErrorF
-                ("[mi] EQ overflowing.  Additional events will be discarded until existing events are processed.\n");
+            ErrorFSigSafe("[mi] EQ overflowing.  Additional events will be "
+                         "discarded until existing events are processed.\n");
             xorg_backtrace();
-            ErrorF
-                ("[mi] These backtraces from mieqEnqueue may point to a culprit higher up the stack.\n");
-            ErrorF("[mi] mieq is *NOT* the cause.  It is a victim.\n");
+            ErrorFSigSafe("[mi] These backtraces from mieqEnqueue may point to "
+                         "a culprit higher up the stack.\n");
+            ErrorFSigSafe("[mi] mieq is *NOT* the cause.  It is a victim.\n");
         }
         else if (miEventQueue.dropped % QUEUE_DROP_BACKTRACE_FREQUENCY == 0 &&
                  miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY <=
                  QUEUE_DROP_BACKTRACE_MAX) {
-            ErrorF
-                ("[mi] EQ overflow continuing.  %lu events have been dropped.\n",
-                 miEventQueue.dropped);
+            ErrorFSigSafe("[mi] EQ overflow continuing.  %u events have been "
+                         "dropped.\n", miEventQueue.dropped);
             if (miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY ==
                 QUEUE_DROP_BACKTRACE_MAX) {
-                ErrorF
-                    ("[mi] No further overflow reports will be reported until the clog is cleared.\n");
+                ErrorFSigSafe("[mi] No further overflow reports will be "
+                             "reported until the clog is cleared.\n");
             }
             xorg_backtrace();
         }
index dbb29ca..8b7c93f 100644 (file)
@@ -327,7 +327,7 @@ miSendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable,
 
         numRects = RegionNumRects(pRgn);
         pBox = RegionRects(pRgn);
-        if (!(pEvent = malloc(numRects * sizeof(xEvent))))
+        if (!(pEvent = calloc(numRects, sizeof(xEvent))))
             return;
         pe = pEvent;
 
@@ -349,13 +349,12 @@ miSendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable,
         free(pEvent);
     }
     else {
-        xEvent event;
-
-        memset(&event, 0, sizeof(xEvent));
+        xEvent event = {
+            .u.noExposure.drawable = drawable,
+            .u.noExposure.majorEvent = major,
+            .u.noExposure.minorEvent = minor
+        };
         event.u.u.type = NoExpose;
-        event.u.noExposure.drawable = drawable;
-        event.u.noExposure.majorEvent = major;
-        event.u.noExposure.minorEvent = minor;
         WriteEventsToClient(client, 1, &event);
     }
 }
index b543d73..9c7c4d6 100644 (file)
@@ -44,21 +44,46 @@ SOFTWARE.
 
 ******************************************************************/
 
+/*
+ * Copyright (c) 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).
+ */
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
 
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
+#include "xf86Extensions.h"
 #endif
 
 #ifdef HAVE_DMX_CONFIG_H
 #include <dmx-config.h>
 #undef XV
 #undef DBE
-#undef XF86VIDMODE
-#undef XFreeXDGA
-#undef XF86DRI
 #undef SCREENSAVER
 #undef RANDR
 #undef XFIXES
@@ -75,198 +100,18 @@ SOFTWARE.
 
 #ifdef HAVE_KDRIVE_CONFIG_H
 #include <kdrive-config.h>
-/* there must be a better way... */
-#undef XFreeXDGA
-#undef XF86DRI
-#undef XF86VIDMODE
 #endif
 
 #ifdef HAVE_XGL_CONFIG_H
 #include <xgl-config.h>
-#undef XFreeXDGA
-#undef XF86DRI
-#undef XF86VIDMODE
 #endif
 
 #include "misc.h"
 #include "extension.h"
+#include "extinit.h"
 #include "micmap.h"
 #include "globals.h"
 
-extern Bool noTestExtensions;
-
-#ifdef COMPOSITE
-extern Bool noCompositeExtension;
-#endif
-#ifdef DBE
-extern Bool noDbeExtension;
-#endif
-#ifdef DPMSExtension
-extern Bool noDPMSExtension;
-#endif
-#ifdef GLXEXT
-extern Bool noGlxExtension;
-#endif
-#ifdef SCREENSAVER
-extern Bool noScreenSaverExtension;
-#endif
-#ifdef MITSHM
-extern Bool noMITShmExtension;
-#endif
-#ifdef RANDR
-extern Bool noRRExtension;
-#endif
-extern Bool noRenderExtension;
-
-#ifdef XCSECURITY
-extern Bool noSecurityExtension;
-#endif
-#ifdef RES
-extern Bool noResExtension;
-#endif
-#ifdef XF86BIGFONT
-extern Bool noXFree86BigfontExtension;
-#endif
-#ifdef XFreeXDGA
-extern Bool noXFree86DGAExtension;
-#endif
-#ifdef XF86DRI
-extern Bool noXFree86DRIExtension;
-#endif
-#ifdef XF86VIDMODE
-extern Bool noXFree86VidModeExtension;
-#endif
-#ifdef XFIXES
-extern Bool noXFixesExtension;
-#endif
-#ifdef PANORAMIX
-extern Bool noPanoramiXExtension;
-#endif
-#ifdef INXQUARTZ
-extern Bool noPseudoramiXExtension;
-#endif
-#ifdef XSELINUX
-extern Bool noSELinuxExtension;
-#endif
-#ifdef XV
-extern Bool noXvExtension;
-#endif
-extern Bool noGEExtension;
-
-#ifndef XFree86LOADER
-#define INITARGS void
-typedef void (*InitExtension) (INITARGS);
-#else                           /* XFree86Loader */
-#include "loaderProcs.h"
-#endif
-
-#ifdef MITSHM
-#include <X11/extensions/shm.h>
-#endif
-#ifdef XTEST
-#include <X11/extensions/xtestconst.h>
-#endif
-#include <X11/extensions/XKB.h>
-#ifdef XCSECURITY
-#include "securitysrv.h"
-#include <X11/extensions/secur.h>
-#endif
-#ifdef XSELINUX
-#include "xselinux.h"
-#endif
-#ifdef PANORAMIX
-#include <X11/extensions/panoramiXproto.h>
-#endif
-#ifdef XF86BIGFONT
-#include <X11/extensions/xf86bigfproto.h>
-#endif
-#ifdef RES
-#include <X11/extensions/XResproto.h>
-#endif
-
-/* FIXME: this whole block of externs should be from the appropriate headers */
-#ifdef MITSHM
-extern void ShmExtensionInit(INITARGS);
-#endif
-#ifdef PANORAMIX
-extern void PanoramiXExtensionInit(INITARGS);
-#endif
-#ifdef INXQUARTZ
-extern void PseudoramiXExtensionInit(INITARGS);
-#endif
-extern void XInputExtensionInit(INITARGS);
-
-#ifdef XTEST
-extern void XTestExtensionInit(INITARGS);
-#endif
-extern void BigReqExtensionInit(INITARGS);
-
-#ifdef SCREENSAVER
-extern void ScreenSaverExtensionInit(INITARGS);
-#endif
-#ifdef XV
-extern void XvExtensionInit(INITARGS);
-extern void XvMCExtensionInit(INITARGS);
-#endif
-extern void SyncExtensionInit(INITARGS);
-extern void XkbExtensionInit(INITARGS);
-extern void XCMiscExtensionInit(INITARGS);
-
-#ifdef XRECORD
-extern void RecordExtensionInit(INITARGS);
-#endif
-#ifdef DBE
-extern void DbeExtensionInit(INITARGS);
-#endif
-#ifdef XCSECURITY
-extern void SecurityExtensionInit(INITARGS);
-#endif
-#ifdef XSELINUX
-extern void SELinuxExtensionInit(INITARGS);
-#endif
-#ifdef XF86BIGFONT
-extern void XFree86BigfontExtensionInit(INITARGS);
-#endif
-#ifdef XF86VIDMODE
-extern void XFree86VidModeExtensionInit(INITARGS);
-#endif
-#ifdef XFreeXDGA
-extern void XFree86DGAExtensionInit(INITARGS);
-#endif
-#ifdef GLXEXT
-typedef struct __GLXprovider __GLXprovider;
-extern __GLXprovider __glXDRISWRastProvider;
-extern void GlxPushProvider(__GLXprovider * impl);
-extern void GlxExtensionInit(INITARGS);
-#endif
-#ifdef XF86DRI
-extern void XFree86DRIExtensionInit(INITARGS);
-#endif
-#ifdef DPMSExtension
-extern void DPMSExtensionInit(INITARGS);
-#endif
-extern void RenderExtensionInit(INITARGS);
-
-#ifdef RANDR
-extern void RRExtensionInit(INITARGS);
-#endif
-#ifdef RES
-extern void ResExtensionInit(INITARGS);
-#endif
-#ifdef DMXEXT
-extern void DMXExtensionInit(INITARGS);
-#endif
-#ifdef XFIXES
-extern void XFixesExtensionInit(INITARGS);
-#endif
-#ifdef DAMAGE
-extern void DamageExtensionInit(INITARGS);
-#endif
-#ifdef COMPOSITE
-extern void CompositeExtensionInit(INITARGS);
-#endif
-extern void GEExtensionInit(INITARGS);
-
 /* The following is only a small first step towards run-time
  * configurable extensions.
  */
@@ -312,6 +157,7 @@ static ExtensionToggle ExtensionToggleList[] = {
 #ifdef XF86BIGFONT
     {"XFree86-Bigfont", &noXFree86BigfontExtension},
 #endif
+#ifdef XorgLoader
 #ifdef XFreeXDGA
     {"XFree86-DGA", &noXFree86DGAExtension},
 #endif
@@ -321,6 +167,7 @@ static ExtensionToggle ExtensionToggleList[] = {
 #ifdef XF86VIDMODE
     {"XFree86-VidModeExtension", &noXFree86VidModeExtension},
 #endif
+#endif
 #ifdef XFIXES
     {"XFIXES", &noXFixesExtension},
 #endif
@@ -336,15 +183,16 @@ static ExtensionToggle ExtensionToggleList[] = {
 #ifdef XV
     {"XVideo", &noXvExtension},
 #endif
-    {NULL, NULL}
 };
 
 Bool
 EnableDisableExtension(const char *name, Bool enable)
 {
-    ExtensionToggle *ext = &ExtensionToggleList[0];
+    ExtensionToggle *ext;
+    int i;
 
-    for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) {
+    for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) {
+        ext = &ExtensionToggleList[i];
         if (strcmp(name, ext->name) == 0) {
             if (ext->disablePtr != NULL) {
                 *ext->disablePtr = !enable;
@@ -385,186 +233,102 @@ EnableDisableExtensionError(const char *name, Bool enable)
     }
 }
 
-#ifndef XFree86LOADER
-
- /*ARGSUSED*/ void
-InitExtensions(int argc, char *argv[])
-{
-    if (!noGEExtension)
-        GEExtensionInit();
-
-#ifdef PANORAMIX
-    if (!noPanoramiXExtension)
-        PanoramiXExtensionInit();
-#endif
-#ifdef INXQUARTZ
-    if (!noPseudoramiXExtension)
-        PseudoramiXExtensionInit();
-#endif
+/* List of built-in (statically linked) extensions */
+static ExtensionModule staticExtensions[] = {
+    {GEExtensionInit, "Generic Event Extension", &noGEExtension},
+    {ShapeExtensionInit, "SHAPE", NULL},
 #ifdef _F_GESTURE_EXTENSION_
-    GestureExtensionInit()
+    { GestureExtensionInit, "X Gesture Extension", NULL},
 #endif//_F_GESTURE_EXTENSION_
-    ShapeExtensionInit();
 #ifdef MITSHM
-    if (!noMITShmExtension)
-        ShmExtensionInit();
+    {ShmExtensionInit, SHMNAME, &noMITShmExtension},
 #endif
-    XInputExtensionInit();
+    {XInputExtensionInit, "XInputExtension", NULL},
 #ifdef XTEST
-    if (!noTestExtensions)
-        XTestExtensionInit();
-#endif
-    BigReqExtensionInit();
-#if defined(SCREENSAVER)
-    if (!noScreenSaverExtension)
-        ScreenSaverExtensionInit();
-#endif
-#ifdef XV
-    if (!noXvExtension) {
-        XvExtensionInit();
-        XvMCExtensionInit();
-    }
-#endif
-    SyncExtensionInit();
-    XkbExtensionInit();
-    XCMiscExtensionInit();
-#ifdef XRECORD
-    if (!noTestExtensions)
-        RecordExtensionInit();
-#endif
-#ifdef DBE
-    if (!noDbeExtension)
-        DbeExtensionInit();
+    {XTestExtensionInit, XTestExtensionName, &noTestExtensions},
 #endif
+    {BigReqExtensionInit, "BIG-REQUESTS", NULL},
+    {SyncExtensionInit, "SYNC", NULL},
+    {XkbExtensionInit, XkbName, NULL},
+    {XCMiscExtensionInit, "XC-MISC", NULL},
 #ifdef XCSECURITY
-    if (!noSecurityExtension)
-        SecurityExtensionInit();
-#endif
-#ifdef XSELINUX
-    if (!noSELinuxExtension)
-        SELinuxExtensionInit();
-#endif
-#if defined(DPMSExtension) && !defined(NO_HW_ONLY_EXTS)
-    if (!noDPMSExtension)
-        DPMSExtensionInit();
-#endif
-#ifdef XF86BIGFONT
-    if (!noXFree86BigfontExtension)
-        XFree86BigfontExtensionInit();
-#endif
-#if !defined(NO_HW_ONLY_EXTS)
-#if defined(XF86VIDMODE)
-    if (!noXFree86VidModeExtension)
-        XFree86VidModeExtensionInit();
-#endif
-#if defined(XFreeXDGA)
-    if (!noXFree86DGAExtension)
-        XFree86DGAExtensionInit();
+    {SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension},
 #endif
-#ifdef XF86DRI
-    if (!noXFree86DRIExtension)
-        XFree86DRIExtensionInit();
+#ifdef PANORAMIX
+    {PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension},
 #endif
+#ifdef INXQUARTZ
+    /* PseudoramiXExtensionInit must be done before RRExtensionInit, or
+     * XQuartz will render windows offscreen.
+     */
+    {PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension},
 #endif
 #ifdef XFIXES
     /* must be before Render to layer DisplayCursor correctly */
-    if (!noXFixesExtension)
-        XFixesExtensionInit();
+    {XFixesExtensionInit, "XFIXES", &noXFixesExtension},
 #endif
-    if (!noRenderExtension)
-        RenderExtensionInit();
-#ifdef RANDR
-    if (!noRRExtension)
-        RRExtensionInit();
-#endif
-#ifdef RES
-    if (!noResExtension)
-        ResExtensionInit();
+#ifdef XF86BIGFONT
+    {XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension},
 #endif
-#ifdef DMXEXT
-    DMXExtensionInit();         /* server-specific extension, cannot be disabled */
+    {RenderExtensionInit, "RENDER", &noRenderExtension},
+#ifdef RANDR
+    {RRExtensionInit, "RANDR", &noRRExtension},
 #endif
 #ifdef COMPOSITE
-    if (!noCompositeExtension)
-        CompositeExtensionInit();
+    {CompositeExtensionInit, "COMPOSITE", &noCompositeExtension},
 #endif
 #ifdef DAMAGE
-    if (!noDamageExtension)
-        DamageExtensionInit();
-#endif
-
-#ifdef GLXEXT
-    if (serverGeneration == 1)
-        GlxPushProvider(&__glXDRISWRastProvider);
-    if (!noGlxExtension)
-        GlxExtensionInit();
+    {DamageExtensionInit, "DAMAGE", &noDamageExtension},
 #endif
-}
-
-#else                           /* XFree86LOADER */
-/* List of built-in (statically linked) extensions */
-static ExtensionModule staticExtensions[] = {
-    {GEExtensionInit, "Generic Event Extension", &noGEExtension, NULL, NULL},
-    {ShapeExtensionInit, "SHAPE", NULL, NULL, NULL},
-#ifdef MITSHM
-    {ShmExtensionInit, SHMNAME, &noMITShmExtension, NULL, NULL},
-#endif
-#ifdef _F_GESTURE_EXTENSION_
-    { GestureExtensionInit, "X Gesture Extension", NULL, NULL, NULL },
-#endif//_F_GESTURE_EXTENSION_
-    {XInputExtensionInit, "XInputExtension", NULL, NULL, NULL},
-#ifdef XTEST
-    {XTestExtensionInit, XTestExtensionName, &noTestExtensions, NULL, NULL},
-#endif
-    {BigReqExtensionInit, "BIG-REQUESTS", NULL, NULL, NULL},
-    {SyncExtensionInit, "SYNC", NULL, NULL, NULL},
-    {XkbExtensionInit, XkbName, NULL, NULL, NULL},
-    {XCMiscExtensionInit, "XC-MISC", NULL, NULL, NULL},
-#ifdef XCSECURITY
-    {SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL,
-     NULL},
+#ifdef SCREENSAVER
+    {ScreenSaverExtensionInit, ScreenSaverName, &noScreenSaverExtension},
 #endif
-#ifdef PANORAMIX
-    {PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension,
-     NULL, NULL},
+#ifdef DBE
+    {DbeExtensionInit, "DOUBLE-BUFFER", &noDbeExtension},
 #endif
-#ifdef XFIXES
-    /* must be before Render to layer DisplayCursor correctly */
-    {XFixesExtensionInit, "XFIXES", &noXFixesExtension, NULL, NULL},
+#ifdef XRECORD
+    {RecordExtensionInit, "RECORD", &noTestExtensions},
 #endif
-#ifdef XF86BIGFONT
-    {XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension,
-     NULL, NULL},
+#ifdef DPMSExtension
+    {DPMSExtensionInit, DPMSExtensionName, &noDPMSExtension},
 #endif
-    {RenderExtensionInit, "RENDER", &noRenderExtension, NULL, NULL},
-#ifdef RANDR
-    {RRExtensionInit, "RANDR", &noRRExtension, NULL, NULL},
+#ifdef RES
+    {ResExtensionInit, XRES_NAME, &noResExtension},
 #endif
-#ifdef COMPOSITE
-    {CompositeExtensionInit, "COMPOSITE", &noCompositeExtension, NULL},
+#ifdef XV
+    {XvExtensionInit, XvName, &noXvExtension},
+    {XvMCExtensionInit, XvMCName, &noXvExtension},
 #endif
-#ifdef DAMAGE
-    {DamageExtensionInit, "DAMAGE", &noDamageExtension, NULL},
+#ifdef XSELINUX
+    {SELinuxExtensionInit, SELINUX_EXTENSION_NAME, &noSELinuxExtension},
 #endif
-    {NULL, NULL, NULL, NULL, NULL}
 };
 
- /*ARGSUSED*/ void
+static ExtensionModule *ExtensionModuleList = NULL;
+static int numExtensionModules = 0;
+
+static void
+AddStaticExtensions(void)
+{
+    static Bool listInitialised = FALSE;
+    int i;
+
+    if (listInitialised)
+        return;
+    listInitialised = TRUE;
+
+    /* Add built-in extensions to the list. */
+    for (i = 0; i < ARRAY_SIZE(staticExtensions); i++)
+        LoadExtension(&staticExtensions[i], TRUE);
+}
+
+void
 InitExtensions(int argc, char *argv[])
 {
     int i;
     ExtensionModule *ext;
-    static Bool listInitialised = FALSE;
-
-    if (!listInitialised) {
-        /* Add built-in extensions to the list. */
-        for (i = 0; staticExtensions[i].name; i++)
-            LoadExtension(&staticExtensions[i], TRUE);
 
-        /* Sort the extensions according the init dependencies. */
-        LoaderSortExtensions();
-        listInitialised = TRUE;
-    }
+    AddStaticExtensions();
 
     for (i = 0; ExtensionModuleList[i].name != NULL; i++) {
         ext = &ExtensionModuleList[i];
@@ -575,4 +339,51 @@ InitExtensions(int argc, char *argv[])
     }
 }
 
-#endif                          /* XFree86LOADER */
+static ExtensionModule *
+NewExtensionModule(void)
+{
+    ExtensionModule *save = ExtensionModuleList;
+    int n;
+
+    /* Make sure built-in extensions get added to the list before those
+     * in modules. */
+    AddStaticExtensions();
+
+    /* Sanity check */
+    if (!ExtensionModuleList)
+        numExtensionModules = 0;
+
+    n = numExtensionModules + 1;
+    ExtensionModuleList = realloc(ExtensionModuleList,
+                                  (n + 1) * sizeof(ExtensionModule));
+    if (ExtensionModuleList == NULL) {
+        ExtensionModuleList = save;
+        return NULL;
+    }
+    else {
+        numExtensionModules++;
+        ExtensionModuleList[numExtensionModules].name = NULL;
+        return ExtensionModuleList + (numExtensionModules - 1);
+    }
+}
+
+void
+LoadExtension(ExtensionModule * e, Bool builtin)
+{
+    ExtensionModule *newext;
+
+    if (e == NULL || e->name == NULL)
+        return;
+
+    if (!(newext = NewExtensionModule()))
+        return;
+
+    if (builtin)
+        ErrorF("Initializing built-in extension %s\n", e->name);
+    else
+        ErrorF("Loading extension %s\n", e->name);
+
+    newext->name = e->name;
+    newext->initFunc = e->initFunc;
+    newext->disablePtr = e->disablePtr;
+}
index f72159e..2bfd5e4 100644 (file)
@@ -66,7 +66,7 @@ static Bool HasUnderlayChildren(WindowPtr);
 static void MarkUnderlayWindow(WindowPtr);
 static Bool CollectUnderlayChildrenRegions(WindowPtr, RegionPtr);
 
-static Bool miOverlayCloseScreen(int, ScreenPtr);
+static Bool miOverlayCloseScreen(ScreenPtr);
 static Bool miOverlayCreateWindow(WindowPtr);
 static Bool miOverlayDestroyWindow(WindowPtr);
 static Bool miOverlayUnrealizeWindow(WindowPtr);
@@ -160,7 +160,7 @@ miInitOverlay(ScreenPtr pScreen,
 }
 
 static Bool
-miOverlayCloseScreen(int i, ScreenPtr pScreen)
+miOverlayCloseScreen(ScreenPtr pScreen)
 {
     miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
 
@@ -172,7 +172,7 @@ miOverlayCloseScreen(int i, ScreenPtr pScreen)
 
     free(pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static Bool
index de6698a..4defaf5 100644 (file)
@@ -91,7 +91,7 @@ static void miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen,
                                   BoxPtr pTopLeftBox);
 static Bool miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
                                        int x, int y, Bool generateEvent);
-static Bool miPointerCloseScreen(int index, ScreenPtr pScreen);
+static Bool miPointerCloseScreen(ScreenPtr pScreen);
 static void miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
 static Bool miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
 static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
@@ -154,7 +154,7 @@ miPointerInitialize(ScreenPtr pScreen,
  * @param pScreen The actual screen pointer
  */
 static Bool
-miPointerCloseScreen(int index, ScreenPtr pScreen)
+miPointerCloseScreen(ScreenPtr pScreen)
 {
     SetupScreen(pScreen);
 
@@ -162,7 +162,7 @@ miPointerCloseScreen(int index, ScreenPtr pScreen)
     free((pointer) pScreenPriv);
     FreeEventList(events, GetMaximumEventsNum());
     events = NULL;
-    return (*pScreen->CloseScreen) (index, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 /*
@@ -575,7 +575,7 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx,
 
     miPointerPtr pPointer;
 
-    if (!pDev || !pDev->coreEvents)
+    if (!pDev)
         return NULL;
 
     pPointer = MIPOINTER(pDev);
index 2850c8d..4698b53 100644 (file)
@@ -119,7 +119,7 @@ miModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
 }
 
 static Bool
-miCloseScreen(int iScreen, ScreenPtr pScreen)
+miCloseScreen(ScreenPtr pScreen)
 {
     return ((*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate));
 }
@@ -262,8 +262,6 @@ miScreenInit(ScreenPtr pScreen, pointer pbits,  /* pointer to screen bits */
     pScreen->SendGraphicsExpose = miSendGraphicsExpose;
     pScreen->BlockHandler = (ScreenBlockHandlerProcPtr) NoopDDA;
     pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr) NoopDDA;
-    pScreen->blockData = (pointer) 0;
-    pScreen->wakeupData = (pointer) 0;
     pScreen->MarkWindow = miMarkWindow;
     pScreen->MarkOverlappedWindows = miMarkOverlappedWindows;
     pScreen->MoveWindow = miMoveWindow;
index c9fcabc..97bbf8e 100644 (file)
@@ -191,7 +191,7 @@ static DevPrivateKeyRec miSpriteDevPrivatesKeyRec;
 
 #define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec)
 
-static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen);
+static Bool miSpriteCloseScreen(ScreenPtr pScreen);
 static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy,
                              int w, int h, unsigned int format,
                              unsigned long planemask, char *pdstLine);
@@ -203,7 +203,7 @@ static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y,
                                    unsigned int subWindowMode);
 static void miSpriteCopyWindow(WindowPtr pWindow,
                                DDXPointRec ptOldOrg, RegionPtr prgnSrc);
-static void miSpriteBlockHandler(int i, pointer blockData,
+static void miSpriteBlockHandler(ScreenPtr pScreen,
                                  pointer pTimeout, pointer pReadMask);
 static void miSpriteInstallColormap(ColormapPtr pMap);
 static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef);
@@ -367,7 +367,7 @@ miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
  */
 
 static Bool
-miSpriteCloseScreen(int i, ScreenPtr pScreen)
+miSpriteCloseScreen(ScreenPtr pScreen)
 {
     miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
 
@@ -382,7 +382,7 @@ miSpriteCloseScreen(int i, ScreenPtr pScreen)
 
     free(pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
@@ -520,10 +520,9 @@ miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
 }
 
 static void
-miSpriteBlockHandler(int i, pointer blockData, pointer pTimeout,
+miSpriteBlockHandler(ScreenPtr pScreen, pointer pTimeout,
                      pointer pReadmask)
 {
-    ScreenPtr pScreen = screenInfo.screens[i];
     miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
     DeviceIntPtr pDev;
     miCursorInfoPtr pCursorInfo;
@@ -554,7 +553,7 @@ miSpriteBlockHandler(int i, pointer blockData, pointer pTimeout,
 
     SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler);
 
-    (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+    (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
 
     if (WorkToDo)
         SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler);
index bbedac2..b84adc1 100644 (file)
@@ -1,11 +1,8 @@
 SUBDIRS = sync damage shadow
-if COMPOSITE
-SUBDIRS += cw
-endif
 if XQUARTZ
 SUBDIRS += rootless
 endif
 if XWIN_MULTIWINDOWEXTWM
 SUBDIRS += rootless
 endif
-DIST_SUBDIRS = sync damage shadow cw rootless
+DIST_SUBDIRS = sync damage shadow rootless
diff --git a/miext/cw/Makefile.am b/miext/cw/Makefile.am
deleted file mode 100644 (file)
index e056f42..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-noinst_LTLIBRARIES = libcw.la
-
-AM_CFLAGS = $(DIX_CFLAGS)
-
-INCLUDES = -I$(top_srcdir)/hw/xfree86/os-support
-
-libcw_la_SOURCES =     \
-       cw.c            \
-       cw_ops.c        \
-       cw_render.c     \
-        cw.h
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
deleted file mode 100644 (file)
index 87ced2f..0000000
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * Copyright © 2004 Eric Anholt
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Eric Anholt not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Eric Anholt makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <string.h>
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "cw.h"
-
-#define CW_DEBUG 1
-
-#if CW_DEBUG
-#define CW_ASSERT(x) do {                                              \
-    if (!(x)) {                                                                \
-       ErrorF("composite wrapper: assertion failed at %s:%d\n", __FUNC__, \
-           __LINE__);                                                  \
-    }                                                                  \
-} while (0)
-#else
-#define CW_ASSERT(x) do {} while (0)
-#endif
-
-DevPrivateKeyRec cwGCKeyRec;
-DevPrivateKeyRec cwScreenKeyRec;
-DevPrivateKeyRec cwWindowKeyRec;
-DevPrivateKeyRec cwPictureKeyRec;
-
-extern GCOps cwGCOps;
-
-static Bool
- cwCloseScreen(int i, ScreenPtr pScreen);
-
-static void
- cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable);
-static void
- cwChangeGC(GCPtr pGC, unsigned long mask);
-static void
- cwCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void
- cwDestroyGC(GCPtr pGC);
-static void
- cwChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
-static void
- cwCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-static void
- cwDestroyClip(GCPtr pGC);
-
-GCFuncs cwGCFuncs = {
-    cwValidateGC,
-    cwChangeGC,
-    cwCopyGC,
-    cwDestroyGC,
-    cwChangeClip,
-    cwDestroyClip,
-    cwCopyClip,
-};
-
-/* Find the real drawable to draw to, and provide offsets that will translate
- * window coordinates to backing pixmap coordinates.
- */
-DrawablePtr
-cwGetBackingDrawable(DrawablePtr pDrawable, int *x_off, int *y_off)
-{
-    PixmapPtr pPixmap;
-
-    if (pDrawable->type == DRAWABLE_WINDOW &&
-        (pPixmap = getCwPixmap((WindowPtr) pDrawable))) {
-        *x_off = pDrawable->x - pPixmap->screen_x;
-        *y_off = pDrawable->y - pPixmap->screen_y;
-        return &pPixmap->drawable;
-    }
-    else {
-        *x_off = *y_off = 0;
-        return pDrawable;
-    }
-}
-
-#define FUNC_PROLOGUE(pGC, pPriv) do {                                 \
-    (pGC)->funcs = (pPriv)->wrapFuncs;                                 \
-    (pGC)->ops = (pPriv)->wrapOps;                                     \
-} while (0)
-
-#define FUNC_EPILOGUE(pGC, pPriv) do {                                 \
-    (pPriv)->wrapFuncs = (pGC)->funcs;                                 \
-    (pPriv)->wrapOps = (pGC)->ops;                                     \
-    (pGC)->funcs = &cwGCFuncs;                                         \
-    (pGC)->ops = &cwGCOps;                                             \
-} while (0)
-
-static Bool
-cwCreateBackingGC(GCPtr pGC, DrawablePtr pDrawable)
-{
-    cwGCRec *pPriv = getCwGC(pGC);
-    int status, x_off, y_off;
-    XID noexpose = xFalse;
-    DrawablePtr pBackingDrawable;
-
-    pBackingDrawable = cwGetBackingDrawable(pDrawable, &x_off, &y_off);
-    pPriv->pBackingGC = CreateGC(pBackingDrawable, GCGraphicsExposures,
-                                 &noexpose, &status, (XID) 0, serverClient);
-    if (status != Success)
-        return FALSE;
-
-    pPriv->serialNumber = 0;
-    pPriv->stateChanges = GCAllBits;
-
-    return TRUE;
-}
-
-static void
-cwDestroyBackingGC(GCPtr pGC)
-{
-    cwGCPtr pPriv;
-
-    pPriv = (cwGCPtr) getCwGC(pGC);
-
-    if (pPriv->pBackingGC) {
-        FreeGC(pPriv->pBackingGC, (XID) 0);
-        pPriv->pBackingGC = NULL;
-    }
-}
-
-static void
-cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
-{
-    GCPtr pBackingGC;
-    cwGCPtr pPriv;
-    DrawablePtr pBackingDrawable;
-    int x_off, y_off;
-
-    pPriv = (cwGCPtr) getCwGC(pGC);
-
-    FUNC_PROLOGUE(pGC, pPriv);
-
-    /*
-     * Must call ValidateGC to ensure pGC->pCompositeClip is valid
-     */
-    (*pGC->funcs->ValidateGC) (pGC, stateChanges, pDrawable);
-
-    if (!cwDrawableIsRedirWindow(pDrawable)) {
-        cwDestroyBackingGC(pGC);
-        FUNC_EPILOGUE(pGC, pPriv);
-        return;
-    }
-    else {
-        if (!pPriv->pBackingGC && !cwCreateBackingGC(pGC, pDrawable)) {
-            FUNC_EPILOGUE(pGC, pPriv);
-            return;
-        }
-    }
-
-    pBackingGC = pPriv->pBackingGC;
-    pBackingDrawable = cwGetBackingDrawable(pDrawable, &x_off, &y_off);
-
-    pPriv->stateChanges |= stateChanges;
-
-    /*
-     * Copy the composite clip into the backing GC if either
-     * the drawable clip list has changed or the client has changed
-     * the client clip data
-     */
-    if (pDrawable->serialNumber != pPriv->serialNumber ||
-        (pPriv->stateChanges & (GCClipXOrigin | GCClipYOrigin | GCClipMask))) {
-        ChangeGCVal vals[2];
-        RegionPtr pCompositeClip;
-
-        pCompositeClip = RegionCreate(NULL, 0);
-        RegionCopy(pCompositeClip, pGC->pCompositeClip);
-
-        /* Either the drawable has changed, or the clip list in the drawable has
-         * changed.  Copy the new clip list over and set the new translated
-         * offset for it.
-         */
-
-        (*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION,
-                                          (pointer) pCompositeClip, 0);
-
-        vals[0].val = x_off - pDrawable->x;
-        vals[1].val = y_off - pDrawable->y;
-        ChangeGC(NullClient, pBackingGC, (GCClipXOrigin | GCClipYOrigin), vals);
-
-        pPriv->serialNumber = pDrawable->serialNumber;
-        /*
-         * Mask off any client clip changes to make sure
-         * the clip list set above remains in effect
-         */
-        pPriv->stateChanges &= ~(GCClipXOrigin | GCClipYOrigin | GCClipMask);
-    }
-
-    if (pPriv->stateChanges) {
-        CopyGC(pGC, pBackingGC, pPriv->stateChanges);
-        pPriv->stateChanges = 0;
-    }
-
-    if ((pGC->patOrg.x + x_off) != pBackingGC->patOrg.x ||
-        (pGC->patOrg.y + y_off) != pBackingGC->patOrg.y) {
-        ChangeGCVal vals[2];
-
-        vals[0].val = pGC->patOrg.x + x_off;
-        vals[1].val = pGC->patOrg.y + y_off;
-        ChangeGC(NullClient, pBackingGC,
-                 (GCTileStipXOrigin | GCTileStipYOrigin), vals);
-    }
-
-    ValidateGC(pBackingDrawable, pBackingGC);
-
-    FUNC_EPILOGUE(pGC, pPriv);
-}
-
-static void
-cwChangeGC(GCPtr pGC, unsigned long mask)
-{
-    cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pGC->devPrivates, cwGCKey);
-
-    FUNC_PROLOGUE(pGC, pPriv);
-
-    (*pGC->funcs->ChangeGC) (pGC, mask);
-
-    FUNC_EPILOGUE(pGC, pPriv);
-}
-
-static void
-cwCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
-{
-    cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pGCDst->devPrivates, cwGCKey);
-
-    FUNC_PROLOGUE(pGCDst, pPriv);
-
-    (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
-
-    FUNC_EPILOGUE(pGCDst, pPriv);
-}
-
-static void
-cwDestroyGC(GCPtr pGC)
-{
-    cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pGC->devPrivates, cwGCKey);
-
-    FUNC_PROLOGUE(pGC, pPriv);
-
-    cwDestroyBackingGC(pGC);
-
-    (*pGC->funcs->DestroyGC) (pGC);
-
-    /* leave it unwrapped */
-}
-
-static void
-cwChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
-{
-    cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pGC->devPrivates, cwGCKey);
-
-    FUNC_PROLOGUE(pGC, pPriv);
-
-    (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
-
-    FUNC_EPILOGUE(pGC, pPriv);
-}
-
-static void
-cwCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
-    cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pgcDst->devPrivates, cwGCKey);
-
-    FUNC_PROLOGUE(pgcDst, pPriv);
-
-    (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc);
-
-    FUNC_EPILOGUE(pgcDst, pPriv);
-}
-
-static void
-cwDestroyClip(GCPtr pGC)
-{
-    cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pGC->devPrivates, cwGCKey);
-
-    FUNC_PROLOGUE(pGC, pPriv);
-
-    (*pGC->funcs->DestroyClip) (pGC);
-
-    FUNC_EPILOGUE(pGC, pPriv);
-}
-
-/*
- * Screen wrappers.
- */
-
-#define SCREEN_PROLOGUE(pScreen, field)                                \
-  ((pScreen)->field = getCwScreen(pScreen)->field)
-
-#define SCREEN_EPILOGUE(pScreen, field, wrapper) do {          \
-    getCwScreen(pScreen)->field = (pScreen)->field;            \
-    (pScreen)->field = (wrapper);                              \
-} while (0)
-
-static Bool
-cwCreateGC(GCPtr pGC)
-{
-    cwGCPtr pPriv = getCwGC(pGC);
-    ScreenPtr pScreen = pGC->pScreen;
-    Bool ret;
-
-    SCREEN_PROLOGUE(pScreen, CreateGC);
-
-    if ((ret = (*pScreen->CreateGC) (pGC)))
-        FUNC_EPILOGUE(pGC, pPriv);
-
-    SCREEN_EPILOGUE(pScreen, CreateGC, cwCreateGC);
-
-    return ret;
-}
-
-static void
-cwGetImage(DrawablePtr pSrc, int x, int y, int w, int h, unsigned int format,
-           unsigned long planemask, char *pdstLine)
-{
-    ScreenPtr pScreen = pSrc->pScreen;
-    DrawablePtr pBackingDrawable;
-    int src_off_x, src_off_y;
-
-    SCREEN_PROLOGUE(pScreen, GetImage);
-
-    pBackingDrawable = cwGetBackingDrawable(pSrc, &src_off_x, &src_off_y);
-
-    CW_OFFSET_XY_SRC(x, y);
-
-    (*pScreen->GetImage) (pBackingDrawable, x, y, w, h, format, planemask,
-                          pdstLine);
-
-    SCREEN_EPILOGUE(pScreen, GetImage, cwGetImage);
-}
-
-static void
-cwGetSpans(DrawablePtr pSrc, int wMax, DDXPointPtr ppt, int *pwidth,
-           int nspans, char *pdstStart)
-{
-    ScreenPtr pScreen = pSrc->pScreen;
-    DrawablePtr pBackingDrawable;
-    int i;
-    int src_off_x, src_off_y;
-
-    SCREEN_PROLOGUE(pScreen, GetSpans);
-
-    pBackingDrawable = cwGetBackingDrawable(pSrc, &src_off_x, &src_off_y);
-
-    for (i = 0; i < nspans; i++)
-        CW_OFFSET_XY_SRC(ppt[i].x, ppt[i].y);
-
-    (*pScreen->GetSpans) (pBackingDrawable, wMax, ppt, pwidth, nspans,
-                          pdstStart);
-
-    SCREEN_EPILOGUE(pScreen, GetSpans, cwGetSpans);
-}
-
-static void
-cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-{
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-
-    SCREEN_PROLOGUE(pScreen, CopyWindow);
-
-    if (!cwDrawableIsRedirWindow((DrawablePtr) pWin)) {
-        (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
-    }
-    else {
-        GCPtr pGC;
-        BoxPtr pExtents;
-        int x_off, y_off;
-        int dx, dy;
-        PixmapPtr pBackingPixmap;
-        RegionPtr pClip;
-        int src_x, src_y, dst_x, dst_y, w, h;
-
-        dx = ptOldOrg.x - pWin->drawable.x;
-        dy = ptOldOrg.y - pWin->drawable.y;
-
-        pExtents = RegionExtents(prgnSrc);
-
-        pBackingPixmap = (PixmapPtr) cwGetBackingDrawable((DrawablePtr) pWin,
-                                                          &x_off, &y_off);
-
-        src_x = pExtents->x1 - pBackingPixmap->screen_x;
-        src_y = pExtents->y1 - pBackingPixmap->screen_y;
-        w = pExtents->x2 - pExtents->x1;
-        h = pExtents->y2 - pExtents->y1;
-        dst_x = src_x - dx;
-        dst_y = src_y - dy;
-
-        /* Translate region (as required by API) */
-        RegionTranslate(prgnSrc, -dx, -dy);
-
-        pGC = GetScratchGC(pBackingPixmap->drawable.depth, pScreen);
-        /*
-         * Copy region to GC as clip, aligning as dest clip
-         */
-        pClip = RegionCreate(NULL, 0);
-        RegionIntersect(pClip, &pWin->borderClip, prgnSrc);
-        RegionTranslate(pClip,
-                        -pBackingPixmap->screen_x, -pBackingPixmap->screen_y);
-
-        (*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
-
-        ValidateGC(&pBackingPixmap->drawable, pGC);
-
-        (*pGC->ops->CopyArea) (&pBackingPixmap->drawable,
-                               &pBackingPixmap->drawable, pGC,
-                               src_x, src_y, w, h, dst_x, dst_y);
-
-        (*pGC->funcs->DestroyClip) (pGC);
-
-        FreeScratchGC(pGC);
-    }
-
-    SCREEN_EPILOGUE(pScreen, CopyWindow, cwCopyWindow);
-}
-
-static PixmapPtr
-cwGetWindowPixmap(WindowPtr pWin)
-{
-    PixmapPtr pPixmap = getCwPixmap(pWin);
-
-    if (!pPixmap) {
-        ScreenPtr pScreen = pWin->drawable.pScreen;
-
-        SCREEN_PROLOGUE(pScreen, GetWindowPixmap);
-        if (pScreen->GetWindowPixmap)
-            pPixmap = (*pScreen->GetWindowPixmap) (pWin);
-        SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap);
-    }
-    return pPixmap;
-}
-
-static void
-cwSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap)
-{
-    ScreenPtr pScreen = pWindow->drawable.pScreen;
-
-    if (pPixmap == (*pScreen->GetScreenPixmap) (pScreen))
-        pPixmap = NULL;
-    setCwPixmap(pWindow, pPixmap);
-}
-
-/* Screen initialization/teardown */
-void
-miInitializeCompositeWrapper(ScreenPtr pScreen)
-{
-    cwScreenPtr pScreenPriv;
-    Bool has_render = GetPictureScreenIfSet(pScreen) != NULL;
-
-    if (!dixRegisterPrivateKey(&cwScreenKeyRec, PRIVATE_SCREEN, 0))
-        return;
-
-    if (!dixRegisterPrivateKey(&cwGCKeyRec, PRIVATE_GC, sizeof(cwGCRec)))
-        return;
-
-    if (!dixRegisterPrivateKey(&cwWindowKeyRec, PRIVATE_WINDOW, 0))
-        return;
-
-    if (!dixRegisterPrivateKey(&cwPictureKeyRec, PRIVATE_PICTURE, 0))
-        return;
-
-    pScreenPriv = malloc(sizeof(cwScreenRec));
-    if (!pScreenPriv)
-        return;
-
-    dixSetPrivate(&pScreen->devPrivates, cwScreenKey, pScreenPriv);
-
-    SCREEN_EPILOGUE(pScreen, CloseScreen, cwCloseScreen);
-    SCREEN_EPILOGUE(pScreen, GetImage, cwGetImage);
-    SCREEN_EPILOGUE(pScreen, GetSpans, cwGetSpans);
-    SCREEN_EPILOGUE(pScreen, CreateGC, cwCreateGC);
-    SCREEN_EPILOGUE(pScreen, CopyWindow, cwCopyWindow);
-
-    SCREEN_EPILOGUE(pScreen, SetWindowPixmap, cwSetWindowPixmap);
-    SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap);
-
-    if (has_render)
-        cwInitializeRender(pScreen);
-}
-
-static Bool
-cwCloseScreen(int i, ScreenPtr pScreen)
-{
-    cwScreenPtr pScreenPriv;
-    PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-
-    pScreenPriv = (cwScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
-                                                 cwScreenKey);
-    pScreen->CloseScreen = pScreenPriv->CloseScreen;
-    pScreen->GetImage = pScreenPriv->GetImage;
-    pScreen->GetSpans = pScreenPriv->GetSpans;
-    pScreen->CreateGC = pScreenPriv->CreateGC;
-    pScreen->CopyWindow = pScreenPriv->CopyWindow;
-
-    if (ps)
-        cwFiniRender(pScreen);
-
-    free((pointer) pScreenPriv);
-
-    return (*pScreen->CloseScreen) (i, pScreen);
-}
diff --git a/miext/cw/cw.h b/miext/cw/cw.h
deleted file mode 100644 (file)
index 9f880f7..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright © 2004 Eric Anholt
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Eric Anholt not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Eric Anholt makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "gcstruct.h"
-#include "picturestr.h"
-#include "privates.h"
-
-/*
- * One of these structures is allocated per GC that gets used with a window with
- * backing pixmap.
- */
-
-typedef struct {
-    GCPtr pBackingGC;           /* Copy of the GC but with graphicsExposures
-                                 * set FALSE and the clientClip set to
-                                 * clip output to the valid regions of the
-                                 * backing pixmap. */
-    unsigned long serialNumber; /* clientClip computed time */
-    unsigned long stateChanges; /* changes in parent gc since last copy */
-    GCOps *wrapOps;             /* wrapped ops */
-    GCFuncs *wrapFuncs;         /* wrapped funcs */
-} cwGCRec, *cwGCPtr;
-
-extern _X_EXPORT DevPrivateKeyRec cwGCKeyRec;
-
-#define cwGCKey (&cwGCKeyRec)
-
-#define getCwGC(pGC) ((cwGCPtr)dixLookupPrivate(&(pGC)->devPrivates, cwGCKey))
-#define setCwGC(pGC,p) dixSetPrivate(&(pGC)->devPrivates, cwGCKey, p)
-
-/*
- * One of these structures is allocated per Picture that gets used with a
- * window with a backing pixmap
- */
-
-typedef struct {
-    PicturePtr pBackingPicture;
-    unsigned long serialNumber;
-    unsigned long stateChanges;
-} cwPictureRec, *cwPicturePtr;
-
-extern _X_EXPORT DevPrivateKeyRec cwPictureKeyRec;
-
-#define cwPictureKey (&cwPictureKeyRec)
-
-#define getCwPicture(pPicture) (pPicture->pDrawable ? \
-    (cwPicturePtr)dixLookupPrivate(&(pPicture)->devPrivates, cwPictureKey) : 0)
-#define setCwPicture(pPicture,p) dixSetPrivate(&(pPicture)->devPrivates, cwPictureKey, p)
-
-extern _X_EXPORT DevPrivateKeyRec cwWindowKeyRec;
-
-#define cwWindowKey (&cwWindowKeyRec)
-
-#define cwWindowPrivate(pWin) dixLookupPrivate(&(pWin)->devPrivates, cwWindowKey)
-#define getCwPixmap(pWindow)       ((PixmapPtr) cwWindowPrivate(pWindow))
-#define setCwPixmap(pWindow,pPixmap) \
-    dixSetPrivate(&(pWindow)->devPrivates, cwWindowKey, pPixmap)
-
-#define cwDrawableIsRedirWindow(pDraw)                                 \
-       ((pDraw)->type == DRAWABLE_WINDOW &&                            \
-        getCwPixmap((WindowPtr) (pDraw)) != NULL)
-
-typedef struct {
-    /*
-     * screen func wrappers
-     */
-    CloseScreenProcPtr CloseScreen;
-    GetImageProcPtr GetImage;
-    GetSpansProcPtr GetSpans;
-    CreateGCProcPtr CreateGC;
-
-    CopyWindowProcPtr CopyWindow;
-
-    GetWindowPixmapProcPtr GetWindowPixmap;
-    SetWindowPixmapProcPtr SetWindowPixmap;
-
-    DestroyPictureProcPtr DestroyPicture;
-    ChangePictureClipProcPtr ChangePictureClip;
-    DestroyPictureClipProcPtr DestroyPictureClip;
-
-    ChangePictureProcPtr ChangePicture;
-    ValidatePictureProcPtr ValidatePicture;
-
-    CompositeProcPtr Composite;
-    CompositeRectsProcPtr CompositeRects;
-
-    TrapezoidsProcPtr Trapezoids;
-    TrianglesProcPtr Triangles;
-
-    RasterizeTrapezoidProcPtr RasterizeTrapezoid;
-} cwScreenRec, *cwScreenPtr;
-
-extern _X_EXPORT DevPrivateKeyRec cwScreenKeyRec;
-
-#define cwScreenKey (&cwScreenKeyRec)
-
-#define getCwScreen(pScreen) ((cwScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, cwScreenKey))
-#define setCwScreen(pScreen,p) dixSetPrivate(&(pScreen)->devPrivates, cwScreenKey, p)
-
-#define CW_OFFSET_XYPOINTS(ppt, npt) do { \
-    DDXPointPtr _ppt = (DDXPointPtr)(ppt); \
-    int _i; \
-    for (_i = 0; _i < npt; _i++) { \
-       _ppt[_i].x += dst_off_x; \
-       _ppt[_i].y += dst_off_y; \
-    } \
-} while (0)
-
-#define CW_OFFSET_RECTS(prect, nrect) do { \
-    int _i; \
-    for (_i = 0; _i < nrect; _i++) { \
-       (prect)[_i].x += dst_off_x; \
-       (prect)[_i].y += dst_off_y; \
-    } \
-} while (0)
-
-#define CW_OFFSET_ARCS(parc, narc) do { \
-    int _i; \
-    for (_i = 0; _i < narc; _i++) { \
-       (parc)[_i].x += dst_off_x; \
-       (parc)[_i].y += dst_off_y; \
-    } \
-} while (0)
-
-#define CW_OFFSET_XY_DST(x, y) do { \
-    (x) = (x) + dst_off_x; \
-    (y) = (y) + dst_off_y; \
-} while (0)
-
-#define CW_OFFSET_XY_SRC(x, y) do { \
-    (x) = (x) + src_off_x; \
-    (y) = (y) + src_off_y; \
-} while (0)
-
-/* cw.c */
-extern _X_EXPORT DrawablePtr
- cwGetBackingDrawable(DrawablePtr pDrawable, int *x_off, int *y_off);
-
-/* cw_render.c */
-
-extern _X_EXPORT void
- cwInitializeRender(ScreenPtr pScreen);
-
-extern _X_EXPORT void
- cwFiniRender(ScreenPtr pScreen);
-
-/* cw.c */
-
-extern _X_EXPORT void
- miInitializeCompositeWrapper(ScreenPtr pScreen);
diff --git a/miext/cw/cw_ops.c b/miext/cw/cw_ops.c
deleted file mode 100644 (file)
index ccc5580..0000000
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * Copyright © 2004 Eric Anholt
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Eric Anholt not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Eric Anholt makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <stdlib.h>
-
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "cw.h"
-#include "mi.h"
-
-#define SETUP_BACKING_DST(_pDst, _pGC) \
-    cwGCPtr pGCPrivate = getCwGC (_pGC); \
-    int dst_off_x, dst_off_y; \
-    DrawablePtr pBackingDst = cwGetBackingDrawable(pDst, &dst_off_x, \
-       &dst_off_y); \
-    GCPtr pBackingGC = pGCPrivate->pBackingGC ? pGCPrivate->pBackingGC : _pGC
-
-#define SETUP_BACKING_SRC(pSrc, pGC) \
-    int src_off_x, src_off_y; \
-    DrawablePtr pBackingSrc = cwGetBackingDrawable(pSrc, &src_off_x, \
-       &src_off_y)
-
-#define PROLOGUE(pGC) do { \
-    if (pBackingGC->serialNumber != pBackingDst->serialNumber) { \
-       ValidateGC(pBackingDst, pBackingGC); \
-    } \
-    pGC->funcs = pGCPrivate->wrapFuncs;\
-    pGC->ops = pGCPrivate->wrapOps;\
-} while (0)
-
-#define EPILOGUE(pGC) do { \
-    pGCPrivate->wrapFuncs = (pGC)->funcs; \
-    pGCPrivate->wrapOps = (pGC)->ops; \
-    (pGC)->funcs = &cwGCFuncs; \
-    (pGC)->ops = &cwGCOps; \
-} while (0)
-
-extern GCFuncs cwGCFuncs;
-
-/*
- * GC ops -- wrap each GC operation with our own function
- */
-
-static void cwFillSpans(DrawablePtr pDst, GCPtr pGC, int nInit,
-                        DDXPointPtr pptInit, int *pwidthInit, int fSorted);
-static void cwSetSpans(DrawablePtr pDst, GCPtr pGC, char *psrc,
-                       DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
-static void cwPutImage(DrawablePtr pDst, GCPtr pGC, int depth,
-                       int x, int y, int w, int h, int leftPad, int format,
-                       char *pBits);
-static RegionPtr cwCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
-                            int srcx, int srcy, int w, int h,
-                            int dstx, int dsty);
-static RegionPtr cwCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
-                             int srcx, int srcy, int w, int h,
-                             int dstx, int dsty, unsigned long plane);
-static void cwPolyPoint(DrawablePtr pDst, GCPtr pGC, int mode, int npt,
-                        xPoint * pptInit);
-static void cwPolylines(DrawablePtr pDst, GCPtr pGC, int mode, int npt,
-                        DDXPointPtr pptInit);
-static void cwPolySegment(DrawablePtr pDst, GCPtr pGC, int nseg,
-                          xSegment * pSegs);
-static void cwPolyRectangle(DrawablePtr pDst, GCPtr pGC,
-                            int nrects, xRectangle *pRects);
-static void cwPolyArc(DrawablePtr pDst, GCPtr pGC, int narcs, xArc * parcs);
-static void cwFillPolygon(DrawablePtr pDst, GCPtr pGC, int shape, int mode,
-                          int count, DDXPointPtr pPts);
-static void cwPolyFillRect(DrawablePtr pDst, GCPtr pGC,
-                           int nrectFill, xRectangle *prectInit);
-static void cwPolyFillArc(DrawablePtr pDst, GCPtr pGC, int narcs, xArc * parcs);
-static int cwPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
-                       int count, char *chars);
-static int cwPolyText16(DrawablePtr pDst, GCPtr pGC, int x, int y,
-                        int count, unsigned short *chars);
-static void cwImageText8(DrawablePtr pDst, GCPtr pGC, int x, int y,
-                         int count, char *chars);
-static void cwImageText16(DrawablePtr pDst, GCPtr pGC, int x, int y,
-                          int count, unsigned short *chars);
-static void cwImageGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y,
-                            unsigned int nglyph, CharInfoPtr * ppci,
-                            pointer pglyphBase);
-static void cwPolyGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y,
-                           unsigned int nglyph, CharInfoPtr * ppci,
-                           pointer pglyphBase);
-static void cwPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
-                         int w, int h, int x, int y);
-
-GCOps cwGCOps = {
-    cwFillSpans,
-    cwSetSpans,
-    cwPutImage,
-    cwCopyArea,
-    cwCopyPlane,
-    cwPolyPoint,
-    cwPolylines,
-    cwPolySegment,
-    cwPolyRectangle,
-    cwPolyArc,
-    cwFillPolygon,
-    cwPolyFillRect,
-    cwPolyFillArc,
-    cwPolyText8,
-    cwPolyText16,
-    cwImageText8,
-    cwImageText16,
-    cwImageGlyphBlt,
-    cwPolyGlyphBlt,
-    cwPushPixels
-};
-
-static void
-cwFillSpans(DrawablePtr pDst, GCPtr pGC, int nspans, DDXPointPtr ppt,
-            int *pwidth, int fSorted)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XYPOINTS(ppt, nspans);
-
-    (*pBackingGC->ops->FillSpans) (pBackingDst, pBackingGC, nspans, ppt,
-                                   pwidth, fSorted);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwSetSpans(DrawablePtr pDst, GCPtr pGC, char *psrc, DDXPointPtr ppt,
-           int *pwidth, int nspans, int fSorted)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XYPOINTS(ppt, nspans);
-
-    (*pBackingGC->ops->SetSpans) (pBackingDst, pBackingGC, psrc, ppt, pwidth,
-                                  nspans, fSorted);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, int w, int h,
-           int leftPad, int format, char *pBits)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XY_DST(x, y);
-
-    (*pBackingGC->ops->PutImage) (pBackingDst, pBackingGC, depth, x, y, w, h,
-                                  leftPad, format, pBits);
-
-    EPILOGUE(pGC);
-}
-
-static RegionPtr
-cwCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy,
-           int w, int h, int dstx, int dsty)
-{
-    int odstx, odsty;
-    int osrcx, osrcy;
-
-    SETUP_BACKING_DST(pDst, pGC);
-    SETUP_BACKING_SRC(pSrc, pGC);
-
-    PROLOGUE(pGC);
-
-    odstx = dstx;
-    odsty = dsty;
-    osrcx = srcx;
-    osrcy = srcy;
-    CW_OFFSET_XY_DST(dstx, dsty);
-    CW_OFFSET_XY_SRC(srcx, srcy);
-
-    (*pBackingGC->ops->CopyArea) (pBackingSrc, pBackingDst,
-                                  pBackingGC, srcx, srcy, w, h, dstx, dsty);
-
-    EPILOGUE(pGC);
-
-    return miHandleExposures(pSrc, pDst, pGC,
-                             osrcx, osrcy, w, h, odstx, odsty, 0);
-}
-
-static RegionPtr
-cwCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy,
-            int w, int h, int dstx, int dsty, unsigned long plane)
-{
-    int odstx, odsty;
-    int osrcx, osrcy;
-
-    SETUP_BACKING_DST(pDst, pGC);
-    SETUP_BACKING_SRC(pSrc, pGC);
-
-    PROLOGUE(pGC);
-
-    odstx = dstx;
-    odsty = dsty;
-    osrcx = srcx;
-    osrcy = srcy;
-    CW_OFFSET_XY_DST(dstx, dsty);
-    CW_OFFSET_XY_SRC(srcx, srcy);
-
-    (*pBackingGC->ops->CopyPlane) (pBackingSrc, pBackingDst,
-                                   pBackingGC, srcx, srcy, w, h,
-                                   dstx, dsty, plane);
-
-    EPILOGUE(pGC);
-
-    return miHandleExposures(pSrc, pDst, pGC,
-                             osrcx, osrcy, w, h, odstx, odsty, plane);
-}
-
-static void
-cwPolyPoint(DrawablePtr pDst, GCPtr pGC, int mode, int npt, xPoint * ppt)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    if (mode == CoordModeOrigin)
-        CW_OFFSET_XYPOINTS(ppt, npt);
-    else
-        CW_OFFSET_XYPOINTS(ppt, 1);
-
-    (*pBackingGC->ops->PolyPoint) (pBackingDst, pBackingGC, mode, npt, ppt);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwPolylines(DrawablePtr pDst, GCPtr pGC, int mode, int npt, DDXPointPtr ppt)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    if (mode == CoordModeOrigin)
-        CW_OFFSET_XYPOINTS(ppt, npt);
-    else
-        CW_OFFSET_XYPOINTS(ppt, 1);
-
-    (*pBackingGC->ops->Polylines) (pBackingDst, pBackingGC, mode, npt, ppt);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwPolySegment(DrawablePtr pDst, GCPtr pGC, int nseg, xSegment * pSegs)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XYPOINTS(pSegs, nseg * 2);
-
-    (*pBackingGC->ops->PolySegment) (pBackingDst, pBackingGC, nseg, pSegs);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwPolyRectangle(DrawablePtr pDst, GCPtr pGC, int nrects, xRectangle *pRects)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_RECTS(pRects, nrects);
-
-    (*pBackingGC->ops->PolyRectangle) (pBackingDst, pBackingGC, nrects, pRects);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwPolyArc(DrawablePtr pDst, GCPtr pGC, int narcs, xArc * pArcs)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_RECTS(pArcs, narcs);
-
-    (*pBackingGC->ops->PolyArc) (pBackingDst, pBackingGC, narcs, pArcs);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwFillPolygon(DrawablePtr pDst, GCPtr pGC, int shape, int mode, int npt,
-              DDXPointPtr ppt)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    if (mode == CoordModeOrigin)
-        CW_OFFSET_XYPOINTS(ppt, npt);
-    else
-        CW_OFFSET_XYPOINTS(ppt, 1);
-
-    (*pBackingGC->ops->FillPolygon) (pBackingDst, pBackingGC, shape, mode, npt,
-                                     ppt);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwPolyFillRect(DrawablePtr pDst, GCPtr pGC, int nrects, xRectangle *pRects)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_RECTS(pRects, nrects);
-
-    (*pBackingGC->ops->PolyFillRect) (pBackingDst, pBackingGC, nrects, pRects);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwPolyFillArc(DrawablePtr pDst, GCPtr pGC, int narcs, xArc * parcs)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_RECTS(parcs, narcs);
-
-    (*pBackingGC->ops->PolyFillArc) (pBackingDst, pBackingGC, narcs, parcs);
-
-    EPILOGUE(pGC);
-}
-
-static int
-cwPolyText8(DrawablePtr pDst, GCPtr pGC, int x, int y, int count, char *chars)
-{
-    int result;
-
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XY_DST(x, y);
-
-    result = (*pBackingGC->ops->PolyText8) (pBackingDst, pBackingGC, x, y,
-                                            count, chars);
-
-    EPILOGUE(pGC);
-
-    return result;
-}
-
-static int
-cwPolyText16(DrawablePtr pDst, GCPtr pGC, int x, int y, int count,
-             unsigned short *chars)
-{
-    int result;
-
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XY_DST(x, y);
-
-    result = (*pBackingGC->ops->PolyText16) (pBackingDst, pBackingGC, x, y,
-                                             count, chars);
-
-    EPILOGUE(pGC);
-    return result;
-}
-
-static void
-cwImageText8(DrawablePtr pDst, GCPtr pGC, int x, int y, int count, char *chars)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XY_DST(x, y);
-
-    (*pBackingGC->ops->ImageText8) (pBackingDst, pBackingGC, x, y, count,
-                                    chars);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwImageText16(DrawablePtr pDst, GCPtr pGC, int x, int y, int count,
-              unsigned short *chars)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XY_DST(x, y);
-
-    (*pBackingGC->ops->ImageText16) (pBackingDst, pBackingGC, x, y, count,
-                                     chars);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwImageGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, unsigned int nglyph,
-                CharInfoPtr * ppci, pointer pglyphBase)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XY_DST(x, y);
-
-    (*pBackingGC->ops->ImageGlyphBlt) (pBackingDst, pBackingGC, x, y, nglyph,
-                                       ppci, pglyphBase);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwPolyGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, unsigned int nglyph,
-               CharInfoPtr * ppci, pointer pglyphBase)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XY_DST(x, y);
-
-    (*pBackingGC->ops->PolyGlyphBlt) (pBackingDst, pBackingGC, x, y, nglyph,
-                                      ppci, pglyphBase);
-
-    EPILOGUE(pGC);
-}
-
-static void
-cwPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, int w, int h,
-             int x, int y)
-{
-    SETUP_BACKING_DST(pDst, pGC);
-
-    PROLOGUE(pGC);
-
-    CW_OFFSET_XY_DST(x, y);
-
-    (*pBackingGC->ops->PushPixels) (pBackingGC, pBitMap, pBackingDst, w, h,
-                                    x, y);
-
-    EPILOGUE(pGC);
-}
diff --git a/miext/cw/cw_render.c b/miext/cw/cw_render.c
deleted file mode 100644 (file)
index 059d686..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Copyright © 2004 Eric Anholt
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Eric Anholt not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Eric Anholt makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <string.h>
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "cw.h"
-
-#define cwPsDecl(pScreen)      \
-    PictureScreenPtr   ps = GetPictureScreen (pScreen);        \
-    cwScreenPtr                pCwScreen = getCwScreen (pScreen)
-
-#define cwPicturePrivate                                       \
-    cwPicturePtr    pPicturePrivate = getCwPicture(pPicture)
-
-#define cwSrcPictureDecl                                                       \
-    int                    src_picture_x_off, src_picture_y_off;                       \
-    PicturePtr     pBackingSrcPicture = cwGetBackingPicture(pSrcPicture,       \
-                                                            &src_picture_x_off,\
-                                                            &src_picture_y_off)
-
-#define cwDstPictureDecl                                                       \
-    int                    dst_picture_x_off, dst_picture_y_off;                       \
-    PicturePtr     pBackingDstPicture = cwGetBackingPicture(pDstPicture,       \
-                                                            &dst_picture_x_off,\
-                                                            &dst_picture_y_off)
-
-#define cwMskPictureDecl                                                       \
-    int                    msk_picture_x_off = 0, msk_picture_y_off = 0;               \
-    PicturePtr     pBackingMskPicture = (!pMskPicture ? 0 :                    \
-                                         cwGetBackingPicture(pMskPicture,      \
-                                                             &msk_picture_x_off,\
-                                                             &msk_picture_y_off))
-
-#define cwPsUnwrap(elt) {      \
-    ps->elt = pCwScreen->elt;  \
-}
-
-#define cwPsWrap(elt,func) {   \
-    pCwScreen->elt = ps->elt;  \
-    ps->elt = func;            \
-}
-
-static cwPicturePtr
-cwCreatePicturePrivate(PicturePtr pPicture)
-{
-    WindowPtr pWindow = (WindowPtr) pPicture->pDrawable;
-    PixmapPtr pPixmap = getCwPixmap(pWindow);
-    int error;
-    cwPicturePtr pPicturePrivate;
-
-    pPicturePrivate = malloc(sizeof(cwPictureRec));
-    if (!pPicturePrivate)
-        return NULL;
-
-    pPicturePrivate->pBackingPicture = CreatePicture(0, &pPixmap->drawable,
-                                                     pPicture->pFormat,
-                                                     0, 0, serverClient,
-                                                     &error);
-    if (!pPicturePrivate->pBackingPicture) {
-        free(pPicturePrivate);
-        return NULL;
-    }
-
-    /*
-     * Ensure that this serial number does not match the window's
-     */
-    pPicturePrivate->serialNumber = pPixmap->drawable.serialNumber;
-    pPicturePrivate->stateChanges = (1 << (CPLastBit + 1)) - 1;
-
-    setCwPicture(pPicture, pPicturePrivate);
-
-    return pPicturePrivate;
-}
-
-static void
-cwDestroyPicturePrivate(PicturePtr pPicture)
-{
-    cwPicturePrivate;
-
-    if (pPicturePrivate) {
-        if (pPicturePrivate->pBackingPicture)
-            FreePicture(pPicturePrivate->pBackingPicture, 0);
-        free(pPicturePrivate);
-        setCwPicture(pPicture, NULL);
-    }
-}
-
-static PicturePtr
-cwGetBackingPicture(PicturePtr pPicture, int *x_off, int *y_off)
-{
-    cwPicturePrivate;
-
-    if (pPicturePrivate) {
-        DrawablePtr pDrawable = pPicture->pDrawable;
-        WindowPtr pWindow = (WindowPtr) pDrawable;
-        PixmapPtr pPixmap = getCwPixmap(pWindow);
-
-        *x_off = pDrawable->x - pPixmap->screen_x;
-        *y_off = pDrawable->y - pPixmap->screen_y;
-
-        return pPicturePrivate->pBackingPicture;
-    }
-    else {
-        *x_off = *y_off = 0;
-        return pPicture;
-    }
-}
-
-static void
-cwDestroyPicture(PicturePtr pPicture)
-{
-    ScreenPtr pScreen = pPicture->pDrawable->pScreen;
-
-    cwPsDecl(pScreen);
-
-    cwPsUnwrap(DestroyPicture);
-    cwDestroyPicturePrivate(pPicture);
-    (*ps->DestroyPicture) (pPicture);
-    cwPsWrap(DestroyPicture, cwDestroyPicture);
-}
-
-static void
-cwChangePicture(PicturePtr pPicture, Mask mask)
-{
-    ScreenPtr pScreen = pPicture->pDrawable->pScreen;
-
-    cwPsDecl(pScreen);
-    cwPicturePtr pPicturePrivate = getCwPicture(pPicture);
-
-    cwPsUnwrap(ChangePicture);
-    (*ps->ChangePicture) (pPicture, mask);
-    if (pPicturePrivate)
-        pPicturePrivate->stateChanges |= mask;
-    cwPsWrap(ChangePicture, cwChangePicture);
-}
-
-static void
-cwValidatePicture(PicturePtr pPicture, Mask mask)
-{
-    DrawablePtr pDrawable = pPicture->pDrawable;
-    ScreenPtr pScreen = pDrawable->pScreen;
-
-    cwPsDecl(pScreen);
-    cwPicturePrivate;
-
-    cwPsUnwrap(ValidatePicture);
-
-    /*
-     * Must call ValidatePicture to ensure pPicture->pCompositeClip is valid
-     */
-    (*ps->ValidatePicture) (pPicture, mask);
-
-    if (!cwDrawableIsRedirWindow(pDrawable)) {
-        if (pPicturePrivate)
-            cwDestroyPicturePrivate(pPicture);
-    }
-    else {
-        PicturePtr pBackingPicture;
-        DrawablePtr pBackingDrawable;
-        int x_off, y_off;
-
-        pBackingDrawable = cwGetBackingDrawable(pDrawable, &x_off, &y_off);
-
-        if (pPicturePrivate &&
-            pPicturePrivate->pBackingPicture->pDrawable != pBackingDrawable) {
-            cwDestroyPicturePrivate(pPicture);
-            pPicturePrivate = 0;
-        }
-
-        if (!pPicturePrivate) {
-            pPicturePrivate = cwCreatePicturePrivate(pPicture);
-            if (!pPicturePrivate) {
-                cwPsWrap(ValidatePicture, cwValidatePicture);
-                return;
-            }
-        }
-
-        pBackingPicture = pPicturePrivate->pBackingPicture;
-
-        /*
-         * Always copy transform and filters because there's no
-         * indication of when they've changed
-         */
-        SetPictureTransform(pBackingPicture, pPicture->transform);
-
-        if (pBackingPicture->filter != pPicture->filter ||
-            pPicture->filter_nparams > 0) {
-            char *filter = PictureGetFilterName(pPicture->filter);
-
-            SetPictureFilter(pBackingPicture,
-                             filter, strlen(filter),
-                             pPicture->filter_params, pPicture->filter_nparams);
-        }
-
-        pPicturePrivate->stateChanges |= mask;
-
-        if (pPicturePrivate->serialNumber != pDrawable->serialNumber ||
-            (pPicturePrivate->
-             stateChanges & (CPClipXOrigin | CPClipYOrigin | CPClipMask))) {
-            SetPictureClipRegion(pBackingPicture, x_off - pDrawable->x,
-                                 y_off - pDrawable->y,
-                                 pPicture->pCompositeClip);
-
-            pPicturePrivate->serialNumber = pDrawable->serialNumber;
-            pPicturePrivate->stateChanges &=
-                ~(CPClipXOrigin | CPClipYOrigin | CPClipMask);
-        }
-
-        CopyPicture(pPicture, pPicturePrivate->stateChanges, pBackingPicture);
-
-        ValidatePicture(pBackingPicture);
-    }
-    cwPsWrap(ValidatePicture, cwValidatePicture);
-}
-
-static void
-cwComposite(CARD8 op,
-            PicturePtr pSrcPicture,
-            PicturePtr pMskPicture,
-            PicturePtr pDstPicture,
-            INT16 xSrc,
-            INT16 ySrc,
-            INT16 xMsk,
-            INT16 yMsk, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
-{
-    ScreenPtr pScreen = pDstPicture->pDrawable->pScreen;
-
-    cwPsDecl(pScreen);
-    cwSrcPictureDecl;
-    cwMskPictureDecl;
-    cwDstPictureDecl;
-
-    cwPsUnwrap(Composite);
-    (*ps->Composite) (op, pBackingSrcPicture, pBackingMskPicture,
-                      pBackingDstPicture, xSrc + src_picture_x_off,
-                      ySrc + src_picture_y_off, xMsk + msk_picture_x_off,
-                      yMsk + msk_picture_y_off, xDst + dst_picture_x_off,
-                      yDst + dst_picture_y_off, width, height);
-    cwPsWrap(Composite, cwComposite);
-}
-
-static void
-cwCompositeRects(CARD8 op,
-                 PicturePtr pDstPicture,
-                 xRenderColor * color, int nRect, xRectangle *rects)
-{
-    ScreenPtr pScreen = pDstPicture->pDrawable->pScreen;
-
-    cwPsDecl(pScreen);
-    cwDstPictureDecl;
-    int i;
-
-    cwPsUnwrap(CompositeRects);
-    for (i = 0; i < nRect; i++) {
-        rects[i].x += dst_picture_x_off;
-        rects[i].y += dst_picture_y_off;
-    }
-    (*ps->CompositeRects) (op, pBackingDstPicture, color, nRect, rects);
-    cwPsWrap(CompositeRects, cwCompositeRects);
-}
-
-static void
-cwTrapezoids(CARD8 op,
-             PicturePtr pSrcPicture,
-             PicturePtr pDstPicture,
-             PictFormatPtr maskFormat,
-             INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps)
-{
-    ScreenPtr pScreen = pDstPicture->pDrawable->pScreen;
-
-    cwPsDecl(pScreen);
-    cwSrcPictureDecl;
-    cwDstPictureDecl;
-    int i;
-
-    cwPsUnwrap(Trapezoids);
-    if (dst_picture_x_off || dst_picture_y_off) {
-        for (i = 0; i < ntrap; i++) {
-            traps[i].top += dst_picture_y_off << 16;
-            traps[i].bottom += dst_picture_y_off << 16;
-            traps[i].left.p1.x += dst_picture_x_off << 16;
-            traps[i].left.p1.y += dst_picture_y_off << 16;
-            traps[i].left.p2.x += dst_picture_x_off << 16;
-            traps[i].left.p2.y += dst_picture_y_off << 16;
-            traps[i].right.p1.x += dst_picture_x_off << 16;
-            traps[i].right.p1.y += dst_picture_y_off << 16;
-            traps[i].right.p2.x += dst_picture_x_off << 16;
-            traps[i].right.p2.y += dst_picture_y_off << 16;
-        }
-    }
-    (*ps->Trapezoids) (op, pBackingSrcPicture, pBackingDstPicture, maskFormat,
-                       xSrc + src_picture_x_off, ySrc + src_picture_y_off,
-                       ntrap, traps);
-    cwPsWrap(Trapezoids, cwTrapezoids);
-}
-
-static void
-cwTriangles(CARD8 op,
-            PicturePtr pSrcPicture,
-            PicturePtr pDstPicture,
-            PictFormatPtr maskFormat,
-            INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris)
-{
-    ScreenPtr pScreen = pDstPicture->pDrawable->pScreen;
-
-    cwPsDecl(pScreen);
-    cwSrcPictureDecl;
-    cwDstPictureDecl;
-    int i;
-
-    cwPsUnwrap(Triangles);
-    if (dst_picture_x_off || dst_picture_y_off) {
-        for (i = 0; i < ntri; i++) {
-            tris[i].p1.x += dst_picture_x_off << 16;
-            tris[i].p1.y += dst_picture_y_off << 16;
-            tris[i].p2.x += dst_picture_x_off << 16;
-            tris[i].p2.y += dst_picture_y_off << 16;
-            tris[i].p3.x += dst_picture_x_off << 16;
-            tris[i].p3.y += dst_picture_y_off << 16;
-        }
-    }
-    (*ps->Triangles) (op, pBackingSrcPicture, pBackingDstPicture, maskFormat,
-                      xSrc + src_picture_x_off, ySrc + src_picture_y_off,
-                      ntri, tris);
-    cwPsWrap(Triangles, cwTriangles);
-}
-
-void
-cwInitializeRender(ScreenPtr pScreen)
-{
-    cwPsDecl(pScreen);
-
-    cwPsWrap(DestroyPicture, cwDestroyPicture);
-    cwPsWrap(ChangePicture, cwChangePicture);
-    cwPsWrap(ValidatePicture, cwValidatePicture);
-    cwPsWrap(Composite, cwComposite);
-    cwPsWrap(CompositeRects, cwCompositeRects);
-    cwPsWrap(Trapezoids, cwTrapezoids);
-    cwPsWrap(Triangles, cwTriangles);
-    /* There is no need to wrap AddTraps as far as we can tell.  AddTraps can
-     * only be done on alpha-only pictures, and we won't be getting
-     * alpha-only window pictures, so there's no need to translate.
-     */
-}
-
-void
-cwFiniRender(ScreenPtr pScreen)
-{
-    cwPsDecl(pScreen);
-
-    cwPsUnwrap(DestroyPicture);
-    cwPsUnwrap(ChangePicture);
-    cwPsUnwrap(ValidatePicture);
-    cwPsUnwrap(Composite);
-    cwPsUnwrap(CompositeRects);
-    cwPsUnwrap(Trapezoids);
-    cwPsUnwrap(Triangles);
-}
index 72ed659..2d2b422 100644 (file)
@@ -38,9 +38,6 @@
 #include    "gcstruct.h"
 #include    "damage.h"
 #include    "damagestr.h"
-#ifdef COMPOSITE
-#include    "cw.h"
-#endif
 
 #define wrap(priv, real, mem, func) {\
     priv->mem = real->mem; \
@@ -1646,7 +1643,7 @@ damageDestroyWindow(WindowPtr pWindow)
 }
 
 static Bool
-damageCloseScreen(int i, ScreenPtr pScreen)
+damageCloseScreen(ScreenPtr pScreen)
 {
     damageScrPriv(pScreen);
 
@@ -1655,7 +1652,7 @@ damageCloseScreen(int i, ScreenPtr pScreen)
     unwrap(pScrPriv, pScreen, CopyWindow);
     unwrap(pScrPriv, pScreen, CloseScreen);
     free(pScrPriv);
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 /**
index ecc72ea..a1af3e7 100644 (file)
@@ -138,7 +138,7 @@ RootlessCreateScreenResources(ScreenPtr pScreen)
 }
 
 static Bool
-RootlessCloseScreen(int i, ScreenPtr pScreen)
+RootlessCloseScreen(ScreenPtr pScreen)
 {
     RootlessScreenRec *s;
 
@@ -154,7 +154,7 @@ RootlessCloseScreen(int i, ScreenPtr pScreen)
     }
 
     free(s);
-    return pScreen->CloseScreen(i, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 static void
index d2ba684..2d869e5 100644 (file)
@@ -96,7 +96,7 @@ shadowGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
 #define BACKWARDS_COMPATIBILITY
 
 static Bool
-shadowCloseScreen(int i, ScreenPtr pScreen)
+shadowCloseScreen(ScreenPtr pScreen)
 {
     shadowBuf(pScreen);
 
@@ -110,7 +110,7 @@ shadowCloseScreen(int i, ScreenPtr pScreen)
     if (pBuf->pPixmap)
         pScreen->DestroyPixmap(pBuf->pPixmap);
     free(pBuf);
-    return pScreen->CloseScreen(i, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 #ifdef BACKWARDS_COMPATIBILITY
index 57fcf22..f3df6c5 100644 (file)
@@ -54,9 +54,6 @@
 #endif
 
 void
- FUNC(ScreenPtr pScreen, shadowBufPtr pBuf);
-
-void
 FUNC(ScreenPtr pScreen, shadowBufPtr pBuf)
 {
     RegionPtr damage = shadowDamage(pBuf);
index b1e2a36..d24921a 100644 (file)
@@ -163,13 +163,13 @@ miSyncGetScreenFuncs(ScreenPtr pScreen)
 }
 
 static Bool
-SyncCloseScreen(int i, ScreenPtr pScreen)
+SyncCloseScreen(ScreenPtr pScreen)
 {
     SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
 
     pScreen->CloseScreen = pScreenPriv->CloseScreen;
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Bool
index 59f3af6..393890f 100644 (file)
@@ -561,7 +561,7 @@ NextDPMSTimeout(INT32 timeout)
 static CARD32
 ScreenSaverTimeoutExpire(OsTimerPtr timer, CARD32 now, pointer arg)
 {
-    INT32 timeout = now - lastDeviceEventTime.milliseconds;
+    INT32 timeout = now - lastDeviceEventTime[XIAllDevices].milliseconds;
     CARD32 nextTimeout = 0;
 
 #ifdef DPMSExtension
index 81348f4..daac60c 100644 (file)
@@ -45,29 +45,37 @@ xorg_backtrace(void)
     int size, i;
     Dl_info info;
 
-    ErrorF("\n");
-    ErrorF("Backtrace:\n");
+    ErrorFSigSafe("\n");
+    ErrorFSigSafe("Backtrace:\n");
     size = backtrace(array, 64);
     for (i = 0; i < size; i++) {
         int rc = dladdr(array[i], &info);
 
         if (rc == 0) {
-            ErrorF("%d: ?? [%p]\n", i, array[i]);
+            ErrorFSigSafe("%u: ?? [%p]\n", i, array[i]);
             continue;
         }
         mod = (info.dli_fname && *info.dli_fname) ? info.dli_fname : "(vdso)";
         if (info.dli_saddr)
-            ErrorF("%d: %s (%s+0x%lx) [%p]\n", i, mod,
-                   info.dli_sname,
-                   (long unsigned int) ((char *) array[i] -
-                                        (char *) info.dli_saddr), array[i]);
+            ErrorFSigSafe(
+                "%u: %s (%s+0x%x) [%p]\n",
+                i,
+                mod,
+                info.dli_sname,
+                (unsigned int)((char *) array[i] -
+                               (char *) info.dli_saddr),
+                array[i]);
         else
-            ErrorF("%d: %s (%p+0x%lx) [%p]\n", i, mod,
-                   info.dli_fbase,
-                   (long unsigned int) ((char *) array[i] -
-                                        (char *) info.dli_fbase), array[i]);
+            ErrorFSigSafe(
+                "%u: %s (%p+0x%x) [%p]\n",
+                i,
+                mod,
+                info.dli_fbase,
+                (unsigned int)((char *) array[i] -
+                               (char *) info.dli_fbase),
+                array[i]);
     }
-    ErrorF("\n");
+    ErrorFSigSafe("\n");
 }
 
 #else                           /* not glibc or glibc < 2.1 */
@@ -105,7 +113,7 @@ xorg_backtrace_frame(uintptr_t pc, int signo, void *arg)
             strcpy(signame, "unknown");
         }
 
-        ErrorF("** Signal %d (%s)\n", signo, signame);
+        ErrorFSigSafe("** Signal %u (%s)\n", signo, signame);
     }
 
     snprintf(header, sizeof(header), "%d: 0x%lx", depth, pc);
@@ -123,7 +131,8 @@ xorg_backtrace_frame(uintptr_t pc, int signo, void *arg)
             symname = "<section start>";
             offset = pc - (uintptr_t) dlinfo.dli_fbase;
         }
-        ErrorF("%s: %s:%s+0x%lx\n", header, dlinfo.dli_fname, symname, offset);
+        ErrorFSigSafe("%s: %s:%s+0x%x\n", header, dlinfo.dli_fname, symname,
+                     offset);
 
     }
     else {
@@ -131,7 +140,7 @@ xorg_backtrace_frame(uintptr_t pc, int signo, void *arg)
          * probably poke elfloader here, but haven't written that code yet,
          * so we just print the pc.
          */
-        ErrorF("%s\n", header);
+        ErrorFSigSafe("%s\n", header);
     }
 
     return 0;
@@ -183,7 +192,7 @@ xorg_backtrace_pstack(void)
 
             if (bytesread > 0) {
                 btline[bytesread] = 0;
-                ErrorF("%s", btline);
+                ErrorFSigSafe("%s", btline);
             }
             else if ((bytesread < 0) || ((errno != EINTR) && (errno != EAGAIN)))
                 done = 1;
@@ -203,8 +212,8 @@ void
 xorg_backtrace(void)
 {
 
-    ErrorF("\n");
-    ErrorF("Backtrace:\n");
+    ErrorFSigSafe("\n");
+    ErrorFSigSafe("Backtrace:\n");
 
 #ifdef HAVE_PSTACK
 /* First try fork/exec of pstack - otherwise fall back to walkcontext
@@ -221,9 +230,9 @@ xorg_backtrace(void)
             walkcontext(&u, xorg_backtrace_frame, &depth);
         else
 #endif
-            ErrorF("Failed to get backtrace info: %s\n", strerror(errno));
+            ErrorFSigSafe("Failed to get backtrace info: %s\n", strerror(errno));
     }
-    ErrorF("\n");
+    ErrorFSigSafe("\n");
 }
 
 #else
index 9cbc02b..d95289f 100644 (file)
@@ -142,6 +142,7 @@ Bool AnyClientsWriteBlocked;    /* true if some client blocked on write */
 static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */
 Bool RunFromSigStopParent;      /* send SIGSTOP to our own process; Upstart (or
                                    equivalent) will send SIGCONT back. */
+static char dynamic_display[7]; /* display name */
 Bool PartialNetwork;            /* continue even if unable to bind all addrs */
 static Pid_t ParentProcess;
 
@@ -350,6 +351,11 @@ void
 NotifyParentProcess(void)
 {
 #if !defined(WIN32)
+    if (dynamic_display[0]) {
+        write(displayfd, dynamic_display, strlen(dynamic_display));
+        write(displayfd, "\n", 1);
+        close(displayfd);
+    }
     if (RunFromSmartParent) {
         if (ParentProcess > 1) {
             kill(ParentProcess, SIGUSR1);
@@ -360,6 +366,18 @@ NotifyParentProcess(void)
 #endif
 }
 
+static Bool
+TryCreateSocket(int num, int *partial)
+{
+    char port[20];
+
+    snprintf(port, sizeof(port), "%d", num);
+
+    return (_XSERVTransMakeAllCOTSServerListeners(port, partial,
+                                                  &ListenTransCount,
+                                                  &ListenTransConns) >= 0);
+}
+
 /*****************
  * CreateWellKnownSockets
  *    At initialization, create the sockets to listen on for new clients.
@@ -370,7 +388,6 @@ CreateWellKnownSockets(void)
 {
     int i;
     int partial;
-    char port[20];
 
     FD_ZERO(&AllSockets);
     FD_ZERO(&AllClients);
@@ -386,29 +403,41 @@ CreateWellKnownSockets(void)
 
     FD_ZERO(&WellKnownConnections);
 
-    snprintf(port, sizeof(port), "%d", atoi(display));
-
-    if ((_XSERVTransMakeAllCOTSServerListeners(port, &partial,
-                                               &ListenTransCount,
-                                               &ListenTransConns) >= 0) &&
-        (ListenTransCount >= 1)) {
-        if (!PartialNetwork && partial) {
-            FatalError("Failed to establish all listening sockets");
+    /* display is initialized to "0" by main(). It is then set to the display
+     * number if specified on the command line, or to NULL when the -displayfd
+     * option is used. */
+    if (display) {
+        if (TryCreateSocket(atoi(display), &partial) &&
+            ListenTransCount >= 1)
+            if (!PartialNetwork && partial)
+                FatalError ("Failed to establish all listening sockets");
+    }
+    else { /* -displayfd */
+        Bool found = 0;
+        for (i = 0; i < 65535 - X_TCP_PORT; i++) {
+            if (TryCreateSocket(i, &partial) && !partial) {
+                found = 1;
+                break;
+            }
+            else
+                CloseWellKnownConnections();
         }
-        else {
-            ListenTransFds = malloc(ListenTransCount * sizeof(int));
+        if (!found)
+            FatalError("Failed to find a socket to listen on");
+        snprintf(dynamic_display, sizeof(dynamic_display), "%d", i);
+        display = dynamic_display;
+    }
 
-            for (i = 0; i < ListenTransCount; i++) {
-                int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]);
+    ListenTransFds = malloc(ListenTransCount * sizeof (int));
 
-                ListenTransFds[i] = fd;
-                FD_SET(fd, &WellKnownConnections);
+    for (i = 0; i < ListenTransCount; i++) {
+        int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]);
 
-                if (!_XSERVTransIsLocal(ListenTransConns[i])) {
-                    DefineSelf(fd);
-                }
-            }
-        }
+        ListenTransFds[i] = fd;
+        FD_SET(fd, &WellKnownConnections);
+
+        if (!_XSERVTransIsLocal(ListenTransConns[i]))
+            DefineSelf (fd);
     }
 
     if (!XFD_ANYSET(&WellKnownConnections))
@@ -863,7 +892,7 @@ ErrorConnMax(XtransConnInfo trans_conn)
 {
     int fd = _XSERVTransGetConnectionNumber(trans_conn);
     xConnSetupPrefix csp;
-    char pad[3];
+    char pad[3] = { 0, 0, 0 };
     struct iovec iov[3];
     char byteOrder = 0;
     int whichbyte = 1;
diff --git a/os/io.c b/os/io.c
index b67a5f3..e44db39 100644 (file)
--- a/os/io.c
+++ b/os/io.c
@@ -578,8 +578,6 @@ ResetCurrentRequest(ClientPtr client)
     }
 }
 
-static const int padlength[4] = { 0, 3, 2, 1 };
-
  /********************
  * FlushAllOutput()
  *    Flush all clients with output.  However, if some client still
@@ -757,7 +755,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
         oc->output = oco;
     }
 
-    padBytes = padlength[count & 3];
+    padBytes = padding_for_int32(count);
 
     if (ReplyCallback) {
         ReplyInfoRec replyinfo;
@@ -815,7 +813,11 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
     NewOutputPending = TRUE;
     FD_SET(oc->fd, &OutputPending);
     memmove((char *) oco->buf + oco->count, buf, count);
-    oco->count += count + padBytes;
+    oco->count += count;
+    if (padBytes) {
+        memset(oco->buf + oco->count, '\0', padBytes);
+        oco->count += padBytes;
+    }
     return count;
 }
 
@@ -846,7 +848,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
     if (!oco)
         return 0;
     written = 0;
-    padsize = padlength[extraCount & 3];
+    padsize = padding_for_int32(extraCount);
     notWritten = oco->count + extraCount + padsize;
     todo = notWritten;
     while (notWritten) {
index 0e49572..4820e9a 100644 (file)
--- a/os/log.c
+++ b/os/log.c
@@ -108,6 +108,7 @@ void (*OsVendorVErrorFProc) (const char *, va_list args) = NULL;
 #endif
 
 static FILE *logFile = NULL;
+static int logFileFd = -1;
 static Bool logFlush = FALSE;
 static Bool logSync = FALSE;
 static int logVerbosity = DEFAULT_LOG_VERBOSITY;
@@ -164,10 +165,21 @@ asm(".desc ___crashreporter_info__, 0x10");
 #ifndef X_NOT_IMPLEMENTED_STRING
 #define X_NOT_IMPLEMENTED_STRING       "(NI)"
 #endif
+#ifndef X_DEBUG_STRING
+#define X_DEBUG_STRING                 "(DB)"
+#endif
 #ifndef X_NONE_STRING
 #define X_NONE_STRING                  ""
 #endif
 
+static size_t
+strlen_sigsafe(const char *s)
+{
+    size_t len;
+    for (len = 0; s[len]; len++);
+    return len;
+}
+
 /*
  * LogInit is called to start logging to a file.  It is also called (with
  * NULL arguments) when logging to a file is not wanted.  It must always be
@@ -208,6 +220,8 @@ LogInit(const char *fname, const char *backup)
             FatalError("Cannot open log file \"%s\"\n", logFileName);
         setvbuf(logFile, NULL, _IONBF, 0);
 
+        logFileFd = fileno(logFile);
+
         /* Flush saved log information. */
         if (saveBuffer && bufferSize > 0) {
             fwrite(saveBuffer, bufferPos, 1, logFile);
@@ -240,6 +254,7 @@ LogClose(enum ExitCode error)
                (error == EXIT_NO_ERROR) ? "successfully" : "with error", error);
         fclose(logFile);
         logFile = NULL;
+        logFileFd = -1;
     }
 }
 
@@ -264,16 +279,107 @@ LogSetParameter(LogParameter param, int value)
     }
 }
 
-/* This function does the actual log message writes. */
+static int
+pnprintf(char *string, size_t size, const char *f, va_list args)
+{
+    int f_idx = 0;
+    int s_idx = 0;
+    int f_len = strlen_sigsafe(f);
+    char *string_arg;
+    char number[21];
+    int p_len;
+    int i;
+    uint64_t ui;
+    int64_t si;
+
+    for (; f_idx < f_len && s_idx < size - 1; f_idx++) {
+        if (f[f_idx] != '%') {
+            string[s_idx++] = f[f_idx];
+            continue;
+        }
+
+        switch (f[++f_idx]) {
+        case 's':
+            string_arg = va_arg(args, char*);
+            p_len = strlen_sigsafe(string_arg);
+
+            for (i = 0; i < p_len && s_idx < size - 1; i++)
+                string[s_idx++] = string_arg[i];
+            break;
+
+        case 'u':
+            ui = va_arg(args, unsigned);
+            FormatUInt64(ui, number);
+            p_len = strlen_sigsafe(number);
+
+            for (i = 0; i < p_len && s_idx < size - 1; i++)
+                string[s_idx++] = number[i];
+            break;
+        case 'i':
+        case 'd':
+            si = va_arg(args, int);
+            FormatInt64(si, number);
+            p_len = strlen_sigsafe(number);
+
+            for (i = 0; i < p_len && s_idx < size - 1; i++)
+                string[s_idx++] = number[i];
+            break;
+
+        case 'p':
+            string[s_idx++] = '0';
+            if (s_idx < size - 1)
+                string[s_idx++] = 'x';
+            ui = (uintptr_t)va_arg(args, void*);
+            FormatUInt64Hex(ui, number);
+            p_len = strlen_sigsafe(number);
+
+            for (i = 0; i < p_len && s_idx < size - 1; i++)
+                string[s_idx++] = number[i];
+            break;
+
+        case 'x':
+            ui = va_arg(args, unsigned);
+            FormatUInt64Hex(ui, number);
+            p_len = strlen_sigsafe(number);
+
+            for (i = 0; i < p_len && s_idx < size - 1; i++)
+                string[s_idx++] = number[i];
+            break;
+
+        default:
+            va_arg(args, char*);
+            string[s_idx++] = '%';
+            if (s_idx < size - 1)
+                string[s_idx++] = f[f_idx];
+            break;
+        }
+    }
+
+    string[s_idx] = '\0';
+
+    return s_idx;
+}
+
+/* This function does the actual log message writes. It must be signal safe.
+ * When attempting to call non-signal-safe functions, guard them with a check
+ * of the inSignalContext global variable. */
 static void
 LogSWrite(int verb, const char *buf, size_t len, Bool end_line)
 {
     static Bool newline = TRUE;
 
     if (verb < 0 || logVerbosity >= verb)
-        fwrite(buf, len, 1, stderr);
+        write(2, buf, len);
+
     if (verb < 0 || logFileVerbosity >= verb) {
-        if (logFile) {
+        if (inSignalContext && logFileFd >= 0) {
+            write(logFileFd, buf, len);
+#ifndef WIN32
+            if (logFlush && logSync)
+                fsync(logFileFd);
+#endif
+        }
+        else if (!inSignalContext && logFile) {
             if (newline)
                 fprintf(logFile, "[%10.3f] ", GetTimeInMillis() / 1000.0);
             newline = end_line;
@@ -286,7 +392,7 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line)
 #endif
             }
         }
-        else if (needBuffer) {
+        else if (!inSignalContext && needBuffer) {
             if (len > bufferUnused) {
                 bufferSize += 1024;
                 bufferUnused += 1024;
@@ -351,6 +457,8 @@ LogMessageTypeVerbString(MessageType type, int verb)
         return X_UNKNOWN_STRING;
     case X_NONE:
         return X_NONE_STRING;
+    case X_DEBUG:
+        return X_DEBUG_STRING;
     default:
         return X_UNKNOWN_STRING;
     }
@@ -359,12 +467,27 @@ LogMessageTypeVerbString(MessageType type, int verb)
 void
 LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
 {
+    static unsigned int warned;
     const char *type_str;
     char buf[1024];
     const size_t size = sizeof(buf);
     Bool newline;
     size_t len = 0;
 
+    if (inSignalContext) {
+        if (warned < 3) {
+            BUG_WARN_MSG(inSignalContext,
+                         "Warning: attempting to log data in a signal unsafe "
+                         "manner while in signal context.\nPlease update to check "
+                         "inSignalContext and/or use LogMessageVerbSigSafe() or "
+                         "ErrorFSigSafe().\nThe offending log format message is:\n"
+                         "%s\n", format);
+            warned++;
+            if (warned == 3)
+                LogMessageVerbSigSafe(X_WARNING, -1, "Warned %u times about sigsafe logging. Will be quiet now.\n", warned);
+        }
+    }
+
     type_str = LogMessageTypeVerbString(type, verb);
     if (!type_str)
         return;
@@ -406,16 +529,69 @@ LogMessage(MessageType type, const char *format, ...)
     va_end(ap);
 }
 
+/* Log a message using only signal safe functions. */
+void
+LogMessageVerbSigSafe(MessageType type, int verb, const char *format, ...)
+{
+    va_list ap;
+    va_start(ap, format);
+    LogVMessageVerbSigSafe(type, verb, format, ap);
+    va_end(ap);
+}
+
+void
+LogVMessageVerbSigSafe(MessageType type, int verb, const char *format, va_list args)
+{
+    const char *type_str;
+    char buf[1024];
+    int len;
+    Bool newline;
+
+    type_str = LogMessageTypeVerbString(type, verb);
+    if (!type_str)
+        return;
+
+    /* if type_str is not "", prepend it and ' ', to message */
+    if (type_str[0] != '\0') {
+        LogSWrite(verb, type_str, strlen_sigsafe(type_str), FALSE);
+        LogSWrite(verb, " ", 1, FALSE);
+    }
+
+    len = pnprintf(buf, sizeof(buf), format, args);
+
+    /* Force '\n' at end of truncated line */
+    if (sizeof(buf) - len == 1)
+        buf[len - 1] = '\n';
+
+    newline = (buf[len - 1] == '\n');
+    LogSWrite(verb, buf, len, newline);
+}
+
 void
 LogVHdrMessageVerb(MessageType type, int verb, const char *msg_format,
                    va_list msg_args, const char *hdr_format, va_list hdr_args)
 {
+    static unsigned int warned;
     const char *type_str;
     char buf[1024];
     const size_t size = sizeof(buf);
     Bool newline;
     size_t len = 0;
 
+    if (inSignalContext) {
+        if (warned < 3) {
+            BUG_WARN_MSG(inSignalContext,
+                         "Warning: attempting to log data in a signal unsafe "
+                         "manner while in signal context.\nPlease update to check "
+                         "inSignalContext and/or use LogMessageVerbSigSafe().\nThe "
+                         "offending header and log message formats are:\n%s %s\n",
+                         hdr_format, msg_format);
+            warned++;
+            if (warned == 3)
+                LogMessageVerbSigSafe(X_WARNING, -1, "Warned %u times about sigsafe logging. Will be quiet now.\n", warned);
+        }
+    }
+
     type_str = LogMessageTypeVerbString(type, verb);
     if (!type_str)
         return;
@@ -583,6 +759,7 @@ void
 FatalError(const char *f, ...)
 {
     va_list args;
+    va_list args2;
     static Bool beenhere = FALSE;
 
     if (beenhere)
@@ -591,21 +768,26 @@ FatalError(const char *f, ...)
         ErrorF("\nFatal server error:\n");
 
     va_start(args, f);
+
+    /* Make a copy for OsVendorFatalError */
+    va_copy(args2, args);
+
 #ifdef __APPLE__
     {
-        va_list args2;
+        va_list apple_args;
 
-        va_copy(args2, args);
-        (void) vsnprintf(__crashreporter_info_buff__,
-                         sizeof(__crashreporter_info_buff__), f, args2);
-        va_end(args2);
+        va_copy(apple_args, args);
+        (void)vsnprintf(__crashreporter_info_buff__,
+                        sizeof(__crashreporter_info_buff__), f, apple_args);
+        va_end(apple_args);
     }
 #endif
     VErrorF(f, args);
     va_end(args);
     ErrorF("\n");
     if (!beenhere)
-        OsVendorFatalError();
+        OsVendorFatalError(f, args2);
+    va_end(args2);
     if (!beenhere) {
         beenhere = TRUE;
         AbortServer();
@@ -638,6 +820,22 @@ ErrorF(const char *f, ...)
 }
 
 void
+VErrorFSigSafe(const char *f, va_list args)
+{
+    LogVMessageVerbSigSafe(X_ERROR, -1, f, args);
+}
+
+void
+ErrorFSigSafe(const char *f, ...)
+{
+    va_list args;
+
+    va_start(args, f);
+    VErrorFSigSafe(f, args);
+    va_end(args);
+}
+
+void
 LogPrintMarkers(void)
 {
     /* Show what the message marker symbols mean. */
index 30ec53a..786d5ae 100644 (file)
@@ -113,7 +113,7 @@ OsSigHandler(int signo)
     const char *dlerr = dlerror();
 
     if (dlerr) {
-        LogMessage(X_ERROR, "Dynamic loader error: %s\n", dlerr);
+        LogMessageVerbSigSafe(X_ERROR, 1, "Dynamic loader error: %s\n", dlerr);
     }
 #endif                          /* RTLD_DI_SETSIGNAL */
 
@@ -129,8 +129,8 @@ OsSigHandler(int signo)
 
 #ifdef SA_SIGINFO
     if (sip->si_code == SI_USER) {
-        ErrorF("Recieved signal %d sent by process %ld, uid %ld\n",
-               signo, (long) sip->si_pid, (long) sip->si_uid);
+        ErrorFSigSafe("Recieved signal %u sent by process %u, uid %u\n", signo,
+                     sip->si_pid, sip->si_uid);
     }
     else {
         switch (signo) {
@@ -138,7 +138,7 @@ OsSigHandler(int signo)
         case SIGBUS:
         case SIGILL:
         case SIGFPE:
-            ErrorF("%s at address %p\n", strsignal(signo), sip->si_addr);
+            ErrorFSigSafe("%s at address %p\n", strsignal(signo), sip->si_addr);
         }
     }
 #endif
@@ -292,6 +292,7 @@ OsInit(void)
     }
     TimerInit();
     OsVendorInit();
+    OsResetSignals();
     /*
      * No log file by default.  OsVendorInit() should call LogInit() with the
      * log file name if logging to a file is desired.
index 30592d2..04bcbc6 100644 (file)
@@ -138,7 +138,6 @@ Bool noDPMSExtension = FALSE;
 #endif
 #ifdef GLXEXT
 Bool noGlxExtension = FALSE;
-Bool noGlxVisualInit = FALSE;
 #endif
 #ifdef SCREENSAVER
 Bool noScreenSaverExtension = FALSE;
@@ -204,6 +203,8 @@ int auditTrailLevel = 1;
 
 char *SeatId = NULL;
 
+sig_atomic_t inSignalContext = FALSE;
+
 #if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
 #define HAS_SAVED_IDS_AND_SETEUID
 #endif
@@ -659,6 +660,15 @@ ProcessCommandLine(int argc, char *argv[])
             else
                 UseMsg();
         }
+        else if (strcmp(argv[i], "-displayfd") == 0) {
+            if (++i < argc) {
+                displayfd = atoi(argv[i]);
+                display = NULL;
+                nolock = TRUE;
+            }
+            else
+                UseMsg();
+        }
 #ifdef DPMSExtension
         else if (strcmp(argv[i], "dpms") == 0)
             /* ignored for compatibility */ ;
@@ -746,8 +756,8 @@ ProcessCommandLine(int argc, char *argv[])
         else if (strcmp(argv[i], "-nolisten") == 0) {
             if (++i < argc) {
                 if (_XSERVTransNoListen(argv[i]))
-                    FatalError("Failed to disable listen for %s transport",
-                               argv[i]);
+                    ErrorF("Failed to disable listen for %s transport",
+                           argv[i]);
             }
             else
                 UseMsg();
@@ -1156,15 +1166,15 @@ OsBlockSignals(void)
     if (BlockedSignalCount++ == 0) {
         sigset_t set;
 
+#ifdef SIGIO
+        OsBlockSIGIO();
+#endif
         sigemptyset(&set);
         sigaddset(&set, SIGALRM);
         sigaddset(&set, SIGVTALRM);
 #ifdef SIGWINCH
         sigaddset(&set, SIGWINCH);
 #endif
-#ifdef SIGIO
-        sigaddset(&set, SIGIO);
-#endif
         sigaddset(&set, SIGTSTP);
         sigaddset(&set, SIGTTIN);
         sigaddset(&set, SIGTTOU);
@@ -1174,16 +1184,74 @@ OsBlockSignals(void)
 #endif
 }
 
+#ifdef SIG_BLOCK
+static sig_atomic_t sigio_blocked;
+static sigset_t PreviousSigIOMask;
+#endif
+
+/**
+ * returns zero if this call caused SIGIO to be blocked now, non-zero if it
+ * was already blocked by a previous call to this function.
+ */
+int
+OsBlockSIGIO(void)
+{
+#ifdef SIGIO
+#ifdef SIG_BLOCK
+    if (sigio_blocked++ == 0) {
+        sigset_t set;
+        int ret;
+
+        sigemptyset(&set);
+        sigaddset(&set, SIGIO);
+        sigprocmask(SIG_BLOCK, &set, &PreviousSigIOMask);
+        ret = sigismember(&PreviousSigIOMask, SIGIO);
+        return ret;
+    } else
+        return 1;
+#endif
+#endif
+}
+
+void
+OsReleaseSIGIO(void)
+{
+#ifdef SIGIO
+#ifdef SIG_BLOCK
+    if (--sigio_blocked == 0) {
+        sigprocmask(SIG_SETMASK, &PreviousSigIOMask, 0);
+    } else if (sigio_blocked < 0) {
+        BUG_WARN(sigio_blocked < 0);
+        sigio_blocked = 0;
+    }
+#endif
+#endif
+}
+
 void
 OsReleaseSignals(void)
 {
 #ifdef SIG_BLOCK
     if (--BlockedSignalCount == 0) {
         sigprocmask(SIG_SETMASK, &PreviousSignalMask, 0);
+        OsReleaseSIGIO();
     }
 #endif
 }
 
+void
+OsResetSignals(void)
+{
+#ifdef SIG_BLOCK
+    while (BlockedSignalCount > 0)
+        OsReleaseSignals();
+#ifdef SIGIO
+    while (sigio_blocked > 0)
+        OsReleaseSIGIO();
+#endif
+#endif
+}
+
 /*
  * Pending signals may interfere with core dumping. Provide a
  * mechanism to block signals when aborting.
@@ -1490,6 +1558,79 @@ Fclose(pointer iop)
 
 #endif                          /* !WIN32 */
 
+#ifdef WIN32
+
+#include <X11/Xwindows.h>
+
+const char *
+Win32TempDir()
+{
+    static char buffer[PATH_MAX];
+
+    if (GetTempPath(sizeof(buffer), buffer)) {
+        int len;
+
+        buffer[sizeof(buffer) - 1] = 0;
+        len = strlen(buffer);
+        if (len > 0)
+            if (buffer[len - 1] == '\\')
+                buffer[len - 1] = 0;
+        return buffer;
+    }
+    if (getenv("TEMP") != NULL)
+        return getenv("TEMP");
+    else if (getenv("TMP") != NULL)
+        return getenv("TMP");
+    else
+        return "/tmp";
+}
+
+int
+System(const char *cmdline)
+{
+    STARTUPINFO si;
+    PROCESS_INFORMATION pi;
+    DWORD dwExitCode;
+    char *cmd = strdup(cmdline);
+
+    ZeroMemory(&si, sizeof(si));
+    si.cb = sizeof(si);
+    ZeroMemory(&pi, sizeof(pi));
+
+    if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
+        LPVOID buffer;
+
+        if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                           FORMAT_MESSAGE_FROM_SYSTEM |
+                           FORMAT_MESSAGE_IGNORE_INSERTS,
+                           NULL,
+                           GetLastError(),
+                           MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                           (LPTSTR) & buffer, 0, NULL)) {
+            ErrorF("[xkb] Starting '%s' failed!\n", cmdline);
+        }
+        else {
+            ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *) buffer);
+            LocalFree(buffer);
+        }
+
+        free(cmd);
+        return -1;
+    }
+    /* Wait until child process exits. */
+    WaitForSingleObject(pi.hProcess, INFINITE);
+
+    GetExitCodeProcess(pi.hProcess, &dwExitCode);
+
+    /* Close process and thread handles. */
+    CloseHandle(pi.hProcess);
+    CloseHandle(pi.hThread);
+    free(cmd);
+
+    return dwExitCode;
+}
+#endif
+
 /*
  * CheckUserParameters: check for long command line arguments and long
  * environment variables.  By default, these checks are only done when
@@ -1782,3 +1923,61 @@ xstrtokenize(const char *str, const char *separators)
     free(list);
     return NULL;
 }
+
+/* Format a signed number into a string in a signal safe manner. The string
+ * should be at least 21 characters in order to handle all int64_t values.
+ */
+void
+FormatInt64(int64_t num, char *string)
+{
+    if (num < 0) {
+        string[0] = '-';
+        num *= -1;
+        string++;
+    }
+    FormatUInt64(num, string);
+}
+
+/* Format a number into a string in a signal safe manner. The string should be
+ * at least 21 characters in order to handle all uint64_t values. */
+void
+FormatUInt64(uint64_t num, char *string)
+{
+    uint64_t divisor;
+    int len;
+    int i;
+
+    for (len = 1, divisor = 10;
+         len < 20 && num / divisor;
+         len++, divisor *= 10);
+
+    for (i = len, divisor = 1; i > 0; i--, divisor *= 10)
+        string[i - 1] = '0' + ((num / divisor) % 10);
+
+    string[len] = '\0';
+}
+
+/* Format a number into a hexadecimal string in a signal safe manner. The string
+ * should be at least 17 characters in order to handle all uint64_t values. */
+void
+FormatUInt64Hex(uint64_t num, char *string)
+{
+    uint64_t divisor;
+    int len;
+    int i;
+
+    for (len = 1, divisor = 0x10;
+         len < 16 && num / divisor;
+         len++, divisor *= 0x10);
+
+    for (i = len, divisor = 1; i > 0; i--, divisor *= 0x10) {
+        int val = (num / divisor) % 0x10;
+
+        if (val < 10)
+            string[i - 1] = '0' + val;
+        else
+            string[i - 1] = 'a' + val - 10;
+    }
+
+    string[len] = '\0';
+}
index 8d0fbb5..87f04b4 100644 (file)
@@ -1391,7 +1391,7 @@ recv_alive_msg(unsigned length)
         if (SessionRunning && AliveSessionID == SessionID) {
             /* backoff dormancy period */
             state = XDM_RUN_SESSION;
-            if ((GetTimeInMillis() - lastDeviceEventTime.milliseconds) >
+            if ((GetTimeInMillis() - lastDeviceEventTime[XIAllDevices].milliseconds) >
                 keepaliveDormancy * 1000) {
                 keepaliveDormancy <<= 1;
                 if (keepaliveDormancy > XDM_MAX_DORMANCY)
index dccce74..fa66c7a 100644 (file)
@@ -74,6 +74,48 @@ x_sha1_final(void *ctx, unsigned char result[20])
     return 1;
 }
 
+#elif defined(HAVE_SHA1_IN_CRYPTOAPI)        /* Use CryptoAPI for SHA1 */
+
+#define WIN32_LEAN_AND_MEAN
+#include <X11/Xwindows.h>
+#include <wincrypt.h>
+
+static HCRYPTPROV hProv;
+
+void *
+x_sha1_init(void)
+{
+    HCRYPTHASH *ctx = malloc(sizeof(*ctx));
+
+    if (!ctx)
+        return NULL;
+    CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
+    CryptCreateHash(hProv, CALG_SHA1, 0, 0, ctx);
+    return ctx;
+}
+
+int
+x_sha1_update(void *ctx, void *data, int size)
+{
+    HCRYPTHASH *hHash = ctx;
+
+    CryptHashData(*hHash, data, size, 0);
+    return 1;
+}
+
+int
+x_sha1_final(void *ctx, unsigned char result[20])
+{
+    HCRYPTHASH *hHash = ctx;
+    DWORD len = 20;
+
+    CryptGetHashParam(*hHash, HP_HASHVAL, result, &len, 0);
+    CryptDestroyHash(*hHash);
+    CryptReleaseContext(hProv, 0);
+    free(ctx);
+    return 1;
+}
+
 #elif defined(HAVE_SHA1_IN_LIBGCRYPT)   /* Use libgcrypt for SHA1 */
 
 #include <gcrypt.h>
index 1ae1f82..8d38a75 100644 (file)
@@ -1,6 +1,6 @@
 Name:      xorg-x11-server
 Summary:    X.Org X11 X server
-Version:    1.12.2
+Version:    1.12.99.905
 Release:    1
 Group:      System/X11
 License:    MIT
@@ -253,9 +253,9 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{_libdir}/xorg
 %dir %{_libdir}/xorg/modules
 %dir %{_libdir}/xorg/modules/extensions
-%{_libdir}/xorg/modules/extensions/libdri2.so
-%{_libdir}/xorg/modules/extensions/libextmod.so
-%{_libdir}/xorg/modules/extensions/librecord.so
+#%{_libdir}/xorg/modules/extensions/libdri2.so
+#%{_libdir}/xorg/modules/extensions/libextmod.so
+#%{_libdir}/xorg/modules/extensions/librecord.so
 %dir %{_libdir}/xorg/modules/multimedia
 %{_libdir}/xorg/modules/*.so
 
index de338b9..ccaff3f 100644 (file)
@@ -18,6 +18,8 @@ librandr_la_SOURCES = \
        rroutput.c      \
        rrpointer.c     \
        rrproperty.c    \
+       rrprovider.c    \
+       rrproviderproperty.c    \
        rrscreen.c      \
        rrsdispatch.c   \
        rrtransform.h   \
index 9f3df5f..da48c3f 100644 (file)
@@ -30,6 +30,7 @@
 #endif
 
 #include "randrstr.h"
+#include "extinit.h"
 
 /* From render.h */
 #ifndef SubPixelUnknown
@@ -83,7 +84,7 @@ RRClientCallback(CallbackListPtr *list, pointer closure, pointer data)
 }
 
 static Bool
-RRCloseScreen(int i, ScreenPtr pScreen)
+RRCloseScreen(ScreenPtr pScreen)
 {
     rrScrPriv(pScreen);
     int j;
@@ -94,11 +95,14 @@ RRCloseScreen(int i, ScreenPtr pScreen)
     for (j = pScrPriv->numOutputs - 1; j >= 0; j--)
         RROutputDestroy(pScrPriv->outputs[j]);
 
+    if (pScrPriv->provider)
+        RRProviderDestroy(pScrPriv->provider);
+
     free(pScrPriv->crtcs);
     free(pScrPriv->outputs);
     free(pScrPriv);
     RRNScreens -= 1;            /* ok, one fewer screen with RandR running */
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
@@ -176,6 +180,47 @@ SRROutputPropertyNotifyEvent(xRROutputPropertyNotifyEvent * from,
 }
 
 static void
+SRRProviderChangeNotifyEvent(xRRProviderChangeNotifyEvent * from,
+                         xRRProviderChangeNotifyEvent * to)
+{
+    to->type = from->type;
+    to->subCode = from->subCode;
+    cpswaps(from->sequenceNumber, to->sequenceNumber);
+    cpswapl(from->timestamp, to->timestamp);
+    cpswapl(from->window, to->window);
+    cpswapl(from->provider, to->provider);
+}
+
+static void
+SRRProviderPropertyNotifyEvent(xRRProviderPropertyNotifyEvent * from,
+                               xRRProviderPropertyNotifyEvent * to)
+{
+    to->type = from->type;
+    to->subCode = from->subCode;
+    cpswaps(from->sequenceNumber, to->sequenceNumber);
+    cpswapl(from->window, to->window);
+    cpswapl(from->provider, to->provider);
+    cpswapl(from->atom, to->atom);
+    cpswapl(from->timestamp, to->timestamp);
+    to->state = from->state;
+    /* pad1 */
+    /* pad2 */
+    /* pad3 */
+    /* pad4 */
+}
+
+static void
+SRRResourceChangeNotifyEvent(xRRResourceChangeNotifyEvent * from,
+                             xRRResourceChangeNotifyEvent * to)
+{
+    to->type = from->type;
+    to->subCode = from->subCode;
+    cpswaps(from->sequenceNumber, to->sequenceNumber);
+    cpswapl(from->timestamp, to->timestamp);
+    cpswapl(from->window, to->window);
+}
+
+static void
 SRRNotifyEvent(xEvent *from, xEvent *to)
 {
     switch (from->u.u.detail) {
@@ -191,6 +236,17 @@ SRRNotifyEvent(xEvent *from, xEvent *to)
         SRROutputPropertyNotifyEvent((xRROutputPropertyNotifyEvent *) from,
                                      (xRROutputPropertyNotifyEvent *) to);
         break;
+    case RRNotify_ProviderChange:
+        SRRProviderChangeNotifyEvent((xRRProviderChangeNotifyEvent *) from,
+                                   (xRRProviderChangeNotifyEvent *) to);
+        break;
+    case RRNotify_ProviderProperty:
+        SRRProviderPropertyNotifyEvent((xRRProviderPropertyNotifyEvent *) from,
+                                       (xRRProviderPropertyNotifyEvent *) to);
+        break;
+    case RRNotify_ResourceChange:
+        SRRResourceChangeNotifyEvent((xRRResourceChangeNotifyEvent *) from,
+                                   (xRRResourceChangeNotifyEvent *) to);
     default:
         break;
     }
@@ -269,7 +325,7 @@ RRScreenInit(ScreenPtr pScreen)
     wrap(pScrPriv, pScreen, CloseScreen, RRCloseScreen);
 
     pScreen->ConstrainCursorHarder = RRConstrainCursorHarder;
-
+    pScreen->ReplaceScanoutPixmap = RRReplaceScanoutPixmap;
     pScrPriv->numOutputs = 0;
     pScrPriv->outputs = NULL;
     pScrPriv->numCrtcs = 0;
@@ -356,7 +412,7 @@ RRExtensionInit(void)
     RRModeInitErrorValue();
     RRCrtcInitErrorValue();
     RROutputInitErrorValue();
-
+    RRProviderInitErrorValue();
 #ifdef PANORAMIX
     RRXineramaExtensionInit();
 #endif
@@ -412,25 +468,37 @@ TellChanged(WindowPtr pWin, pointer value)
 void
 RRTellChanged(ScreenPtr pScreen)
 {
+    ScreenPtr master;
     rrScrPriv(pScreen);
+    rrScrPrivPtr mastersp;
     int i;
 
+    if (pScreen->isGPU) {
+        master = pScreen->current_master;
+        mastersp = rrGetScrPriv(master);
+    }
+    else {
+        master = pScreen;
+        mastersp = pScrPriv;
+    }
+
     if (pScrPriv->changed) {
-        UpdateCurrentTime();
-        if (pScrPriv->configChanged) {
-            pScrPriv->lastConfigTime = currentTime;
-            pScrPriv->configChanged = FALSE;
+        UpdateCurrentTimeIf();
+        if (mastersp->configChanged) {
+            mastersp->lastConfigTime = currentTime;
+            mastersp->configChanged = FALSE;
         }
         pScrPriv->changed = FALSE;
-        WalkTree(pScreen, TellChanged, (pointer) pScreen);
+        mastersp->changed = FALSE;
+        WalkTree(master, TellChanged, (pointer) master);
         for (i = 0; i < pScrPriv->numOutputs; i++)
             pScrPriv->outputs[i]->changed = FALSE;
         for (i = 0; i < pScrPriv->numCrtcs; i++)
             pScrPriv->crtcs[i]->changed = FALSE;
-        if (pScrPriv->layoutChanged) {
+        if (mastersp->layoutChanged) {
             pScrPriv->layoutChanged = FALSE;
-            RRPointerScreenConfigured(pScreen);
-            RRSendConfigNotify(pScreen);
+            RRPointerScreenConfigured(master);
+            RRSendConfigNotify(master);
         }
     }
 }
@@ -446,6 +514,9 @@ RRFirstOutput(ScreenPtr pScreen)
     RROutputPtr output;
     int i, j;
 
+    if (!pScrPriv)
+        return NULL;
+
     if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc)
         return pScrPriv->primaryOutput;
 
index 273885d..212b0a9 100644 (file)
@@ -62,6 +62,7 @@
 typedef XID RRMode;
 typedef XID RROutput;
 typedef XID RRCrtc;
+typedef XID RRProvider;
 
 extern _X_EXPORT int RREventBase, RRErrorBase;
 
@@ -78,6 +79,7 @@ typedef struct _rrPropertyValue RRPropertyValueRec, *RRPropertyValuePtr;
 typedef struct _rrProperty RRPropertyRec, *RRPropertyPtr;
 typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr;
 typedef struct _rrOutput RROutputRec, *RROutputPtr;
+typedef struct _rrProvider RRProviderRec, *RRProviderPtr;
 
 struct _rrMode {
     int refcnt;
@@ -125,6 +127,8 @@ struct _rrCrtc {
     PictTransform transform;
     struct pict_f_transform f_transform;
     struct pict_f_transform f_inverse;
+
+    PixmapPtr scanout_pixmap;
 };
 
 struct _rrOutput {
@@ -152,6 +156,18 @@ struct _rrOutput {
     void *devPrivate;
 };
 
+struct _rrProvider {
+    RRProvider id;
+    ScreenPtr pScreen;
+    uint32_t capabilities;
+    char *name;
+    int nameLength;
+    RRPropertyPtr properties;
+    Bool pendingProperties;
+    struct _rrProvider *offload_sink;
+    struct _rrProvider *output_source;
+};
+
 #if RANDR_12_INTERFACE
 typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen,
                                         CARD16 width,
@@ -197,8 +213,24 @@ typedef Bool (*RRSetPanningProcPtr) (ScreenPtr pScrn,
 
 #endif                          /* RANDR_13_INTERFACE */
 
+typedef Bool (*RRProviderGetPropertyProcPtr) (ScreenPtr pScreen,
+                                            RRProviderPtr provider, Atom property);
+typedef Bool (*RRProviderSetPropertyProcPtr) (ScreenPtr pScreen,
+                                              RRProviderPtr provider,
+                                              Atom property,
+                                              RRPropertyValuePtr value);
+
 typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation * rotations);
-typedef Bool (*RRCloseScreenProcPtr) (int i, ScreenPtr pscreen);
+typedef Bool (*RRCloseScreenProcPtr) (ScreenPtr pscreen);
+
+typedef Bool (*RRProviderSetOutputSourceProcPtr)(ScreenPtr pScreen,
+                                          RRProviderPtr provider,
+                                          RRProviderPtr output_source);
+
+typedef Bool (*RRProviderSetOffloadSinkProcPtr)(ScreenPtr pScreen,
+                                         RRProviderPtr provider,
+                                         RRProviderPtr offload_sink);
+
 
 /* These are for 1.0 compatibility */
 
@@ -223,6 +255,8 @@ typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
 
 #endif
 
+typedef Bool (*RRCrtcSetScanoutPixmapProcPtr)(RRCrtcPtr crtc, PixmapPtr pixmap);
+
 typedef struct _rrScrPriv {
     /*
      * 'public' part of the structure; DDXen fill this in
@@ -246,7 +280,13 @@ typedef struct _rrScrPriv {
     RRGetPanningProcPtr rrGetPanning;
     RRSetPanningProcPtr rrSetPanning;
 #endif
+    /* TODO #if RANDR_15_INTERFACE */
+    RRCrtcSetScanoutPixmapProcPtr rrCrtcSetScanoutPixmap;
 
+    RRProviderSetOutputSourceProcPtr rrProviderSetOutputSource;
+    RRProviderSetOffloadSinkProcPtr rrProviderSetOffloadSink;
+    RRProviderGetPropertyProcPtr rrProviderGetProperty;
+    RRProviderSetPropertyProcPtr rrProviderSetProperty;
     /*
      * Private part of the structure; not considered part of the ABI
      */
@@ -288,6 +328,8 @@ typedef struct _rrScrPriv {
     int size;
 #endif
     Bool discontiguous;
+
+    RRProviderPtr provider;
 } rrScrPrivRec, *rrScrPrivPtr;
 
 extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;
@@ -331,7 +373,7 @@ extern _X_EXPORT RESTYPE RRClientType, RREventType;     /* resource types for ev
 extern _X_EXPORT DevPrivateKeyRec RRClientPrivateKeyRec;
 
 #define RRClientPrivateKey (&RRClientPrivateKeyRec)
-extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
+extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType;
 
 #define VERIFY_RR_OUTPUT(id, ptr, a)\
     {\
@@ -363,13 +405,19 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
        }\
     }
 
+#define VERIFY_RR_PROVIDER(id, ptr, a)\
+    {\
+        int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
+                                         RRProviderType, client, a);\
+        if (rc != Success) {\
+            client->errorValue = id;\
+            return rc;\
+        }\
+    }
+
 #define GetRRClient(pClient)    ((RRClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RRClientPrivateKey))
 #define rrClientPriv(pClient)  RRClientPtr pRRClient = GetRRClient(pClient)
 
-/* Initialize the extension */
-extern _X_EXPORT void
- RRExtensionInit(void);
-
 #ifdef RANDR_12_INTERFACE
 /*
  * Set the range of sizes for the screen
@@ -575,25 +623,6 @@ extern _X_EXPORT void
  RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
 
 /*
- * Compute the complete transformation matrix including
- * client-specified transform, rotation/reflection values and the crtc 
- * offset.
- *
- * Return TRUE if the resulting transform is not a simple translation.
- */
-extern _X_EXPORT Bool
-
-RRTransformCompute(int x,
-                   int y,
-                   int width,
-                   int height,
-                   Rotation rotation,
-                   RRTransformPtr rr_transform,
-                   PictTransformPtr transform,
-                   struct pict_f_transform *f_transform,
-                   struct pict_f_transform *f_inverse);
-
-/*
  * Return crtc transform
  */
 extern _X_EXPORT RRTransformPtr RRCrtcGetTransform(RRCrtcPtr crtc);
@@ -635,6 +664,15 @@ extern _X_EXPORT void
  RRCrtcInitErrorValue(void);
 
 /*
+ * Detach and free a scanout pixmap
+ */
+extern _X_EXPORT void
+ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc);
+
+extern _X_EXPORT Bool
+ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable);
+
+/*
  * Crtc dispatch
  */
 
@@ -843,6 +881,74 @@ extern _X_EXPORT int
 extern _X_EXPORT int
  ProcRRDeleteOutputProperty(ClientPtr client);
 
+/* rrprovider.c */
+extern _X_EXPORT void
+RRProviderInitErrorValue(void);
+
+extern _X_EXPORT int
+ProcRRGetProviders(ClientPtr client);
+
+extern _X_EXPORT int
+ProcRRGetProviderInfo(ClientPtr client);
+
+extern _X_EXPORT int
+ProcRRSetProviderOutputSource(ClientPtr client);
+
+extern _X_EXPORT int
+ProcRRSetProviderOffloadSink(ClientPtr client);
+
+extern _X_EXPORT Bool
+RRProviderInit(void);
+
+extern _X_EXPORT RRProviderPtr
+RRProviderCreate(ScreenPtr pScreen, const char *name,
+                 int nameLength);
+
+extern _X_EXPORT void
+RRProviderDestroy (RRProviderPtr provider);
+
+extern _X_EXPORT void
+RRProviderSetCapabilities(RRProviderPtr provider, uint32_t capabilities);
+
+extern _X_EXPORT Bool
+RRProviderLookup(XID id, RRProviderPtr *provider_p);
+
+/* rrproviderproperty.c */
+
+extern _X_EXPORT void
+ RRDeleteAllProviderProperties(RRProviderPtr provider);
+
+extern _X_EXPORT RRPropertyValuePtr
+ RRGetProviderProperty(RRProviderPtr provider, Atom property, Bool pending);
+
+extern _X_EXPORT RRPropertyPtr
+ RRQueryProviderProperty(RRProviderPtr provider, Atom property);
+
+extern _X_EXPORT void
+ RRDeleteProviderProperty(RRProviderPtr provider, Atom property);
+
+extern _X_EXPORT int
+RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
+                       int format, int mode, unsigned long len,
+                       pointer value, Bool sendevent, Bool pending);
+
+extern _X_EXPORT int
+ ProcRRGetProviderProperty(ClientPtr client);
+
+extern _X_EXPORT int
+ ProcRRListProviderProperties(ClientPtr client);
+
+extern _X_EXPORT int
+ ProcRRQueryProviderProperty(ClientPtr client);
+
+extern _X_EXPORT int
+ProcRRConfigureProviderProperty(ClientPtr client);
+
+extern _X_EXPORT int
+ProcRRChangeProviderProperty(ClientPtr client);
+
+extern _X_EXPORT int
+ ProcRRDeleteProviderProperty(ClientPtr client);
 /* rrxinerama.c */
 #ifdef XINERAMA
 extern _X_EXPORT void
index 36caa58..e82d050 100644 (file)
@@ -236,29 +236,21 @@ RRDeliverCrtcEvent(ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc)
     ScreenPtr pScreen = pWin->drawable.pScreen;
 
     rrScrPriv(pScreen);
-    xRRCrtcChangeNotifyEvent ce;
     RRModePtr mode = crtc->mode;
 
-    ce.type = RRNotify + RREventBase;
-    ce.subCode = RRNotify_CrtcChange;
-    ce.timestamp = pScrPriv->lastSetTime.milliseconds;
-    ce.window = pWin->drawable.id;
-    ce.crtc = crtc->id;
-    ce.rotation = crtc->rotation;
-    if (mode) {
-        ce.mode = mode->mode.id;
-        ce.x = crtc->x;
-        ce.y = crtc->y;
-        ce.width = mode->mode.width;
-        ce.height = mode->mode.height;
-    }
-    else {
-        ce.mode = None;
-        ce.x = 0;
-        ce.y = 0;
-        ce.width = 0;
-        ce.height = 0;
-    }
+    xRRCrtcChangeNotifyEvent ce = {
+        .type = RRNotify + RREventBase,
+        .subCode = RRNotify_CrtcChange,
+        .timestamp = pScrPriv->lastSetTime.milliseconds,
+        .window = pWin->drawable.id,
+        .crtc = crtc->id,
+        .mode = mode ? mode->mode.id : None,
+        .rotation = crtc->rotation,
+        .x = mode ? crtc->x : 0,
+        .y = mode ? crtc->y : 0,
+        .width = mode ? mode->mode.width : 0,
+        .height = mode ? mode->mode.height : 0
+    };
     WriteEventsToClient(client, 1, (xEvent *) &ce);
 }
 
@@ -367,6 +359,154 @@ RRComputeContiguity(ScreenPtr pScreen)
     pScrPriv->discontiguous = discontiguous;
 }
 
+void
+RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
+{
+    ScreenPtr master = crtc->pScreen->current_master;
+    int ret;
+    PixmapPtr mscreenpix;
+    rrScrPriv(crtc->pScreen);
+
+    mscreenpix = master->GetScreenPixmap(master);
+
+    ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
+    if (crtc->scanout_pixmap) {
+        master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap);
+        master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap);
+        crtc->pScreen->DestroyPixmap(crtc->scanout_pixmap);
+    }
+    crtc->scanout_pixmap = NULL;
+    RRCrtcChanged(crtc, TRUE);
+}
+
+static Bool
+rrCreateSharedPixmap(RRCrtcPtr crtc, int width, int height,
+                     int x, int y)
+{
+    PixmapPtr mpix, spix;
+    ScreenPtr master = crtc->pScreen->current_master;
+    Bool ret;
+    int depth;
+    PixmapPtr mscreenpix;
+    PixmapPtr protopix = crtc->pScreen->current_master->GetScreenPixmap(crtc->pScreen->current_master);
+    rrScrPriv(crtc->pScreen);
+
+    /* create a pixmap on the master screen,
+       then get a shared handle for it
+       create a shared pixmap on the slave screen using the handle
+       set the master screen to do dirty updates to the shared pixmap
+       from the screen pixmap.
+       set slave screen to scanout shared linear pixmap
+    */
+
+    mscreenpix = master->GetScreenPixmap(master);
+    depth = protopix->drawable.depth;
+
+    if (crtc->scanout_pixmap)
+        RRCrtcDetachScanoutPixmap(crtc);
+
+    if (width == 0 && height == 0) {
+        return TRUE;
+    }
+
+    mpix = master->CreatePixmap(master, width, height, depth,
+                                CREATE_PIXMAP_USAGE_SHARED);
+    if (!mpix)
+        return FALSE;
+
+    spix = PixmapShareToSlave(mpix, crtc->pScreen);
+    if (spix == NULL) {
+        master->DestroyPixmap(mpix);
+        return FALSE;
+    }
+
+    ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, spix);
+    if (ret == FALSE) {
+        ErrorF("failed to set shadow slave pixmap\n");
+        return FALSE;
+    }
+
+    crtc->scanout_pixmap = spix;
+
+    master->StartPixmapTracking(mscreenpix, spix, x, y);
+    return TRUE;
+}
+
+static Bool
+rrCheckPixmapBounding(ScreenPtr pScreen,
+                      RRCrtcPtr rr_crtc, int x, int y, int w, int h)
+{
+    RegionRec root_pixmap_region, total_region, new_crtc_region;
+    int i, c;
+    BoxRec newbox;
+    BoxPtr newsize;
+    ScreenPtr slave;
+    int new_width, new_height;
+    PixmapPtr screen_pixmap = pScreen->GetScreenPixmap(pScreen);
+    rrScrPriv(pScreen);
+
+    PixmapRegionInit(&root_pixmap_region, screen_pixmap);
+    RegionInit(&total_region, NULL, 0);
+
+    /* have to iterate all the crtcs of the attached gpu masters
+       and all their output slaves */
+    for (c = 0; c < pScrPriv->numCrtcs; c++) {
+        if (pScrPriv->crtcs[c] == rr_crtc) {
+            newbox.x1 = x;
+            newbox.x2 = x + w;
+            newbox.y1 = y;
+            newbox.y2 = y + h;
+        } else {
+            if (!pScrPriv->crtcs[c]->mode)
+                continue;
+            newbox.x1 = pScrPriv->crtcs[c]->x;
+            newbox.x2 = pScrPriv->crtcs[c]->x + pScrPriv->crtcs[c]->mode->mode.width;
+            newbox.y1 = pScrPriv->crtcs[c]->y;
+            newbox.y2 = pScrPriv->crtcs[c]->y + pScrPriv->crtcs[c]->mode->mode.height;
+        }
+        RegionInit(&new_crtc_region, &newbox, 1);
+        RegionUnion(&total_region, &total_region, &new_crtc_region);
+    }
+
+    xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
+        rrScrPriv(slave);
+        for (c = 0; c < pScrPriv->numCrtcs; c++)
+            if (pScrPriv->crtcs[c] == rr_crtc) {
+                newbox.x1 = x;
+                newbox.x2 = x + w;
+                newbox.y1 = y;
+                newbox.y2 = y + h;
+            }
+            else {
+                if (!pScrPriv->crtcs[c]->mode)
+                    continue;
+                newbox.x1 = pScrPriv->crtcs[c]->x;
+                newbox.x2 = pScrPriv->crtcs[c]->x + pScrPriv->crtcs[c]->mode->mode.width;
+                newbox.y1 = pScrPriv->crtcs[c]->y;
+                newbox.y2 = pScrPriv->crtcs[c]->y + pScrPriv->crtcs[c]->mode->mode.height;
+            }
+        RegionInit(&new_crtc_region, &newbox, 1);
+        RegionUnion(&total_region, &total_region, &new_crtc_region);
+    }
+
+    newsize = RegionExtents(&total_region);
+    new_width = newsize->x2 - newsize->x1;
+    new_height = newsize->y2 - newsize->y1;
+
+    if (new_width == screen_pixmap->drawable.width &&
+        new_height == screen_pixmap->drawable.height) {
+        ErrorF("adjust shatters %d %d\n", newsize->x1, newsize->x2);
+    } else {
+        int ret;
+        rrScrPriv(pScreen);
+        ret = pScrPriv->rrScreenSetSize(pScreen,
+                                           new_width, new_height, 0, 0);
+    }
+
+    /* set shatters TODO */
+    return TRUE;
+}
+
 /*
  * Request that the Crtc be reconfigured
  */
@@ -394,6 +534,26 @@ RRCrtcSet(RRCrtcPtr crtc,
         ret = TRUE;
     }
     else {
+        if (pScreen->isGPU) {
+            ScreenPtr master = pScreen->current_master;
+            int width = 0, height = 0;
+
+            if (mode) {
+                width = mode->mode.width;
+                height = mode->mode.height;
+            }
+            ErrorF("have a master to look out for\n");
+            ret = rrCheckPixmapBounding(master, crtc,
+                                        x, y, width, height);
+            if (!ret)
+                return FALSE;
+
+            if (pScreen->current_master) {
+                ret = rrCreateSharedPixmap(crtc, width, height, x, y);
+                ErrorF("need to create shared pixmap %d", ret);
+
+            }
+        }
 #if RANDR_12_INTERFACE
         if (pScrPriv->rrCrtcSet) {
             ret = (*pScrPriv->rrCrtcSet) (pScreen, crtc, mode, x, y,
@@ -508,6 +668,9 @@ RRCrtcDestroyResource(pointer value, XID pid)
             }
         }
     }
+
+    if (crtc->scanout_pixmap)
+        RRCrtcDetachScanoutPixmap(crtc);
     free(crtc->gammaRed);
     if (crtc->mode)
         RRModeDestroy(crtc->mode);
@@ -729,11 +892,13 @@ ProcRRGetCrtcInfo(ClientPtr client)
 
     mode = crtc->mode;
 
-    rep.type = X_Reply;
-    rep.status = RRSetConfigSuccess;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.timestamp = pScrPriv->lastSetTime.milliseconds;
+    rep = (xRRGetCrtcInfoReply) {
+        .type = X_Reply,
+        .status = RRSetConfigSuccess,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .timestamp = pScrPriv->lastSetTime.milliseconds
+    };
     if (pScrPriv->rrGetPanning &&
         pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) &&
         (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1))
@@ -804,9 +969,9 @@ ProcRRGetCrtcInfo(ClientPtr client)
         swaps(&rep.nOutput);
         swaps(&rep.nPossibleOutput);
     }
-    WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRGetCrtcInfoReply), &rep);
     if (extraLen) {
-        WriteToClient(client, extraLen, (char *) extra);
+        WriteToClient(client, extraLen, extra);
         free(extra);
     }
 
@@ -825,10 +990,10 @@ ProcRRSetCrtcConfig(ClientPtr client)
     int numOutputs;
     RROutputPtr *outputs = NULL;
     RROutput *outputIds;
-    TimeStamp configTime;
     TimeStamp time;
     Rotation rotation;
-    int rc, i, j;
+    int ret, i, j;
+    CARD8 status;
 
     REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
     numOutputs = (stuff->length - bytes_to_int32(SIZEOF(xRRSetCrtcConfigReq)));
@@ -855,11 +1020,11 @@ ProcRRSetCrtcConfig(ClientPtr client)
 
     outputIds = (RROutput *) (stuff + 1);
     for (i = 0; i < numOutputs; i++) {
-        rc = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i],
+        ret = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i],
                                      RROutputType, client, DixSetAttrAccess);
-        if (rc != Success) {
+        if (ret != Success) {
             free(outputs);
-            return rc;
+            return ret;
         }
         /* validate crtc for this output */
         for (j = 0; j < outputs[i]->numCrtcs; j++)
@@ -904,11 +1069,10 @@ ProcRRSetCrtcConfig(ClientPtr client)
     pScrPriv = rrGetScrPriv(pScreen);
 
     time = ClientTimeToServerTime(stuff->timestamp);
-    configTime = ClientTimeToServerTime(stuff->configTimestamp);
 
     if (!pScrPriv) {
         time = currentTime;
-        rep.status = RRSetConfigFailed;
+        status = RRSetConfigFailed;
         goto sendReply;
     }
 
@@ -956,6 +1120,16 @@ ProcRRSetCrtcConfig(ClientPtr client)
             int source_height;
             PictTransform transform;
             struct pixman_f_transform f_transform, f_inverse;
+            int width, height;
+
+            if (pScreen->isGPU) {
+                width = pScreen->current_master->width;
+                height = pScreen->current_master->height;
+            }
+            else {
+                width = pScreen->width;
+                height = pScreen->height;
+            }
 
             RRTransformCompute(stuff->x, stuff->y,
                                mode->mode.width, mode->mode.height,
@@ -965,13 +1139,13 @@ ProcRRSetCrtcConfig(ClientPtr client)
 
             RRModeGetScanoutSize(mode, &transform, &source_width,
                                  &source_height);
-            if (stuff->x + source_width > pScreen->width) {
+            if (stuff->x + source_width > width) {
                 client->errorValue = stuff->x;
                 free(outputs);
                 return BadValue;
             }
 
-            if (stuff->y + source_height > pScreen->height) {
+            if (stuff->y + source_height > height) {
                 client->errorValue = stuff->y;
                 free(outputs);
                 return BadValue;
@@ -982,27 +1156,29 @@ ProcRRSetCrtcConfig(ClientPtr client)
 
     if (!RRCrtcSet(crtc, mode, stuff->x, stuff->y,
                    rotation, numOutputs, outputs)) {
-        rep.status = RRSetConfigFailed;
+        status = RRSetConfigFailed;
         goto sendReply;
     }
-    rep.status = RRSetConfigSuccess;
+    status = RRSetConfigSuccess;
     pScrPriv->lastSetTime = time;
 
  sendReply:
     free(outputs);
 
-    rep.type = X_Reply;
-    /* rep.status has already been filled in */
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
+    rep = (xRRSetCrtcConfigReply) {
+        .type = X_Reply,
+        .status = status,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .newTimestamp = pScrPriv->lastSetTime.milliseconds
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.newTimestamp);
     }
-    WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRSetCrtcConfigReply), &rep);
 
     return Success;
 }
@@ -1031,12 +1207,13 @@ ProcRRGetPanning(ClientPtr client)
     if (!pScrPriv)
         return RRErrorBase + BadRRCrtc;
 
-    memset(&rep, 0, sizeof(rep));
-    rep.type = X_Reply;
-    rep.status = RRSetConfigSuccess;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 1;
-    rep.timestamp = pScrPriv->lastSetTime.milliseconds;
+    rep = (xRRGetPanningReply) {
+        .type = X_Reply,
+        .status = RRSetConfigSuccess,
+        .sequenceNumber = client->sequence,
+        .length = 1,
+        .timestamp = pScrPriv->lastSetTime.milliseconds
+    };
 
     if (pScrPriv->rrGetPanning &&
         pScrPriv->rrGetPanning(pScreen, crtc, &total, &tracking, border)) {
@@ -1071,7 +1248,7 @@ ProcRRGetPanning(ClientPtr client)
         swaps(&rep.border_right);
         swaps(&rep.border_bottom);
     }
-    WriteToClient(client, sizeof(xRRGetPanningReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRGetPanningReply), &rep);
     return Success;
 }
 
@@ -1087,6 +1264,7 @@ ProcRRSetPanning(ClientPtr client)
     BoxRec total;
     BoxRec tracking;
     INT16 border[4];
+    CARD8 status;
 
     REQUEST_SIZE_MATCH(xRRSetPanningReq);
     VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
@@ -1099,7 +1277,7 @@ ProcRRSetPanning(ClientPtr client)
 
     if (!pScrPriv) {
         time = currentTime;
-        rep.status = RRSetConfigFailed;
+        status = RRSetConfigFailed;
         goto sendReply;
     }
 
@@ -1126,20 +1304,23 @@ ProcRRSetPanning(ClientPtr client)
 
     pScrPriv->lastSetTime = time;
 
-    rep.status = RRSetConfigSuccess;
+    status = RRSetConfigSuccess;
 
  sendReply:
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
+    rep = (xRRSetPanningReply) {
+        .type = X_Reply,
+        .status = status,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .newTimestamp = pScrPriv->lastSetTime.milliseconds
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.newTimestamp);
     }
-    WriteToClient(client, sizeof(xRRSetPanningReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRSetPanningReply), &rep);
     return Success;
 }
 
@@ -1157,16 +1338,18 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
     if (!RRCrtcGammaGet(crtc))
         return RRErrorBase + BadRRCrtc;
 
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = 0;
-    reply.size = crtc->gammaSize;
+    reply = (xRRGetCrtcGammaSizeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .size = crtc->gammaSize
+    };
     if (client->swapped) {
         swaps(&reply.sequenceNumber);
         swapl(&reply.length);
         swaps(&reply.size);
     }
-    WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), (char *) &reply);
+    WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), &reply);
     return Success;
 }
 
@@ -1194,16 +1377,18 @@ ProcRRGetCrtcGamma(ClientPtr client)
             return BadAlloc;
     }
 
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
-    reply.length = bytes_to_int32(len);
-    reply.size = crtc->gammaSize;
+    reply = (xRRGetCrtcGammaReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(len),
+        .size = crtc->gammaSize
+    };
     if (client->swapped) {
         swaps(&reply.sequenceNumber);
         swapl(&reply.length);
         swaps(&reply.size);
     }
-    WriteToClient(client, sizeof(xRRGetCrtcGammaReply), (char *) &reply);
+    WriteToClient(client, sizeof(xRRGetCrtcGammaReply), &reply);
     if (crtc->gammaSize) {
         memcpy(extra, crtc->gammaRed, len);
         client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write;
@@ -1344,7 +1529,7 @@ ProcRRGetCrtcTransform(ClientPtr client)
     nextra = (transform_filter_length(pending) +
               transform_filter_length(current));
 
-    reply = malloc(sizeof(xRRGetCrtcTransformReply) + nextra);
+    reply = calloc(1, sizeof(xRRGetCrtcTransformReply) + nextra);
     if (!reply)
         return BadAlloc;
 
@@ -1369,24 +1554,15 @@ ProcRRGetCrtcTransform(ClientPtr client)
         swaps(&reply->sequenceNumber);
         swapl(&reply->length);
     }
-    WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra,
-                  (char *) reply);
+    WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra, reply);
     free(reply);
     return Success;
 }
 
-void
-RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x,
-                        int *y)
+static Bool check_all_screen_crtcs(ScreenPtr pScreen, int *x, int *y)
 {
     rrScrPriv(pScreen);
     int i;
-
-    /* intentional dead space -> let it float */
-    if (pScrPriv->discontiguous)
-        return;
-
-    /* if we're moving inside a crtc, we're fine */
     for (i = 0; i < pScrPriv->numCrtcs; i++) {
         RRCrtcPtr crtc = pScrPriv->crtcs[i];
 
@@ -1398,8 +1574,15 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x,
         crtc_bounds(crtc, &left, &right, &top, &bottom);
 
         if ((*x >= left) && (*x < right) && (*y >= top) && (*y < bottom))
-            return;
+            return TRUE;
     }
+    return FALSE;
+}
+
+static Bool constrain_all_screen_crtcs(DeviceIntPtr pDev, ScreenPtr pScreen, int *x, int *y)
+{
+    rrScrPriv(pScreen);
+    int i;
 
     /* if we're trying to escape, clamp to the CRTC we're coming from */
     for (i = 0; i < pScrPriv->numCrtcs; i++) {
@@ -1423,7 +1606,101 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x,
             if (*y >= bottom)
                 *y = bottom - 1;
 
+            return TRUE;
+        }
+    }
+    return FALSE;
+}
+
+void
+RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x,
+                        int *y)
+{
+    rrScrPriv(pScreen);
+    Bool ret;
+    ScreenPtr slave;
+
+    /* intentional dead space -> let it float */
+    if (pScrPriv->discontiguous)
+        return;
+
+    /* if we're moving inside a crtc, we're fine */
+    ret = check_all_screen_crtcs(pScreen, x, y);
+    if (ret == TRUE)
+        return;
+
+    xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
+        ret = check_all_screen_crtcs(slave, x, y);
+        if (ret == TRUE)
             return;
+    }
+
+    /* if we're trying to escape, clamp to the CRTC we're coming from */
+    ret = constrain_all_screen_crtcs(pDev, pScreen, x, y);
+    if (ret == TRUE)
+        return;
+
+    xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
+        ret = constrain_all_screen_crtcs(pDev, slave, x, y);
+        if (ret == TRUE)
+            return;
+    }
+}
+
+Bool
+RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable)
+{
+    rrScrPriv(pDrawable->pScreen);
+    int i;
+    Bool size_fits = FALSE;
+    Bool changed = FALSE;
+    Bool ret = TRUE;
+
+    for (i = 0; i < pScrPriv->numCrtcs; i++) {
+        RRCrtcPtr crtc = pScrPriv->crtcs[i];
+
+        if (!crtc->mode && enable)
+            continue;
+
+        changed = FALSE;
+        if (crtc->mode && crtc->x == pDrawable->x &&
+            crtc->y == pDrawable->y &&
+            crtc->mode->mode.width == pDrawable->width &&
+            crtc->mode->mode.height == pDrawable->height)
+            size_fits = TRUE;
+
+        /* is the pixmap already set? */
+        if (crtc->scanout_pixmap == pPixmap) {
+            /* if its a disable then don't care about size */
+            if (enable == FALSE) {
+                /* set scanout to NULL */
+                crtc->scanout_pixmap = NULL;
+                changed = TRUE;
+            } else {
+                /* if the size fits then we are already setup */
+                if (size_fits)
+                    return TRUE;
+                /* if the size no longer fits then drop off */
+                crtc->scanout_pixmap = NULL;
+                changed = TRUE;
+                ret = FALSE;
+            }
+        } else {
+            if (!size_fits)
+                return FALSE;
+            if (enable) {
+                crtc->scanout_pixmap = pPixmap;
+                pScrPriv->rrCrtcSetScanoutPixmap(crtc, pPixmap);
+                changed = TRUE;
+            }
+        }
+
+        if (changed && pScrPriv->rrCrtcSet) {
+            pScrPriv->rrCrtcSetScanoutPixmap(crtc, crtc->scanout_pixmap);
+
+            (*pScrPriv->rrCrtcSet) (pDrawable->pScreen, crtc, crtc->mode, crtc->x, crtc->y,
+                                    crtc->rotation, crtc->numOutputs, crtc->outputs);
         }
     }
+    return ret;
 }
index 85cf037..7fbc9f0 100644 (file)
@@ -35,16 +35,17 @@ RRClientKnowsRates(ClientPtr pClient)
 static int
 ProcRRQueryVersion(ClientPtr client)
 {
-    xRRQueryVersionReply rep = { 0 };
+    xRRQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     REQUEST(xRRQueryVersionReq);
     rrClientPriv(client);
 
     REQUEST_SIZE_MATCH(xRRQueryVersionReq);
     pRRClient->major_version = stuff->majorVersion;
     pRRClient->minor_version = stuff->minorVersion;
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
 
     if (version_compare(stuff->majorVersion, stuff->minorVersion,
                         SERVER_RANDR_MAJOR_VERSION,
@@ -63,7 +64,7 @@ ProcRRQueryVersion(ClientPtr client)
         swapl(&rep.majorVersion);
         swapl(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xRRQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRQueryVersionReply), &rep);
     return Success;
 }
 
@@ -90,7 +91,8 @@ ProcRRSelectInput(ClientPtr client)
     if (stuff->enable & (RRScreenChangeNotifyMask |
                          RRCrtcChangeNotifyMask |
                          RROutputChangeNotifyMask |
-                         RROutputPropertyNotifyMask)) {
+                         RROutputPropertyNotifyMask |
+                         RRProviderPropertyNotifyMask)) {
         ScreenPtr pScreen = pWin->drawable.pScreen;
 
         rrScrPriv(pScreen);
@@ -241,4 +243,15 @@ int (*ProcRandrVector[RRNumberRequests]) (ClientPtr) = {
         ProcRRSetPanning,       /* 29 */
         ProcRRSetOutputPrimary, /* 30 */
         ProcRRGetOutputPrimary, /* 31 */
+/* V1.4 additions */
+        ProcRRGetProviders,     /* 32 */
+        ProcRRGetProviderInfo,  /* 33 */
+        ProcRRSetProviderOffloadSink, /* 34 */
+        ProcRRSetProviderOutputSource, /* 35 */
+        ProcRRListProviderProperties,    /* 36 */
+        ProcRRQueryProviderProperty,     /* 37 */
+        ProcRRConfigureProviderProperty, /* 38 */
+        ProcRRChangeProviderProperty, /* 39 */
+        ProcRRDeleteProviderProperty, /* 40 */
+        ProcRRGetProviderProperty,    /* 41 */
 };
index 114ec34..1408d6f 100644 (file)
@@ -82,6 +82,7 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations)
     int i;
     CARD16 minWidth = MAXSHORT, minHeight = MAXSHORT;
     CARD16 maxWidth = 0, maxHeight = 0;
+    CARD16 width, height;
 
     /*
      * First time through, create a crtc and output and hook
@@ -141,11 +142,11 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations)
 
     /* find size bounds */
     for (i = 0; i < output->numModes + output->numUserModes; i++) {
-        RRModePtr mode = (i < output->numModes ?
+        mode = (i < output->numModes ?
                           output->modes[i] :
                           output->userModes[i - output->numModes]);
-        CARD16 width = mode->mode.width;
-        CARD16 height = mode->mode.height;
+        width = mode->mode.width;
+        height = mode->mode.height;
 
         if (width < minWidth)
             minWidth = width;
index b637c06..f5d3f9e 100644 (file)
@@ -89,8 +89,10 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen)
     }
 
     mode->mode.id = FakeClientID(0);
-    if (!AddResource(mode->mode.id, RRModeType, (pointer) mode))
+    if (!AddResource(mode->mode.id, RRModeType, (pointer) mode)) {
+        free(newModes);
         return NULL;
+    }
     modes = newModes;
     modes[num_modes++] = mode;
 
@@ -173,7 +175,7 @@ RRModesForScreen(ScreenPtr pScreen, int *num_ret)
      */
     for (o = 0; o < pScrPriv->numOutputs; o++) {
         RROutputPtr output = pScrPriv->outputs[o];
-        int m, n;
+        int n;
 
         for (m = 0; m < output->numModes + output->numUserModes; m++) {
             RRModePtr mode = (m < output->numModes ?
@@ -282,10 +284,9 @@ int
 ProcRRCreateMode(ClientPtr client)
 {
     REQUEST(xRRCreateModeReq);
-    xRRCreateModeReply rep = { 0 };
+    xRRCreateModeReply rep;
     WindowPtr pWin;
     ScreenPtr pScreen;
-    rrScrPrivPtr pScrPriv;
     xRRModeInfo *modeInfo;
     long units_after;
     char *name;
@@ -298,7 +299,6 @@ ProcRRCreateMode(ClientPtr client)
         return rc;
 
     pScreen = pWin->drawable.pScreen;
-    pScrPriv = rrGetScrPriv(pScreen);
 
     modeInfo = &stuff->modeInfo;
     name = (char *) (stuff + 1);
@@ -312,17 +312,18 @@ ProcRRCreateMode(ClientPtr client)
     if (!mode)
         return error;
 
-    rep.type = X_Reply;
-    rep.pad0 = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.mode = mode->mode.id;
+    rep = (xRRCreateModeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .mode = mode->mode.id
+       };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.mode);
     }
-    WriteToClient(client, sizeof(xRRCreateModeReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRCreateModeReply), &rep);
     /* Drop out reference to this mode */
     RRModeDestroy(mode);
     return Success;
index 0890c55..88781ba 100644 (file)
@@ -305,28 +305,22 @@ RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output)
     ScreenPtr pScreen = pWin->drawable.pScreen;
 
     rrScrPriv(pScreen);
-    xRROutputChangeNotifyEvent oe;
     RRCrtcPtr crtc = output->crtc;
-    RRModePtr mode = crtc ? crtc->mode : 0;
-
-    oe.type = RRNotify + RREventBase;
-    oe.subCode = RRNotify_OutputChange;
-    oe.timestamp = pScrPriv->lastSetTime.milliseconds;
-    oe.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
-    oe.window = pWin->drawable.id;
-    oe.output = output->id;
-    if (crtc) {
-        oe.crtc = crtc->id;
-        oe.mode = mode ? mode->mode.id : None;
-        oe.rotation = crtc->rotation;
-    }
-    else {
-        oe.crtc = None;
-        oe.mode = None;
-        oe.rotation = RR_Rotate_0;
-    }
-    oe.connection = output->connection;
-    oe.subpixelOrder = output->subpixelOrder;
+    RRModePtr mode = crtc ? crtc->mode : NULL;
+
+    xRROutputChangeNotifyEvent oe = {
+        .type = RRNotify + RREventBase,
+        .subCode = RRNotify_OutputChange,
+        .timestamp = pScrPriv->lastSetTime.milliseconds,
+        .configTimestamp = pScrPriv->lastConfigTime.milliseconds,
+        .window = pWin->drawable.id,
+        .output = output->id,
+        .crtc = crtc ? crtc->id : None,
+        .mode = mode ? mode->mode.id : None,
+        .rotation = crtc ? crtc->rotation : RR_Rotate_0,
+        .connection = output->connection,
+        .subpixelOrder = output->subpixelOrder
+    };
     WriteEventsToClient(client, 1, (xEvent *) &oe);
 }
 
@@ -425,21 +419,23 @@ ProcRRGetOutputInfo(ClientPtr client)
     pScreen = output->pScreen;
     pScrPriv = rrGetScrPriv(pScreen);
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = bytes_to_int32(OutputInfoExtra);
-    rep.timestamp = pScrPriv->lastSetTime.milliseconds;
-    rep.crtc = output->crtc ? output->crtc->id : None;
-    rep.mmWidth = output->mmWidth;
-    rep.mmHeight = output->mmHeight;
-    rep.connection = output->connection;
-    rep.subpixelOrder = output->subpixelOrder;
-    rep.nCrtcs = output->numCrtcs;
-    rep.nModes = output->numModes + output->numUserModes;
-    rep.nPreferred = output->numPreferred;
-    rep.nClones = output->numClones;
-    rep.nameLength = output->nameLength;
-
+    rep = (xRRGetOutputInfoReply) {
+        .type = X_Reply,
+        .status = RRSetConfigSuccess,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(OutputInfoExtra),
+        .timestamp = pScrPriv->lastSetTime.milliseconds,
+        .crtc = output->crtc ? output->crtc->id : None,
+        .mmWidth = output->mmWidth,
+        .mmHeight = output->mmHeight,
+        .connection = output->connection,
+        .subpixelOrder = output->subpixelOrder,
+        .nCrtcs = output->numCrtcs,
+        .nModes = output->numModes + output->numUserModes,
+        .nPreferred = output->numPreferred,
+        .nClones = output->numClones,
+        .nameLength = output->nameLength
+    };
     extraLen = ((output->numCrtcs +
                  output->numModes + output->numUserModes +
                  output->numClones + bytes_to_int32(rep.nameLength)) << 2);
@@ -489,9 +485,9 @@ ProcRRGetOutputInfo(ClientPtr client)
         swaps(&rep.nClones);
         swaps(&rep.nameLength);
     }
-    WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRGetOutputInfoReply), &rep);
     if (extraLen) {
-        WriteToClient(client, extraLen, (char *) extra);
+        WriteToClient(client, extraLen, extra);
         free(extra);
     }
 
@@ -528,13 +524,13 @@ ProcRRSetOutputPrimary(ClientPtr client)
     RROutputPtr output = NULL;
     WindowPtr pWin;
     rrScrPrivPtr pScrPriv;
-    int rc;
+    int ret;
 
     REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
 
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
-    if (rc != Success)
-        return rc;
+    ret = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+    if (ret != Success)
+        return ret;
 
     if (stuff->output) {
         VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
@@ -546,7 +542,8 @@ ProcRRSetOutputPrimary(ClientPtr client)
     }
 
     pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
-    RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);
+    if (pScrPriv)
+        RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);
 
     return Success;
 }
@@ -571,10 +568,11 @@ ProcRRGetOutputPrimary(ClientPtr client)
     if (pScrPriv)
         primary = pScrPriv->primaryOutput;
 
-    memset(&rep, 0, sizeof(rep));
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.output = primary ? primary->id : None;
+    rep = (xRRGetOutputPrimaryReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .output = primary ? primary->id : None
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
index 75948fc..67b5467 100644 (file)
@@ -65,14 +65,14 @@ RRDestroyOutputProperty(RRPropertyPtr prop)
 static void
 RRDeleteProperty(RROutputRec * output, RRPropertyRec * prop)
 {
-    xRROutputPropertyNotifyEvent event;
-
-    event.type = RREventBase + RRNotify;
-    event.subCode = RRNotify_OutputProperty;
-    event.output = output->id;
-    event.state = PropertyDelete;
-    event.atom = prop->propertyName;
-    event.timestamp = currentTime.milliseconds;
+    xRROutputPropertyNotifyEvent event = {
+        .type = RREventBase + RRNotify,
+        .subCode = RRNotify_OutputProperty,
+        .output = output->id,
+        .state = PropertyDelete,
+        .atom = prop->propertyName,
+        .timestamp = currentTime.milliseconds
+    };
 
     RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event);
 
@@ -138,7 +138,6 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
                        pointer value, Bool sendevent, Bool pending)
 {
     RRPropertyPtr prop;
-    xRROutputPropertyNotifyEvent event;
     rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen);
     int size_in_bytes;
     int total_size;
@@ -218,6 +217,8 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
             !pScrPriv->rrOutputSetProperty(output->pScreen, output,
                                            prop->propertyName, &new_value)) {
             free(new_value.data);
+            if (add)
+                RRDestroyOutputProperty(prop);
             return BadValue;
         }
         free(prop_value->data);
@@ -237,12 +238,14 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
         output->pendingProperties = TRUE;
 
     if (sendevent) {
-        event.type = RREventBase + RRNotify;
-        event.subCode = RRNotify_OutputProperty;
-        event.output = output->id;
-        event.state = PropertyNewValue;
-        event.atom = prop->propertyName;
-        event.timestamp = currentTime.milliseconds;
+        xRROutputPropertyNotifyEvent event = {
+            .type = RREventBase + RRNotify,
+            .subCode = RRNotify_OutputProperty,
+            .output = output->id,
+            .state = PropertyNewValue,
+            .atom = prop->propertyName,
+            .timestamp = currentTime.milliseconds
+        };
         RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event);
     }
     return Success;
@@ -341,12 +344,18 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property,
     /*
      * ranges must have even number of values
      */
-    if (range && (num_values & 1))
+    if (range && (num_values & 1)) {
+        if (add)
+            RRDestroyOutputProperty(prop);
         return BadMatch;
+    }
 
     new_values = malloc(num_values * sizeof(INT32));
-    if (!new_values && num_values)
+    if (!new_values && num_values) {
+        if (add)
+            RRDestroyOutputProperty(prop);
         return BadAlloc;
+    }
     if (num_values)
         memcpy(new_values, values, num_values * sizeof(INT32));
 
@@ -378,7 +387,7 @@ int
 ProcRRListOutputProperties(ClientPtr client)
 {
     REQUEST(xRRListOutputPropertiesReq);
-    Atom *pAtoms = NULL, *temppAtoms;
+    Atom *pAtoms = NULL;
     xRRListOutputPropertiesReply rep;
     int numProps = 0;
     RROutputPtr output;
@@ -394,21 +403,25 @@ ProcRRListOutputProperties(ClientPtr client)
         if (!(pAtoms = (Atom *) malloc(numProps * sizeof(Atom))))
             return BadAlloc;
 
-    rep.type = X_Reply;
-    rep.length = bytes_to_int32(numProps * sizeof(Atom));
-    rep.sequenceNumber = client->sequence;
-    rep.nAtoms = numProps;
+    rep = (xRRListOutputPropertiesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(numProps * sizeof(Atom)),
+        .nAtoms = numProps
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swaps(&rep.nAtoms);
     }
-    temppAtoms = pAtoms;
-    for (prop = output->properties; prop; prop = prop->next)
-        *temppAtoms++ = prop->propertyName;
+    WriteToClient(client, sizeof(xRRListOutputPropertiesReply), &rep);
 
-    WriteToClient(client, sizeof(xRRListOutputPropertiesReply), (char *) &rep);
     if (numProps) {
+        /* Copy property name atoms to reply buffer */
+        Atom *temppAtoms = pAtoms;
+        for (prop = output->properties; prop; prop = prop->next)
+            *temppAtoms++ = prop->propertyName;
+
         client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
         WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
         free(pAtoms);
@@ -438,17 +451,21 @@ ProcRRQueryOutputProperty(ClientPtr client)
         if (!extra)
             return BadAlloc;
     }
-    rep.type = X_Reply;
-    rep.length = prop->num_valid;
-    rep.sequenceNumber = client->sequence;
-    rep.pending = prop->is_pending;
-    rep.range = prop->range;
-    rep.immutable = prop->immutable;
+
+    rep = (xRRQueryOutputPropertyReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = prop->num_valid,
+        .pending = prop->is_pending,
+        .range = prop->range,
+        .immutable = prop->immutable
+    };
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
     }
-    WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), &rep);
     if (prop->num_valid) {
         memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32));
         client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
@@ -594,8 +611,10 @@ ProcRRGetOutputProperty(ClientPtr client)
         if (prop->propertyName == stuff->property)
             break;
 
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
+    reply = (xRRGetOutputPropertyReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence
+    };
     if (!prop) {
         reply.nItems = 0;
         reply.length = 0;
@@ -672,14 +691,14 @@ ProcRRGetOutputProperty(ClientPtr client)
     reply.propertyType = prop_value->type;
 
     if (stuff->delete && (reply.bytesAfter == 0)) {
-        xRROutputPropertyNotifyEvent event;
-
-        event.type = RREventBase + RRNotify;
-        event.subCode = RRNotify_OutputProperty;
-        event.output = output->id;
-        event.state = PropertyDelete;
-        event.atom = prop->propertyName;
-        event.timestamp = currentTime.milliseconds;
+        xRROutputPropertyNotifyEvent event = {
+            .type = RREventBase + RRNotify,
+            .subCode = RRNotify_OutputProperty,
+            .output = output->id,
+            .state = PropertyDelete,
+            .atom = prop->propertyName,
+            .timestamp = currentTime.milliseconds
+        };
         RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event);
     }
 
diff --git a/randr/rrprovider.c b/randr/rrprovider.c
new file mode 100644 (file)
index 0000000..c4ed515
--- /dev/null
@@ -0,0 +1,416 @@
+/*
+ * Copyright © 2012 Red Hat Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ *
+ * Authors: Dave Airlie
+ */
+
+#include "randrstr.h"
+#include "swaprep.h"
+
+RESTYPE RRProviderType;
+
+/*
+ * Initialize provider type error value
+ */
+void
+RRProviderInitErrorValue(void)
+{
+    SetResourceTypeErrorValue(RRProviderType, RRErrorBase + BadRRProvider);
+}
+
+#define ADD_PROVIDER(_pScreen) do {                                 \
+    pScrPriv = rrGetScrPriv((_pScreen));                            \
+    if (pScrPriv->provider) {                                   \
+        providers[count_providers] = pScrPriv->provider->id;    \
+        if (client->swapped)                                    \
+            swapl(&providers[count_providers]);                 \
+        count_providers++;                                      \
+    }                                                           \
+    } while(0)
+
+int
+ProcRRGetProviders (ClientPtr client)
+{
+    REQUEST(xRRGetProvidersReq);
+    xRRGetProvidersReply rep;
+    WindowPtr pWin;
+    ScreenPtr pScreen;
+    rrScrPrivPtr pScrPriv;
+    int rc;
+    CARD8 *extra;
+    unsigned int extraLen;
+    RRProvider *providers;
+    int total_providers = 0, count_providers = 0;
+    ScreenPtr iter;
+
+    REQUEST_SIZE_MATCH(xRRGetProvidersReq);
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+    if (rc != Success)
+        return rc;
+
+    pScreen = pWin->drawable.pScreen;
+
+    pScrPriv = rrGetScrPriv(pScreen);
+
+    if (pScrPriv->provider)
+        total_providers++;
+    xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
+        pScrPriv = rrGetScrPriv(iter);
+        total_providers += pScrPriv->provider ? 1 : 0;
+    }
+    xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) {
+        pScrPriv = rrGetScrPriv(iter);
+        total_providers += pScrPriv->provider ? 1 : 0;
+    }
+    xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) {
+        pScrPriv = rrGetScrPriv(iter);
+        total_providers += pScrPriv->provider ? 1 : 0;
+    }
+
+    pScrPriv = rrGetScrPriv(pScreen);
+
+    if (!pScrPriv)
+    {
+        rep = (xRRGetProvidersReply) {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = 0,
+            .timestamp = currentTime.milliseconds,
+            .nProviders = 0
+        };
+        extra = NULL;
+        extraLen = 0;
+    } else {
+        rep = (xRRGetProvidersReply) {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .timestamp = pScrPriv->lastSetTime.milliseconds,
+            .nProviders = total_providers,
+            .length = total_providers
+        };
+        extraLen = rep.length << 2;
+        if (extraLen) {
+            extra = malloc(extraLen);
+            if (!extra)
+                return BadAlloc;
+        } else
+            extra = NULL;
+
+        providers = (RRProvider *)extra;
+        ADD_PROVIDER(pScreen);
+        xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
+            ADD_PROVIDER(iter);
+        }
+        xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) {
+            ADD_PROVIDER(iter);
+        }
+        xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) {
+            ADD_PROVIDER(iter);
+        }
+    }
+
+    if (client->swapped) {
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.timestamp);
+        swaps(&rep.nProviders);
+    }
+    WriteToClient(client, sizeof(xRRGetProvidersReply), (char *)&rep);
+    if (extraLen)
+    {
+        WriteToClient (client, extraLen, (char *) extra);
+        free(extra);
+    }
+    return Success;
+}
+
+int
+ProcRRGetProviderInfo (ClientPtr client)
+{
+    REQUEST(xRRGetProviderInfoReq);
+    xRRGetProviderInfoReply rep;
+    rrScrPrivPtr pScrPriv, pScrProvPriv;
+    RRProviderPtr provider;
+    ScreenPtr pScreen;
+    CARD8 *extra;
+    unsigned int extraLen = 0;
+    RRCrtc *crtcs;
+    RROutput *outputs;
+    int i;
+    char *name;
+    ScreenPtr provscreen;
+    RRProvider *providers;
+    uint32_t *prov_cap;
+    REQUEST_SIZE_MATCH(xRRGetProviderInfoReq);
+    VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
+
+    pScreen = provider->pScreen;
+    pScrPriv = rrGetScrPriv(pScreen);
+
+    rep = (xRRGetProviderInfoReply) {
+        .type = X_Reply,
+        .status = RRSetConfigSuccess,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .capabilities = provider->capabilities,
+        .nameLength = provider->nameLength,
+        .timestamp = pScrPriv->lastSetTime.milliseconds,
+        .nCrtcs = pScrPriv->numCrtcs,
+        .nOutputs = pScrPriv->numOutputs,
+        .nAssociatedProviders = 0
+    };
+
+    /* count associated providers */
+    if (provider->offload_sink)
+        rep.nAssociatedProviders++;
+    if (provider->output_source)
+        rep.nAssociatedProviders++;
+    xorg_list_for_each_entry(provscreen, &pScreen->output_slave_list, output_head)
+        rep.nAssociatedProviders++;
+    xorg_list_for_each_entry(provscreen, &pScreen->offload_slave_list, offload_head)
+        rep.nAssociatedProviders++;
+
+    rep.length = (pScrPriv->numCrtcs + pScrPriv->numOutputs +
+                  (rep.nAssociatedProviders * 2) + bytes_to_int32(rep.nameLength));
+
+    extraLen = rep.length << 2;
+    if (extraLen) {
+        extra = malloc(extraLen);
+        if (!extra)
+            return BadAlloc;
+    }
+    else
+        extra = NULL;
+
+    crtcs = (RRCrtc *)extra;
+    outputs = (RROutput *)(crtcs + rep.nCrtcs);
+    providers = (RRProvider *)(outputs + rep.nOutputs);
+    prov_cap = (unsigned int *)(providers + rep.nAssociatedProviders);
+    name = (char *)(prov_cap + rep.nAssociatedProviders);
+
+    for (i = 0; i < pScrPriv->numCrtcs; i++) {
+        crtcs[i] = pScrPriv->crtcs[i]->id;
+        if (client->swapped)
+            swapl(&crtcs[i]);
+    }
+
+    for (i = 0; i < pScrPriv->numOutputs; i++) {
+        outputs[i] = pScrPriv->outputs[i]->id;
+        if (client->swapped)
+            swapl(&outputs[i]);
+    }
+
+    i = 0;
+    if (provider->offload_sink) {
+        providers[i] = provider->offload_sink->id;
+        if (client->swapped)
+            swapl(&providers[i]);
+        prov_cap[i] = RR_Capability_SinkOffload;
+        if (client->swapped)
+            swapl(&prov_cap[i]);
+        i++;
+    }
+    if (provider->output_source) {
+        providers[i] = provider->output_source->id;
+        if (client->swapped)
+            swapl(&providers[i]);
+        prov_cap[i] = RR_Capability_SourceOutput;
+            swapl(&prov_cap[i]);
+        i++;
+    }
+    xorg_list_for_each_entry(provscreen, &pScreen->output_slave_list, output_head) {
+        pScrProvPriv = rrGetScrPriv(provscreen);
+        providers[i] = pScrProvPriv->provider->id;
+        if (client->swapped)
+            swapl(&providers[i]);
+        prov_cap[i] = RR_Capability_SinkOutput;
+        if (client->swapped)
+            swapl(&prov_cap[i]);
+        i++;
+    }
+    xorg_list_for_each_entry(provscreen, &pScreen->offload_slave_list, offload_head) {
+        pScrProvPriv = rrGetScrPriv(provscreen);
+        providers[i] = pScrProvPriv->provider->id;
+        if (client->swapped)
+            swapl(&providers[i]);
+        prov_cap[i] = RR_Capability_SourceOffload;
+        if (client->swapped)
+            swapl(&prov_cap[i]);
+        i++;
+    }
+
+
+    memcpy(name, provider->name, rep.nameLength);
+    if (client->swapped) {
+              swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.capabilities);
+        swaps(&rep.nCrtcs);
+        swaps(&rep.nOutputs);
+        swaps(&rep.nameLength);
+    }
+    WriteToClient(client, sizeof(xRRGetProviderInfoReply), (char *)&rep);
+    if (extraLen)
+    {
+        WriteToClient (client, extraLen, (char *) extra);
+        free(extra);
+    }
+    return Success;
+}
+
+int
+ProcRRSetProviderOutputSource(ClientPtr client)
+{
+    REQUEST(xRRSetProviderOutputSourceReq);
+    rrScrPrivPtr pScrPriv;
+    RRProviderPtr provider, source_provider = NULL;
+    ScreenPtr pScreen;
+
+    REQUEST_AT_LEAST_SIZE(xRRSetProviderOutputSourceReq);
+
+    VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
+
+    if (!(provider->capabilities & RR_Capability_SinkOutput))
+        return BadValue;
+
+    if (stuff->source_provider) {
+        VERIFY_RR_PROVIDER(stuff->source_provider, source_provider, DixReadAccess);
+
+        if (!(source_provider->capabilities & RR_Capability_SourceOutput))
+            return BadValue;
+    }
+
+    pScreen = provider->pScreen;
+    pScrPriv = rrGetScrPriv(pScreen);
+
+    pScrPriv->rrProviderSetOutputSource(pScreen, provider, source_provider);
+
+    RRTellChanged (pScreen);
+
+    return Success;
+}
+
+int
+ProcRRSetProviderOffloadSink(ClientPtr client)
+{
+    REQUEST(xRRSetProviderOffloadSinkReq);
+    rrScrPrivPtr pScrPriv;
+    RRProviderPtr provider, sink_provider = NULL;
+    ScreenPtr pScreen;
+
+    REQUEST_AT_LEAST_SIZE(xRRSetProviderOffloadSinkReq);
+
+    VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
+    if (!(provider->capabilities & RR_Capability_SourceOffload))
+        return BadValue;
+
+    if (stuff->sink_provider) {
+        VERIFY_RR_PROVIDER(stuff->sink_provider, sink_provider, DixReadAccess);
+        if (!(sink_provider->capabilities & RR_Capability_SinkOffload))
+            return BadValue;
+    }
+    pScreen = provider->pScreen;
+    pScrPriv = rrGetScrPriv(pScreen);
+
+    pScrPriv->rrProviderSetOffloadSink(pScreen, provider, sink_provider);
+
+    RRTellChanged (pScreen);
+
+    return Success;
+}
+
+RRProviderPtr
+RRProviderCreate(ScreenPtr pScreen, const char *name,
+                 int nameLength)
+{
+    RRProviderPtr provider;
+    rrScrPrivPtr pScrPriv;
+
+    pScrPriv = rrGetScrPriv(pScreen);
+
+    provider = calloc(1, sizeof(RRProviderRec) + nameLength + 1);
+    if (!provider)
+        return NULL;
+
+    provider->id = FakeClientID(0);
+    provider->pScreen = pScreen;
+    provider->name = (char *) (provider + 1);
+    provider->nameLength = nameLength;
+    memcpy(provider->name, name, nameLength);
+    provider->name[nameLength] = '\0';
+
+    if (!AddResource (provider->id, RRProviderType, (pointer) provider))
+        return NULL;
+    pScrPriv->provider = provider;
+    return provider;
+}
+
+/*
+ * Destroy a provider at shutdown
+ */
+void
+RRProviderDestroy (RRProviderPtr provider)
+{
+    FreeResource (provider->id, 0);
+}
+
+void
+RRProviderSetCapabilities(RRProviderPtr provider, uint32_t capabilities)
+{
+    provider->capabilities = capabilities;
+}
+
+static int
+RRProviderDestroyResource (pointer value, XID pid)
+{
+    RRProviderPtr provider = (RRProviderPtr)value;
+    ScreenPtr pScreen = provider->pScreen;
+
+    if (pScreen)
+    {
+        rrScrPriv(pScreen);
+
+        pScrPriv->provider = NULL;
+    }
+    free(provider);
+    return 1;
+}
+
+Bool
+RRProviderInit(void)
+{
+    RRProviderType = CreateNewResourceType(RRProviderDestroyResource, "Provider");
+    if (!RRProviderType)
+        return FALSE;
+
+    return TRUE;
+}
+
+extern _X_EXPORT Bool
+RRProviderLookup(XID id, RRProviderPtr *provider_p)
+{
+    int rc = dixLookupResourceByType((void **)provider_p, id,
+                                   RRProviderType, NullClient, DixReadAccess);
+    if (rc == Success)
+        return TRUE;
+    return FALSE;
+}
diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c
new file mode 100644 (file)
index 0000000..ab601da
--- /dev/null
@@ -0,0 +1,730 @@
+/*
+ * Copyright © 2006 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include "randrstr.h"
+#include "propertyst.h"
+#include "swaprep.h"
+
+static int
+DeliverPropertyEvent(WindowPtr pWin, void *value)
+{
+    xRRProviderPropertyNotifyEvent *event = value;
+    RREventPtr *pHead, pRREvent;
+
+    dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id,
+                            RREventType, serverClient, DixReadAccess);
+    if (!pHead)
+        return WT_WALKCHILDREN;
+
+    for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) {
+        if (!(pRREvent->mask & RRProviderPropertyNotifyMask))
+            continue;
+
+        event->window = pRREvent->window->drawable.id;
+        WriteEventsToClient(pRREvent->client, 1, (xEvent *) event);
+    }
+
+    return WT_WALKCHILDREN;
+}
+
+static void
+RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event)
+{
+    if (!(dispatchException & (DE_RESET | DE_TERMINATE)))
+        WalkTree(pScreen, DeliverPropertyEvent, event);
+}
+
+static void
+RRDestroyProviderProperty(RRPropertyPtr prop)
+{
+    free(prop->valid_values);
+    free(prop->current.data);
+    free(prop->pending.data);
+    free(prop);
+}
+
+static void
+RRDeleteProperty(RRProviderRec * provider, RRPropertyRec * prop)
+{
+    xRRProviderPropertyNotifyEvent event = {
+        .type = RREventBase + RRNotify,
+        .subCode = RRNotify_ProviderProperty,
+        .provider = provider->id,
+        .state = PropertyDelete,
+        .atom = prop->propertyName,
+        .timestamp = currentTime.milliseconds
+    };
+
+    RRDeliverPropertyEvent(provider->pScreen, (xEvent *) &event);
+
+    RRDestroyProviderProperty(prop);
+}
+
+void
+RRDeleteAllProviderProperties(RRProviderPtr provider)
+{
+    RRPropertyPtr prop, next;
+
+    for (prop = provider->properties; prop; prop = next) {
+        next = prop->next;
+        RRDeleteProperty(provider, prop);
+    }
+}
+
+static void
+RRInitProviderPropertyValue(RRPropertyValuePtr property_value)
+{
+    property_value->type = None;
+    property_value->format = 0;
+    property_value->size = 0;
+    property_value->data = NULL;
+}
+
+static RRPropertyPtr
+RRCreateProviderProperty(Atom property)
+{
+    RRPropertyPtr prop;
+
+    prop = (RRPropertyPtr) malloc(sizeof(RRPropertyRec));
+    if (!prop)
+        return NULL;
+    prop->next = NULL;
+    prop->propertyName = property;
+    prop->is_pending = FALSE;
+    prop->range = FALSE;
+    prop->immutable = FALSE;
+    prop->num_valid = 0;
+    prop->valid_values = NULL;
+    RRInitProviderPropertyValue(&prop->current);
+    RRInitProviderPropertyValue(&prop->pending);
+    return prop;
+}
+
+void
+RRDeleteProviderProperty(RRProviderPtr provider, Atom property)
+{
+    RRPropertyRec *prop, **prev;
+
+    for (prev = &provider->properties; (prop = *prev); prev = &(prop->next))
+        if (prop->propertyName == property) {
+            *prev = prop->next;
+            RRDeleteProperty(provider, prop);
+            return;
+        }
+}
+
+int
+RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
+                       int format, int mode, unsigned long len,
+                       pointer value, Bool sendevent, Bool pending)
+{
+    RRPropertyPtr prop;
+    rrScrPrivPtr pScrPriv = rrGetScrPriv(provider->pScreen);
+    int size_in_bytes;
+    int total_size;
+    unsigned long total_len;
+    RRPropertyValuePtr prop_value;
+    RRPropertyValueRec new_value;
+    Bool add = FALSE;
+
+    size_in_bytes = format >> 3;
+
+    /* first see if property already exists */
+    prop = RRQueryProviderProperty(provider, property);
+    if (!prop) {                /* just add to list */
+        prop = RRCreateProviderProperty(property);
+        if (!prop)
+            return BadAlloc;
+        add = TRUE;
+        mode = PropModeReplace;
+    }
+    if (pending && prop->is_pending)
+        prop_value = &prop->pending;
+    else
+        prop_value = &prop->current;
+
+    /* To append or prepend to a property the request format and type
+       must match those of the already defined property.  The
+       existing format and type are irrelevant when using the mode
+       "PropModeReplace" since they will be written over. */
+
+    if ((format != prop_value->format) && (mode != PropModeReplace))
+        return BadMatch;
+    if ((prop_value->type != type) && (mode != PropModeReplace))
+        return BadMatch;
+    new_value = *prop_value;
+    if (mode == PropModeReplace)
+        total_len = len;
+    else
+        total_len = prop_value->size + len;
+
+    if (mode == PropModeReplace || len > 0) {
+        pointer new_data = NULL, old_data = NULL;
+
+        total_size = total_len * size_in_bytes;
+        new_value.data = (pointer) malloc(total_size);
+        if (!new_value.data && total_size) {
+            if (add)
+                RRDestroyProviderProperty(prop);
+            return BadAlloc;
+        }
+        new_value.size = len;
+        new_value.type = type;
+        new_value.format = format;
+
+        switch (mode) {
+        case PropModeReplace:
+            new_data = new_value.data;
+            old_data = NULL;
+            break;
+        case PropModeAppend:
+            new_data = (pointer) (((char *) new_value.data) +
+                                  (prop_value->size * size_in_bytes));
+            old_data = new_value.data;
+            break;
+        case PropModePrepend:
+            new_data = new_value.data;
+            old_data = (pointer) (((char *) new_value.data) +
+                                  (prop_value->size * size_in_bytes));
+            break;
+        }
+        if (new_data)
+            memcpy((char *) new_data, (char *) value, len * size_in_bytes);
+        if (old_data)
+            memcpy((char *) old_data, (char *) prop_value->data,
+                   prop_value->size * size_in_bytes);
+
+        if (pending && pScrPriv->rrProviderSetProperty &&
+            !pScrPriv->rrProviderSetProperty(provider->pScreen, provider,
+                                           prop->propertyName, &new_value)) {
+            if (add)
+                RRDestroyProviderProperty(prop);
+            free(new_value.data);
+            return BadValue;
+        }
+        free(prop_value->data);
+        *prop_value = new_value;
+    }
+
+    else if (len == 0) {
+        /* do nothing */
+    }
+
+    if (add) {
+        prop->next = provider->properties;
+        provider->properties = prop;
+    }
+
+    if (pending && prop->is_pending)
+        provider->pendingProperties = TRUE;
+
+    if (sendevent) {
+        xRRProviderPropertyNotifyEvent event = {
+            .type = RREventBase + RRNotify,
+            .subCode = RRNotify_ProviderProperty,
+            .provider = provider->id,
+            .state = PropertyNewValue,
+            .atom = prop->propertyName,
+            .timestamp = currentTime.milliseconds
+        };
+        RRDeliverPropertyEvent(provider->pScreen, (xEvent *) &event);
+    }
+    return Success;
+}
+
+Bool
+RRPostProviderPendingProperties(RRProviderPtr provider)
+{
+    RRPropertyValuePtr pending_value;
+    RRPropertyValuePtr current_value;
+    RRPropertyPtr property;
+    Bool ret = TRUE;
+
+    if (!provider->pendingProperties)
+        return TRUE;
+
+    provider->pendingProperties = FALSE;
+    for (property = provider->properties; property; property = property->next) {
+        /* Skip non-pending properties */
+        if (!property->is_pending)
+            continue;
+
+        pending_value = &property->pending;
+        current_value = &property->current;
+
+        /*
+         * If the pending and current values are equal, don't mark it
+         * as changed (which would deliver an event)
+         */
+        if (pending_value->type == current_value->type &&
+            pending_value->format == current_value->format &&
+            pending_value->size == current_value->size &&
+            !memcmp(pending_value->data, current_value->data,
+                    pending_value->size * (pending_value->format / 8)))
+            continue;
+
+        if (RRChangeProviderProperty(provider, property->propertyName,
+                                   pending_value->type, pending_value->format,
+                                   PropModeReplace, pending_value->size,
+                                   pending_value->data, TRUE, FALSE) != Success)
+            ret = FALSE;
+    }
+    return ret;
+}
+
+RRPropertyPtr
+RRQueryProviderProperty(RRProviderPtr provider, Atom property)
+{
+    RRPropertyPtr prop;
+
+    for (prop = provider->properties; prop; prop = prop->next)
+        if (prop->propertyName == property)
+            return prop;
+    return NULL;
+}
+
+RRPropertyValuePtr
+RRGetProviderProperty(RRProviderPtr provider, Atom property, Bool pending)
+{
+    RRPropertyPtr prop = RRQueryProviderProperty(provider, property);
+    rrScrPrivPtr pScrPriv = rrGetScrPriv(provider->pScreen);
+
+    if (!prop)
+        return NULL;
+    if (pending && prop->is_pending)
+        return &prop->pending;
+    else {
+#if RANDR_13_INTERFACE
+        /* If we can, try to update the property value first */
+        if (pScrPriv->rrProviderGetProperty)
+            pScrPriv->rrProviderGetProperty(provider->pScreen, provider,
+                                          prop->propertyName);
+#endif
+        return &prop->current;
+    }
+}
+
+int
+RRConfigureProviderProperty(RRProviderPtr provider, Atom property,
+                          Bool pending, Bool range, Bool immutable,
+                          int num_values, INT32 *values)
+{
+    RRPropertyPtr prop = RRQueryProviderProperty(provider, property);
+    Bool add = FALSE;
+    INT32 *new_values;
+
+    if (!prop) {
+        prop = RRCreateProviderProperty(property);
+        if (!prop)
+            return BadAlloc;
+        add = TRUE;
+    }
+    else if (prop->immutable && !immutable)
+        return BadAccess;
+
+    /*
+     * ranges must have even number of values
+     */
+    if (range && (num_values & 1)) {
+        if (add)
+            RRDestroyProviderProperty(prop);
+        return BadMatch;
+    }
+
+    new_values = malloc(num_values * sizeof(INT32));
+    if (!new_values && num_values) {
+        if (add)
+            RRDestroyProviderProperty(prop);
+        return BadAlloc;
+    }
+    if (num_values)
+        memcpy(new_values, values, num_values * sizeof(INT32));
+
+    /*
+     * Property moving from pending to non-pending
+     * loses any pending values
+     */
+    if (prop->is_pending && !pending) {
+        free(prop->pending.data);
+        RRInitProviderPropertyValue(&prop->pending);
+    }
+
+    prop->is_pending = pending;
+    prop->range = range;
+    prop->immutable = immutable;
+    prop->num_valid = num_values;
+    free(prop->valid_values);
+    prop->valid_values = new_values;
+
+    if (add) {
+        prop->next = provider->properties;
+        provider->properties = prop;
+    }
+
+    return Success;
+}
+
+int
+ProcRRListProviderProperties(ClientPtr client)
+{
+    REQUEST(xRRListProviderPropertiesReq);
+    Atom *pAtoms = NULL, *temppAtoms;
+    xRRListProviderPropertiesReply rep;
+    int numProps = 0;
+    RRProviderPtr provider;
+    RRPropertyPtr prop;
+
+    REQUEST_SIZE_MATCH(xRRListProviderPropertiesReq);
+
+    VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
+
+    for (prop = provider->properties; prop; prop = prop->next)
+        numProps++;
+    if (numProps)
+        if (!(pAtoms = (Atom *) malloc(numProps * sizeof(Atom))))
+            return BadAlloc;
+
+    rep = (xRRListProviderPropertiesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(numProps * sizeof(Atom)),
+        .nAtoms = numProps
+    };
+    if (client->swapped) {
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swaps(&rep.nAtoms);
+    }
+    temppAtoms = pAtoms;
+    for (prop = provider->properties; prop; prop = prop->next)
+        *temppAtoms++ = prop->propertyName;
+
+    WriteToClient(client, sizeof(xRRListProviderPropertiesReply), (char *) &rep);
+    if (numProps) {
+        client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
+        WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
+        free(pAtoms);
+    }
+    return Success;
+}
+
+int
+ProcRRQueryProviderProperty(ClientPtr client)
+{
+    REQUEST(xRRQueryProviderPropertyReq);
+    xRRQueryProviderPropertyReply rep;
+    RRProviderPtr provider;
+    RRPropertyPtr prop;
+    char *extra = NULL;
+
+    REQUEST_SIZE_MATCH(xRRQueryProviderPropertyReq);
+
+    VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
+
+    prop = RRQueryProviderProperty(provider, stuff->property);
+    if (!prop)
+        return BadName;
+
+    if (prop->num_valid) {
+        extra = malloc(prop->num_valid * sizeof(INT32));
+        if (!extra)
+            return BadAlloc;
+    }
+    rep = (xRRQueryProviderPropertyReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = prop->num_valid,
+        .pending = prop->is_pending,
+        .range = prop->range,
+        .immutable = prop->immutable
+    };
+    if (client->swapped) {
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+    }
+    WriteToClient(client, sizeof(xRRQueryProviderPropertyReply), (char *) &rep);
+    if (prop->num_valid) {
+        memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32));
+        client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
+        WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32),
+                                 extra);
+        free(extra);
+    }
+    return Success;
+}
+
+int
+ProcRRConfigureProviderProperty(ClientPtr client)
+{
+    REQUEST(xRRConfigureProviderPropertyReq);
+    RRProviderPtr provider;
+    int num_valid;
+
+    REQUEST_AT_LEAST_SIZE(xRRConfigureProviderPropertyReq);
+
+    VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
+
+    num_valid =
+        stuff->length - bytes_to_int32(sizeof(xRRConfigureProviderPropertyReq));
+    return RRConfigureProviderProperty(provider, stuff->property, stuff->pending,
+                                     stuff->range, FALSE, num_valid,
+                                     (INT32 *) (stuff + 1));
+}
+
+int
+ProcRRChangeProviderProperty(ClientPtr client)
+{
+    REQUEST(xRRChangeProviderPropertyReq);
+    RRProviderPtr provider;
+    char format, mode;
+    unsigned long len;
+    int sizeInBytes;
+    int totalSize;
+    int err;
+
+    REQUEST_AT_LEAST_SIZE(xRRChangeProviderPropertyReq);
+    UpdateCurrentTime();
+    format = stuff->format;
+    mode = stuff->mode;
+    if ((mode != PropModeReplace) && (mode != PropModeAppend) &&
+        (mode != PropModePrepend)) {
+        client->errorValue = mode;
+        return BadValue;
+    }
+    if ((format != 8) && (format != 16) && (format != 32)) {
+        client->errorValue = format;
+        return BadValue;
+    }
+    len = stuff->nUnits;
+    if (len > bytes_to_int32((0xffffffff - sizeof(xChangePropertyReq))))
+        return BadLength;
+    sizeInBytes = format >> 3;
+    totalSize = len * sizeInBytes;
+    REQUEST_FIXED_SIZE(xRRChangeProviderPropertyReq, totalSize);
+
+    VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
+
+    if (!ValidAtom(stuff->property)) {
+        client->errorValue = stuff->property;
+        return BadAtom;
+    }
+    if (!ValidAtom(stuff->type)) {
+        client->errorValue = stuff->type;
+        return BadAtom;
+    }
+
+    err = RRChangeProviderProperty(provider, stuff->property,
+                                 stuff->type, (int) format,
+                                 (int) mode, len, (pointer) &stuff[1], TRUE,
+                                 TRUE);
+    if (err != Success)
+        return err;
+    else
+        return Success;
+}
+
+int
+ProcRRDeleteProviderProperty(ClientPtr client)
+{
+    REQUEST(xRRDeleteProviderPropertyReq);
+    RRProviderPtr provider;
+    RRPropertyPtr prop;
+
+    REQUEST_SIZE_MATCH(xRRDeleteProviderPropertyReq);
+    UpdateCurrentTime();
+    VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
+
+    if (!ValidAtom(stuff->property)) {
+        client->errorValue = stuff->property;
+        return BadAtom;
+    }
+
+    prop = RRQueryProviderProperty(provider, stuff->property);
+    if (!prop) {
+        client->errorValue = stuff->property;
+        return BadName;
+    }
+
+    if (prop->immutable) {
+        client->errorValue = stuff->property;
+        return BadAccess;
+    }
+
+    RRDeleteProviderProperty(provider, stuff->property);
+    return Success;
+}
+
+int
+ProcRRGetProviderProperty(ClientPtr client)
+{
+    REQUEST(xRRGetProviderPropertyReq);
+    RRPropertyPtr prop, *prev;
+    RRPropertyValuePtr prop_value;
+    unsigned long n, len, ind;
+    RRProviderPtr provider;
+    xRRGetProviderPropertyReply reply = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence
+    };
+    char *extra = NULL;
+
+    REQUEST_SIZE_MATCH(xRRGetProviderPropertyReq);
+    if (stuff->delete)
+        UpdateCurrentTime();
+    VERIFY_RR_PROVIDER(stuff->provider, provider,
+                     stuff->delete ? DixWriteAccess : DixReadAccess);
+
+    if (!ValidAtom(stuff->property)) {
+        client->errorValue = stuff->property;
+        return BadAtom;
+    }
+    if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) {
+        client->errorValue = stuff->delete;
+        return BadValue;
+    }
+    if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type)) {
+        client->errorValue = stuff->type;
+        return BadAtom;
+    }
+
+    for (prev = &provider->properties; (prop = *prev); prev = &prop->next)
+        if (prop->propertyName == stuff->property)
+            break;
+
+    if (!prop) {
+        reply.nItems = 0;
+        reply.length = 0;
+        reply.bytesAfter = 0;
+        reply.propertyType = None;
+        reply.format = 0;
+        if (client->swapped) {
+            swaps(&reply.sequenceNumber);
+            swapl(&reply.length);
+            swapl(&reply.propertyType);
+            swapl(&reply.bytesAfter);
+            swapl(&reply.nItems);
+        }
+        WriteToClient(client, sizeof(xRRGetProviderPropertyReply), &reply);
+        return Success;
+    }
+
+    if (prop->immutable && stuff->delete)
+        return BadAccess;
+
+    prop_value = RRGetProviderProperty(provider, stuff->property, stuff->pending);
+    if (!prop_value)
+        return BadAtom;
+
+    /* If the request type and actual type don't match. Return the
+       property information, but not the data. */
+
+    if (((stuff->type != prop_value->type) && (stuff->type != AnyPropertyType))
+        ) {
+        reply.bytesAfter = prop_value->size;
+        reply.format = prop_value->format;
+        reply.length = 0;
+        reply.nItems = 0;
+        reply.propertyType = prop_value->type;
+        if (client->swapped) {
+            swaps(&reply.sequenceNumber);
+            swapl(&reply.length);
+            swapl(&reply.propertyType);
+            swapl(&reply.bytesAfter);
+            swapl(&reply.nItems);
+        }
+        WriteToClient(client, sizeof(xRRGetProviderPropertyReply), &reply);
+        return Success;
+    }
+
+/*
+ *  Return type, format, value to client
+ */
+    n = (prop_value->format / 8) * prop_value->size;    /* size (bytes) of prop */
+    ind = stuff->longOffset << 2;
+
+    /* If longOffset is invalid such that it causes "len" to
+       be negative, it's a value error. */
+
+    if (n < ind) {
+        client->errorValue = stuff->longOffset;
+        return BadValue;
+    }
+
+    len = min(n - ind, 4 * stuff->longLength);
+
+    if (len) {
+        extra = malloc(len);
+        if (!extra)
+            return BadAlloc;
+    }
+    reply.bytesAfter = n - (ind + len);
+    reply.format = prop_value->format;
+    reply.length = bytes_to_int32(len);
+    if (prop_value->format)
+        reply.nItems = len / (prop_value->format / 8);
+    else
+        reply.nItems = 0;
+    reply.propertyType = prop_value->type;
+
+    if (stuff->delete && (reply.bytesAfter == 0)) {
+        xRRProviderPropertyNotifyEvent event = {
+            .type = RREventBase + RRNotify,
+            .subCode = RRNotify_ProviderProperty,
+            .provider = provider->id,
+            .state = PropertyDelete,
+            .atom = prop->propertyName,
+            .timestamp = currentTime.milliseconds
+        };
+        RRDeliverPropertyEvent(provider->pScreen, (xEvent *) &event);
+    }
+
+    if (client->swapped) {
+        swaps(&reply.sequenceNumber);
+        swapl(&reply.length);
+        swapl(&reply.propertyType);
+        swapl(&reply.bytesAfter);
+        swapl(&reply.nItems);
+    }
+    WriteToClient(client, sizeof(xGenericReply), &reply);
+    if (len) {
+        memcpy(extra, (char *) prop_value->data + ind, len);
+        switch (reply.format) {
+        case 32:
+            client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
+            break;
+        case 16:
+            client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write;
+            break;
+        default:
+            client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient;
+            break;
+        }
+        WriteSwappedDataToClient(client, len, extra);
+        free(extra);
+    }
+
+    if (stuff->delete && (reply.bytesAfter == 0)) {     /* delete the Property */
+        *prev = prop->next;
+        RRDestroyProviderProperty(prop);
+    }
+    return Success;
+}
index f570afa..39340cc 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "randrstr.h"
 
-static const int padlength[4] = { 0, 3, 2, 1 };
-
 static CARD16
  RR10CurrentSizeID(ScreenPtr pScreen);
 
@@ -46,8 +44,7 @@ RREditConnectionInfo(ScreenPtr pScreen)
     connSetup = (xConnSetup *) ConnectionInfo;
     vendor = (char *) connSetup + sizeof(xConnSetup);
     formats = (xPixmapFormat *) ((char *) vendor +
-                                 connSetup->nbytesVendor +
-                                 padlength[connSetup->nbytesVendor & 3]);
+                                 pad_to_int32(connSetup->nbytesVendor));
     root = (xWindowRoot *) ((char *) formats +
                             sizeof(xPixmapFormat) *
                             screenInfo.numPixmapFormats);
@@ -71,20 +68,20 @@ void
 RRSendConfigNotify(ScreenPtr pScreen)
 {
     WindowPtr pWin = pScreen->root;
-    xEvent event;
-
-    event.u.u.type = ConfigureNotify;
-    event.u.configureNotify.window = pWin->drawable.id;
-    event.u.configureNotify.aboveSibling = None;
-    event.u.configureNotify.x = 0;
-    event.u.configureNotify.y = 0;
+    xEvent event = {
+        .u.configureNotify.window = pWin->drawable.id,
+        .u.configureNotify.aboveSibling = None,
+        .u.configureNotify.x = 0,
+        .u.configureNotify.y = 0,
 
     /* XXX xinerama stuff ? */
 
-    event.u.configureNotify.width = pWin->drawable.width;
-    event.u.configureNotify.height = pWin->drawable.height;
-    event.u.configureNotify.borderWidth = wBorderWidth(pWin);
-    event.u.configureNotify.override = pWin->overrideRedirect;
+        .u.configureNotify.width = pWin->drawable.width,
+        .u.configureNotify.height = pWin->drawable.height,
+        .u.configureNotify.borderWidth = wBorderWidth(pWin),
+        .u.configureNotify.override = pWin->overrideRedirect
+    };
+    event.u.u.type = ConfigureNotify;
     DeliverEvents(pWin, &event, 1, NullWindow);
 }
 
@@ -92,19 +89,20 @@ void
 RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr pScreen)
 {
     rrScrPriv(pScreen);
-    xRRScreenChangeNotifyEvent se;
     RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL;
     WindowPtr pRoot = pScreen->root;
 
-    se.type = RRScreenChangeNotify + RREventBase;
-    se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0);
-    se.timestamp = pScrPriv->lastSetTime.milliseconds;
-    se.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
-    se.root = pRoot->drawable.id;
-    se.window = pWin->drawable.id;
-    se.subpixelOrder = PictureGetSubpixelOrder(pScreen);
+    xRRScreenChangeNotifyEvent se = {
+        .type = RRScreenChangeNotify + RREventBase,
+        .rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0),
+        .timestamp = pScrPriv->lastSetTime.milliseconds,
+        .configTimestamp = pScrPriv->lastConfigTime.milliseconds,
+        .root = pRoot->drawable.id,
+        .window = pWin->drawable.id,
+        .subpixelOrder = PictureGetSubpixelOrder(pScreen),
 
-    se.sizeID = RR10CurrentSizeID(pScreen);
+        .sizeID = RR10CurrentSizeID(pScreen)
+    };
 
     if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) {
         se.widthInPixels = pScreen->height;
@@ -195,7 +193,7 @@ ProcRRGetScreenSizeRange(ClientPtr client)
     rrScrPrivPtr pScrPriv;
     int rc;
 
-    REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
+    REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
         return rc;
@@ -203,10 +201,12 @@ ProcRRGetScreenSizeRange(ClientPtr client)
     pScreen = pWin->drawable.pScreen;
     pScrPriv = rrGetScrPriv(pScreen);
 
-    rep.type = X_Reply;
-    rep.pad = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
+    rep = (xRRGetScreenSizeRangeReply) {
+        .type = X_Reply,
+        .pad = 0,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     if (pScrPriv) {
         if (!RRGetInfo(pScreen, FALSE))
@@ -228,7 +228,7 @@ ProcRRGetScreenSizeRange(ClientPtr client)
         swaps(&rep.maxWidth);
         swaps(&rep.maxHeight);
     }
-    WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), &rep);
     return Success;
 }
 
@@ -248,6 +248,9 @@ ProcRRSetScreenSize(ClientPtr client)
 
     pScreen = pWin->drawable.pScreen;
     pScrPriv = rrGetScrPriv(pScreen);
+    if (!pScrPriv)
+        return BadMatch;
+
     if (stuff->width < pScrPriv->minWidth || pScrPriv->maxWidth < stuff->width) {
         client->errorValue = stuff->width;
         return BadValue;
@@ -289,6 +292,173 @@ ProcRRSetScreenSize(ClientPtr client)
     return Success;
 }
 
+
+#define update_totals(gpuscreen, pScrPriv) do {       \
+    total_crtcs += pScrPriv->numCrtcs;                \
+    total_outputs += pScrPriv->numOutputs;            \
+    modes = RRModesForScreen(gpuscreen, &num_modes);  \
+    if (!modes)                                       \
+        return BadAlloc;                              \
+    for (j = 0; j < num_modes; j++)                   \
+        total_name_len += modes[j]->mode.nameLength;  \
+    total_modes += num_modes;                         \
+    free(modes);                                      \
+} while(0)
+
+static inline void swap_modeinfos(xRRModeInfo *modeinfos, int i)
+{
+    swapl(&modeinfos[i].id);
+    swaps(&modeinfos[i].width);
+    swaps(&modeinfos[i].height);
+    swapl(&modeinfos[i].dotClock);
+    swaps(&modeinfos[i].hSyncStart);
+    swaps(&modeinfos[i].hSyncEnd);
+    swaps(&modeinfos[i].hTotal);
+    swaps(&modeinfos[i].hSkew);
+    swaps(&modeinfos[i].vSyncStart);
+    swaps(&modeinfos[i].vSyncEnd);
+    swaps(&modeinfos[i].vTotal);
+    swaps(&modeinfos[i].nameLength);
+    swapl(&modeinfos[i].modeFlags);
+}
+
+#define update_arrays(gpuscreen, pScrPriv) do {            \
+    for (j = 0; j < pScrPriv->numCrtcs; j++) {             \
+        crtcs[crtc_count] = pScrPriv->crtcs[j]->id;        \
+        if (client->swapped)                               \
+            swapl(&crtcs[crtc_count]);                     \
+        crtc_count++;                                      \
+    }                                                      \
+    for (j = 0; j < pScrPriv->numOutputs; j++) {           \
+        outputs[output_count] = pScrPriv->outputs[j]->id;  \
+        if (client->swapped)                               \
+            swapl(&outputs[output_count]);                 \
+        output_count++;                                    \
+    }                                                      \
+    {                                                      \
+        RRModePtr mode;                                    \
+        modes = RRModesForScreen(gpuscreen, &num_modes);   \
+        for (j = 0; j < num_modes; j++) {                  \
+            mode = modes[j];                               \
+            modeinfos[mode_count] = mode->mode;            \
+            if (client->swapped) {                         \
+                swap_modeinfos(modeinfos, mode_count);     \
+            }                                              \
+            memcpy(names, mode->name, mode->mode.nameLength); \
+            names += mode->mode.nameLength;                \
+            mode_count++;                                  \
+        }                                                  \
+        free(modes);                                       \
+    }                                                      \
+    } while (0)
+
+static int
+rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
+{
+    int j;
+    int total_crtcs, total_outputs, total_modes, total_name_len;
+    int crtc_count, output_count, mode_count;
+    ScreenPtr iter;
+    rrScrPrivPtr pScrPriv;
+    int num_modes;
+    RRModePtr *modes;
+    xRRGetScreenResourcesReply rep;
+    unsigned long extraLen;
+    CARD8 *extra;
+    RRCrtc *crtcs;
+    RROutput *outputs;
+    xRRModeInfo *modeinfos;
+    CARD8 *names;
+
+    /* we need to iterate all the GPU masters and all their output slaves */
+    total_crtcs = 0;
+    total_outputs = 0;
+    total_modes = 0;
+    total_name_len = 0;
+
+    pScrPriv = rrGetScrPriv(pScreen);
+
+    if (query && pScrPriv)
+        if (!RRGetInfo(pScreen, query))
+            return BadAlloc;
+
+    update_totals(pScreen, pScrPriv);
+
+    xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
+        pScrPriv = rrGetScrPriv(iter);
+
+        if (query)
+          if (!RRGetInfo(iter, query))
+            return BadAlloc;
+        update_totals(iter, pScrPriv);
+    }
+
+    ErrorF("reporting %d %d %d %d\n", total_crtcs, total_outputs, total_modes, total_name_len);
+
+    pScrPriv = rrGetScrPriv(pScreen);
+    rep = (xRRGetScreenResourcesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .timestamp = pScrPriv->lastSetTime.milliseconds,
+        .configTimestamp = pScrPriv->lastConfigTime.milliseconds,
+        .nCrtcs = total_crtcs,
+        .nOutputs = total_outputs,
+        .nModes = total_modes,
+        .nbytesNames = total_name_len
+    };
+
+    rep.length = (total_crtcs + total_outputs + total_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) +
+                  bytes_to_int32(rep.nbytesNames));
+
+    extraLen = rep.length << 2;
+    if (extraLen) {
+        extra = malloc(extraLen);
+        if (!extra) {
+            return BadAlloc;
+        }
+    }
+    else
+        extra = NULL;
+
+    crtcs = (RRCrtc *)extra;
+    outputs = (RROutput *)(crtcs + total_crtcs);
+    modeinfos = (xRRModeInfo *)(outputs + total_outputs);
+    names = (CARD8 *)(modeinfos + total_modes);
+
+    /* TODO primary */
+    crtc_count = 0;
+    output_count = 0;
+    mode_count = 0;
+
+    pScrPriv = rrGetScrPriv(pScreen);
+    update_arrays(pScreen, pScrPriv);
+
+    xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
+        pScrPriv = rrGetScrPriv(iter);
+
+        update_arrays(iter, pScrPriv);
+    }
+
+    assert(bytes_to_int32((char *) names - (char *) extra) == rep.length);
+    if (client->swapped) {
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.timestamp);
+        swapl(&rep.configTimestamp);
+        swaps(&rep.nCrtcs);
+        swaps(&rep.nOutputs);
+        swaps(&rep.nModes);
+        swaps(&rep.nbytesNames);
+    }
+    WriteToClient(client, sizeof(xRRGetScreenResourcesReply), &rep);
+    if (extraLen) {
+        WriteToClient(client, extraLen, extra);
+        free(extra);
+    }
+    return Success;
+}
+
 static int
 rrGetScreenResources(ClientPtr client, Bool query)
 {
@@ -312,22 +482,26 @@ rrGetScreenResources(ClientPtr client, Bool query)
 
     pScreen = pWin->drawable.pScreen;
     pScrPriv = rrGetScrPriv(pScreen);
-    rep.pad = 0;
 
     if (query && pScrPriv)
         if (!RRGetInfo(pScreen, query))
             return BadAlloc;
 
+    if (!xorg_list_is_empty(&pScreen->output_slave_list))
+        return rrGetMultiScreenResources(client, query, pScreen);
+
     if (!pScrPriv) {
-        rep.type = X_Reply;
-        rep.sequenceNumber = client->sequence;
-        rep.length = 0;
-        rep.timestamp = currentTime.milliseconds;
-        rep.configTimestamp = currentTime.milliseconds;
-        rep.nCrtcs = 0;
-        rep.nOutputs = 0;
-        rep.nModes = 0;
-        rep.nbytesNames = 0;
+        rep = (xRRGetScreenResourcesReply) {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = 0,
+            .timestamp = currentTime.milliseconds,
+            .configTimestamp = currentTime.milliseconds,
+            .nCrtcs = 0,
+            .nOutputs = 0,
+            .nModes = 0,
+            .nbytesNames = 0
+        };
         extra = NULL;
         extraLen = 0;
     }
@@ -339,15 +513,18 @@ rrGetScreenResources(ClientPtr client, Bool query)
         if (!modes)
             return BadAlloc;
 
-        rep.type = X_Reply;
-        rep.sequenceNumber = client->sequence;
-        rep.length = 0;
-        rep.timestamp = pScrPriv->lastSetTime.milliseconds;
-        rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
-        rep.nCrtcs = pScrPriv->numCrtcs;
-        rep.nOutputs = pScrPriv->numOutputs;
-        rep.nModes = num_modes;
-        rep.nbytesNames = 0;
+        rep = (xRRGetScreenResourcesReply) {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = 0,
+            .timestamp = pScrPriv->lastSetTime.milliseconds,
+            .configTimestamp = pScrPriv->lastConfigTime.milliseconds,
+            .nCrtcs = pScrPriv->numCrtcs,
+            .nOutputs = pScrPriv->numOutputs,
+            .nModes = num_modes,
+            .nbytesNames = 0
+        };
+
 
         for (i = 0; i < num_modes; i++)
             rep.nbytesNames += modes[i]->mode.nameLength;
@@ -572,7 +749,6 @@ ProcRRGetScreenInfo(ClientPtr client)
 
     pScreen = pWin->drawable.pScreen;
     pScrPriv = rrGetScrPriv(pScreen);
-    rep.pad = 0;
 
     if (pScrPriv)
         if (!RRGetInfo(pScreen, TRUE))
@@ -581,18 +757,20 @@ ProcRRGetScreenInfo(ClientPtr client)
     output = RRFirstOutput(pScreen);
 
     if (!pScrPriv || !output) {
-        rep.type = X_Reply;
-        rep.setOfRotations = RR_Rotate_0;
-        rep.sequenceNumber = client->sequence;
-        rep.length = 0;
-        rep.root = pWin->drawable.pScreen->root->drawable.id;
-        rep.timestamp = currentTime.milliseconds;
-        rep.configTimestamp = currentTime.milliseconds;
-        rep.nSizes = 0;
-        rep.sizeID = 0;
-        rep.rotation = RR_Rotate_0;
-        rep.rate = 0;
-        rep.nrateEnts = 0;
+        rep = (xRRGetScreenInfoReply) {
+            .type = X_Reply,
+            .setOfRotations = RR_Rotate_0,
+            .sequenceNumber = client->sequence,
+            .length = 0,
+            .root = pWin->drawable.pScreen->root->drawable.id,
+            .timestamp = currentTime.milliseconds,
+            .configTimestamp = currentTime.milliseconds,
+            .nSizes = 0,
+            .sizeID = 0,
+            .rotation = RR_Rotate_0,
+            .rate = 0,
+            .nrateEnts = 0
+        };
         extra = 0;
         extraLen = 0;
     }
@@ -609,18 +787,20 @@ ProcRRGetScreenInfo(ClientPtr client)
         if (!pData)
             return BadAlloc;
 
-        rep.type = X_Reply;
-        rep.setOfRotations = output->crtc->rotations;
-        rep.sequenceNumber = client->sequence;
-        rep.length = 0;
-        rep.root = pWin->drawable.pScreen->root->drawable.id;
-        rep.timestamp = pScrPriv->lastSetTime.milliseconds;
-        rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
-        rep.rotation = output->crtc->rotation;
-        rep.nSizes = pData->nsize;
-        rep.nrateEnts = pData->nrefresh + pData->nsize;
-        rep.sizeID = pData->size;
-        rep.rate = pData->refresh;
+        rep = (xRRGetScreenInfoReply) {
+            .type = X_Reply,
+            .setOfRotations = output->crtc->rotations,
+            .sequenceNumber = client->sequence,
+            .length = 0,
+            .root = pWin->drawable.pScreen->root->drawable.id,
+            .timestamp = pScrPriv->lastSetTime.milliseconds,
+            .configTimestamp = pScrPriv->lastConfigTime.milliseconds,
+            .rotation = output->crtc->rotation,
+            .nSizes = pData->nsize,
+            .nrateEnts = pData->nrefresh + pData->nsize,
+            .sizeID = pData->size,
+            .rate = pData->refresh
+        };
 
         extraLen = rep.nSizes * sizeof(xScreenSizes);
         if (has_rate)
@@ -682,15 +862,16 @@ ProcRRGetScreenInfo(ClientPtr client)
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.timestamp);
+        swapl(&rep.configTimestamp);
         swaps(&rep.rotation);
         swaps(&rep.nSizes);
         swaps(&rep.sizeID);
         swaps(&rep.rate);
         swaps(&rep.nrateEnts);
     }
-    WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRGetScreenInfoReply), &rep);
     if (extraLen) {
-        WriteToClient(client, extraLen, (char *) extra);
+        WriteToClient(client, extraLen, extra);
         free(extra);
     }
     return Success;
@@ -710,6 +891,7 @@ ProcRRSetScreenConfig(ClientPtr client)
     Rotation rotation;
     int rate;
     Bool has_rate;
+    CARD8 status;
     RROutputPtr output;
     RRCrtcPtr crtc;
     RRModePtr mode;
@@ -740,7 +922,7 @@ ProcRRSetScreenConfig(ClientPtr client)
 
     if (!pScrPriv) {
         time = currentTime;
-        rep.status = RRSetConfigFailed;
+        status = RRSetConfigFailed;
         goto sendReply;
     }
     if (!RRGetInfo(pScreen, FALSE))
@@ -749,7 +931,7 @@ ProcRRSetScreenConfig(ClientPtr client)
     output = RRFirstOutput(pScreen);
     if (!output) {
         time = currentTime;
-        rep.status = RRSetConfigFailed;
+        status = RRSetConfigFailed;
         goto sendReply;
     }
 
@@ -765,7 +947,7 @@ ProcRRSetScreenConfig(ClientPtr client)
      * stop working after several hours have passed (freedesktop bug #6502).
      */
     if (stuff->configTimestamp != pScrPriv->lastConfigTime.milliseconds) {
-        rep.status = RRSetConfigInvalidConfigTime;
+        status = RRSetConfigInvalidConfigTime;
         goto sendReply;
     }
 
@@ -844,7 +1026,7 @@ ProcRRSetScreenConfig(ClientPtr client)
      * the last set-time
      */
     if (CompareTimeStamps(time, pScrPriv->lastSetTime) < 0) {
-        rep.status = RRSetConfigInvalidTime;
+        status = RRSetConfigInvalidTime;
         goto sendReply;
     }
 
@@ -876,24 +1058,24 @@ ProcRRSetScreenConfig(ClientPtr client)
         for (c = 0; c < pScrPriv->numCrtcs; c++) {
             if (!RRCrtcSet(pScrPriv->crtcs[c], NULL, 0, 0, RR_Rotate_0,
                            0, NULL)) {
-                rep.status = RRSetConfigFailed;
+                status = RRSetConfigFailed;
                 /* XXX recover from failure */
                 goto sendReply;
             }
         }
         if (!RRScreenSizeSet(pScreen, width, height,
                              pScreen->mmWidth, pScreen->mmHeight)) {
-            rep.status = RRSetConfigFailed;
+            status = RRSetConfigFailed;
             /* XXX recover from failure */
             goto sendReply;
         }
     }
 
     if (!RRCrtcSet(crtc, mode, 0, 0, stuff->rotation, 1, &output))
-        rep.status = RRSetConfigFailed;
+        status = RRSetConfigFailed;
     else {
         pScrPriv->lastSetTime = time;
-        rep.status = RRSetConfigSuccess;
+        status = RRSetConfigSuccess;
     }
 
     /*
@@ -904,14 +1086,17 @@ ProcRRSetScreenConfig(ClientPtr client)
 
     free(pData);
 
-    rep.type = X_Reply;
-    /* rep.status has already been filled in */
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
+    rep = (xRRSetScreenConfigReply) {
+        .type = X_Reply,
+        .status = status,
+        .sequenceNumber = client->sequence,
+        .length = 0,
 
-    rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
-    rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds;
-    rep.root = pDraw->pScreen->root->drawable.id;
+        .newTimestamp = pScrPriv->lastSetTime.milliseconds,
+        .newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds,
+        .root = pDraw->pScreen->root->drawable.id,
+        /* .subpixelOrder = ?? */
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
@@ -920,7 +1105,7 @@ ProcRRSetScreenConfig(ClientPtr client)
         swapl(&rep.newConfigTimestamp);
         swapl(&rep.root);
     }
-    WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRRSetScreenConfigReply), &rep);
 
     return Success;
 }
index efce7e0..2269b4c 100644 (file)
@@ -57,6 +57,13 @@ RRTransformSetFilter(RRTransformPtr dst,
 extern _X_EXPORT Bool
  RRTransformCopy(RRTransformPtr dst, RRTransformPtr src);
 
+/*
+ * Compute the complete transformation matrix including
+ * client-specified transform, rotation/reflection values and the crtc 
+ * offset.
+ *
+ * Return TRUE if the resulting transform is not a simple translation.
+ */
 extern _X_EXPORT Bool
 
 RRTransformCompute(int x,
index aa8a61e..76d728c 100644 (file)
@@ -89,21 +89,22 @@ static int SProcRRXineramaDispatch(ClientPtr client);
 int
 ProcRRXineramaQueryVersion(ClientPtr client)
 {
-    xPanoramiXQueryVersionReply rep;
+    xPanoramiXQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION,
+        .minorVersion = SERVER_RRXINERAMA_MINOR_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION;
-    rep.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swaps(&rep.majorVersion);
         swaps(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
     return Success;
 }
 
@@ -130,17 +131,19 @@ ProcRRXineramaGetState(ClientPtr client)
         active = TRUE;
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.state = active;
-    rep.window = stuff->window;
+    rep = (xPanoramiXGetStateReply) {
+        .type = X_Reply,
+        .state = active,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .window = stuff->window
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.window);
     }
-    WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep);
+    WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
     return Success;
 }
 
@@ -154,6 +157,7 @@ static int
 RRXineramaScreenCount(ScreenPtr pScreen)
 {
     int i, n;
+    ScreenPtr slave;
 
     n = 0;
     if (rrGetScrPriv(pScreen)) {
@@ -162,6 +166,15 @@ RRXineramaScreenCount(ScreenPtr pScreen)
             if (RRXineramaCrtcActive(pScrPriv->crtcs[i]))
                 n++;
     }
+
+    xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
+        rrScrPrivPtr pSlavePriv;
+        pSlavePriv = rrGetScrPriv(slave);
+        for (i = 0; i < pSlavePriv->numCrtcs; i++)
+            if (RRXineramaCrtcActive(pSlavePriv->crtcs[i]))
+                n++;
+    }
+
     return n;
 }
 
@@ -184,17 +197,19 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
     if (rc != Success)
         return rc;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen);
-    rep.window = stuff->window;
+    rep = (xPanoramiXGetScreenCountReply)  {
+        .type = X_Reply,
+        .ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen),
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .window = stuff->window
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.window);
     }
-    WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep);
+    WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
     return Success;
 }
 
@@ -215,13 +230,15 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
     pScreen = pWin->drawable.pScreen;
     pRoot = pScreen->root;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.width = pRoot->drawable.width;
-    rep.height = pRoot->drawable.height;
-    rep.window = stuff->window;
-    rep.screen = stuff->screen;
+    rep = (xPanoramiXGetScreenSizeReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .width = pRoot->drawable.width,
+        .height = pRoot->drawable.height,
+        .window = stuff->window,
+        .screen = stuff->screen
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -230,7 +247,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
         swapl(&rep.window);
         swapl(&rep.screen);
     }
-    WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep);
+    WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
     return Success;
 }
 
@@ -241,17 +258,18 @@ ProcRRXineramaIsActive(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
 
-    memset(&rep, 0, sizeof(xXineramaIsActiveReply));
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN]);
+    rep = (xXineramaIsActiveReply) {
+        .type = X_Reply,
+        .length = 0,
+        .sequenceNumber = client->sequence,
+        .state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN])
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.state);
     }
-    WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
     return Success;
 }
 
@@ -299,26 +317,32 @@ ProcRRXineramaQueryScreens(ClientPtr client)
 {
     xXineramaQueryScreensReply rep;
     ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
+    int n = 0;
+    int i;
 
     REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
 
-    if (RRXineramaScreenActive(pScreen))
+    if (RRXineramaScreenActive(pScreen)) {
         RRGetInfo(pScreen, FALSE);
+        n = RRXineramaScreenCount(pScreen);
+    }
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.number = RRXineramaScreenCount(pScreen);
-    rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
+    rep = (xXineramaQueryScreensReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(n * sz_XineramaScreenInfo),
+        .number = n
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.number);
     }
-    WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
 
-    if (rep.number) {
+    if (n) {
+        ScreenPtr slave;
         rrScrPriv(pScreen);
-        int i;
         int has_primary = 0;
 
         if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
@@ -334,6 +358,13 @@ ProcRRXineramaQueryScreens(ClientPtr client)
             }
             RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]);
         }
+
+        xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
+            rrScrPrivPtr pSlavePriv;
+            pSlavePriv = rrGetScrPriv(slave);
+            for (i = 0; i < pSlavePriv->numCrtcs; i++)
+                RRXineramaWriteCrtc(client, pSlavePriv->crtcs[i]);
+        }
     }
 
     return Success;
index 8a38118..f3a26a7 100644 (file)
@@ -38,6 +38,7 @@ and Jim Haggerty of Metheus.
 
 #include "dixstruct.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include <X11/extensions/recordproto.h>
 #include "set.h"
 #include "swaprep.h"
@@ -139,8 +140,6 @@ static int RecordDeleteContext(pointer /*value */ ,
                                XID      /*id */
     );
 
-void RecordExtensionInit(void);
-
 /***************************************************************************/
 
 /* client private stuff */
@@ -241,12 +240,12 @@ RecordFlushReplyBuffer(RecordContextPtr pContext,
     ++pContext->inFlush;
     if (pContext->numBufBytes)
         WriteToClient(pContext->pRecordingClient, pContext->numBufBytes,
-                      (char *) pContext->replyBuffer);
+                      pContext->replyBuffer);
     pContext->numBufBytes = 0;
     if (len1)
-        WriteToClient(pContext->pRecordingClient, len1, (char *) data1);
+        WriteToClient(pContext->pRecordingClient, len1, data1);
     if (len2)
-        WriteToClient(pContext->pRecordingClient, len2, (char *) data2);
+        WriteToClient(pContext->pRecordingClient, len2, data2);
     --pContext->inFlush;
 }                               /* RecordFlushReplyBuffer */
 
@@ -1816,21 +1815,21 @@ static int
 ProcRecordQueryVersion(ClientPtr client)
 {
     /* REQUEST(xRecordQueryVersionReq); */
-    xRecordQueryVersionReply rep;
+    xRecordQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .majorVersion = SERVER_RECORD_MAJOR_VERSION,
+        .minorVersion = SERVER_RECORD_MINOR_VERSION
+    };
 
     REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.majorVersion = SERVER_RECORD_MAJOR_VERSION;
-    rep.minorVersion = SERVER_RECORD_MINOR_VERSION;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swaps(&rep.majorVersion);
         swaps(&rep.minorVersion);
     }
-    (void) WriteToClient(client, sizeof(xRecordQueryVersionReply),
-                         (char *) &rep);
+    WriteToClient(client, sizeof(xRecordQueryVersionReply), &rep);
     return Success;
 }                               /* ProcRecordQueryVersion */
 
@@ -2136,6 +2135,7 @@ ProcRecordGetContext(ClientPtr client)
     GetContextRangeInfoPtr pri;
     int i;
     int err;
+    CARD32 nClients, length;
 
     REQUEST_SIZE_MATCH(xRecordGetContextReq);
     VERIFY_CONTEXT(pContext, stuff->context, client);
@@ -2219,28 +2219,32 @@ ProcRecordGetContext(ClientPtr client)
 
     /* calculate number of clients and reply length */
 
-    rep.nClients = 0;
-    rep.length = 0;
+    nClients = 0;
+    length = 0;
     for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo;
          pRCAP; pRCAP = pRCAP->pNextRCAP, pri++) {
-        rep.nClients += pRCAP->numClients;
-        rep.length += pRCAP->numClients *
+        nClients += pRCAP->numClients;
+        length += pRCAP->numClients *
             (bytes_to_int32(sizeof(xRecordClientInfo)) +
              pri->nRanges * bytes_to_int32(sizeof(xRecordRange)));
     }
 
     /* write the reply header */
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.enabled = pContext->pRecordingClient != NULL;
-    rep.elementHeader = pContext->elemHeaders;
+    rep = (xRecordGetContextReply) {
+        .type = X_Reply,
+        .enabled = pContext->pRecordingClient != NULL,
+        .sequenceNumber = client->sequence,
+        .length = length,
+        .elementHeader = pContext->elemHeaders,
+        .nClients = nClients
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
         swapl(&rep.nClients);
     }
-    (void) WriteToClient(client, sizeof(xRecordGetContextReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRecordGetContextReply), &rep);
 
     /* write all the CLIENT_INFOs */
 
@@ -2257,9 +2261,9 @@ ProcRecordGetContext(ClientPtr client)
             rci.clientResource = pRCAP->pClientIDs[i];
             if (client->swapped)
                 swapl(&rci.clientResource);
-            WriteToClient(client, sizeof(xRecordClientInfo), (char *) &rci);
+            WriteToClient(client, sizeof(xRecordClientInfo), &rci);
             WriteToClient(client, sizeof(xRecordRange) * pri->nRanges,
-                          (char *) pri->pRanges);
+                          pri->pRanges);
         }
     }
     err = Success;
index 485c068..ebc5b8e 100644 (file)
@@ -89,7 +89,7 @@ static DevPrivateKeyRec AnimCurScreenPrivateKeyRec;
 #define Unwrap(as,s,elt)    ((s)->elt = (as)->elt)
 
 static Bool
-AnimCurCloseScreen(int index, ScreenPtr pScreen)
+AnimCurCloseScreen(ScreenPtr pScreen)
 {
     AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
     Bool ret;
@@ -103,7 +103,7 @@ AnimCurCloseScreen(int index, ScreenPtr pScreen)
     Unwrap(as, pScreen, UnrealizeCursor);
     Unwrap(as, pScreen, RecolorCursor);
     SetAnimCurScreen(pScreen, 0);
-    ret = (*pScreen->CloseScreen) (index, pScreen);
+    ret = (*pScreen->CloseScreen) (pScreen);
     free(as);
     return ret;
 }
@@ -135,11 +135,9 @@ AnimCurCursorLimits(DeviceIntPtr pDev,
  */
 
 static void
-AnimCurScreenBlockHandler(int screenNum,
-                          pointer blockData,
+AnimCurScreenBlockHandler(ScreenPtr pScreen,
                           pointer pTimeout, pointer pReadmask)
 {
-    ScreenPtr pScreen = screenInfo.screens[screenNum];
     AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
     DeviceIntPtr dev;
     Bool activeDevice = FALSE;
@@ -183,7 +181,7 @@ AnimCurScreenBlockHandler(int screenNum,
         AdjustWaitForDelay(pTimeout, soonest - now);
 
     Unwrap(as, pScreen, BlockHandler);
-    (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
+    (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
     if (activeDevice)
         Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
     else
index 8c401ee..019ea7f 100644 (file)
@@ -273,7 +273,10 @@ PictureResetFilters(ScreenPtr pScreen)
 
     free(ps->filters);
     free(ps->filterAliases);
-    PictureFreeFilterIds();
+
+    /* Free the filters when the last screen is closed */
+    if (pScreen->myNum == 0)
+        PictureFreeFilterIds();
 }
 
 int
index a143e9e..e1dc662 100644 (file)
@@ -80,8 +80,6 @@ static GlyphHashSetRec glyphHashSets[] = {
 
 #define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0]))
 
-static const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 };
-
 static GlyphHashRec globalGlyphs[GlyphFormatNum];
 
 void
@@ -90,7 +88,6 @@ GlyphUninit(ScreenPtr pScreen)
     PictureScreenPtr ps = GetPictureScreen(pScreen);
     GlyphPtr glyph;
     int fdepth, i;
-    int scrno = pScreen->myNum;
 
     for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++) {
         if (!globalGlyphs[fdepth].hashSet)
@@ -99,9 +96,9 @@ GlyphUninit(ScreenPtr pScreen)
         for (i = 0; i < globalGlyphs[fdepth].hashSet->size; i++) {
             glyph = globalGlyphs[fdepth].table[i].glyph;
             if (glyph && glyph != DeletedGlyph) {
-                if (GlyphPicture(glyph)[scrno]) {
-                    FreePicture((pointer) GlyphPicture(glyph)[scrno], 0);
-                    GlyphPicture(glyph)[scrno] = NULL;
+                if (GetGlyphPicture(glyph, pScreen)) {
+                    FreePicture((pointer) GetGlyphPicture(glyph, pScreen), 0);
+                    SetGlyphPicture(glyph, pScreen, NULL);
                 }
                 (*ps->UnrealizeGlyph) (pScreen, glyph);
             }
@@ -239,8 +236,8 @@ FreeGlyphPicture(GlyphPtr glyph)
     for (i = 0; i < screenInfo.numScreens; i++) {
         ScreenPtr pScreen = screenInfo.screens[i];
 
-        if (GlyphPicture(glyph)[i])
-            FreePicture((pointer) GlyphPicture(glyph)[i], 0);
+        if (GetGlyphPicture(glyph, pScreen))
+            FreePicture((pointer) GetGlyphPicture(glyph, pScreen), 0);
 
         ps = GetPictureScreenIfSet(pScreen);
         if (ps)
@@ -363,11 +360,12 @@ AllocateGlyph(xGlyphInfo * gi, int fdepth)
     dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH);
 
     for (i = 0; i < screenInfo.numScreens; i++) {
-        GlyphPicture(glyph)[i] = NULL;
-        ps = GetPictureScreenIfSet(screenInfo.screens[i]);
+        ScreenPtr pScreen = screenInfo.screens[i];
+        SetGlyphPicture(glyph, pScreen, NULL);
+        ps = GetPictureScreenIfSet(pScreen);
 
         if (ps) {
-            if (!(*ps->RealizeGlyph) (screenInfo.screens[i], glyph))
+            if (!(*ps->RealizeGlyph) (pScreen, glyph))
                 goto bail;
         }
     }
@@ -638,7 +636,7 @@ miGlyphs(CARD8 op,
         n = list->len;
         while (n--) {
             glyph = *glyphs++;
-            pPicture = GlyphPicture(glyph)[pScreen->myNum];
+            pPicture = GetGlyphPicture(glyph, pScreen);
 
             if (pPicture) {
                 if (maskFormat) {
@@ -684,3 +682,15 @@ miGlyphs(CARD8 op,
         (*pScreen->DestroyPixmap) (pMaskPixmap);
     }
 }
+
+PicturePtr GetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen)
+{
+    if (pScreen->isGPU)
+        return NULL;
+    return GlyphPicture(glyph)[pScreen->myNum];
+}
+
+void SetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen, PicturePtr picture)
+{
+    GlyphPicture(glyph)[pScreen->myNum] = picture;
+}
index cbc4751..7d178be 100644 (file)
@@ -133,4 +133,10 @@ extern _X_EXPORT GlyphSetPtr AllocateGlyphSet(int fdepth, PictFormatPtr format);
 extern _X_EXPORT int
  FreeGlyphSet(pointer value, XID gid);
 
+#define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR 1 /* used for api compat */
+extern _X_EXPORT PicturePtr
+ GetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen);
+extern _X_EXPORT void
+ SetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen, PicturePtr picture);
+
 #endif                          /* _GLYPHSTR_H_ */
index 2fd13fc..2908b76 100644 (file)
@@ -50,6 +50,14 @@ RESTYPE PictFormatType;
 RESTYPE GlyphSetType;
 int PictureCmapPolicy = PictureCmapPolicyDefault;
 
+PictFormatPtr
+PictureWindowFormat(WindowPtr pWindow)
+{
+    ScreenPtr pScreen = pWindow->drawable.pScreen;
+    return PictureMatchVisual(pScreen, pWindow->drawable.depth,
+                              WindowGetVisual(pWindow));
+}
+
 Bool
 PictureDestroyWindow(WindowPtr pWindow)
 {
@@ -72,14 +80,14 @@ PictureDestroyWindow(WindowPtr pWindow)
 }
 
 Bool
-PictureCloseScreen(int index, ScreenPtr pScreen)
+PictureCloseScreen(ScreenPtr pScreen)
 {
     PictureScreenPtr ps = GetPictureScreen(pScreen);
     Bool ret;
     int n;
 
     pScreen->CloseScreen = ps->CloseScreen;
-    ret = (*pScreen->CloseScreen) (index, pScreen);
+    ret = (*pScreen->CloseScreen) (pScreen);
     PictureResetFilters(pScreen);
     for (n = 0; n < ps->nformats; n++)
         if (ps->formats[n].type == PictTypeIndexed)
@@ -591,6 +599,29 @@ PictureParseCmapPolicy(const char *name)
         return PictureCmapPolicyInvalid;
 }
 
+/** @see GetDefaultBytes */
+static void
+GetPictureBytes(pointer value, XID id, ResourceSizePtr size)
+{
+    PicturePtr picture = value;
+
+    /* Currently only pixmap bytes are reported to clients. */
+    size->resourceSize = 0;
+
+    size->refCnt = picture->refcnt;
+
+    /* Calculate pixmap reference sizes. */
+    size->pixmapRefSize = 0;
+    if (picture->pDrawable && (picture->pDrawable->type == DRAWABLE_PIXMAP))
+    {
+        SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP);
+        ResourceSizeRec pixmapSize = { 0, 0, 0 };
+        PixmapPtr pixmap = (PixmapPtr)picture->pDrawable;
+        pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize);
+        size->pixmapRefSize += pixmapSize.pixmapRefSize;
+    }
+}
+
 Bool
 PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
 {
@@ -602,6 +633,7 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
         PictureType = CreateNewResourceType(FreePicture, "PICTURE");
         if (!PictureType)
             return FALSE;
+        SetResourceTypeSizeFunc(PictureType, GetPictureBytes);
         PictFormatType = CreateNewResourceType(FreePictFormat, "PICTFORMAT");
         if (!PictFormatType)
             return FALSE;
@@ -731,7 +763,8 @@ CreatePicture(Picture pid,
     PicturePtr pPicture;
     PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen);
 
-    pPicture = dixAllocateObjectWithPrivates(PictureRec, PRIVATE_PICTURE);
+    pPicture = dixAllocateScreenObjectWithPrivates(pDrawable->pScreen,
+                                                   PictureRec, PRIVATE_PICTURE);
     if (!pPicture) {
         *error = BadAlloc;
         return 0;
@@ -821,7 +854,7 @@ createSourcePicture(void)
 {
     PicturePtr pPicture;
 
-    pPicture = dixAllocateObjectWithPrivates(PictureRec, PRIVATE_PICTURE);
+    pPicture = dixAllocateScreenObjectWithPrivates(NULL, PictureRec, PRIVATE_PICTURE);
     pPicture->pDrawable = 0;
     pPicture->pFormat = 0;
     pPicture->pNext = 0;
index cd4ec49..dc00f41 100644 (file)
@@ -377,11 +377,14 @@ extern _X_EXPORT RESTYPE GlyphSetType;
     } \
 } \
 
+extern _X_EXPORT PictFormatPtr
+ PictureWindowFormat(WindowPtr pWindow);
+
 extern _X_EXPORT Bool
  PictureDestroyWindow(WindowPtr pWindow);
 
 extern _X_EXPORT Bool
- PictureCloseScreen(int Index, ScreenPtr pScreen);
+ PictureCloseScreen(ScreenPtr pScreen);
 
 extern _X_EXPORT void
  PictureStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef);
@@ -544,8 +547,6 @@ CompositeTriFan(CARD8 op,
                 PictFormatPtr maskFormat,
                 INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
 
-extern _X_EXPORT void RenderExtensionInit(void);
-
 Bool
  AnimCurInit(ScreenPtr pScreen);
 
index 344ca75..51f75ae 100644 (file)
@@ -37,6 +37,7 @@
 #include "pixmapstr.h"
 #include "colormapst.h"
 #include "extnsionst.h"
+#include "extinit.h"
 #include "servermd.h"
 #include <X11/extensions/render.h>
 #include <X11/extensions/renderproto.h>
@@ -267,7 +268,11 @@ static int
 ProcRenderQueryVersion(ClientPtr client)
 {
     RenderClientPtr pRenderClient = GetRenderClient(client);
-    xRenderQueryVersionReply rep;
+    xRenderQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     REQUEST(xRenderQueryVersionReq);
 
@@ -275,10 +280,6 @@ ProcRenderQueryVersion(ClientPtr client)
     pRenderClient->minor_version = stuff->minorVersion;
 
     REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
-    memset(&rep, 0, sizeof(xRenderQueryVersionReply));
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
 
     if ((stuff->majorVersion * 1000 + stuff->minorVersion) <
         (SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION)) {
@@ -296,7 +297,7 @@ ProcRenderQueryVersion(ClientPtr client)
         swapl(&rep.majorVersion);
         swapl(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xRenderQueryVersionReply), &rep);
     return Success;
 }
 
@@ -500,7 +501,7 @@ ProcRenderQueryPictFormats(ClientPtr client)
         swapl(&reply->numVisuals);
         swapl(&reply->numSubpixel);
     }
-    WriteToClient(client, rlength, (char *) reply);
+    WriteToClient(client, rlength, reply);
     free(reply);
     return Success;
 }
@@ -531,7 +532,7 @@ ProcRenderQueryPictIndexValues(ClientPtr client)
     num = pFormat->index.nvalues;
     rlength = (sizeof(xRenderQueryPictIndexValuesReply) +
                num * sizeof(xIndexValue));
-    reply = (xRenderQueryPictIndexValuesReply *) malloc(rlength);
+    reply = (xRenderQueryPictIndexValuesReply *) calloc(1, rlength);
     if (!reply)
         return BadAlloc;
 
@@ -557,7 +558,7 @@ ProcRenderQueryPictIndexValues(ClientPtr client)
         swapl(&reply->numIndexValues);
     }
 
-    WriteToClient(client, rlength, (char *) reply);
+    WriteToClient(client, rlength, reply);
     free(reply);
     return Success;
 }
@@ -1136,11 +1137,11 @@ ProcRenderAddGlyphs(ClientPtr client)
                     goto bail;
                 }
 
-                GlyphPicture(glyph)[screen] = pDst =
-                    CreatePicture(0, &pDstPix->drawable,
+                pDst = CreatePicture(0, &pDstPix->drawable,
                                   glyphSet->format,
                                   CPComponentAlpha, &component_alpha,
                                   serverClient, &error);
+                SetGlyphPicture(glyph, pScreen, pDst);
 
                 /* The picture takes a reference to the pixmap, so we
                    drop ours. */
@@ -1688,7 +1689,7 @@ ProcRenderQueryFilters(ClientPtr client)
     }
     len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName);
     total_bytes = sizeof(xRenderQueryFiltersReply) + (len << 2);
-    reply = (xRenderQueryFiltersReply *) malloc(total_bytes);
+    reply = (xRenderQueryFiltersReply *) calloc(1, total_bytes);
     if (!reply)
         return BadAlloc;
     aliases = (INT16 *) (reply + 1);
@@ -1748,7 +1749,7 @@ ProcRenderQueryFilters(ClientPtr client)
         swapl(&reply->numAliases);
         swapl(&reply->numFilters);
     }
-    WriteToClient(client, total_bytes, (char *) reply);
+    WriteToClient(client, total_bytes, reply);
     free(reply);
 
     return Success;
index 32be00d..34f53fc 100644 (file)
@@ -5,7 +5,7 @@ if XORG
 # Tests that require at least some DDX functions in order to fully link
 # For now, requires xf86 ddx, could be adjusted to use another
 SUBDIRS += xi2
-noinst_PROGRAMS += xkb input xtest misc fixes xfree86
+noinst_PROGRAMS += xkb input xtest misc fixes xfree86 hashtabletest os signal-logging
 endif
 check_LTLIBRARIES = libxservertest.la
 
@@ -18,15 +18,14 @@ if XORG
 INCLUDES += -I$(top_srcdir)/hw/xfree86/parser \
        -I$(top_srcdir)/hw/xfree86/ddc \
        -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \
-       -I$(top_srcdir)/hw/xfree86/ramdac
+       -I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri \
+       -I$(top_srcdir)/hw/xfree86/dri2
 endif
-TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
+TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
 
-if XORG
 if SPECIAL_DTRACE_OBJECTS
 TEST_LDADD += $(OS_LIB) $(DIX_LIB)
 endif
-endif
 
 xkb_LDADD=$(TEST_LDADD)
 input_LDADD=$(TEST_LDADD)
@@ -36,9 +35,13 @@ misc_LDADD=$(TEST_LDADD)
 fixes_LDADD=$(TEST_LDADD)
 xfree86_LDADD=$(TEST_LDADD)
 touch_LDADD=$(TEST_LDADD)
+signal_logging_LDADD=$(TEST_LDADD)
+hashtabletest_LDADD=$(TEST_LDADD) $(top_srcdir)/Xext/hashtable.c
+os_LDADD=$(TEST_LDADD)
 
 libxservertest_la_LIBADD = $(XSERVER_LIBS)
 if XORG
+
 nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c
 libxservertest_la_LIBADD += \
             $(top_builddir)/hw/xfree86/loader/libloader.la \
@@ -53,6 +56,14 @@ libxservertest_la_LIBADD += \
             $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
             @XORG_LIBS@
 
+if DRI
+libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri/libdri.la
+endif
+
+if DRI2
+libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri2/libdri2.la
+endif
+
 else
 nodist_libxservertest_la_SOURCES = \
             ddxstubs.c \
index a214b96..3647dc5 100644 (file)
@@ -50,7 +50,7 @@ OsVendorInit(void)
 }
 
 void
-OsVendorFatalError(void)
+OsVendorFatalError(const char *f, va_list args)
 {
 }
 
diff --git a/test/hashtabletest.c b/test/hashtabletest.c
new file mode 100644 (file)
index 0000000..64c7091
--- /dev/null
@@ -0,0 +1,162 @@
+#include <misc.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "hashtable.h"
+#include "resource.h"
+
+static void
+print_xid(void* ptr, void* v)
+{
+    XID *x = v;
+    printf("%ld", *x);
+}
+
+static void
+print_int(void* ptr, void* v)
+{
+    int *x = v;
+    printf("%d", *x);
+}
+
+static int
+test1(void)
+{
+    HashTable h;
+    XID id;
+    int c;
+    int ok = 1;
+    const int numKeys = 420;
+
+    printf("test1\n");
+    h = ht_create(sizeof(XID), sizeof(int), ht_resourceid_hash, ht_resourceid_compare, NULL);
+
+    for (c = 0; c < numKeys; ++c) {
+      int *dest;
+      id = c;
+      dest = ht_add(h, &id);
+      if (dest) {
+        *dest = 2 * c;
+      }
+    }
+
+    printf("Distribution after insertion\n");
+    ht_dump_distribution(h);
+    ht_dump_contents(h, print_xid, print_int, NULL);
+
+    for (c = 0; c < numKeys; ++c) {
+      XID id = c;
+      int* v = ht_find(h, &id);
+      if (v) {
+        if (*v == 2 * c) {
+          // ok
+        } else {
+          printf("Key %d doesn't have expected value %d but has %d instead\n",
+                 c, 2 * c, *v);
+          ok = 0;
+        }
+      } else {
+        ok = 0;
+        printf("Cannot find key %d\n", c);
+      }
+    }
+
+    if (ok) {
+      printf("%d keys inserted and found\n", c);
+
+      for (c = 0; c < numKeys; ++c) {
+        XID id = c;
+        ht_remove(h, &id);
+      }
+
+      printf("Distribution after deletion\n");
+      ht_dump_distribution(h);
+    }
+
+    ht_destroy(h);
+
+    return ok;
+}
+
+static int
+test2(void)
+{
+    HashTable h;
+    XID id;
+    int c;
+    int ok = 1;
+    const int numKeys = 420;
+
+    printf("test2\n");
+    h = ht_create(sizeof(XID), 0, ht_resourceid_hash, ht_resourceid_compare, NULL);
+
+    for (c = 0; c < numKeys; ++c) {
+      id = c;
+      ht_add(h, &id);
+    }
+
+    for (c = 0; c < numKeys; ++c) {
+      XID id = c;
+      if (!ht_find(h, &id)) {
+        ok = 0;
+        printf("Cannot find key %d\n", c);
+      }
+    }
+
+    {
+        XID id = c + 1;
+        if (ht_find(h, &id)) {
+            ok = 0;
+            printf("Could find a key that shouldn't be there\n");
+        }
+    }
+
+    ht_destroy(h);
+
+    if (ok) {
+        printf("Test with empty keys OK\n");
+    } else {
+        printf("Test with empty keys FAILED\n");
+    }
+
+    return ok;
+}
+
+static int
+test3(void)
+{
+    int ok = 1;
+    HtGenericHashSetupRec hashSetup = {
+        .keySize = 4
+    };
+    HashTable h;
+    printf("test3\n");
+    h = ht_create(4, 0, ht_generic_hash, ht_generic_compare, &hashSetup);
+
+    if (!ht_add(h, "helo") ||
+        !ht_add(h, "wrld")) {
+        printf("Could not insert keys\n");
+    }
+
+    if (!ht_find(h, "helo") ||
+        !ht_find(h, "wrld")) {
+        ok = 0;
+        printf("Could not find inserted keys\n");
+    }
+
+    printf("Hash distribution with two strings\n");
+    ht_dump_distribution(h);
+
+    ht_destroy(h);
+
+    return ok;
+}
+
+int
+main(void)
+{
+    int ok = test1();
+    ok = ok && test2();
+    ok = ok && test3();
+
+    return ok ? 0 : 1;
+}
index 90ab9ae..191c817 100644 (file)
@@ -965,6 +965,19 @@ test_pad_to_int32(int i)
 }
 
 static void
+test_padding_for_int32(int i)
+{
+    static const int padlength[4] = { 0, 3, 2, 1 };
+    int expected_bytes = (((i + 3) / 4) * 4) - i;
+
+    assert(padding_for_int32(i) >= 0);
+    assert(padding_for_int32(i) <= 3);
+    assert(padding_for_int32(i) == expected_bytes);
+    assert(padding_for_int32(i) == padlength[i & 3]);
+    assert((padding_for_int32(i) + i) == pad_to_int32(i));
+}
+
+static void
 include_byte_padding_macros(void)
 {
     printf("Testing bits_to_bytes()\n");
@@ -996,12 +1009,12 @@ include_byte_padding_macros(void)
     test_bytes_to_int32(INT_MAX - 4);
     test_bytes_to_int32(INT_MAX - 3);
 
-    printf("Testing pad_to_int32\n");
+    printf("Testing pad_to_int32()\n");
 
     test_pad_to_int32(0);
-    test_pad_to_int32(0);
     test_pad_to_int32(1);
     test_pad_to_int32(2);
+    test_pad_to_int32(3);
     test_pad_to_int32(7);
     test_pad_to_int32(8);
     test_pad_to_int32(0xFF);
@@ -1012,6 +1025,23 @@ include_byte_padding_macros(void)
     test_pad_to_int32(0x1000000);
     test_pad_to_int32(INT_MAX - 4);
     test_pad_to_int32(INT_MAX - 3);
+
+    printf("Testing padding_for_int32()\n");
+
+    test_padding_for_int32(0);
+    test_padding_for_int32(1);
+    test_padding_for_int32(2);
+    test_padding_for_int32(3);
+    test_padding_for_int32(7);
+    test_padding_for_int32(8);
+    test_padding_for_int32(0xFF);
+    test_padding_for_int32(0x100);
+    test_padding_for_int32(0xFFFF);
+    test_padding_for_int32(0x10000);
+    test_padding_for_int32(0xFFFFFF);
+    test_padding_for_int32(0x1000000);
+    test_padding_for_int32(INT_MAX - 4);
+    test_padding_for_int32(INT_MAX - 3);
 }
 
 static void
diff --git a/test/os.c b/test/os.c
new file mode 100644 (file)
index 0000000..2d005a0
--- /dev/null
+++ b/test/os.c
@@ -0,0 +1,166 @@
+/**
+ * Copyright © 2012 Red Hat, 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 (including the next
+ *  paragraph) shall be included in all copies or substantial portions of the
+ *  Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *  DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <signal.h>
+#include "os.h"
+
+static int last_signal = 0;
+static int expect_signal = 0;
+
+static void sighandler(int signal)
+{
+    assert(expect_signal);
+    expect_signal = 0;
+    if (!last_signal)
+        raise(signal);
+    OsBlockSignals();
+    OsReleaseSignals();
+    last_signal = 1;
+    expect_signal = 1;
+}
+
+static int
+sig_is_blocked(int sig)
+{
+    sigset_t current;
+
+    sigemptyset(&current);
+    assert(sigprocmask(SIG_BLOCK, NULL, &current) == 0);
+    return sigismember(&current, sig);
+}
+
+static void block_sigio_test(void)
+{
+#ifdef SIG_BLOCK
+    sigset_t current;
+
+    sigemptyset(&current);
+    assert(!sig_is_blocked(SIGIO));
+
+    /* block once */
+    OsBlockSIGIO();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSIGIO();
+    assert(!sig_is_blocked(SIGIO));
+
+    /* block twice, nested */
+    OsBlockSIGIO();
+    assert(sig_is_blocked(SIGIO));
+    OsBlockSIGIO();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSIGIO();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSIGIO();
+    assert(!sig_is_blocked(SIGIO));
+
+    /* block all */
+    OsBlockSignals();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSignals();
+    assert(!sig_is_blocked(SIGIO));
+
+    /* block all nested */
+    OsBlockSignals();
+    assert(sig_is_blocked(SIGIO));
+    OsBlockSignals();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSignals();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSignals();
+    assert(!sig_is_blocked(SIGIO));
+
+    /* mix the two */
+    /* ABBA */
+    OsBlockSignals();
+    assert(sig_is_blocked(SIGIO));
+    OsBlockSIGIO();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSIGIO();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSignals();
+    assert(!sig_is_blocked(SIGIO));
+
+    /* ABAB */
+    OsBlockSignals();
+    assert(sig_is_blocked(SIGIO));
+    OsBlockSIGIO();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSignals();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSIGIO();
+    assert(!sig_is_blocked(SIGIO));
+
+    /* BAAB */
+    OsBlockSIGIO();
+    assert(sig_is_blocked(SIGIO));
+    OsBlockSignals();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSignals();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSIGIO();
+    assert(!sig_is_blocked(SIGIO));
+
+    /* BABA */
+    OsBlockSIGIO();
+    assert(sig_is_blocked(SIGIO));
+    OsBlockSignals();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSIGIO();
+    assert(sig_is_blocked(SIGIO));
+    OsReleaseSignals();
+    assert(!sig_is_blocked(SIGIO));
+#endif
+}
+
+static void block_sigio_test_nested(void)
+{
+#ifdef SIG_BLOCK
+    /* Check for bug releasing SIGIO during SIGIO signal handling.
+       test case:
+           raise signal
+           → in signal handler:
+                raise signal
+                OsBlockSignals()
+                OsReleaseSignals()
+                tail guard
+       tail guard must be hit.
+     */
+    void (*old_handler)(int);
+    old_handler = signal(SIGIO, sighandler);
+    expect_signal = 1;
+    assert(raise(SIGIO) == 0);
+    assert(signal(SIGIO, old_handler) == sighandler);
+#endif
+}
+
+int
+main(int argc, char **argv)
+{
+    block_sigio_test();
+    block_sigio_test_nested();
+    return 0;
+}
diff --git a/test/signal-logging.c b/test/signal-logging.c
new file mode 100644 (file)
index 0000000..3206dde
--- /dev/null
@@ -0,0 +1,309 @@
+/**
+ * Copyright © 2012 Canonical, Ltd.
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a
+ *  copy of this software and associated documentation files (the "Software"),
+ *  to deal in the Software without restriction, including without limitation
+ *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ *  and/or sell copies of the Software, and to permit persons to whom the
+ *  Software is furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice (including the next
+ *  paragraph) shall be included in all copies or substantial portions of the
+ *  Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *  DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <stdint.h>
+#include <unistd.h>
+#include "assert.h"
+#include "misc.h"
+
+struct number_format_test {
+    uint64_t number;
+    char string[21];
+    char hex_string[17];
+};
+
+struct signed_number_format_test {
+    int64_t number;
+    char string[21];
+};
+
+static Bool
+check_signed_number_format_test(const struct signed_number_format_test *test)
+{
+    char string[21];
+
+    FormatInt64(test->number, string);
+    if(strncmp(string, test->string, 21) != 0) {
+        fprintf(stderr, "Failed to convert %jd to decimal string (%s vs %s)\n",
+                test->number, test->string, string);
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
+static Bool
+check_number_format_test(const struct number_format_test *test)
+{
+    char string[21];
+
+    FormatUInt64(test->number, string);
+    if(strncmp(string, test->string, 21) != 0) {
+        fprintf(stderr, "Failed to convert %ju to decimal string (%s vs %s)\n",
+                test->number, test->string, string);
+        return FALSE;
+    }
+    FormatUInt64Hex(test->number, string);
+    if(strncmp(string, test->hex_string, 17) != 0) {
+        fprintf(stderr,
+                "Failed to convert %ju to hexadecimal string (%s vs %s)\n",
+                test->number, test->hex_string, string);
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
+static void
+number_formatting(void)
+{
+    int i;
+    struct number_format_test unsigned_tests[] = {
+        { /* Zero */
+            0,
+            "0",
+            "0",
+        },
+        { /* Single digit number */
+            5,
+            "5",
+            "5",
+        },
+        { /* Two digit decimal number */
+            12,
+            "12",
+            "c",
+        },
+        { /* Two digit hex number */
+            37,
+            "37",
+            "25",
+        },
+        { /* Large < 32 bit number */
+            0xC90B2,
+            "823474",
+            "c90b2",
+        },
+        { /* Large > 32 bit number */
+            0x15D027BF211B37A,
+            "98237498237498234",
+            "15d027bf211b37a",
+        },
+        { /* Maximum 64-bit number */
+            0xFFFFFFFFFFFFFFFF,
+            "18446744073709551615",
+            "ffffffffffffffff",
+        },
+    };
+
+    struct signed_number_format_test signed_tests[] = {
+        { /* Zero */
+            0,
+            "0",
+        },
+        { /* Single digit number */
+            5,
+            "5",
+        },
+        { /* Two digit decimal number */
+            12,
+            "12",
+        },
+        { /* Two digit hex number */
+            37,
+            "37",
+        },
+        { /* Large < 32 bit number */
+            0xC90B2,
+            "823474",
+        },
+        { /* Large > 32 bit number */
+            0x15D027BF211B37A,
+            "98237498237498234",
+        },
+        { /* Maximum 64-bit signed number */
+            0x7FFFFFFFFFFFFFFF,
+            "9223372036854775807",
+        },
+        { /* Single digit number */
+            -1,
+            "-1",
+        },
+        { /* Two digit decimal number */
+            -12,
+            "-12",
+        },
+        { /* Large < 32 bit number */
+            -0xC90B2,
+            "-823474",
+        },
+        { /* Large > 32 bit number */
+            -0x15D027BF211B37A,
+            "-98237498237498234",
+        },
+        { /* Maximum 64-bit number */
+            -0x7FFFFFFFFFFFFFFF,
+            "-9223372036854775807",
+        },
+    };
+
+    for (i = 0; i < sizeof(unsigned_tests) / sizeof(unsigned_tests[0]); i++)
+        assert(check_number_format_test(unsigned_tests + i));
+
+    for (i = 0; i < sizeof(unsigned_tests) / sizeof(signed_tests[0]); i++)
+        assert(check_signed_number_format_test(signed_tests + i));
+}
+
+static void logging_format(void)
+{
+    const char *log_file_path = "/tmp/Xorg-logging-test.log";
+    const char *str = "%s %d %u %% %p %i";
+    char buf[1024];
+    int i;
+    unsigned int ui;
+    FILE *f;
+    char read_buf[2048];
+    char *logmsg;
+    uintptr_t ptr;
+
+    /* set up buf to contain ".....end" */
+    memset(buf, '.', sizeof(buf));
+    strcpy(&buf[sizeof(buf) - 4], "end");
+
+    LogInit(log_file_path, NULL);
+    assert(f = fopen(log_file_path, "r"));
+
+#define read_log_msg(msg) \
+    fgets(read_buf, sizeof(read_buf), f); \
+    msg = strchr(read_buf, ']') + 2; /* advance past [time.stamp] */
+
+    /* boring test message */
+    LogMessageVerbSigSafe(X_ERROR, -1, "test message\n");
+    read_log_msg(logmsg);
+    assert(strcmp(logmsg, "(EE) test message\n") == 0);
+
+    /* long buf is truncated to "....en\n" */
+#pragma GCC diagnostic ignored "-Wformat-security"
+    LogMessageVerbSigSafe(X_ERROR, -1, buf);
+#pragma GCC diagnostic pop "-Wformat-security"
+    read_log_msg(logmsg);
+    assert(strcmp(&logmsg[strlen(logmsg) - 3], "en\n") == 0);
+
+    /* same thing, this time as string substitution */
+    LogMessageVerbSigSafe(X_ERROR, -1, "%s", buf);
+    read_log_msg(logmsg);
+    assert(strcmp(&logmsg[strlen(logmsg) - 3], "en\n") == 0);
+
+    /* strings containing placeholders should just work */
+    LogMessageVerbSigSafe(X_ERROR, -1, "%s\n", str);
+    read_log_msg(logmsg);
+    assert(strcmp(logmsg, "(EE) %s %d %u %% %p %i\n") == 0);
+
+    /* string substitution */
+    LogMessageVerbSigSafe(X_ERROR, -1, "%s\n", "substituted string");
+    read_log_msg(logmsg);
+    assert(strcmp(logmsg, "(EE) substituted string\n") == 0);
+
+    /* number substitution */
+    ui = 0;
+    do {
+        char expected[30];
+        sprintf(expected, "(EE) %u\n", ui);
+        LogMessageVerbSigSafe(X_ERROR, -1, "%u\n", ui);
+        read_log_msg(logmsg);
+        assert(strcmp(logmsg, expected) == 0);
+        if (ui == 0)
+            ui = 1;
+        else
+            ui <<= 1;
+    } while(ui);
+
+    /* signed number substitution */
+    i = 0;
+    do {
+        char expected[30];
+        sprintf(expected, "(EE) %d\n", i);
+        LogMessageVerbSigSafe(X_ERROR, -1, "%d\n", i);
+        read_log_msg(logmsg);
+        assert(strcmp(logmsg, expected) == 0);
+
+
+        sprintf(expected, "(EE) %d\n", i | INT_MIN);
+        LogMessageVerbSigSafe(X_ERROR, -1, "%d\n", i | INT_MIN);
+        read_log_msg(logmsg);
+        assert(strcmp(logmsg, expected) == 0);
+
+        if (i == 0)
+            i = 1;
+        else
+            i <<= 1;
+    } while(i > INT_MIN);
+
+    /* hex number substitution */
+    ui = 0;
+    do {
+        char expected[30];
+        sprintf(expected, "(EE) %x\n", ui);
+        LogMessageVerbSigSafe(X_ERROR, -1, "%x\n", ui);
+        read_log_msg(logmsg);
+        assert(strcmp(logmsg, expected) == 0);
+        if (ui == 0)
+            ui = 1;
+        else
+            ui <<= 1;
+    } while(ui);
+
+    /* pointer substitution */
+    /* we print a null-pointer differently to printf */
+    LogMessageVerbSigSafe(X_ERROR, -1, "%p\n", NULL);
+    read_log_msg(logmsg);
+    assert(strcmp(logmsg, "(EE) 0x0\n") == 0);
+
+    ptr = 1;
+    do {
+        char expected[30];
+        sprintf(expected, "(EE) %p\n", (void*)ptr);
+        LogMessageVerbSigSafe(X_ERROR, -1, "%p\n", (void*)ptr);
+        read_log_msg(logmsg);
+        assert(strcmp(logmsg, expected) == 0);
+        ptr <<= 1;
+    } while(ptr);
+
+    LogClose(EXIT_NO_ERROR);
+    unlink(log_file_path);
+
+#undef read_log_msg
+}
+
+int
+main(int argc, char **argv)
+{
+    number_formatting();
+    logging_format();
+
+    return 0;
+}
index 2ec535b..df1db11 100644 (file)
@@ -40,6 +40,7 @@ touch_grow_queue(void)
     int i;
 
     memset(&dev, 0, sizeof(dev));
+    dev.name = "test device";
     dev.id = 2;
     dev.valuator = &val;
     val.numAxes = 5;
@@ -94,6 +95,7 @@ touch_find_ddxid(void)
     int i;
 
     memset(&dev, 0, sizeof(dev));
+    dev.name = "test device";
     dev.id = 2;
     dev.valuator = &val;
     val.numAxes = 5;
@@ -162,6 +164,7 @@ touch_begin_ddxtouch(void)
     int size = 5;
 
     memset(&dev, 0, sizeof(dev));
+    dev.name = "test device";
     dev.id = 2;
     dev.valuator = &val;
     val.numAxes = 5;
@@ -209,6 +212,7 @@ touch_begin_touch(void)
     screenInfo.screens[0] = &screen;
 
     memset(&dev, 0, sizeof(dev));
+    dev.name = "test device";
     dev.id = 2;
 
     memset(&sprite, 0, sizeof(sprite));
@@ -247,6 +251,7 @@ touch_init(void)
     screenInfo.screens[0] = &screen;
 
     memset(&dev, 0, sizeof(dev));
+    dev.name = "test device";
 
     memset(&sprite, 0, sizeof(sprite));
     dev.spriteInfo = &sprite;
index 913ba0f..9de7abf 100644 (file)
@@ -18,7 +18,7 @@ TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV)
 
 AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
 INCLUDES = @XORG_INCS@
-TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
+TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
 COMMON_SOURCES=protocol-common.h protocol-common.c
 
 if SPECIAL_DTRACE_OBJECTS
index 32c0567..e2b0b8b 100644 (file)
@@ -30,6 +30,7 @@
 #include "exglobals.h"
 #include "xkbsrv.h"             /* for XkbInitPrivates */
 #include "xserver-properties.h"
+#include "syncsrv.h"
 #include <X11/extensions/XI2.h>
 
 #include "protocol-common.h"
@@ -38,6 +39,7 @@ struct devices devices;
 ScreenRec screen;
 WindowRec root;
 WindowRec window;
+static ClientRec server_client;
 
 void *userdata;
 
@@ -214,6 +216,11 @@ device_cursor_init(DeviceIntPtr dev, ScreenPtr screen)
     return TRUE;
 }
 
+static void
+device_cursor_cleanup(DeviceIntPtr dev, ScreenPtr screen)
+{
+}
+
 static Bool
 set_cursor_pos(DeviceIntPtr dev, ScreenPtr screen, int x, int y, Bool event)
 {
@@ -231,6 +238,7 @@ init_simple(void)
     screen.width = 640;
     screen.height = 480;
     screen.DeviceCursorInitialize = device_cursor_init;
+    screen.DeviceCursorCleanup = device_cursor_cleanup;
     screen.SetCursorPosition = set_cursor_pos;
 
     dixResetPrivates();
@@ -245,6 +253,12 @@ init_simple(void)
     init_window(&root, NULL, ROOT_WINDOW_ID);
     init_window(&window, &root, CLIENT_WINDOW_ID);
 
+    serverClient = &server_client;
+    InitClient(serverClient, 0, (pointer) NULL);
+    if (!InitClientResources(serverClient)) /* for root resources */
+        FatalError("couldn't init server resources");
+    SyncExtensionInit();
+
     devices = init_devices();
 }
 
index 04a1e89..f27f248 100644 (file)
@@ -33,8 +33,6 @@
 #ifndef PROTOCOL_COMMON_H
 #define PROTOCOL_COMMON_H
 
-extern int BadDevice;
-
 /* Check default values in a reply */
 #define reply_check_defaults(rep, len, type) \
     { \
@@ -83,7 +81,7 @@ struct devices {
 
     int num_devices;
     int num_master_devices;
-} devices;
+};
 
 /**
  * The set of default devices available in all tests if necessary.
index 53c65bd..84b386b 100644 (file)
@@ -37,6 +37,7 @@
 #include "scrnintstr.h"
 #include "xipassivegrab.h"
 #include "exevents.h"
+#include "exglobals.h"
 
 #include "protocol-common.h"
 
@@ -54,7 +55,7 @@ int __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev,
                       GrabParameters *param, enum InputLevel grabtype,
                       GrabMask *mask);
 static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len,
-                                           char *data, void *userdata);
+                                           char *data, void *closure);
 
 int
 __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access)
@@ -85,7 +86,7 @@ __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev,
 }
 
 static void
-reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *userdata)
+reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *closure)
 {
     xXIPassiveGrabDeviceReply *rep = (xXIPassiveGrabDeviceReply *) data;
 
@@ -107,7 +108,7 @@ reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *userdata)
 
 static void
 reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data,
-                               void *userdata)
+                               void *closure)
 {
     int i;
 
index 5e59e80..9d13bbb 100644 (file)
@@ -32,6 +32,7 @@
 #include <X11/Xatom.h>
 #include "inputstr.h"
 #include "extinit.h"
+#include "exglobals.h"
 #include "scrnintstr.h"
 #include "xkbsrv.h"
 
@@ -54,9 +55,9 @@ struct test_data {
 };
 
 static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data,
-                                     void *userdata);
+                                     void *closure);
 static void reply_XIQueryDevice(ClientPtr client, int len, char *data,
-                                void *userdata);
+                                void *closure);
 
 /* reply handling for the first bytes that constitute the reply */
 static void
@@ -86,10 +87,10 @@ reply_XIQueryDevice(ClientPtr client, int len, char *data, void *userdata)
 
 /* reply handling for the trailing bytes that constitute the device info */
 static void
-reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata)
+reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *closure)
 {
     int i, j;
-    struct test_data *querydata = (struct test_data *) userdata;
+    struct test_data *querydata = (struct test_data *) closure;
 
     DeviceIntPtr dev;
     xXIDeviceInfo *info = (xXIDeviceInfo *) data;
@@ -222,7 +223,7 @@ reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata)
                            any->type == XIValuatorClass);
 
                 if (any->type == XIButtonClass) {
-                    int len;
+                    int l;
                     xXIButtonInfo *bi = (xXIButtonInfo *) any;
 
                     if (client->swapped)
@@ -230,10 +231,9 @@ reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata)
 
                     assert(bi->num_buttons == devices.vcp->button->numButtons);
 
-                    len =
-                        2 + bi->num_buttons +
+                    l = 2 + bi->num_buttons +
                         bytes_to_int32(bits_to_bytes(bi->num_buttons));
-                    assert(bi->length == len);
+                    assert(bi->length == l);
                 }
                 else if (any->type == XIValuatorClass) {
                     xXIValuatorInfo *vi = (xXIValuatorInfo *) any;
index 4756a6b..fc66b64 100644 (file)
 #include "scrnintstr.h"
 #include "xiquerypointer.h"
 #include "exevents.h"
+#include "exglobals.h"
 
 #include "protocol-common.h"
 
 static ClientRec client_request;
 static void reply_XIQueryPointer_data(ClientPtr client, int len,
-                                      char *data, void *userdata);
+                                      char *data, void *closure);
 
 static struct {
     DeviceIntPtr dev;
@@ -70,7 +71,7 @@ __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access)
 }
 
 static void
-reply_XIQueryPointer(ClientPtr client, int len, char *data, void *userdata)
+reply_XIQueryPointer(ClientPtr client, int len, char *data, void *closure)
 {
     xXIQueryPointerReply *rep = (xXIQueryPointerReply *) data;
     SpritePtr sprite;
@@ -121,7 +122,7 @@ reply_XIQueryPointer(ClientPtr client, int len, char *data, void *userdata)
 }
 
 static void
-reply_XIQueryPointer_data(ClientPtr client, int len, char *data, void *userdata)
+reply_XIQueryPointer_data(ClientPtr client, int len, char *data, void *closure)
 {
     reply_handler = reply_XIQueryPointer;
 }
index 3d50fa8..aff0237 100644 (file)
@@ -54,13 +54,15 @@ struct test_data {
     int minor_client;
     int major_server;
     int minor_server;
+    int major_cached;
+    int minor_cached;
 };
 
 static void
-reply_XIQueryVersion(ClientPtr client, int len, char *data, void *userdata)
+reply_XIQueryVersion(ClientPtr client, int len, char *data, void *closure)
 {
     xXIQueryVersionReply *rep = (xXIQueryVersionReply *) data;
-    struct test_data *versions = (struct test_data *) userdata;
+    struct test_data *versions = (struct test_data *) closure;
     unsigned int sver, cver, ver;
 
     if (client->swapped) {
@@ -82,6 +84,24 @@ reply_XIQueryVersion(ClientPtr client, int len, char *data, void *userdata)
     assert((sver > cver) ? ver == cver : ver == sver);
 }
 
+static void
+reply_XIQueryVersion_multiple(ClientPtr client, int len, char *data, void *closure)
+{
+    xXIQueryVersionReply *rep = (xXIQueryVersionReply *) data;
+    struct test_data *versions = (struct test_data *) closure;
+
+    reply_check_defaults(rep, len, XIQueryVersion);
+    assert(rep->length == 0);
+
+    if (versions->major_cached == -1) {
+        versions->major_cached = rep->major_version;
+        versions->minor_cached = rep->minor_version;
+    }
+
+    assert(versions->major_cached == rep->major_version);
+    assert(versions->minor_cached == rep->minor_version);
+}
+
 /**
  * Run a single test with server version smaj.smin and client
  * version cmaj.cmin. Verify that return code is equal to 'error'.
@@ -115,6 +135,7 @@ request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int error)
     rc = ProcXIQueryVersion(&client);
     assert(rc == error);
 
+    client = init_client(request.length, &request);
     client.swapped = TRUE;
 
     swaps(&request.length);
@@ -172,12 +193,105 @@ test_XIQueryVersion(void)
     reply_handler = NULL;
 }
 
+
+static void
+test_XIQueryVersion_multiple(void)
+{
+    xXIQueryVersionReq request;
+    ClientRec client;
+    struct test_data versions;
+    int rc;
+
+    request_init(&request, XIQueryVersion);
+    client = init_client(request.length, &request);
+
+    /* Change the server to support 2.2 */
+    XIVersion.major_version = 2;
+    XIVersion.minor_version = 2;
+
+    reply_handler = reply_XIQueryVersion_multiple;
+    userdata = (void *) &versions;
+
+    /* run 1 */
+    versions.major_cached = -1;
+    versions.minor_cached = -1;
+
+    /* client is lower than server, noncached */
+    request.major_version = 2;
+    request.minor_version = 1;
+    rc = ProcXIQueryVersion(&client);
+    assert(rc == Success);
+
+    /* client is higher than server, cached */
+    request.major_version = 2;
+    request.minor_version = 3;
+    rc = ProcXIQueryVersion(&client);
+    assert(rc == Success);
+
+    /* client is equal, cached */
+    request.major_version = 2;
+    request.minor_version = 2;
+    rc = ProcXIQueryVersion(&client);
+    assert(rc == Success);
+
+    /* client is low than cached */
+    request.major_version = 2;
+    request.minor_version = 0;
+    rc = ProcXIQueryVersion(&client);
+    assert(rc == BadValue);
+
+    /* run 2 */
+    client = init_client(request.length, &request);
+    XIVersion.major_version = 2;
+    XIVersion.minor_version = 2;
+    versions.major_cached = -1;
+    versions.minor_cached = -1;
+
+    request.major_version = 2;
+    request.minor_version = 2;
+    rc = ProcXIQueryVersion(&client);
+    assert(rc == Success);
+
+    request.major_version = 2;
+    request.minor_version = 3;
+    rc = ProcXIQueryVersion(&client);
+    assert(rc == Success);
+
+    request.major_version = 2;
+    request.minor_version = 1;
+    rc = ProcXIQueryVersion(&client);
+    assert(rc == BadValue);
+
+    /* run 3 */
+    client = init_client(request.length, &request);
+    XIVersion.major_version = 2;
+    XIVersion.minor_version = 2;
+    versions.major_cached = -1;
+    versions.minor_cached = -1;
+
+    request.major_version = 2;
+    request.minor_version = 3;
+    rc = ProcXIQueryVersion(&client);
+    assert(rc == Success);
+
+    request.major_version = 2;
+    request.minor_version = 2;
+    rc = ProcXIQueryVersion(&client);
+    assert(rc == Success);
+
+    request.major_version = 2;
+    request.minor_version = 1;
+    rc = ProcXIQueryVersion(&client);
+    assert(rc == BadValue);
+}
+
 int
 main(int argc, char **argv)
 {
     init_simple();
 
     test_XIQueryVersion();
+    test_XIQueryVersion_multiple();
 
     return 0;
 }
index 4daba87..8f6b947 100644 (file)
@@ -55,6 +55,7 @@
 #include "windowstr.h"
 #include "extinit.h"            /* for XInputExtensionInit */
 #include "scrnintstr.h"
+#include "exglobals.h"
 #include "xiselectev.h"
 
 #include "protocol-common.h"
index 51db4ac..90f1b94 100644 (file)
@@ -44,6 +44,7 @@
 #include "scrnintstr.h"
 #include "xisetclientpointer.h"
 #include "exevents.h"
+#include "exglobals.h"
 
 #include "protocol-common.h"
 
index c279ac4..4bea333 100644 (file)
@@ -37,6 +37,7 @@
 #include "scrnintstr.h"
 #include "xiwarppointer.h"
 #include "exevents.h"
+#include "exglobals.h"
 
 #include "protocol-common.h"
 
index aeca669..e5e5241 100644 (file)
 #include "inputstr.h"
 #include "scrnintstr.h"
 #include "exevents.h"
+#include "extinit.h"
 #include "xkbsrv.h"
 #include "xserver-properties.h"
+#include "syncsrv.h"
 
 /**
  */
@@ -47,9 +49,15 @@ device_cursor_init(DeviceIntPtr dev, ScreenPtr screen)
 }
 
 static void
+device_cursor_cleanup(DeviceIntPtr dev, ScreenPtr screen)
+{
+}
+
+static void
 xtest_init_devices(void)
 {
     ScreenRec screen;
+    ClientRec server_client;
 
     /* random stuff that needs initialization */
     memset(&screen, 0, sizeof(screen));
@@ -60,10 +68,14 @@ xtest_init_devices(void)
     screen.width = 640;
     screen.height = 480;
     screen.DeviceCursorInitialize = device_cursor_init;
+    screen.DeviceCursorCleanup = device_cursor_cleanup;
     dixResetPrivates();
+    serverClient = &server_client;
+    InitClient(serverClient, 0, (pointer) NULL);
+    if (!InitClientResources(serverClient)) /* for root resources */
+        FatalError("couldn't init server resources");
     InitAtoms();
-
-    XkbInitPrivates();
+    SyncExtensionInit();
 
     /* this also inits the xtest devices */
     InitCoreDevices();
index 602b906..4eee592 100644 (file)
@@ -172,14 +172,14 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
         CursorCurrent[pDev->id] = pCursor;
         for (e = cursorEvents; e; e = e->next) {
             if ((e->eventMask & XFixesDisplayCursorNotifyMask)) {
-                xXFixesCursorNotifyEvent ev;
-
-                ev.type = XFixesEventBase + XFixesCursorNotify;
-                ev.subtype = XFixesDisplayCursorNotify;
-                ev.window = e->pWindow->drawable.id;
-                ev.cursorSerial = pCursor ? pCursor->serialNumber : 0;
-                ev.timestamp = currentTime.milliseconds;
-                ev.name = pCursor ? pCursor->name : None;
+                xXFixesCursorNotifyEvent ev = {
+                    .type = XFixesEventBase + XFixesCursorNotify,
+                    .subtype = XFixesDisplayCursorNotify,
+                    .window = e->pWindow->drawable.id,
+                    .cursorSerial = pCursor ? pCursor->serialNumber : 0,
+                    .timestamp = currentTime.milliseconds,
+                    .name = pCursor ? pCursor->name : None
+                };
                 WriteEventsToClient(e->pClient, 1, (xEvent *) &ev);
             }
         }
@@ -190,7 +190,7 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 }
 
 static Bool
-CursorCloseScreen(int index, ScreenPtr pScreen)
+CursorCloseScreen(ScreenPtr pScreen)
 {
     CursorScreenPtr cs = GetCursorScreen(pScreen);
     Bool ret;
@@ -202,7 +202,7 @@ CursorCloseScreen(int index, ScreenPtr pScreen)
     Unwrap(cs, pScreen, DisplayCursor, display_proc);
     Unwrap(cs, pScreen, ConstrainCursorHarder, constrain_proc);
     deleteCursorHideCountsForScreen(pScreen);
-    ret = (*pScreen->CloseScreen) (index, pScreen);
+    ret = (*pScreen->CloseScreen) (pScreen);
     free(cs);
     return ret;
 }
@@ -380,7 +380,8 @@ ProcXFixesGetCursorImage(ClientPtr client)
     width = pCursor->bits->width;
     height = pCursor->bits->height;
     npixels = width * height;
-    rep = malloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32));
+    rep = calloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32),
+                 1);
     if (!rep)
         return BadAlloc;
 
@@ -409,8 +410,8 @@ ProcXFixesGetCursorImage(ClientPtr client)
         swapl(&rep->cursorSerial);
         SwapLongs(image, npixels);
     }
-    WriteToClient(client, sizeof(xXFixesGetCursorImageReply) +
-                  (npixels << 2), (char *) rep);
+    WriteToClient(client,
+                  sizeof(xXFixesGetCursorImageReply) + (npixels << 2), rep);
     free(rep);
     return Success;
 }
@@ -473,11 +474,13 @@ ProcXFixesGetCursorName(ClientPtr client)
         str = "";
     len = strlen(str);
 
-    reply.type = X_Reply;
-    reply.length = bytes_to_int32(len);
-    reply.sequenceNumber = client->sequence;
-    reply.atom = pCursor->name;
-    reply.nbytes = len;
+    reply = (xXFixesGetCursorNameReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(len),
+        .atom = pCursor->name,
+        .nbytes = len
+    };
     if (client->swapped) {
         swaps(&reply.sequenceNumber);
         swapl(&reply.length);
@@ -529,8 +532,8 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
     name = pCursor->name ? NameForAtom(pCursor->name) : "";
     nbytes = strlen(name);
     nbytesRound = pad_to_int32(nbytes);
-    rep = malloc(sizeof(xXFixesGetCursorImageAndNameReply) +
-                 npixels * sizeof(CARD32) + nbytesRound);
+    rep = calloc(sizeof(xXFixesGetCursorImageAndNameReply) +
+                 npixels * sizeof(CARD32) + nbytesRound, 1);
     if (!rep)
         return BadAlloc;
 
@@ -565,7 +568,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
         SwapLongs(image, npixels);
     }
     WriteToClient(client, sizeof(xXFixesGetCursorImageAndNameReply) +
-                  (npixels << 2) + nbytesRound, (char *) rep);
+                  (npixels << 2) + nbytesRound, rep);
     free(rep);
     return Success;
 }
index 624109d..0e9ca44 100644 (file)
@@ -27,7 +27,6 @@
 #include "xfixesint.h"
 #include "scrnintstr.h"
 #include <picturestr.h>
-extern int RenderErrBase;
 
 #include <regionstr.h>
 #include <gcstruct.h>
@@ -558,7 +557,8 @@ ProcXFixesFetchRegion(ClientPtr client)
     pBox = RegionRects(pRegion);
     nBox = RegionNumRects(pRegion);
 
-    reply = malloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle));
+    reply = calloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle),
+                   1);
     if (!reply)
         return BadAlloc;
     reply->type = X_Reply;
@@ -585,7 +585,7 @@ ProcXFixesFetchRegion(ClientPtr client)
         swaps(&reply->height);
         SwapShorts((INT16 *) pRect, nBox * 4);
     }
-    (void) WriteToClient(client, sizeof(xXFixesFetchRegionReply) +
+    WriteToClient(client, sizeof(xXFixesFetchRegionReply) +
                          nBox * sizeof(xRectangle), (char *) reply);
     free(reply);
     return Success;
index a896846..ee8ed6f 100644 (file)
@@ -77,19 +77,16 @@ XFixesSelectionCallback(CallbackListPtr *callbacks, pointer data, pointer args)
     }
     for (e = selectionEvents; e; e = e->next) {
         if (e->selection == selection->selection && (e->eventMask & eventMask)) {
-            xXFixesSelectionNotifyEvent ev;
-
-            memset(&ev, 0, sizeof(xXFixesSelectionNotifyEvent));
-            ev.type = XFixesEventBase + XFixesSelectionNotify;
-            ev.subtype = subtype;
-            ev.window = e->pWindow->drawable.id;
-            if (subtype == XFixesSetSelectionOwnerNotify)
-                ev.owner = selection->window;
-            else
-                ev.owner = 0;
-            ev.selection = e->selection;
-            ev.timestamp = currentTime.milliseconds;
-            ev.selectionTimestamp = selection->lastTimeChanged.milliseconds;
+            xXFixesSelectionNotifyEvent ev = {
+                .type = XFixesEventBase + XFixesSelectionNotify,
+                .subtype = subtype,
+                .window = e->pWindow->drawable.id,
+                .owner = (subtype == XFixesSetSelectionOwnerNotify) ?
+                            selection->window : 0,
+                .selection = e->selection,
+                .timestamp = currentTime.milliseconds,
+                .selectionTimestamp = selection->lastTimeChanged.milliseconds
+            };
             WriteEventsToClient(e->pClient, 1, (xEvent *) &ev);
         }
     }
index f80230f..52c57df 100644 (file)
@@ -48,6 +48,7 @@
 
 #include "xfixesint.h"
 #include "protocol-versions.h"
+#include "extinit.h"
 
 static unsigned char XFixesReqCode;
 int XFixesEventBase;
@@ -61,15 +62,15 @@ static int
 ProcXFixesQueryVersion(ClientPtr client)
 {
     XFixesClientPtr pXFixesClient = GetXFixesClient(client);
-    xXFixesQueryVersionReply rep;
+    xXFixesQueryVersionReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
 
     REQUEST(xXFixesQueryVersionReq);
 
     REQUEST_SIZE_MATCH(xXFixesQueryVersionReq);
-    memset(&rep, 0, sizeof(xXFixesQueryVersionReply));
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
 
     if (version_compare(stuff->majorVersion, stuff->minorVersion,
                         SERVER_XFIXES_MAJOR_VERSION,
@@ -90,7 +91,7 @@ ProcXFixesQueryVersion(ClientPtr client)
         swapl(&rep.majorVersion);
         swapl(&rep.minorVersion);
     }
-    WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *) &rep);
+    WriteToClient(client, sizeof(xXFixesQueryVersionReply), &rep);
     return Success;
 }
 
index 71f88a9..334c71f 100644 (file)
@@ -71,11 +71,6 @@ typedef struct _XFixesClient {
 
 extern int (*ProcXFixesVector[XFixesNumberRequests]) (ClientPtr);
 
-/* Initialize extension at server startup time */
-
-void
- XFixesExtensionInit(void);
-
 /* Save set */
 int
  ProcXFixesChangeSaveSet(ClientPtr client);
index f7e0176..8880784 100644 (file)
@@ -249,51 +249,6 @@ XkbFreeGeomOverlayKeys(XkbOverlayRowPtr row, int first, int count, Bool freeAll)
 
 /***====================================================================***/
 
-static void
-_XkbClearOverlayRow(char *row_in)
-{
-    XkbOverlayRowPtr row = (XkbOverlayRowPtr) row_in;
-
-    if (row->keys != NULL)
-        XkbFreeGeomOverlayKeys(row, 0, row->num_keys, TRUE);
-    return;
-}
-
-void
-XkbFreeGeomOverlayRows(XkbOverlayPtr overlay, int first, int count,
-                       Bool freeAll)
-{
-    _XkbFreeGeomNonLeafElems(freeAll, first, count,
-                             &overlay->num_rows, &overlay->sz_rows,
-                             (char **) &overlay->rows,
-                             sizeof(XkbOverlayRowRec), _XkbClearOverlayRow);
-    return;
-}
-
-/***====================================================================***/
-
-static void
-_XkbClearOverlay(char *overlay_in)
-{
-    XkbOverlayPtr overlay = (XkbOverlayPtr) overlay_in;
-
-    if (overlay->rows != NULL)
-        XkbFreeGeomOverlayRows(overlay, 0, overlay->num_rows, TRUE);
-    return;
-}
-
-void
-XkbFreeGeomOverlays(XkbSectionPtr section, int first, int count, Bool freeAll)
-{
-    _XkbFreeGeomNonLeafElems(freeAll, first, count,
-                             &section->num_overlays, &section->sz_overlays,
-                             (char **) &section->overlays,
-                             sizeof(XkbOverlayRec), _XkbClearOverlay);
-    return;
-}
-
-/***====================================================================***/
-
 void
 XkbFreeGeomKeys(XkbRowPtr row, int first, int count, Bool freeAll)
 {
@@ -543,90 +498,6 @@ _XkbGeomAlloc(void **old,
                                (n),sizeof(XkbOverlayKeyRec))
 
 Status
-XkbAllocGeomProps(XkbGeometryPtr geom, int nProps)
-{
-    return _XkbAllocProps(geom, nProps);
-}
-
-Status
-XkbAllocGeomColors(XkbGeometryPtr geom, int nColors)
-{
-    return _XkbAllocColors(geom, nColors);
-}
-
-Status
-XkbAllocGeomKeyAliases(XkbGeometryPtr geom, int nKeyAliases)
-{
-    return _XkbAllocKeyAliases(geom, nKeyAliases);
-}
-
-Status
-XkbAllocGeomShapes(XkbGeometryPtr geom, int nShapes)
-{
-    return _XkbAllocShapes(geom, nShapes);
-}
-
-Status
-XkbAllocGeomSections(XkbGeometryPtr geom, int nSections)
-{
-    return _XkbAllocSections(geom, nSections);
-}
-
-Status
-XkbAllocGeomOverlays(XkbSectionPtr section, int nOverlays)
-{
-    return _XkbAllocOverlays(section, nOverlays);
-}
-
-Status
-XkbAllocGeomOverlayRows(XkbOverlayPtr overlay, int nRows)
-{
-    return _XkbAllocOverlayRows(overlay, nRows);
-}
-
-Status
-XkbAllocGeomOverlayKeys(XkbOverlayRowPtr row, int nKeys)
-{
-    return _XkbAllocOverlayKeys(row, nKeys);
-}
-
-Status
-XkbAllocGeomDoodads(XkbGeometryPtr geom, int nDoodads)
-{
-    return _XkbAllocDoodads(geom, nDoodads);
-}
-
-Status
-XkbAllocGeomSectionDoodads(XkbSectionPtr section, int nDoodads)
-{
-    return _XkbAllocDoodads(section, nDoodads);
-}
-
-Status
-XkbAllocGeomOutlines(XkbShapePtr shape, int nOL)
-{
-    return _XkbAllocOutlines(shape, nOL);
-}
-
-Status
-XkbAllocGeomRows(XkbSectionPtr section, int nRows)
-{
-    return _XkbAllocRows(section, nRows);
-}
-
-Status
-XkbAllocGeomPoints(XkbOutlinePtr ol, int nPts)
-{
-    return _XkbAllocPoints(ol, nPts);
-}
-
-Status
-XkbAllocGeomKeys(XkbRowPtr row, int nKeys)
-{
-    return _XkbAllocKeys(row, nKeys);
-}
-
-Status
 XkbAllocGeometry(XkbDescPtr xkb, XkbGeometrySizesPtr sizes)
 {
     XkbGeometryPtr geom;
index 645e905..3ffd5da 100644 (file)
@@ -375,8 +375,10 @@ XkbResizeKeyType(XkbDescPtr xkb,
         nResize = 0;
         for (nTotal = 1, i = xkb->min_key_code; i <= xkb->max_key_code; i++) {
             width = XkbKeyGroupsWidth(xkb, i);
-            if (width < type->num_levels)
+            if (width < type->num_levels || width >= new_num_lvls) {
+                nTotal += XkbKeyNumSyms(xkb,i);
                 continue;
+            }
             for (match = 0, g = XkbKeyNumGroups(xkb, i) - 1;
                  (g >= 0) && (!match); g--) {
                 if (XkbKeyKeyTypeIndex(xkb, i, g) == type_ndx) {
@@ -384,7 +386,7 @@ XkbResizeKeyType(XkbDescPtr xkb,
                     match = 1;
                 }
             }
-            if ((!match) || (width >= new_num_lvls))
+            if (!match)
                 nTotal += XkbKeyNumSyms(xkb, i);
             else {
                 nTotal += XkbKeyNumGroups(xkb, i) * new_num_lvls;
diff --git a/xkb/XKM_file_format.txt b/xkb/XKM_file_format.txt
new file mode 100644 (file)
index 0000000..0ba28ee
--- /dev/null
@@ -0,0 +1,684 @@
+                        XKM File Format Description
+                                Version 15
+
+1. Introduction
+
+The XKM file format is the exchange format for XKB keyboard descriptions
+between the server and xkbcomp. Usually, the server forks off xkbcomp,
+xkbcomp compiles the XKM format from the given parameters.
+The resulting XKM file is put into a directory readable by the server and
+then parsed.
+
+The XKM format is little more than a binary dump of various XKB-specific
+structures and hence tied to the ABI of the server.
+
+                              ❧❧❧❧❧❧❧❧❧❧❧
+
+1.1 About this file format description
+
+This description was produced by analyzing the XKM parsing code. Parts of
+the file description present in the original format specification may be
+missing. This description thus cannot be a reference document for XKM
+implementations.
+
+No description of the meaning of the various fields is given here. Refer to
+the XKB protocol specification for more details.
+                              ❧❧❧❧❧❧❧❧❧❧❧
+
+2. Notations used in this document
+
+Notation for structures:
+
+┌───
+  Name of struct
+       name of field:          type or fixed value of field
+       name of field:          type or fixed value of field
+└───
+
+Data types are identical to those used in the X Protocol specification
+except where noted otherwise. Structs specific to XKM are prefixed with XKM,
+defines specific to the XKB protocol specification are prefixed with Xkb and
+their value is equivalent to that in the protocol specification.
+
+Multiple instances of a given type are denoted in the following form:
+       name of field:          LISTofFIELDTYPE
+
+Length specifiers for such fields are usually prefixed with num_. For
+example, a struct containing a num_foo of 8 and a 'foo' field contains 8
+structures of type 'foo'.
+
+Variable length padding is specified as pad(x), where x is the length of the
+data to be padded out to a multiple of 4 bytes. For example, given an x of
+10, pad(x) would be the remaining 2 bytes to pad the whole struct to 12
+bytes.
+
+A special notation is a variable content struct. In this case, the contents
+of the struct depend on the value of one or more specific fields.
+┌───
+  Name of struct
+       field:                  type or fixed value of field
+       field:                  type or fixed value of field
+       ───
+       field ⇒ value 1
+       ⇒
+               specific field:         type
+               specific field:         type
+       ───
+        field ⇒ value 2
+       ⇒
+               specific field:         type
+               specific field:         type
+└───
+This notation denotes that if field is of value 1, this struct contains the
+specific fields listed underneath value 1.
+
+                              ❧❧❧❧❧❧❧❧❧❧❧
+
+3. XKM Format
+
+The XKM format is a binary format with structs usually being padded to a
+multiple of 4 bytes. No provisions for endianess are provided, the parser is
+left to guess the endianess of the XKM file.
+
+                              ❧❧❧❧❧❧❧❧❧❧❧
+3.1 Common data types
+
+┌───
+  XKMCountedString
+       count:                  CARD16
+       string:                 count * CHAR
+       pad:                    pad(count + 2)
+└───
+
+XKMCountedString is used for user-readable identifiers. Prime example are
+the level names and the section names ("complete", "evdev(inet)", etc.)
+
+┌───
+  XKMGroupBits:                CARD8
+       group1                  0x1
+       group2                  0x2
+       group3                  0x4
+       group4                  0x8
+└───
+
+                              ❧❧❧❧❧❧❧❧❧❧❧
+
+3.2 Header and Table of Contents
+
+┌───
+  XKMHeader
+       version:                CARD8
+       identifier1:            'm'
+       identifier2:            'k'
+       idenfifier3:            'x'
+└───
+
+The XKM file format has a 4 byte header identifying the file and the XKM
+version. The header is followed by the table of contents indicating the
+sections present in this file.
+
+┌───
+  XKMFileInfo
+       type:                   CARD8
+       min_keycode:            CARD8
+       max_keycode:            CARD8
+       num_sectioninfo:        CARD8
+       present:                CARD16
+       pad:                    CARD16
+       sectioninfo:            LISTofXKMSectionInfo
+└───
+
+min_keycode and max_keycode specify the keycode range for this keyboard
+descriptions. The core protocol requires min_keycode always be equal to or
+greater than 8.
+
+┌───
+  XKMSectionInfo
+       type:                   CARD16
+               XkmTypesIndex           0
+               XkmCompatMapIndex       1
+               XkmSymbolsIndex         2
+               XkmIndicatorsIndex      3
+               XkmKeyNamesIndex        4
+               XkmGeometryIndex        5
+               XkmVirtualModsIndex     6
+       format:                 CARD16
+       size:                   CARD16
+       offset:                 CARD16
+└───
+
+Describes the section found in a chunk of a file. This struct is found
+_twice_ in the file per section, once as part of the XKMFileInfo, once at
+the beginning of the actual section (see offset).
+The type specifies the type of the section, the section is to be parsed
+according to this type.
+Size and offset specify the size in bytes and the offset into the file in
+bytes, respectively.
+
+3.3 Sections
+
+Each section resides at the offset specified in the XKMFileInfo sectioninfo.
+
+                              ❧❧❧❧❧❧❧❧❧❧❧
+
+3.3.1 XKMTypes
+
+An XKMTypes section describes the key types defined in a layout. Roughly
+speaking, a key type defines how many levels a given key has and which
+modifiers change to a particular level.
+
+┌───
+  XKMTypesSection
+       section_info:           XKMSectionInfo
+       name:                   XKMCountedString
+       num_types:              CARD16
+       pad:                    CARD16
+       types:                  LISTofXKMKeyType
+└───
+
+┌───
+  XKMKeyType
+       real_mods:              CARD8
+       num_levels:             CARD8
+       virt_mods:              CARD16
+       num_map_entries:        CARD8
+       num_level_names:        CARD8
+       perserve:               CARD8
+       pad:                    CARD8
+       map_entries:            LISTofXKMKTMapEntry
+       name:                   XKMCountedString
+       mods:                   LISTofXKMModsDesc
+       level_names:            LISXTofXKMCountedString
+└───
+
+The num_map_entries specifies the number of structs in both map_entries and mods. mods is only present if preserve is TRUE.
+
+┌───
+  XKMKTMapEntry
+       level:                  CARD8
+       real_mods:              CARD8
+       virt_mods:              CARD16
+└───
+
+┌───
+  XKMModsDesc
+       real_mods:              CARD8
+       pad:                    CARD8
+       virt_mods:              CARD16
+└───
+
+                              ❧❧❧❧❧❧❧❧❧❧❧
+3.3.2 XKMCompatMap
+
+An XKMCompatMap section describes the actions a keyboard may trigger. This
+ranges from the TerminateServer action to simple modifier bits.
+
+┌───
+  XKMCompatMap
+       section_info:           XKMSectionInfo
+       name:                   XKMCountedString
+       num_si:                 CARD16
+       group_mask:             XKMGroupBits
+       pad:                    CARD8
+       si:                     LISTofXKMSymInterpreterDesc
+       groups:                 LISTofXKMModsDesc
+└───
+
+One XKMModsDesc is present for each bit set in group_mask.
+
+┌───
+  XKMSymInterpretDesc
+       sym:                    CARD32
+       mods:                   CARD8
+       match:                  CARD8
+       virtual_mod:            CARD8
+       flags:                  CARD8
+       action_type:            CARD8
+       action_data:            XKMActionData
+└───
+
+Where the action is 7 bytes of CARD8 whose content is determined by
+action_type.
+
+┌───
+  XKMActionData:
+       pad0:                   CARD8
+       pad1:                   CARD16
+       pad2:                   CARD32
+       ───
+        action_type ⇒ XkbSA_SetMods ||
+        action_type ⇒ XkbSA_LatchMods ||
+        action_type ⇒ XkbSA_LockMods
+       ⇒
+               flags:                  CARD8
+               mask:                   CARD8
+               real_mods:              CARD8
+               vmods1:                 CARD8
+               vmods2:                 CARD8
+               pad:                    CARD16
+       ───
+        action_type ⇒ XkbSA_SetGroup ||
+        action_type ⇒ XkbSA_LatchGroup ||
+        action_type ⇒ XkbSA_LockGroup
+       ⇒
+               flags:                  CARD8
+               group_XXX:              CARD8
+               pad0:                   CARD8
+               pad1:                   CARD32
+       ───
+        action_type ⇒ XkbSA_MovePtr
+       ⇒
+               flags:                  CARD8
+               high_XXX:               CARD8
+               low_XXX:                CARD8
+               high_YYY:               CARD8
+               low_YYY:                CARD8
+               pad:                    CARD16
+       ───
+        action_type ⇒ XkbSA_PtrBtn ||
+        action_type ⇒ XkbSA_LockPtrBtn
+       ⇒
+               flags:                  CARD8
+               count:                  CARD8
+               button:                 CARD8
+               pad:                    CARD32
+       ───
+        action_type ⇒ XkbSA_DeviceBtn ||
+        action_type ⇒ XkbSA_LockLockPtrBtn
+       ⇒
+               flags:                  CARD8
+               count:                  CARD8
+               button:                 CARD8
+               device:                 CARD8
+               pad0:                   CARD8
+               pad1:                   CARD16
+       ───
+        action_type ⇒ XkbSA_SetPtrDflt
+       ⇒
+               flags:                  CARD8
+               affect:                 CARD8
+               valueXXX:               CARD8
+               pad0:                   CARD32
+       ───
+        action_type ⇒ XkbSA_ISOLock
+       ⇒
+               flags:                  CARD8
+               mask:                   CARD8
+               real_mods:              CARD8
+               group_XXX:              CARD8
+               affect:                 CARD8
+               vmods1:                 CARD8
+               vmods1:                 CARD8
+       ───
+        action_type ⇒ XkbSA_SwitchScreen
+       ⇒
+               flags:                  CARD8
+               screenXXX:              CARD8
+               pad0:                   CARD8
+               pad1:                   CARD32
+       ───
+        action_type ⇒ XkbSA_SetControls ||
+        action_type ⇒ XkbSA_LockControls
+       ⇒
+               flags:                  CARD8
+               ctrls3:                 CARD8
+               ctrls2:                 CARD8
+               ctrls1:                 CARD8
+               ctrls0:                 CARD8
+               pad:                    CARD16
+       ───
+        action_type ⇒ XkbSA_RedirectKey
+       ⇒
+               new_key:                CARD8
+               mods_mask:              CARD8
+               mods:                   CARD8
+               vmods_mask0:            CARD8
+               vmods_mask1:            CARD8
+               vmods0:                 CARD8
+               vmods1:                 CARD8
+       ───
+        action_type ⇒ XkbSA_DeviceValuator
+       ⇒
+               device:         CARD8
+               v1_what:                CARD8
+               v1_idx:                 CARD8
+               v1_value:               CARD8
+               v2_what:                CARD8
+               v2_idx:                 CARD8
+               v2_value:               CARD8
+               pad:                    CARD8
+       ───
+        action_type ⇒ XkbSA_XFree86Private ||
+        action_type ⇒ XkbSA_Terminate
+       ⇒
+               pad0:                   CARD8
+               pad1:                   CARD16
+               pad2:                   CARD32
+       ───
+        action_type ⇒ XkbSA_ActionMessage
+       ⇒
+               press_msg:              BOOL
+               release_msg:            BOOL
+               gen_event:              BOOL
+               message:                4 * CHAR
+└───
+
+Note: XkbSA_ActionMessage is currently unsupported and the contents are
+ignored.
+
+                              ❧❧❧❧❧❧❧❧❧❧❧
+3.3.3 XkmSymbols
+
+The symbols in a keymap define the actual keysyms each key may produce.
+
+┌───
+  XKMSymbols
+       section_info:           XKMSectionInfo
+       name:                   XKMCountedString
+       min_keycode:            CARD8
+       max_keycode:            CARD8
+       group_names_mask:       XKMGroupBits
+       num_vmod_maps:          CARD8
+       group_names:            LISTofXKMCountedString
+       keysyms:                XKMKeysymMapDesc
+       vmod_maps:              XKMVModMapDesc
+└───
+One group_name is present for each bit set in group_names_mask.
+The number of keysyms present is max_keycode - min_keycode + 1.
+
+┌───
+  XKMKeysymMapDesc
+       width:                  CARD8
+       num_groups:             CARD8
+       modifier_map:           CARD8
+       flags:                  CARD8
+       names:                  LISTofXKMCountedString
+       syms:                   LISTofCARD32
+       behavior:               XKMBehaviorDesc
+└───
+
+Presence of names is conditional on the XkmKeyHasTypes flag. The number of
+strings is equal to the number of group bits in group_names_mask in the
+preceeding XKMSymbols section.
+The number of elements in syms is equal to width * num_groups.
+Presence of behavior is conditional on the XkmKeyHasBehavior flag.
+
+┌───
+  XKMKeyBehaviorDesc
+       type:                   CARD8
+       data:                   CARD8
+       pad:                    CARD16
+└───
+
+┌───
+  XKMVModMapDesc
+       key:                    CARD8
+       pad:                    CARD8
+       vmods:                  CARD16
+└───
+
+                              ❧❧❧❧❧❧❧❧❧❧❧
+
+3.3.4 XKMIndicators
+
+┌───
+  XKMIndicators
+       section_info:           XKMSectionInfo
+       name:                   XKMCountedString
+       num_indicators:         CARD8
+       pad0:                   CARD8
+       pad1:                   CARD16
+       indicators:             LISTofXKMIndicatorMapDesc
+└───
+
+┌───
+  XKMIndicatorMapDesc
+       name:                   XKMCountedString
+       indicator:              CARD8
+       flags:                  CARD8
+       which_mods:             CARD8
+       real_mods:              CARD8
+       vmods:                  CARD16
+       which_groups:           CARD8
+       groups:                 CARD8
+       ctrls:                  CARD32
+└───
+                              ❧❧❧❧❧❧❧❧❧❧❧
+
+3.3.5 XKMKeyNames
+
+┌───
+  XKMKeyNames
+       section_info:           XKMSectionInfo
+       name:                   XKMCountedString
+       min_keycode:            CARD8
+       max_keycode:            CARD8
+       num_aliases:            CARD8
+       pad:                    CARD8
+       keynames:               LISTofXKMKeyname
+       aliases:                LISTofXKMKeyAlias
+└───
+
+keynames contains max_keycode - min_keycode + 1 entries.
+
+┌───
+  XkmKeyname
+       name:                   4 * CHAR8
+└───
+
+┌───
+  XkmKeyAlias
+       real:                   XkmKeyname
+       alias:                  XkmKeyname
+└───
+
+                              ❧❧❧❧❧❧❧❧❧❧❧
+
+3.3.5 XKMGeometry
+
+┌───
+  XKMGeometry
+       section_info:           XKMSectionInfo
+       name:                   XKMCountedString
+       width_mm:               CARD16
+       height_mm:              CARD16
+       base_color_ndx:         CARD8
+       label_color_ndx:        CARD8
+       num_properties:         CARD16
+       num_colors:             CARD16
+       num_shapes:             CARD16
+       num_sections:           CARD16
+       num_doodads:            CARD16
+       num_key_aliases:        CARD16
+       pad:                    CARD16
+       label_font:             XKMCountedString
+       properties:             LISTofXKMGeomProperty
+       colors:                 LISTofXKMCountedString
+       shapes:                 LISTofXKMGeomShape
+       sections:               LISTofXKMGeomSection
+       doodads:                LISTofXKMGeomDoodad
+       key_aliases:            LISTofXKMKeyAlias
+└───
+
+┌───
+  XKMGeomProperty
+       name:                   XKMCountedString
+       value:                  XKMCountedString
+
+└───
+
+┌───
+  XKMGeomShape
+       name:                   XKMCountedString
+       num_outlines:           CARD8
+       primary_idx:            CARD8
+       approx_idx:             CARD8
+       pad:                    CARD8
+       outlines:               LISTofXKMOutlineDesc
+└───
+
+┌───
+  XKMOutlineDesc
+       num_points:             CARD8
+       corner_radius:          CARD8
+       pad:                    CARD16
+       points:                 LISTofXKMPointDesc
+└───
+
+┌───
+  XKMPointDesc
+       x:                      INT16
+       y:                      INT16
+└───
+
+┌───
+  XKMGeomSection
+       name:                   XKMCountedString
+       top:                    INT16
+       left:                   INT16
+       width:                  CARD16
+       height:                 CARD16
+       angle:                  INT16
+       priority:               CARD8
+       num_rows:               CARD8
+       num_doodads:            CARD8
+       num_overlays:           CARD8
+       pad:                    CARD16
+       rows:                   LISTofXKMRowDesc
+       doodads:                LISTofXKMGeomDoodad
+       overlays:               LISTofXKMGeomOverlay
+└───
+
+┌───
+  XKMRowDesc
+       top:                    INT16
+       left:                   INT16
+       num_keys:               CARD8
+       vertical:               BOOL
+       pad:                    CARD16
+       keys:                   XKMKeyDesc
+└───
+
+┌───
+  XKMKeyDesc
+       name:                   XKMKeyname
+       gap:                    INT16
+       shape_idx:              CARD8
+       color_idx:              CARD8
+└───
+
+┌───
+  XKMGeomDoodad
+       name:                   XKMCountedString
+       type:                   CARD8
+       priority:               CARD8
+       top:                    INT16
+       left:                   INT16
+       pad1:                   CARD16
+       pad2:                   CARD32
+       pad3:                   CARD32
+       ───
+        type ⇒ XkbOutlineDoodad ||
+        type ⇒ XkbSolideDoodad
+       ⇒
+               type:                   CARD8
+               priority:               CARD8
+               top:                    INT16
+               left:                   INT16
+               angle:                  INT16
+               color_idx:              CARD8
+               shape_idx:              CARD8
+               pad0:                   CARD16
+               pad1:                   CARD32
+       ───
+        type ⇒ XkbTextDoodad
+       ⇒
+               type:                   CARD8
+               priority:               CARD8
+               top:                    INT16
+               left:                   INT16
+               angle:                  INT16
+               width:                  CARD16
+               height:                 CARD16
+               color_idx:              CARD8
+               pad0:                   CARD8
+               pad1:                   CARD16
+               text:                   XKMCountedString
+               font:                   XKMCountedString
+       ───
+        type ⇒ XkbIndicatorDoodad
+       ⇒
+               type:                   CARD8
+               priority:               CARD8
+               top:                    INT16
+               left:                   INT16
+               shape_idx:              CARD8
+               on_color_idx:           CARD8
+               off_color_idx:          CARD8
+               pad0:                   CARD8
+               pad1:                   CARD16
+               pad2:                   CARD32
+       ───
+        type ⇒ XkbLogoDoodad
+       ⇒
+               type:                   CARD8
+               priority:               CARD8
+               top:                    INT16
+               left:                   INT16
+               angle:                  INT16
+               color_idx:              CARD8
+               shape_idx:              CARD8
+               pad0:                   CARD16
+               pad1:                   CARD32
+               logo_name:              XKMCountedString
+└───
+
+WARNING: XKMGeomDoodad has variable length depending on the type.
+NOTE: The current server implementation does not use all fields of all
+structures.
+
+┌───
+  XKMOverlayDesc
+       name:                   XKMCountedString
+       num_rows:               CARD8
+       pad0:                   CARD8
+       pad1:                   CARD16
+       rows:                   LISTofXKMOverlayRowDesc
+└───
+
+┌───
+  XKMOverlayRowDesc
+       name:                   XKMCountedString
+       row_under:              CARD8
+       num_keys:               CARD8
+       pad:                    CARD16
+       keys:                   LISTofXKMOverlayKeyDesc
+└───
+
+┌───
+  XKMOverlayKeyDesc
+       over:                   XKMKeyname
+       under:                  XKMKeyname
+└───
+
+                              ❧❧❧❧❧❧❧❧❧❧❧
+
+3.3.6 XKMVirtualMods
+
+┌───
+  XKMOverlayRowDesc
+       section_info:           XKMSectionInfo
+       name:                   XKMCountedString
+       bound_mask:             SETofVMODBITS
+       named_mask:             SETofVMODBITS
+       vmods:                  LISTofCARD8
+       pad:                    pad(vmods)
+       names:                  LISTofXKMCountedString
+└───
+
+       VMODBITS:               CARD16
+
+Number of elements in vmods is equal to the number of bits set in
+bound_mask. The padding completes vmods to a multiple of 4 byte units.
+Number of elements in names is equal to the number of bits set in
+named_mask.
index 9b69b2b..79f4637 100644 (file)
@@ -44,12 +44,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 #ifdef WIN32
 /* from ddxLoad.c */
-extern const char *Win32TempDir(void);
-extern int Win32System(const char *cmdline);
-
-#undef System
-#define System Win32System
-
 #define W32_tmparg " '%s'"
 #define W32_tmpfile ,tmpname
 #define W32_tmplen strlen(tmpname)+3
index cb2dfc3..d462957 100644 (file)
@@ -68,81 +68,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define PATHSEPARATOR "/"
 #endif
 
-#ifdef WIN32
-
-#include <X11/Xwindows.h>
-const char *
-Win32TempDir()
-{
-    static char buffer[PATH_MAX];
-
-    if (GetTempPath(sizeof(buffer), buffer)) {
-        int len;
-
-        buffer[sizeof(buffer) - 1] = 0;
-        len = strlen(buffer);
-        if (len > 0)
-            if (buffer[len - 1] == '\\')
-                buffer[len - 1] = 0;
-        return buffer;
-    }
-    if (getenv("TEMP") != NULL)
-        return getenv("TEMP");
-    else if (getenv("TMP") != NULL)
-        return getenv("TEMP");
-    else
-        return "/tmp";
-}
-
-int
-Win32System(const char *cmdline)
-{
-    STARTUPINFO si;
-    PROCESS_INFORMATION pi;
-    DWORD dwExitCode;
-    char *cmd = strdup(cmdline);
-
-    ZeroMemory(&si, sizeof(si));
-    si.cb = sizeof(si);
-    ZeroMemory(&pi, sizeof(pi));
-
-    if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
-        LPVOID buffer;
-
-        if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                           FORMAT_MESSAGE_FROM_SYSTEM |
-                           FORMAT_MESSAGE_IGNORE_INSERTS,
-                           NULL,
-                           GetLastError(),
-                           MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                           (LPTSTR) & buffer, 0, NULL)) {
-            ErrorF("[xkb] Starting '%s' failed!\n", cmdline);
-        }
-        else {
-            ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *) buffer);
-            LocalFree(buffer);
-        }
-
-        free(cmd);
-        return -1;
-    }
-    /* Wait until child process exits. */
-    WaitForSingleObject(pi.hProcess, INFINITE);
-
-    GetExitCodeProcess(pi.hProcess, &dwExitCode);
-
-    /* Close process and thread handles. */
-    CloseHandle(pi.hProcess);
-    CloseHandle(pi.hThread);
-    free(cmd);
-
-    return dwExitCode;
-}
-
-#undef System
-#define System(x) Win32System(x)
-#endif
-
 static void
 OutputDirectory(char *outdir, size_t size)
 {
index 0bec24f..4440a98 100644 (file)
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -36,6 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define        XKBSRV_NEED_FILE_FUNCS
 #include <xkbsrv.h>
 #include "extnsionst.h"
+#include "extinit.h"
 #include "xace.h"
 #include "xkb.h"
 #include "protocol-versions.h"
@@ -181,19 +182,20 @@ ProcXkbUseExtension(ClientPtr client)
              stuff->wantedMinor, SERVER_XKB_MAJOR_VERSION,
              SERVER_XKB_MINOR_VERSION);
     }
-    memset(&rep, 0, sizeof(xkbUseExtensionReply));
-    rep.type = X_Reply;
-    rep.supported = supported;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.serverMajor = SERVER_XKB_MAJOR_VERSION;
-    rep.serverMinor = SERVER_XKB_MINOR_VERSION;
+    rep = (xkbUseExtensionReply) {
+        .type = X_Reply,
+        .supported = supported,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .serverMajor = SERVER_XKB_MAJOR_VERSION,
+        .serverMinor = SERVER_XKB_MINOR_VERSION
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swaps(&rep.serverMajor);
         swaps(&rep.serverMinor);
     }
-    WriteToClient(client, SIZEOF(xkbUseExtensionReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xkbUseExtensionReply), &rep);
     return Success;
 }
 
@@ -577,26 +579,27 @@ ProcXkbGetState(ClientPtr client)
     CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess);
 
     xkb = &dev->key->xkbInfo->state;
-    memset(&rep, 0, sizeof(xkbGetStateReply));
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.deviceID = dev->id;
-    rep.mods = XkbStateFieldFromRec(xkb) & 0xff;
-    rep.baseMods = xkb->base_mods;
-    rep.lockedMods = xkb->locked_mods;
-    rep.latchedMods = xkb->latched_mods;
-    rep.group = xkb->group;
-    rep.baseGroup = xkb->base_group;
-    rep.latchedGroup = xkb->latched_group;
-    rep.lockedGroup = xkb->locked_group;
-    rep.compatState = xkb->compat_state;
-    rep.ptrBtnState = xkb->ptr_buttons;
+    rep = (xkbGetStateReply) {
+        .type = X_Reply,
+        .deviceID = dev->id,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .mods = XkbStateFieldFromRec(xkb) & 0xff,
+        .baseMods = xkb->base_mods,
+        .latchedMods = xkb->latched_mods,
+        .lockedMods = xkb->locked_mods,
+        .group = xkb->group,
+        .lockedGroup = xkb->locked_group,
+        .baseGroup = xkb->base_group,
+        .latchedGroup = xkb->latched_group,
+        .compatState = xkb->compat_state,
+        .ptrBtnState = xkb->ptr_buttons
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swaps(&rep.ptrBtnState);
     }
-    WriteToClient(client, SIZEOF(xkbGetStateReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xkbGetStateReply), &rep);
     return Success;
 }
 
@@ -688,36 +691,38 @@ ProcXkbGetControls(ClientPtr client)
     CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess);
 
     xkb = dev->key->xkbInfo->desc->ctrls;
-    rep.type = X_Reply;
-    rep.length = bytes_to_int32(SIZEOF(xkbGetControlsReply) -
-                                SIZEOF(xGenericReply));
-    rep.sequenceNumber = client->sequence;
-    rep.deviceID = ((DeviceIntPtr) dev)->id;
-    rep.numGroups = xkb->num_groups;
-    rep.groupsWrap = xkb->groups_wrap;
-    rep.internalMods = xkb->internal.mask;
-    rep.ignoreLockMods = xkb->ignore_lock.mask;
-    rep.internalRealMods = xkb->internal.real_mods;
-    rep.ignoreLockRealMods = xkb->ignore_lock.real_mods;
-    rep.internalVMods = xkb->internal.vmods;
-    rep.ignoreLockVMods = xkb->ignore_lock.vmods;
-    rep.enabledCtrls = xkb->enabled_ctrls;
-    rep.repeatDelay = xkb->repeat_delay;
-    rep.repeatInterval = xkb->repeat_interval;
-    rep.slowKeysDelay = xkb->slow_keys_delay;
-    rep.debounceDelay = xkb->debounce_delay;
-    rep.mkDelay = xkb->mk_delay;
-    rep.mkInterval = xkb->mk_interval;
-    rep.mkTimeToMax = xkb->mk_time_to_max;
-    rep.mkMaxSpeed = xkb->mk_max_speed;
-    rep.mkCurve = xkb->mk_curve;
-    rep.mkDfltBtn = xkb->mk_dflt_btn;
-    rep.axTimeout = xkb->ax_timeout;
-    rep.axtCtrlsMask = xkb->axt_ctrls_mask;
-    rep.axtCtrlsValues = xkb->axt_ctrls_values;
-    rep.axtOptsMask = xkb->axt_opts_mask;
-    rep.axtOptsValues = xkb->axt_opts_values;
-    rep.axOptions = xkb->ax_options;
+    rep = (xkbGetControlsReply) {
+        .type = X_Reply,
+        .deviceID = ((DeviceIntPtr) dev)->id,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(SIZEOF(xkbGetControlsReply) -
+                                 SIZEOF(xGenericReply)),
+        .mkDfltBtn = xkb->mk_dflt_btn,
+        .numGroups = xkb->num_groups,
+        .groupsWrap = xkb->groups_wrap,
+        .internalMods = xkb->internal.mask,
+        .ignoreLockMods = xkb->ignore_lock.mask,
+        .internalRealMods = xkb->internal.real_mods,
+        .ignoreLockRealMods = xkb->ignore_lock.real_mods,
+        .internalVMods = xkb->internal.vmods,
+        .ignoreLockVMods = xkb->ignore_lock.vmods,
+        .repeatDelay = xkb->repeat_delay,
+        .repeatInterval = xkb->repeat_interval,
+        .slowKeysDelay = xkb->slow_keys_delay,
+        .debounceDelay = xkb->debounce_delay,
+        .mkDelay = xkb->mk_delay,
+        .mkInterval = xkb->mk_interval,
+        .mkTimeToMax = xkb->mk_time_to_max,
+        .mkMaxSpeed = xkb->mk_max_speed,
+        .mkCurve = xkb->mk_curve,
+        .axOptions = xkb->ax_options,
+        .axTimeout = xkb->ax_timeout,
+        .axtOptsMask = xkb->axt_opts_mask,
+        .axtOptsValues = xkb->axt_opts_values,
+        .axtCtrlsMask = xkb->axt_ctrls_mask,
+        .axtCtrlsValues = xkb->axt_ctrls_values,
+        .enabledCtrls = xkb->enabled_ctrls,
+    };
     memcpy(rep.perKeyRepeat, xkb->per_key_repeat, XkbPerKeyBitArraySize);
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
@@ -741,7 +746,7 @@ ProcXkbGetControls(ClientPtr client)
         swaps(&rep.axtOptsValues);
         swaps(&rep.axOptions);
     }
-    WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xkbGetControlsReply), &rep);
     return Success;
 }
 
@@ -1433,7 +1438,7 @@ XkbSendMap(ClientPtr client, XkbDescPtr xkb, xkbGetMapReply * rep)
         swaps(&rep->totalSyms);
         swaps(&rep->totalActs);
     }
-    WriteToClient(client, (i = SIZEOF(xkbGetMapReply)), (char *) rep);
+    WriteToClient(client, (i = SIZEOF(xkbGetMapReply)), rep);
     WriteToClient(client, len, start);
     free((char *) start);
     return Success;
@@ -1459,14 +1464,16 @@ ProcXkbGetMap(ClientPtr client)
     CHK_MASK_LEGAL(0x03, stuff->partial, XkbAllMapComponentsMask);
 
     xkb = dev->key->xkbInfo->desc;
-    memset(&rep, 0, sizeof(xkbGetMapReply));
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = (SIZEOF(xkbGetMapReply) - SIZEOF(xGenericReply)) >> 2;
-    rep.deviceID = dev->id;
-    rep.present = stuff->partial | stuff->full;
-    rep.minKeyCode = xkb->min_key_code;
-    rep.maxKeyCode = xkb->max_key_code;
+    rep = (xkbGetMapReply) {
+        .type = X_Reply,
+        .deviceID = dev->id,
+        .sequenceNumber = client->sequence,
+        .length = (SIZEOF(xkbGetMapReply) - SIZEOF(xGenericReply)) >> 2,
+        .present = stuff->partial | stuff->full,
+        .minKeyCode = xkb->min_key_code,
+        .maxKeyCode = xkb->max_key_code
+    };
+
     if (stuff->full & XkbKeyTypesMask) {
         rep.firstType = 0;
         rep.nTypes = xkb->map->num_types;
@@ -2744,7 +2751,7 @@ XkbSendCompatMap(ClientPtr client,
         swaps(&rep->nTotalSI);
     }
 
-    WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *) rep);
+    WriteToClient(client, SIZEOF(xkbGetCompatMapReply), rep);
     if (data) {
         WriteToClient(client, size, data);
         free((char *) data);
@@ -2771,12 +2778,14 @@ ProcXkbGetCompatMap(ClientPtr client)
     xkb = dev->key->xkbInfo->desc;
     compat = xkb->compat;
 
-    rep.type = X_Reply;
-    rep.deviceID = dev->id;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.firstSI = stuff->firstSI;
-    rep.nSI = stuff->nSI;
+    rep = (xkbGetCompatMapReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .deviceID = dev->id,
+        .firstSI = stuff->firstSI,
+        .nSI = stuff->nSI
+    };
     if (stuff->getAllSI) {
         rep.firstSI = 0;
         rep.nSI = compat->num_si;
@@ -3034,17 +3043,19 @@ ProcXkbGetIndicatorState(ClientPtr client)
     if (!sli)
         return BadAlloc;
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.deviceID = dev->id;
-    rep.state = sli->effectiveState;
+    rep = (xkbGetIndicatorStateReply) {
+        .type = X_Reply,
+        .deviceID = dev->id,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .state = sli->effectiveState
+    };
 
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.state);
     }
-    WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), &rep);
     return Success;
 }
 
@@ -3118,9 +3129,9 @@ XkbSendIndicatorMap(ClientPtr client,
         swapl(&rep->which);
         swapl(&rep->realIndicators);
     }
-    WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *) rep);
+    WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), rep);
     if (map) {
-        WriteToClient(client, length, (char *) map);
+        WriteToClient(client, length, map);
         free((char *) map);
     }
     return Success;
@@ -3145,11 +3156,13 @@ ProcXkbGetIndicatorMap(ClientPtr client)
     xkb = dev->key->xkbInfo->desc;
     leds = xkb->indicators;
 
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.deviceID = dev->id;
-    rep.which = stuff->which;
+    rep = (xkbGetIndicatorMapReply) {
+        .type = X_Reply,
+        .deviceID = dev->id,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .which = stuff->which
+    };
     XkbComputeGetIndicatorMapReplySize(leds, &rep);
     return XkbSendIndicatorMap(client, leds, &rep);
 }
@@ -3300,11 +3313,13 @@ ProcXkbGetNamedIndicator(ClientPtr client)
         }
     }
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.deviceID = dev->id;
-    rep.indicator = stuff->indicator;
+    rep = (xkbGetNamedIndicatorReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .deviceID = dev->id,
+        .indicator = stuff->indicator
+    };
     if (map != NULL) {
         rep.found = TRUE;
         rep.on = ((sli->effectiveState & (1 << i)) != 0);
@@ -3343,7 +3358,7 @@ ProcXkbGetNamedIndicator(ClientPtr client)
         swapl(&rep.ctrls);
     }
 
-    WriteToClient(client, SIZEOF(xkbGetNamedIndicatorReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xkbGetNamedIndicatorReply), &rep);
     return Success;
 }
 
@@ -3857,7 +3872,7 @@ XkbSendNames(ClientPtr client, XkbDescPtr xkb, xkbGetNamesReply * rep)
         ErrorF("[xkb] BOGUS LENGTH in write names, expected %d, got %ld\n",
                length, (unsigned long) (desc - start));
     }
-    WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *) rep);
+    WriteToClient(client, SIZEOF(xkbGetNamesReply), rep);
     WriteToClient(client, length, start);
     free((char *) start);
     return Success;
@@ -3880,22 +3895,18 @@ ProcXkbGetNames(ClientPtr client)
     CHK_MASK_LEGAL(0x01, stuff->which, XkbAllNamesMask);
 
     xkb = dev->key->xkbInfo->desc;
-    memset(&rep, 0, sizeof(xkbGetNamesReply));
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.deviceID = dev->id;
-    rep.which = stuff->which;
-    rep.nTypes = xkb->map->num_types;
-    rep.firstKey = xkb->min_key_code;
-    rep.nKeys = XkbNumKeys(xkb);
-    if (xkb->names != NULL) {
-        rep.nKeyAliases = xkb->names->num_key_aliases;
-        rep.nRadioGroups = xkb->names->num_rg;
-    }
-    else {
-        rep.nKeyAliases = rep.nRadioGroups = 0;
-    }
+    rep = (xkbGetNamesReply) {
+        .type = X_Reply,
+        .deviceID = dev->id,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .which = stuff->which,
+        .nTypes = xkb->map->num_types,
+        .firstKey = xkb->min_key_code,
+        .nKeys = XkbNumKeys(xkb),
+        .nKeyAliases = xkb->names ? xkb->names->num_key_aliases : 0,
+        .nRadioGroups = xkb->names ? xkb->names->num_rg : 0
+    };
     XkbComputeGetNamesReplySize(xkb, &rep);
     return XkbSendNames(client, xkb, &rep);
 }
@@ -4904,7 +4915,7 @@ XkbSendGeometry(ClientPtr client,
         swaps(&rep->nDoodads);
         swaps(&rep->nKeyAliases);
     }
-    WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *) rep);
+    WriteToClient(client, SIZEOF(xkbGetGeometryReply), rep);
     if (len > 0)
         WriteToClient(client, len, start);
     if (start != NULL)
@@ -4933,10 +4944,12 @@ ProcXkbGetGeometry(ClientPtr client)
     CHK_ATOM_OR_NONE(stuff->name);
 
     geom = XkbLookupNamedGeometry(dev, stuff->name, &shouldFree);
-    rep.type = X_Reply;
-    rep.deviceID = dev->id;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
+    rep = (xkbGetGeometryReply) {
+        .type = X_Reply,
+        .deviceID = dev->id,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     status = XkbComputeGetGeometryReplySize(geom, &rep, stuff->name);
     if (status != Success)
         return status;
@@ -5483,10 +5496,6 @@ ProcXkbPerClientFlags(ClientPtr client)
     CHK_MASK_MATCH(0x02, stuff->change, stuff->value);
 
     interest = XkbFindClientResource((DevicePtr) dev, client);
-    memset(&rep, 0, sizeof(xkbPerClientFlagsReply));
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
     if (stuff->change) {
         client->xkbClientFlags &= ~stuff->change;
         client->xkbClientFlags |= stuff->value;
@@ -5522,15 +5531,16 @@ ProcXkbPerClientFlags(ClientPtr client)
             interest->autoCtrlValues |= stuff->autoCtrlValues & affect;
         }
     }
-    rep.supported = XkbPCF_AllFlagsMask;
-    rep.value = client->xkbClientFlags & XkbPCF_AllFlagsMask;
-    if (interest) {
-        rep.autoCtrls = interest->autoCtrls;
-        rep.autoCtrlValues = interest->autoCtrlValues;
-    }
-    else {
-        rep.autoCtrls = rep.autoCtrlValues = 0;
-    }
+
+    rep = (xkbPerClientFlagsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .supported = XkbPCF_AllFlagsMask,
+        .value = client->xkbClientFlags & XkbPCF_AllFlagsMask,
+        .autoCtrls = interest ? interest->autoCtrls : 0,
+        .autoCtrlValues =  interest ? interest->autoCtrlValues : 0,
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.supported);
@@ -5538,7 +5548,7 @@ ProcXkbPerClientFlags(ClientPtr client)
         swapl(&rep.autoCtrls);
         swapl(&rep.autoCtrlValues);
     }
-    WriteToClient(client, SIZEOF(xkbPerClientFlagsReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xkbPerClientFlagsReply), &rep);
     return Success;
 }
 
@@ -5642,18 +5652,19 @@ ProcXkbListComponents(ClientPtr client)
         list.pool = NULL;
         return status;
     }
-    memset(&rep, 0, sizeof(xkbListComponentsReply));
-    rep.type = X_Reply;
-    rep.deviceID = dev->id;
-    rep.sequenceNumber = client->sequence;
-    rep.length = XkbPaddedSize(list.nPool) / 4;
-    rep.nKeymaps = 0;
-    rep.nKeycodes = list.nFound[_XkbListKeycodes];
-    rep.nTypes = list.nFound[_XkbListTypes];
-    rep.nCompatMaps = list.nFound[_XkbListCompat];
-    rep.nSymbols = list.nFound[_XkbListSymbols];
-    rep.nGeometries = list.nFound[_XkbListGeometry];
-    rep.extra = 0;
+    rep = (xkbListComponentsReply) {
+        .type = X_Reply,
+        .deviceID = dev->id,
+        .sequenceNumber = client->sequence,
+        .length = XkbPaddedSize(list.nPool) / 4,
+        .nKeymaps = 0,
+        .nKeycodes = list.nFound[_XkbListKeycodes],
+        .nTypes = list.nFound[_XkbListTypes],
+        .nCompatMaps = list.nFound[_XkbListCompat],
+        .nSymbols = list.nFound[_XkbListSymbols],
+        .nGeometries = list.nFound[_XkbListGeometry],
+        .extra = 0
+    };
     if (list.nTotal > list.maxRtrn)
         rep.extra = (list.nTotal - list.maxRtrn);
     if (client->swapped) {
@@ -5667,9 +5678,9 @@ ProcXkbListComponents(ClientPtr client)
         swaps(&rep.nGeometries);
         swaps(&rep.extra);
     }
-    WriteToClient(client, SIZEOF(xkbListComponentsReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xkbListComponentsReply), &rep);
     if (list.nPool && list.pool) {
-        WriteToClient(client, XkbPaddedSize(list.nPool), (char *) list.pool);
+        WriteToClient(client, XkbPaddedSize(list.nPool), list.pool);
         free(list.pool);
         list.pool = NULL;
     }
@@ -5939,7 +5950,7 @@ ProcXkbGetKbdByName(ClientPtr client)
         swaps(&rep.found);
         swaps(&rep.reported);
     }
-    WriteToClient(client, SIZEOF(xkbGetKbdByNameReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xkbGetKbdByNameReply), &rep);
     if (reported & (XkbGBN_SymbolsMask | XkbGBN_TypesMask))
         XkbSendMap(client, new, &mrep);
     if (reported & XkbGBN_CompatMapMask)
@@ -6136,7 +6147,7 @@ SendDeviceLedInfo(XkbSrvLedInfoPtr sli, ClientPtr client)
         swapl(&wire.physIndicators);
         swapl(&wire.state);
     }
-    WriteToClient(client, SIZEOF(xkbDeviceLedsWireDesc), (char *) &wire);
+    WriteToClient(client, SIZEOF(xkbDeviceLedsWireDesc), &wire);
     length += SIZEOF(xkbDeviceLedsWireDesc);
     if (sli->namesPresent | sli->mapsPresent) {
         register unsigned i, bit;
@@ -6150,7 +6161,7 @@ SendDeviceLedInfo(XkbSrvLedInfoPtr sli, ClientPtr client)
                     if (client->swapped) {
                         swapl(&awire);
                     }
-                    WriteToClient(client, 4, (char *) &awire);
+                    WriteToClient(client, 4, &awire);
                     length += 4;
                 }
             }
@@ -6173,7 +6184,7 @@ SendDeviceLedInfo(XkbSrvLedInfoPtr sli, ClientPtr client)
                         swapl(&iwire.ctrls);
                     }
                     WriteToClient(client, SIZEOF(xkbIndicatorMapWireDesc),
-                                  (char *) &iwire);
+                                  &iwire);
                     length += SIZEOF(xkbIndicatorMapWireDesc);
                 }
             }
@@ -6254,37 +6265,29 @@ ProcXkbGetDeviceInfo(ClientPtr client)
         wanted &= ~XkbXI_IndicatorsMask;
 
     nameLen = XkbSizeCountedString(dev->name);
-    memset((char *) &rep, 0, SIZEOF(xkbGetDeviceInfoReply));
-    rep.type = X_Reply;
-    rep.deviceID = dev->id;
-    rep.sequenceNumber = client->sequence;
-    rep.length = nameLen / 4;
-    rep.present = wanted;
-    rep.supported = XkbXI_AllDeviceFeaturesMask;
-    rep.unsupported = 0;
-    rep.firstBtnWanted = rep.nBtnsWanted = 0;
-    rep.firstBtnRtrn = rep.nBtnsRtrn = 0;
-    if (dev->button)
-        rep.totalBtns = dev->button->numButtons;
-    else
-        rep.totalBtns = 0;
-    rep.devType = dev->xinput_type;
-    rep.hasOwnState = (dev->key && dev->key->xkbInfo);
-    rep.nDeviceLedFBs = 0;
-    if (dev->kbdfeed)
-        rep.dfltKbdFB = dev->kbdfeed->ctrl.id;
-    else
-        rep.dfltKbdFB = XkbXINone;
-    if (dev->leds)
-        rep.dfltLedFB = dev->leds->ctrl.id;
-    else
-        rep.dfltLedFB = XkbXINone;
+    rep = (xkbGetDeviceInfoReply) {
+        .type = X_Reply,
+        .deviceID = dev->id,
+        .sequenceNumber = client->sequence,
+        .length = nameLen / 4,
+        .present = wanted,
+        .supported = XkbXI_AllDeviceFeaturesMask,
+        .unsupported = 0,
+        .nDeviceLedFBs = 0,
+        .firstBtnWanted = 0,
+        .nBtnsWanted = 0,
+        .firstBtnRtrn = 0,
+        .nBtnsRtrn = 0,
+        .totalBtns = dev->button ? dev->button->numButtons : 0,
+        .hasOwnState = (dev->key && dev->key->xkbInfo),
+        .dfltKbdFB = dev->kbdfeed ? dev->kbdfeed->ctrl.id : XkbXINone,
+        .dfltLedFB = dev->leds ? dev->leds->ctrl.id : XkbXINone,
+        .devType = dev->xinput_type
+    };
 
     ledClass = stuff->ledClass;
     ledID = stuff->ledID;
 
-    rep.firstBtnWanted = rep.nBtnsWanted = 0;
-    rep.firstBtnRtrn = rep.nBtnsRtrn = 0;
     if (wanted & XkbXI_ButtonActionsMask) {
         if (stuff->allBtns) {
             stuff->firstBtn = 0;
@@ -6343,7 +6346,7 @@ ProcXkbGetDeviceInfo(ClientPtr client)
         swaps(&rep.dfltLedFB);
         swapl(&rep.devType);
     }
-    WriteToClient(client, SIZEOF(xkbGetDeviceInfoReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xkbGetDeviceInfoReply), &rep);
 
     str = malloc(nameLen);
     if (!str)
@@ -6359,7 +6362,7 @@ ProcXkbGetDeviceInfo(ClientPtr client)
 
         sz = rep.nBtnsRtrn * SIZEOF(xkbActionWireDesc);
         awire = (xkbActionWireDesc *) & dev->button->xkb_acts[rep.firstBtnRtrn];
-        WriteToClient(client, sz, (char *) awire);
+        WriteToClient(client, sz, awire);
         length -= sz;
     }
     if (nDeviceLedFBs > 0) {
@@ -6746,13 +6749,15 @@ ProcXkbSetDebuggingFlags(ClientPtr client)
     xkbDebugFlags = newFlags;
     xkbDebugCtrls = newCtrls;
 
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.currentFlags = newFlags;
-    rep.currentCtrls = newCtrls;
-    rep.supportedFlags = ~0;
-    rep.supportedCtrls = ~0;
+    rep = (xkbSetDebuggingFlagsReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .currentFlags = newFlags,
+        .currentCtrls = newCtrls,
+        .supportedFlags = ~0,
+        .supportedCtrls = ~0
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.currentFlags);
@@ -6760,7 +6765,7 @@ ProcXkbSetDebuggingFlags(ClientPtr client)
         swapl(&rep.supportedFlags);
         swapl(&rep.supportedCtrls);
     }
-    WriteToClient(client, SIZEOF(xkbSetDebuggingFlagsReply), (char *) &rep);
+    WriteToClient(client, SIZEOF(xkbSetDebuggingFlagsReply), &rep);
     return Success;
 }
 
index a526356..f3a60af 100644 (file)
--- a/xkb/xkb.h
+++ b/xkb/xkb.h
@@ -27,6 +27,4 @@ extern int ProcXkbGetKbdByName(ClientPtr client);
 extern int ProcXkbGetDeviceInfo(ClientPtr client);
 extern int ProcXkbSetDeviceInfo(ClientPtr client);
 extern int ProcXkbSetDebuggingFlags(ClientPtr client);
-
-extern void XkbExtensionInit(void);
 #endif
index 111bf9f..082c0db 100644 (file)
@@ -281,12 +281,12 @@ AccessXStickyKeysTurnOff(DeviceIntPtr dev, xkbControlsNotify * pCN)
 static CARD32
 AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
 {
-    XkbSrvInfoPtr xkbi = ((DeviceIntPtr) arg)->key->xkbInfo;
     xkbControlsNotify cn;
+    DeviceIntPtr dev = arg;
+    XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
 
     if (xkbi->krgTimerActive == _KRG_WARN_TIMER) {
-        XkbDDXAccessXBeep((DeviceIntPtr) arg, _BEEP_SLOW_WARN,
-                          XkbStickyKeysMask);
+        XkbDDXAccessXBeep(dev, _BEEP_SLOW_WARN, XkbStickyKeysMask);
         xkbi->krgTimerActive = _KRG_TIMER;
         return 4000;
     }
@@ -295,10 +295,15 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
     cn.eventType = 0;
     cn.requestMajor = 0;
     cn.requestMinor = 0;
-    if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask)
-        AccessXKRGTurnOff((DeviceIntPtr) arg, &cn);
-    else
-        AccessXKRGTurnOn((DeviceIntPtr) arg, XkbSlowKeysMask, &cn);
+    if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask) {
+        AccessXKRGTurnOff(dev, &cn);
+        LogMessage(X_INFO, "XKB SlowKeys are disabled.\n");
+    }
+    else {
+        AccessXKRGTurnOn(dev, XkbSlowKeysMask, &cn);
+        LogMessage(X_INFO, "XKB SlowKeys are now enabled. Hold shift to disable.\n");
+    }
+
     return 0;
 }
 
@@ -694,7 +699,6 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd)
 /*                                                                     */
 /************************************************************************/
 extern int xkbDevicePrivateIndex;
-extern void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, pointer);
 void
 ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
 {
index 5ec1ed5..1adb389 100644 (file)
@@ -47,7 +47,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 DevPrivateKeyRec xkbDevicePrivateKeyRec;
 
-void XkbFakeDeviceButton(DeviceIntPtr dev, Bool press, int button);
 static void XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x,
                                  int y);
 
index d49e4c1..87a4485 100644 (file)
@@ -59,8 +59,6 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
     int i;
     int keymap_changed = 0;
     int modmap_changed = 0;
-    xEvent core_mn;
-    deviceMappingNotify xi_mn;
     CARD32 time = GetTimeInMillis();
 
     if (xkb_event == XkbNewKeyboardNotify) {
@@ -78,11 +76,6 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
     if (!keymap_changed && !modmap_changed)
         return;
 
-    core_mn.u.u.type = MappingNotify;
-    xi_mn.type = DeviceMappingNotify;
-    xi_mn.deviceid = kbd->id;
-    xi_mn.time = time;
-
     /* 0 is serverClient. */
     for (i = 1; i < currentMaxClients; i++) {
         if (!clients[i] || clients[i]->clientState != ClientStateRunning)
@@ -106,6 +99,7 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
             continue;
 
         if (keymap_changed) {
+            xEvent core_mn = { .u.u.type = MappingNotify };
             core_mn.u.mappingNotify.request = MappingKeyboard;
 
             /* Clip the keycode range to what the client knows about, so it
@@ -123,9 +117,12 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
             WriteEventsToClient(clients[i], 1, &core_mn);
         }
         if (modmap_changed) {
-            core_mn.u.mappingNotify.request = MappingModifier;
-            core_mn.u.mappingNotify.firstKeyCode = 0;
-            core_mn.u.mappingNotify.count = 0;
+            xEvent core_mn = {
+                .u.mappingNotify.request = MappingModifier,
+                .u.mappingNotify.firstKeyCode = 0,
+                .u.mappingNotify.count = 0
+            };
+            core_mn.u.u.type = MappingNotify;
             WriteEventsToClient(clients[i], 1, &core_mn);
         }
     }
@@ -134,16 +131,26 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
      * here? Clients might be upset, but that seems better than the
      * alternative of stale keymaps. -ds */
     if (keymap_changed) {
-        xi_mn.request = MappingKeyboard;
-        xi_mn.firstKeyCode = first_key;
-        xi_mn.count = num_keys;
+        deviceMappingNotify xi_mn = {
+            .type = DeviceMappingNotify,
+            .deviceid = kbd->id,
+            .request = MappingKeyboard,
+            .firstKeyCode = first_key,
+            .count = num_keys,
+            .time = time
+        };
         SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn,
                               1);
     }
     if (modmap_changed) {
-        xi_mn.request = MappingModifier;
-        xi_mn.firstKeyCode = 0;
-        xi_mn.count = 0;
+        deviceMappingNotify xi_mn = {
+            .type = DeviceMappingNotify,
+            .deviceid = kbd->id,
+            .request = MappingModifier,
+            .firstKeyCode = 0,
+            .count = 0,
+            .time = time
+        };
         SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn,
                               1);
     }
@@ -243,7 +250,7 @@ XkbSendStateNotify(DeviceIntPtr kbd, xkbStateNotify * pSN)
                 swaps(&pSN->changed);
                 swaps(&pSN->ptrBtnState);
             }
-            WriteToClient(interest->client, sizeof(xEvent), (char *) pSN);
+            WriteToClient(interest->client, sizeof(xEvent), pSN);
         }
         interest = interest->next;
     }
@@ -416,7 +423,7 @@ XkbSendControlsNotify(DeviceIntPtr kbd, xkbControlsNotify * pCN)
                 swapl(&pCN->enabledControlChanges);
                 swapl(&pCN->time);
             }
-            WriteToClient(interest->client, sizeof(xEvent), (char *) pCN);
+            WriteToClient(interest->client, sizeof(xEvent), pCN);
         }
         interest = interest->next;
     }
@@ -463,7 +470,7 @@ XkbSendIndicatorNotify(DeviceIntPtr kbd, int xkbType, xkbIndicatorNotify * pEv)
                 swapl(&pEv->changed);
                 swapl(&pEv->state);
             }
-            WriteToClient(interest->client, sizeof(xEvent), (char *) pEv);
+            WriteToClient(interest->client, sizeof(xEvent), pEv);
         }
         interest = interest->next;
     }
@@ -550,7 +557,7 @@ XkbHandleBell(BOOL force,
                 swapl(&bn.name);
                 swapl(&bn.window);
             }
-            WriteToClient(interest->client, sizeof(xEvent), (char *) &bn);
+            WriteToClient(interest->client, sizeof(xEvent), &bn);
         }
         interest = interest->next;
     }
@@ -594,7 +601,7 @@ XkbSendAccessXNotify(DeviceIntPtr kbd, xkbAccessXNotify * pEv)
                 swaps(&pEv->slowKeysDelay);
                 swaps(&pEv->debounceDelay);
             }
-            WriteToClient(interest->client, sizeof(xEvent), (char *) pEv);
+            WriteToClient(interest->client, sizeof(xEvent), pEv);
         }
         interest = interest->next;
     }
@@ -642,7 +649,7 @@ XkbSendNamesNotify(DeviceIntPtr kbd, xkbNamesNotify * pEv)
                 swapl(&pEv->changedIndicators);
                 swaps(&pEv->changedVirtualMods);
             }
-            WriteToClient(interest->client, sizeof(xEvent), (char *) pEv);
+            WriteToClient(interest->client, sizeof(xEvent), pEv);
         }
         interest = interest->next;
     }
@@ -689,7 +696,7 @@ XkbSendCompatMapNotify(DeviceIntPtr kbd, xkbCompatMapNotify * pEv)
                 swaps(&pEv->nSI);
                 swaps(&pEv->nTotalSI);
             }
-            WriteToClient(interest->client, sizeof(xEvent), (char *) pEv);
+            WriteToClient(interest->client, sizeof(xEvent), pEv);
         }
         interest = interest->next;
     }
@@ -732,7 +739,7 @@ XkbSendActionMessage(DeviceIntPtr kbd, xkbActionMessage * pEv)
                 swaps(&pEv->sequenceNumber);
                 swapl(&pEv->time);
             }
-            WriteToClient(interest->client, sizeof(xEvent), (char *) pEv);
+            WriteToClient(interest->client, sizeof(xEvent), pEv);
         }
         interest = interest->next;
     }
@@ -786,7 +793,7 @@ XkbSendExtensionDeviceNotify(DeviceIntPtr dev,
                 swaps(&pEv->reason);
                 swaps(&pEv->supported);
             }
-            WriteToClient(interest->client, sizeof(xEvent), (char *) pEv);
+            WriteToClient(interest->client, sizeof(xEvent), pEv);
         }
         interest = interest->next;
     }
index bef3775..1999f5c 100644 (file)
@@ -41,28 +41,11 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define XkbAddGeomRow                  SrvXkbAddGeomRow
 #define XkbAddGeomSection              SrvXkbAddGeomSection
 #define XkbAddGeomShape                        SrvXkbAddGeomShape
-#define XkbAllocGeomKeyAliases         SrvXkbAllocGeomKeyAliases
-#define XkbAllocGeomColors             SrvXkbAllocGeomColors
-#define XkbAllocGeomDoodads            SrvXkbAllocGeomDoodads
-#define XkbAllocGeomKeys               SrvXkbAllocGeomKeys
-#define XkbAllocGeomOutlines           SrvXkbAllocGeomOutlines
-#define XkbAllocGeomPoints             SrvXkbAllocGeomPoints
-#define XkbAllocGeomProps              SrvXkbAllocGeomProps
-#define XkbAllocGeomRows               SrvXkbAllocGeomRows
-#define XkbAllocGeomSectionDoodads     SrvXkbAllocGeomSectionDoodads
-#define XkbAllocGeomSections           SrvXkbAllocGeomSections
-#define        XkbAllocGeomOverlays            SrvXkbAllocGeomOverlays
-#define        XkbAllocGeomOverlayRows         SrvXkbAllocGeomOverlayRows
-#define        XkbAllocGeomOverlayKeys         SrvXkbAllocGeomOverlayKeys
-#define XkbAllocGeomShapes             SrvXkbAllocGeomShapes
 #define XkbAllocGeometry               SrvXkbAllocGeometry
 #define XkbFreeGeomKeyAliases          SrvXkbFreeGeomKeyAliases
 #define XkbFreeGeomColors              SrvXkbFreeGeomColors
 #define XkbFreeGeomDoodads             SrvXkbFreeGeomDoodads
 #define XkbFreeGeomProperties          SrvXkbFreeGeomProperties
-#define        XkbFreeGeomOverlayKeys          SrvXkbFreeGeomOverlayKeys
-#define        XkbFreeGeomOverlayRows          SrvXkbFreeGeomOverlayRows
-#define        XkbFreeGeomOverlays             SrvXkbFreeGeomOverlays
 #define        XkbFreeGeomKeys                 SrvXkbFreeGeomKeys
 #define        XkbFreeGeomRows                 SrvXkbFreeGeomRows
 #define XkbFreeGeomSections            SrvXkbFreeGeomSections
index a98eca8..1de1c6c 100644 (file)
@@ -17,4 +17,4 @@ Description: Modular X.Org X Server
 Version: @PACKAGE_VERSION@
 Requires.private: @SDK_REQUIRED_MODULES@
 Cflags: -I${sdkdir} @symbol_visibility@
-Libs: -L${libdir}
+Libs: -L${libdir} @XORG_DRIVER_LIBS@
diff --git a/ylwrap b/ylwrap
deleted file mode 100755 (executable)
index 36543da..0000000
--- a/ylwrap
+++ /dev/null
@@ -1,225 +0,0 @@
-#! /bin/sh
-# ylwrap - wrapper for lex/yacc invocations.
-
-scriptversion=2011-08-25.18; # UTC
-
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
-#
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-case "$1" in
-  '')
-    echo "$0: No files given.  Try '$0 --help' for more information." 1>&2
-    exit 1
-    ;;
-  --basedir)
-    basedir=$2
-    shift 2
-    ;;
-  -h|--h*)
-    cat <<\EOF
-Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
-
-Wrapper for lex/yacc invocations, renaming files as desired.
-
-  INPUT is the input file
-  OUTPUT is one file PROG generates
-  DESIRED is the file we actually want instead of OUTPUT
-  PROGRAM is program to run
-  ARGS are passed to PROG
-
-Any number of OUTPUT,DESIRED pairs may be used.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
-    exit $?
-    ;;
-  -v|--v*)
-    echo "ylwrap $scriptversion"
-    exit $?
-    ;;
-esac
-
-
-# The input.
-input="$1"
-shift
-case "$input" in
-  [\\/]* | ?:[\\/]*)
-    # Absolute path; do nothing.
-    ;;
-  *)
-    # Relative path.  Make it absolute.
-    input="`pwd`/$input"
-    ;;
-esac
-
-pairlist=
-while test "$#" -ne 0; do
-  if test "$1" = "--"; then
-    shift
-    break
-  fi
-  pairlist="$pairlist $1"
-  shift
-done
-
-# The program to run.
-prog="$1"
-shift
-# Make any relative path in $prog absolute.
-case "$prog" in
-  [\\/]* | ?:[\\/]*) ;;
-  *[\\/]*) prog="`pwd`/$prog" ;;
-esac
-
-# FIXME: add hostname here for parallel makes that run commands on
-# other machines.  But that might take us over the 14-char limit.
-dirname=ylwrap$$
-do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
-trap "ret=129; $do_exit" 1
-trap "ret=130; $do_exit" 2
-trap "ret=141; $do_exit" 13
-trap "ret=143; $do_exit" 15
-mkdir $dirname || exit 1
-
-cd $dirname
-
-case $# in
-  0) "$prog" "$input" ;;
-  *) "$prog" "$@" "$input" ;;
-esac
-ret=$?
-
-if test $ret -eq 0; then
-  set X $pairlist
-  shift
-  first=yes
-  # Since DOS filename conventions don't allow two dots,
-  # the DOS version of Bison writes out y_tab.c instead of y.tab.c
-  # and y_tab.h instead of y.tab.h. Test to see if this is the case.
-  y_tab_nodot="no"
-  if test -f y_tab.c || test -f y_tab.h; then
-    y_tab_nodot="yes"
-  fi
-
-  # The directory holding the input.
-  input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
-  # Quote $INPUT_DIR so we can use it in a regexp.
-  # FIXME: really we should care about more than '.' and '\'.
-  input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
-
-  while test "$#" -ne 0; do
-    from="$1"
-    # Handle y_tab.c and y_tab.h output by DOS
-    if test $y_tab_nodot = "yes"; then
-      if test $from = "y.tab.c"; then
-        from="y_tab.c"
-      else
-        if test $from = "y.tab.h"; then
-          from="y_tab.h"
-        fi
-      fi
-    fi
-    if test -f "$from"; then
-      # If $2 is an absolute path name, then just use that,
-      # otherwise prepend '../'.
-      case "$2" in
-        [\\/]* | ?:[\\/]*) target="$2";;
-        *) target="../$2";;
-      esac
-
-      # We do not want to overwrite a header file if it hasn't
-      # changed.  This avoid useless recompilations.  However the
-      # parser itself (the first file) should always be updated,
-      # because it is the destination of the .y.c rule in the
-      # Makefile.  Divert the output of all other files to a temporary
-      # file so we can compare them to existing versions.
-      if test $first = no; then
-        realtarget="$target"
-        target="tmp-`echo $target | sed s/.*[\\/]//g`"
-      fi
-      # Edit out '#line' or '#' directives.
-      #
-      # We don't want the resulting debug information to point at
-      # an absolute srcdir; it is better for it to just mention the
-      # .y file with no path.
-      #
-      # We want to use the real output file name, not yy.lex.c for
-      # instance.
-      #
-      # We want the include guards to be adjusted too.
-      FROM=`echo "$from" | sed \
-            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
-      TARGET=`echo "$2" | sed \
-            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
-
-      sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
-          -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
-
-      # Check whether header files must be updated.
-      if test $first = no; then
-        if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
-          echo "$2" is unchanged
-          rm -f "$target"
-        else
-          echo updating "$2"
-          mv -f "$target" "$realtarget"
-        fi
-      fi
-    else
-      # A missing file is only an error for the first file.  This
-      # is a blatant hack to let us support using "yacc -d".  If -d
-      # is not specified, we don't want an error when the header
-      # file is "missing".
-      if test $first = yes; then
-        ret=1
-      fi
-    fi
-    shift
-    shift
-    first=no
-  done
-else
-  ret=$?
-fi
-
-# Remove the directory.
-cd ..
-rm -rf $dirname
-
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End: