summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp104
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Credits.rtf2
-rw-r--r--hw/darwin/bundle/XDarwin.icnsbin69461 -> 69465 bytes
-rw-r--r--hw/darwin/darwin.c38
-rw-r--r--hw/darwin/iokit/xfIOKit.c12
-rw-r--r--hw/darwin/quartz/Preferences.h2
-rw-r--r--hw/darwin/quartz/Preferences.m21
-rw-r--r--hw/darwin/quartz/XDarwin.pbproj/project.pbxproj4
-rw-r--r--hw/darwin/quartz/XServer.h7
-rw-r--r--hw/darwin/quartz/XServer.m145
-rw-r--r--hw/darwin/quartz/cr/crFrame.m1
-rw-r--r--hw/darwin/quartz/cr/crScreen.m192
-rw-r--r--hw/darwin/quartz/fullscreen/fullscreen.c15
-rw-r--r--hw/darwin/quartz/pseudoramiX.c14
-rw-r--r--hw/darwin/quartz/pseudoramiX.h3
-rw-r--r--hw/darwin/quartz/quartz.c91
-rw-r--r--hw/darwin/quartz/quartz.h13
-rw-r--r--hw/darwin/quartz/quartzCocoa.m7
-rw-r--r--hw/darwin/quartz/quartzCommon.h9
-rw-r--r--hw/darwin/quartz/xpr/xpr.h2
-rw-r--r--hw/darwin/quartz/xpr/xprFrame.c2
-rw-r--r--hw/darwin/quartz/xpr/xprScreen.c97
-rw-r--r--hw/dmx/dmx.c1129
-rw-r--r--hw/dmx/dmxdpms.c209
-rw-r--r--hw/vfb/InitOutput.c131
-rw-r--r--hw/vfb/Xvfb.man.pre2
-rw-r--r--hw/xfree86/common/compiler.h71
-rw-r--r--hw/xfree86/common/xf86Bus.c2
-rw-r--r--hw/xfree86/common/xf86Config.c65
-rw-r--r--hw/xfree86/common/xf86Configure.c9
-rw-r--r--hw/xfree86/common/xf86Cursor.c2
-rw-r--r--hw/xfree86/common/xf86DGA.c2
-rw-r--r--hw/xfree86/common/xf86DPMS.c10
-rw-r--r--hw/xfree86/common/xf86Date.h2
-rw-r--r--hw/xfree86/common/xf86Events.c16
-rw-r--r--hw/xfree86/common/xf86Globals.c2
-rw-r--r--hw/xfree86/common/xf86Helper.c20
-rw-r--r--hw/xfree86/common/xf86Init.c67
-rw-r--r--hw/xfree86/common/xf86Io.c5
-rw-r--r--hw/xfree86/common/xf86Mode.c2
-rw-r--r--hw/xfree86/common/xf86PciInfo.h46
-rw-r--r--hw/xfree86/common/xf86RandR.c83
-rw-r--r--hw/xfree86/common/xf86Version.h4
-rw-r--r--hw/xfree86/common/xf86cmap.c11
-rw-r--r--hw/xfree86/common/xf86fbman.c6
-rw-r--r--hw/xfree86/common/xf86pciBus.c12
-rw-r--r--hw/xfree86/common/xf86str.h24
-rw-r--r--hw/xfree86/common/xorgHelper.c2
-rw-r--r--hw/xfree86/common/xorgVersion.h6
-rw-r--r--hw/xfree86/ddc/interpret_edid.c4
-rw-r--r--hw/xfree86/ddc/xf86DDC.c8
-rw-r--r--hw/xfree86/ddc/xf86DDC.h4
-rw-r--r--hw/xfree86/dixmods/GLcoremodule.c2
-rw-r--r--hw/xfree86/dixmods/afbmodule.c2
-rw-r--r--hw/xfree86/dixmods/bitmapmod.c2
-rw-r--r--hw/xfree86/dixmods/cfb16module.c2
-rw-r--r--hw/xfree86/dixmods/cfb24module.c2
-rw-r--r--hw/xfree86/dixmods/cfb32module.c2
-rw-r--r--hw/xfree86/dixmods/cfbmodule.c2
-rw-r--r--hw/xfree86/dixmods/dbemodule.c2
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.c2
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.h2
-rw-r--r--hw/xfree86/dixmods/extmod/xf86vmode.c2
-rw-r--r--hw/xfree86/dixmods/fbmodule.c2
-rw-r--r--hw/xfree86/dixmods/ftmodule.c2
-rw-r--r--hw/xfree86/dixmods/glxmodule.c5
-rw-r--r--hw/xfree86/dixmods/laymodule.c2
-rw-r--r--hw/xfree86/dixmods/mfbmodule.c2
-rw-r--r--hw/xfree86/dixmods/recordmod.c2
-rw-r--r--hw/xfree86/dixmods/shmodule.c2
-rw-r--r--hw/xfree86/dixmods/type1mod.c2
-rw-r--r--hw/xfree86/dixmods/xf86XTrapModule.c2
-rw-r--r--hw/xfree86/doc/README.DRI1
-rw-r--r--hw/xfree86/doc/README.fonts86
-rw-r--r--hw/xfree86/doc/devel/README.DRIcomp1
-rw-r--r--hw/xfree86/doc/man/Xorg.man.pre2
-rw-r--r--hw/xfree86/doc/man/xorg.conf.man.pre2
-rw-r--r--hw/xfree86/dri/dri.c144
-rw-r--r--hw/xfree86/dri/dri.h26
-rw-r--r--hw/xfree86/dri/drimodule.c4
-rw-r--r--hw/xfree86/dri/dristruct.h14
-rw-r--r--hw/xfree86/dri/sarea.h2
-rw-r--r--hw/xfree86/dri/xf86dri.c23
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c40
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.h9
-rw-r--r--hw/xfree86/fbdevhw/fbdevhwstub.c24
-rw-r--r--hw/xfree86/getconfig/cfg.sample2
-rw-r--r--hw/xfree86/getconfig/getconfig2
-rw-r--r--hw/xfree86/getconfig/xorg.cfg4
-rw-r--r--hw/xfree86/i2c/xf86i2c.c2
-rw-r--r--hw/xfree86/i2c/xf86i2c.h1
-rw-r--r--hw/xfree86/i2c/xf86i2cmodule.c2
-rw-r--r--hw/xfree86/int10/xf86int10module.c2
-rw-r--r--hw/xfree86/loader/dixsym.c22
-rw-r--r--hw/xfree86/loader/elfloader.c3
-rw-r--r--hw/xfree86/loader/extsym.c2
-rw-r--r--hw/xfree86/loader/hash.c2
-rw-r--r--hw/xfree86/loader/loader.c7
-rw-r--r--hw/xfree86/loader/loadmod.c2
-rw-r--r--hw/xfree86/loader/misym.c2
-rw-r--r--hw/xfree86/loader/xf86sym.c32
-rw-r--r--hw/xfree86/os-support/bsd/bsd_mouse.c2
-rw-r--r--hw/xfree86/os-support/bsd/i386_video.c114
-rw-r--r--hw/xfree86/os-support/bus/Pci.c3
-rw-r--r--hw/xfree86/os-support/bus/Pci.h6
-rw-r--r--hw/xfree86/os-support/bus/ix86Pci.c15
-rw-r--r--hw/xfree86/os-support/bus/linuxPci.c22
-rw-r--r--hw/xfree86/os-support/drm/drmmodule.c2
-rw-r--r--hw/xfree86/os-support/linux/int10/linux.c26
-rw-r--r--hw/xfree86/os-support/linux/lnx_ia64.c45
-rw-r--r--hw/xfree86/os-support/linux/lnx_init.c2
-rw-r--r--hw/xfree86/os-support/linux/lnx_io.c1
-rw-r--r--hw/xfree86/os-support/linux/lnx_kbd.c1
-rw-r--r--hw/xfree86/os-support/linux/lnx_video.c2
-rw-r--r--hw/xfree86/os-support/shared/ia64Pci.c81
-rw-r--r--hw/xfree86/os-support/shared/ia64Pci.h41
-rw-r--r--hw/xfree86/os-support/shared/libc_wrapper.c48
-rw-r--r--hw/xfree86/os-support/shared/sigio.c12
-rw-r--r--hw/xfree86/os-support/shared/sigiostubs.c3
-rw-r--r--hw/xfree86/os-support/solaris/sun_init.c19
-rw-r--r--hw/xfree86/os-support/solaris/sun_kbd.c20
-rw-r--r--hw/xfree86/os-support/solaris/sun_kbdEv.c16
-rw-r--r--hw/xfree86/os-support/solaris/sun_mouse.c243
-rw-r--r--hw/xfree86/os-support/xf86OSmouse.h4
-rw-r--r--hw/xfree86/os-support/xf86_OSlib.h4
-rw-r--r--hw/xfree86/os-support/xf86_libc.h2
-rw-r--r--hw/xfree86/parser/configProcs.h4
-rw-r--r--hw/xfree86/parser/read.c7
-rw-r--r--hw/xfree86/parser/write.c2
-rw-r--r--hw/xfree86/parser/xf86Parser.h8
-rw-r--r--hw/xfree86/rac/xf86RACmodule.c2
-rw-r--r--hw/xfree86/ramdac/IBM.c4
-rw-r--r--hw/xfree86/ramdac/IBM.h3
-rw-r--r--hw/xfree86/ramdac/TI.c4
-rw-r--r--hw/xfree86/ramdac/TI.h3
-rw-r--r--hw/xfree86/ramdac/xf86RamDacMod.c2
-rw-r--r--hw/xfree86/scanpci/extrapci.ids2
-rw-r--r--hw/xfree86/scanpci/xf86ScanPci.c4
-rw-r--r--hw/xfree86/shadowfb/sfbmodule.c2
-rw-r--r--hw/xfree86/utils/gtf/gtf.c2
-rw-r--r--hw/xfree86/utils/gtf/gtf.man.pre1
-rw-r--r--hw/xfree86/utils/xorgcfg/loader.c2
-rw-r--r--hw/xfree86/utils/xorgconfig/cards.c18
-rw-r--r--hw/xfree86/utils/xorgconfig/xorgconfig.c148
-rw-r--r--hw/xfree86/vbe/vbe.c19
-rw-r--r--hw/xfree86/vbe/vbe_module.c2
-rw-r--r--hw/xfree86/vgahw/vgaHW.c10
-rw-r--r--hw/xfree86/vgahw/vgaHW.h9
-rw-r--r--hw/xfree86/vgahw/vgaHWmodule.c2
-rw-r--r--hw/xfree86/x86emu/debug.c8
-rw-r--r--hw/xfree86/x86emu/decode.c72
-rw-r--r--hw/xfree86/x86emu/fpu.c1
-rw-r--r--hw/xfree86/x86emu/ops.c30
-rw-r--r--hw/xfree86/x86emu/ops2.c1
-rw-r--r--hw/xfree86/x86emu/prim_ops.c260
-rw-r--r--hw/xfree86/x86emu/sys.c76
-rw-r--r--hw/xfree86/x86emu/x86emu.h14
-rw-r--r--hw/xfree86/x86emu/x86emu/debug.h1
-rw-r--r--hw/xfree86/x86emu/x86emu/decode.h1
-rw-r--r--hw/xfree86/x86emu/x86emu/fpu_regs.h9
-rw-r--r--hw/xfree86/x86emu/x86emu/prim_asm.h1
-rw-r--r--hw/xfree86/x86emu/x86emu/prim_ops.h90
-rw-r--r--hw/xfree86/x86emu/x86emu/regs.h9
-rw-r--r--hw/xfree86/x86emu/x86emu/types.h3
-rw-r--r--hw/xfree86/x86emu/x86emu/x86emui.h5
-rw-r--r--hw/xfree86/xaa/xaa.h40
-rw-r--r--hw/xfree86/xaa/xaaFallback.c7
-rw-r--r--hw/xfree86/xaa/xaaInit.c18
-rw-r--r--hw/xfree86/xaa/xaaInitAccel.c10
-rw-r--r--hw/xfree86/xaa/xaaOverlay.c2
-rw-r--r--hw/xfree86/xaa/xaaPCache.c3
-rw-r--r--hw/xfree86/xaa/xaaPaintWin.c2
-rw-r--r--hw/xfree86/xaa/xaaPict.c109
-rw-r--r--hw/xfree86/xaa/xaaROP.c19
-rw-r--r--hw/xfree86/xaa/xaaStipple.c5
-rw-r--r--hw/xfree86/xaa/xaaTEGlyph.c6
-rw-r--r--hw/xfree86/xaa/xaaWideLine.c5
-rw-r--r--hw/xfree86/xaa/xaalocal.h41
-rw-r--r--hw/xfree86/xaa/xaarop.h6
-rw-r--r--hw/xfree86/xaa/xaawrap.h14
-rw-r--r--hw/xfree86/xf1bpp/mfbmap.h8
-rw-r--r--hw/xfree86/xf1bpp/mfbmodule.c2
-rw-r--r--hw/xfree86/xf4bpp/mfbbres.c6
-rw-r--r--hw/xfree86/xf4bpp/mfbbresd.c6
-rw-r--r--hw/xfree86/xf4bpp/mfbfillarc.c2
-rw-r--r--hw/xfree86/xf4bpp/mfbhrzvert.c2
-rw-r--r--hw/xfree86/xf4bpp/mfbimggblt.c6
-rw-r--r--hw/xfree86/xf4bpp/mfbline.c6
-rw-r--r--hw/xfree86/xf4bpp/mfbzerarc.c2
-rw-r--r--hw/xfree86/xf4bpp/ppcArea.c2
-rw-r--r--hw/xfree86/xf4bpp/ppcGC.c8
-rw-r--r--hw/xfree86/xf4bpp/ppcIO.c8
-rw-r--r--hw/xfree86/xf4bpp/ppcPixFS.c24
-rw-r--r--hw/xfree86/xf4bpp/ppcPntWin.c2
-rw-r--r--hw/xfree86/xf4bpp/ppcPolyPnt.c2
-rw-r--r--hw/xfree86/xf4bpp/ppcWinFS.c24
-rw-r--r--hw/xfree86/xf4bpp/ppcWindow.c2
-rw-r--r--hw/xfree86/xf4bpp/vgaGC.c2
-rw-r--r--hw/xfree86/xf4bpp/vgamodule.c2
-rw-r--r--hw/xfree86/xf8_16bpp/cfb8_16.h5
-rw-r--r--hw/xfree86/xf8_16bpp/cfb8_16module.c2
-rw-r--r--hw/xfree86/xf8_16bpp/cfbscrinit.c2
-rw-r--r--hw/xfree86/xf8_32bpp/cfb8_32.h10
-rw-r--r--hw/xfree86/xf8_32bpp/cfb8_32module.c2
-rw-r--r--hw/xfree86/xf8_32bpp/cfbpntwin.c2
-rw-r--r--hw/xfree86/xf8_32bpp/cfbscrinit.c2
-rw-r--r--hw/xfree86/xf8_32wid/cfb8_32wid.h5
-rw-r--r--hw/xfree86/xf8_32wid/cfb8_32widmodule.c2
-rw-r--r--hw/xfree86/xf8_32wid/cfbscrinit.c4
-rw-r--r--hw/xfree86/xorgconf.cpp2
-rw-r--r--hw/xnest/Args.c5
-rw-r--r--hw/xnest/Cursor.c73
-rw-r--r--hw/xnest/Events.c10
-rw-r--r--hw/xnest/GCOps.c13
-rw-r--r--hw/xnest/Keyboard.c3
-rw-r--r--hw/xnest/Screen.c65
-rw-r--r--hw/xnest/XNCursor.h9
-rw-r--r--hw/xwin/ChangeLog11
-rw-r--r--hw/xwin/InitOutput.c6
-rw-r--r--hw/xwin/README141
-rw-r--r--hw/xwin/win.h2
-rw-r--r--hw/xwin/winallpriv.c6
222 files changed, 4300 insertions, 1305 deletions
diff --git a/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
index d91d90449..1113b8ae6 100644
--- a/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
+++ b/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
@@ -1 +1,103 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ --> <html> <head> <title>XDarwin Help</title> </head> <body> <center> <h1>XDarwin X Server for Mac OS X</h1> X_VENDOR_NAME X_VERSION<br> Release Date: X_REL_DATE </center> <h2>Inhoud</h2> <ol> <li><A HREF="#notice">Belangrijke Informatie</A></li> <li><A HREF="#usage">Gebruik</A></li> <li><A HREF="#path">Instellen van het Path</A></li> <li><A HREF="#prefs">Voorkeursinstellingen</A></li> <li><A HREF="#license">Licentie</A></li> </ol> <center> <h2><a NAME="notice">Belangrijke Informatie</a></h2> </center> <blockquote> #if X_PRE_RELEASE Dit is een pre-release van XDarwin, waarvoor geen ondersteuning beschikbaar is. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge. Kijk alvorens een bug te rapporteren in een pre-release eerst of een nieuwe versie beschikbaar is bij <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> of de X_VENDOR_LINK. #else Als de server ouder is dan 6-12 maanden, of als uw hardware nieuwer is dan de bovenstaande datum, kijk dan of een nieuwe versie beschikbaar is voor u een probleem aanmeldt. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge. #endif </blockquote> <blockquote> Deze software is beschikbaar gesteld onder de voorwaarden van de <A HREF="#license">MIT X11 / X Consortium Licentie</A> en is beschikbaar 'AS IS',zonder enige garantie. Lees s.v.p. de <A HREF="#license">Licentie</A> voor gebruik.</blockquote> <h2><a NAME="usage">Gebruik</a></h2> <p>XDarwin is een open-source X server van het <a HREF="http://www.x.org/">X Window Systeem</a>. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin werkt op Mac OS X in schermvullende of rootless modus.</p> <p>Het X window systeem in schermvullende modus neemt het hele beeldscherm in beslag. U schakelt terug naar de Mac OS X desktop door de toesten Command-Option-A in te drukken. Deze toetsencombinatie kunt u veranderen in de Voorkeuren. Op de Mac OS X desktop klikt u op de XDarwin icoon in de Dock om weer naar het X window systeem te schakelen. (In de Voorkeuren kunt er voor kiezen om een apart XDarwin schakelpaneel te gebruiken op de Mac OS X desktop.)</p> <p>In rootless modus verschijnen het X window systeem en Aqua (de Mac OS X desktop) tegelijk op het scherm. Het achtergrondscherm van X11, waarbinnen alle X11 vensters vallen, is net zo groot als het gehele scherm, maar het achtergrondscherm zelf is onzichtbaar.</p> <h3>Meerknopsmuis emulatie</h3> <p>Voor veel X11 programma's hebt u een 3-knops muis nodig. Met een 1-knops muis kunt u een 3-knops muis nabootsen door een toets in te drukken terwijl u klikt met de muis. Het instellen hiervan kan bij Voorkeuren, "Meerknopsmuis emulatie" in "Algemeen". Emulatie is standaard ingeschakeld: ingedrukt houden van de "command" toets terwijl u klikt emuleert knop 2, ingedrukt houden van "option" emuleert knop 3. Deze toetsen kunt u dus wijzigen in de Voorkeuren. Let op: als u xmodmap gebruikt om de indeling van het toetsenbord te wijzigen, moet u toch de oorspronkelijke toetsen op het toetsenbord gebruiken voor deze functie.</p> <h2><a NAME="path">Instellen van het Path</a></h2> <p>Het path is de lijst van directories waarin gezocht wordt naar commando's. De X11 commando's staan in de directory <code>/usr/X11R6/bin</code>, die dus aan uw path moet worden toegevoegd. XDarwin doet dit automatisch voor u en kan extra directories toevoegen waarin u commando's hebt ge&iuml;nstalleerd.</p> <p>Ervaren gebruikers zullen het path al correct hebben ingesteld in de configuratiebestanden voor hun shell. In dat geval kunt u XDarwin via de Voorkeuren vertellen het path niet te wijzigen. XDarwin start de eerste X11 clients binnen de standaard login shell van de gebruiker (bij de Voorkeuren kunt u een afwijkende shell opgeven). Het instellen van het path is afhankelijk van de shell. Zie hiervoor de man pages voor de shell.</p> <p>Het kan handig zijn de manualpages voor X11 toe te voegen aan de lijst waarin gezocht wordt als u documentatie opvraagt. De manualpages voor X11 staan in <code>/usr/X11R6/man</code> en de <code>MANPATH</code> environment variable bevat de lijst van directories waarin naar documentatie wordt gezocht.</p> <h2><a NAME="prefs">Voorkeursinstellingen</a></h2> <p>Een aantal instellingen kan worden gewijzigd door "Voorkeuren..." te kiezen in het "XDarwin" menu. Wijzigingen van de instellingen genoemd onder "Start" gaan pas in als u XDarwin opnieuw hebt gestart. Een wijziging van de overige instellingen is direct effectief. Hier onder vindt u de verschillende mogelijkheden beschreven:</p> <h3>Algemeen</h3> <ul> <li><b>Gebruik systeempiep voor X11:</b> Als u dit inschakelt wordt het Mac OS X waarschuwingssignaal ook gebruikt door X11, anders gebruikt X11 een simpele pieptoon (dit is de standaardinstelling).</li> <li><b>Wijzigen muis-versnelling door X11 mogelijk:</b> In een standaard X window systeem kan de window manager de muis-versnelling aanpassen. Dit kan verwarrend zijn omdat de snelheid onder X11 dan verschillend kan zijn van de snelheid die u in Mac OS X bij Systeemvoorkeuren hebt ingesteld. Om verwarring te voorkomen is de standaardinstelling dat X11 de versnelling niet kan wijzigen.</li> <li><b>Meerknopsmuis emulatie:</b> Dit is hierboven beschreven bij <a HREF="#usage">Gebruik</a>. Als emulatie is ingeschakeld moet u de gekozen toetsen ingedrukt houden terwijl u met de muis klikt om de tweede en derde muisknop na te bootsen.</li> </ul> <h3>Start</h3> <ul> <li><b>Standaard modus:</b> Hier kiest u de standaard scherm-modus: schermvullend of rootless (hierboven beschreven bij <a HREF="#usage">Gebruik</a>). U kunt ook kiezen tijdens het starten van XDarwin, zie de optie hieronder.</li> <li><b>Kies scherm-modus tijdens start:</b> Dit is standaard ingeschakeld zodat u tijdens het starten van XDarwin kunt kiezen tussen schermvullend en rootless scherm-modus. Als u dit uitschakelt start XDarwin in de standaard modus zonder u iets te vragen.</li> <li><b>X11 scherm nummer:</b> Met X11 kunnen meerdere schermen worden aangestuurd door verschillende X servers op dezelfde computer. Als u meerdere X servers tegelijk wilt gebruiken stelt u hier het scherm nummer in dat door XDarwin wordt gebruikt.</li> <li><b>Xinerama multi-monitor ondersteuning mogelijk:</b> XDarwin ondersteunt het gebruik van meerdere monitoren met Xinerama, waarbij elke monitor wordt gezien als deel van &eacute;&eacute;n groot rechthoekig scherm. U kunt Xinerama hier uitschakelen, maar XDarwin werkt op dit moment zonder Xinerama niet goed met meerdere monitoren. Als u maar 1 monitor gebruikt is deze instelling automatisch uitgeschakeld.</li> <li><b>Toetsenbordindeling-bestand:</b> Een toetsenbordindeling-bestand wordt bij het starten geladen en omgezet naar een X11 toetsenbordindeling. Voor verschillende talen vindt u toetsenbordindelingen in de directory <code>/System/Library/Keyboards</code>.</li> <li><b>Bij starten eerste X11 clients:</b> Als XDarwin start, wordt <code>xinit</code> uitgevoerd om de X window manager en andere X clients te starten (zie "<code>man xinit</code>"). Voordat XDarwin <code>xinit</code> uitvoert voegt het de opgegeven directories toe aan het path. Standaard wordt alleen <code>/usr/X11R6/bin</code> toegevoegd. U kunt meerdere directories opgeven, gescheiden door een dubbelepunt. X clients worden gestart met de standaard login shell van de gebruiker met gebruik van de configuratiebestanden voor die shell. U kunt een afwijkende shell opgeven.</li> </ul> <h3>Schermvullend</h3> <ul> <li><b>Toetscombinatie knop:</b> Klik op deze knop om de toetscombinatie te wijzigen waarmee u tussen de Mac OS X desktop en X11 schakelt. Als toetscombinatie kunt u elke combinatie gebruiken van de shift, control, command en option toetsen samen met &eacute;&eacute;n normale toets.</li> <li><b>Klikken op icoon in Dock schakelt naar X11:</b> Hiermee is een klik op de XDarwin icoon in de Dock voldoende om naar X11 te schakelen. In sommige versies van Mac OS X verdwijnt soms de cursor als u deze mogelijkheid gebruikt en daarna terugkeert naar de Mac OS X desktop.</li> <li><b>Toon help bij schermvullend starten:</b> Hiermee wordt een inleidend scherm getoond als XDarwin schermvullend start.</li> <li><b>Kleurdiepte:</b> In de schermvullende modus kan X11 een andere kleurdiepte gebruiken dan Aqua (en de Mac OS X desktop). Als u "Huidig" kiest, neemt XDarwin bij het starten de kleurdiepte over van Aqua. U kunt ook kiezen voor 8, 15 of 24 bits.</li> </ul> <h2><a NAME="license">Licentie</a></h2> The main license for XDarwin is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code. <H3><A NAME="3"></A>X Consortium License</H3> <p>Copyright (C) 1996 X Consortium</p> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> <p>Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium.</p> <p>X Window System is a trademark of X Consortium, Inc.</p> </body> </html> \ No newline at end of file
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
+
+<html>
+<head>
+<title>XDarwin Help</title>
+</head>
+<body>
+<center>
+ <h1>XDarwin X Server for Mac OS X</h1>
+ X_VENDOR_NAME X_VERSION<br>
+ Release Date: X_REL_DATE
+</center>
+<h2>Inhoud</h2>
+<ol>
+ <li><A HREF="#notice">Belangrijke Informatie</A></li>
+ <li><A HREF="#usage">Gebruik</A></li>
+ <li><A HREF="#path">Instellen van het Path</A></li>
+ <li><A HREF="#prefs">Voorkeursinstellingen</A></li>
+ <li><A HREF="#license">Licentie</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Belangrijke Informatie</a></h2>
+</center>
+<blockquote>
+#if X_PRE_RELEASE
+Dit is een pre-release van XDarwin, waarvoor geen ondersteuning beschikbaar is. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge. Kijk alvorens een bug te rapporteren in een pre-release eerst of een nieuwe versie beschikbaar is bij <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> of de X_VENDOR_LINK.
+#else
+Als de server ouder is dan 6-12 maanden, of als uw hardware nieuwer is dan de bovenstaande datum, kijk dan of een nieuwe versie beschikbaar is voor u een probleem aanmeldt. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge.
+#endif
+</blockquote>
+<blockquote>
+Deze software is beschikbaar gesteld onder de voorwaarden van de <A HREF="#license">MIT X11 / X Consortium Licentie</A> en is beschikbaar 'AS IS',zonder enige garantie. Lees s.v.p. de <A HREF="#license">Licentie</A> voor gebruik.</blockquote>
+
+<h2><a NAME="usage">Gebruik</a></h2>
+<p>XDarwin is een open-source X server van het <a HREF="http://www.x.org/">X Window Systeem</a>. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin werkt op Mac OS X in schermvullende of rootless modus.</p>
+<p>Het X window systeem in schermvullende modus neemt het hele beeldscherm in beslag. U schakelt terug naar de Mac OS X desktop door de toesten Command-Option-A in te drukken. Deze toetsencombinatie kunt u veranderen in de Voorkeuren. Op de Mac OS X desktop klikt u op de XDarwin icoon in de Dock om weer naar het X window systeem te schakelen. (In de Voorkeuren kunt er voor kiezen om een apart XDarwin schakelpaneel te gebruiken op de Mac OS X desktop.)</p>
+<p>In rootless modus verschijnen het X window systeem en Aqua (de Mac OS X desktop) tegelijk op het scherm. Het achtergrondscherm van X11, waarbinnen alle X11 vensters vallen, is net zo groot als het gehele scherm, maar het achtergrondscherm zelf is onzichtbaar.</p>
+
+<h3>Meerknopsmuis emulatie</h3>
+<p>Voor veel X11 programma's hebt u een 3-knops muis nodig. Met een 1-knops muis kunt u een 3-knops muis nabootsen door een toets in te drukken terwijl u klikt met de muis. Het instellen hiervan kan bij Voorkeuren, "Meerknopsmuis emulatie" in "Algemeen". Emulatie is standaard ingeschakeld: ingedrukt houden van de "command" toets terwijl u klikt emuleert knop 2, ingedrukt houden van "option" emuleert knop 3. Deze toetsen kunt u dus wijzigen in de Voorkeuren. Let op: als u xmodmap gebruikt om de indeling van het toetsenbord te wijzigen, moet u toch de oorspronkelijke toetsen op het toetsenbord gebruiken voor deze functie.</p>
+
+<h2><a NAME="path">Instellen van het Path</a></h2>
+<p>Het path is de lijst van directories waarin gezocht wordt naar commando's. De X11 commando's staan in de directory <code>/usr/X11R6/bin</code>, die dus aan uw path moet worden toegevoegd. XDarwin doet dit automatisch voor u en kan extra directories toevoegen waarin u commando's hebt ge&iuml;nstalleerd.</p>
+
+<p>Ervaren gebruikers zullen het path al correct hebben ingesteld in de configuratiebestanden voor hun shell. In dat geval kunt u XDarwin via de Voorkeuren vertellen het path niet te wijzigen. XDarwin start de eerste X11 clients binnen de standaard login shell van de gebruiker (bij de Voorkeuren kunt u een afwijkende shell opgeven). Het instellen van het path is afhankelijk van de shell. Zie hiervoor de man pages voor de shell.</p>
+
+<p>Het kan handig zijn de manualpages voor X11 toe te voegen aan de lijst waarin gezocht wordt als u documentatie opvraagt. De manualpages voor X11 staan in <code>/usr/X11R6/man</code> en de <code>MANPATH</code> environment variable bevat de lijst van directories waarin naar documentatie wordt gezocht.</p>
+
+<h2><a NAME="prefs">Voorkeursinstellingen</a></h2>
+<p>Een aantal instellingen kan worden gewijzigd door "Voorkeuren..." te kiezen in het "XDarwin" menu. Wijzigingen van de instellingen genoemd onder "Start" gaan pas in als u XDarwin opnieuw hebt gestart. Een wijziging van de overige instellingen is direct effectief. Hier onder vindt u de verschillende mogelijkheden beschreven:</p>
+
+<h3>Algemeen</h3>
+<ul>
+ <li><b>Gebruik systeempiep voor X11:</b> Als u dit inschakelt wordt het Mac OS X waarschuwingssignaal ook gebruikt door X11, anders gebruikt X11 een simpele pieptoon (dit is de standaardinstelling).</li>
+ <li><b>Wijzigen muis-versnelling door X11 mogelijk:</b> In een standaard X window systeem kan de window manager de muis-versnelling aanpassen. Dit kan verwarrend zijn omdat de snelheid onder X11 dan verschillend kan zijn van de snelheid die u in Mac OS X bij Systeemvoorkeuren hebt ingesteld. Om verwarring te voorkomen is de standaardinstelling dat X11 de versnelling niet kan wijzigen.</li>
+ <li><b>Meerknopsmuis emulatie:</b> Dit is hierboven beschreven bij <a HREF="#usage">Gebruik</a>. Als emulatie is ingeschakeld moet u de gekozen toetsen ingedrukt houden terwijl u met de muis klikt om de tweede en derde muisknop na te bootsen.</li>
+</ul>
+
+<h3>Start</h3>
+<ul>
+ <li><b>Standaard modus:</b> Hier kiest u de standaard scherm-modus: schermvullend of rootless (hierboven beschreven bij <a HREF="#usage">Gebruik</a>). U kunt ook kiezen tijdens het starten van XDarwin, zie de optie hieronder.</li>
+ <li><b>Kies scherm-modus tijdens start:</b> Dit is standaard ingeschakeld zodat u tijdens het starten van XDarwin kunt kiezen tussen schermvullend en rootless scherm-modus. Als u dit uitschakelt start XDarwin in de standaard modus zonder u iets te vragen.</li>
+ <li><b>X11 scherm nummer:</b> Met X11 kunnen meerdere schermen worden aangestuurd door verschillende X servers op dezelfde computer. Als u meerdere X servers tegelijk wilt gebruiken stelt u hier het scherm nummer in dat door XDarwin wordt gebruikt.</li>
+ <li><b>Xinerama multi-monitor ondersteuning mogelijk:</b> XDarwin ondersteunt het gebruik van meerdere monitoren met Xinerama, waarbij elke monitor wordt gezien als deel van &eacute;&eacute;n groot rechthoekig scherm. U kunt Xinerama hier uitschakelen, maar XDarwin werkt op dit moment zonder Xinerama niet goed met meerdere monitoren. Als u maar 1 monitor gebruikt is deze instelling automatisch uitgeschakeld.</li>
+ <li><b>Toetsenbordindeling-bestand:</b> Een toetsenbordindeling-bestand wordt bij het starten geladen en omgezet naar een X11 toetsenbordindeling. Voor verschillende talen vindt u toetsenbordindelingen in de directory <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Bij starten eerste X11 clients:</b> Als XDarwin start, wordt <code>xinit</code> uitgevoerd om de X window manager en andere X clients te starten (zie "<code>man xinit</code>"). Voordat XDarwin <code>xinit</code> uitvoert voegt het de opgegeven directories toe aan het path. Standaard wordt alleen <code>/usr/X11R6/bin</code> toegevoegd. U kunt meerdere directories opgeven, gescheiden door een dubbelepunt. X clients worden gestart met de standaard login shell van de gebruiker met gebruik van de configuratiebestanden voor die shell. U kunt een afwijkende shell opgeven.</li>
+</ul>
+
+<h3>Schermvullend</h3>
+<ul>
+ <li><b>Toetscombinatie knop:</b> Klik op deze knop om de toetscombinatie te wijzigen waarmee u tussen de Mac OS X desktop en X11 schakelt. Als toetscombinatie kunt u elke combinatie gebruiken van de shift, control, command en option toetsen samen met &eacute;&eacute;n normale toets.</li>
+ <li><b>Klikken op icoon in Dock schakelt naar X11:</b> Hiermee is een klik op de XDarwin icoon in de Dock voldoende om naar X11 te schakelen. In sommige versies van Mac OS X verdwijnt soms de cursor als u deze mogelijkheid gebruikt en daarna terugkeert naar de Mac OS X desktop.</li>
+ <li><b>Toon help bij schermvullend starten:</b> Hiermee wordt een inleidend scherm getoond als XDarwin schermvullend start.</li>
+ <li><b>Kleurdiepte:</b> In de schermvullende modus kan X11 een andere kleurdiepte gebruiken dan Aqua (en de Mac OS X desktop). Als u "Huidig" kiest, neemt XDarwin bij het starten de kleurdiepte over van Aqua. U kunt ook kiezen voor 8, 15 of 24 bits.</li>
+</ul>
+
+<h2><a NAME="license">Licentie</a></h2>
+The main license for XDarwin is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code.
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
+
diff --git a/hw/darwin/bundle/Japanese.lproj/Credits.rtf b/hw/darwin/bundle/Japanese.lproj/Credits.rtf
index 4ba4d4938..cf9eae207 100644
--- a/hw/darwin/bundle/Japanese.lproj/Credits.rtf
+++ b/hw/darwin/bundle/Japanese.lproj/Credits.rtf
@@ -190,4 +190,4 @@ Dave Zarzycki\
\f1 \
Torrey T. Lyons\
XFree86 4.0.2
-\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67\'82\'d6\'82\'cc\'93\'9d\'8d\'87}
+\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67\'82\'d6\'82\'cc\'93\'9d\'8d\'87} \ No newline at end of file
diff --git a/hw/darwin/bundle/XDarwin.icns b/hw/darwin/bundle/XDarwin.icns
index 2dd5f786e..9c560846e 100644
--- a/hw/darwin/bundle/XDarwin.icns
+++ b/hw/darwin/bundle/XDarwin.icns
Binary files differ
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c
index c774ba1dc..29a31aba1 100644
--- a/hw/darwin/darwin.c
+++ b/hw/darwin/darwin.c
@@ -29,7 +29,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/darwin.c,v 1.1.4.2.4.1 2004/03/04 17:47:29 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/darwin.c,v 1.4 2004/08/11 23:53:36 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.55 2003/11/15 00:07:09 torrey Exp $ */
#include "X.h"
@@ -48,6 +48,13 @@
#include "xf86Date.h"
#include "dix.h"
+#ifdef XINPUT
+# include "XI.h"
+# include "XIproto.h"
+# include "exevents.h"
+# include "extinit.h"
+#endif
+
#include <sys/types.h>
#include <sys/time.h>
#include <sys/syslimits.h>
@@ -131,7 +138,7 @@ DarwinPrintBanner()
"repository hosted at http://www.freedesktop.org/Software/xorg/");
#endif
#if XORG_VERSION_SNAP > 0
- ErrorF(".%d", XF86_VERSION_SNAP);
+ ErrorF(".%d", XORG_VERSION_SNAP);
#endif
#if XORG_VERSION_SNAP >= 900
@@ -404,6 +411,22 @@ static int DarwinMouseProc(
miPointerGetMotionEvents,
DarwinChangePointerControl,
0 );
+#ifdef XINPUT
+ InitValuatorAxisStruct( pPointer,
+ 0, // X axis
+ 0, // min value
+ 16000, // max value (fixme screen size?)
+ 1, // resolution (fixme ?)
+ 1, // min resolution
+ 1 ); // max resolution
+ InitValuatorAxisStruct( pPointer,
+ 1, // X axis
+ 0, // min value
+ 16000, // max value (fixme screen size?)
+ 1, // resolution (fixme ?)
+ 1, // min resolution
+ 1 ); // max resolution
+#endif
break;
case DEVICE_ON:
@@ -699,7 +722,16 @@ void OsVendorInit(void)
/*
- * ddxProcessArgument --
+ * ddxInitGlobals
+ * Called by InitGlobals() from os/util.c.
+ */
+void ddxInitGlobals(void)
+{
+}
+
+
+/*
+ * ddxProcessArgument
* Process device-dependent command line args. Returns 0 if argument is
* not device dependent, otherwise Count of number of elements of argv
* that are part of a device dependent commandline option.
diff --git a/hw/darwin/iokit/xfIOKit.c b/hw/darwin/iokit/xfIOKit.c
index ef3aebb29..9a9d4b530 100644
--- a/hw/darwin/iokit/xfIOKit.c
+++ b/hw/darwin/iokit/xfIOKit.c
@@ -9,7 +9,7 @@
*
**************************************************************/
/*
- * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+ * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -33,7 +33,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c,v 1.1.4.1.4.2 2004/03/04 20:16:10 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c,v 1.3 2004/07/30 17:37:09 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c,v 1.2 2003/10/16 23:50:09 torrey Exp $ */
#include "X.h"
@@ -269,7 +269,7 @@ static void *XFIOKitHIDThread(void *unused)
default:
continue;
}
-
+
DarwinEQEnqueue(&xe);
}
}
@@ -466,7 +466,9 @@ static Bool SetupFBandHID(
#ifdef __i386__
/* x86 in 8bit mode currently needs fixed color map... */
- if( pixelInfo.bitsPerComponent == 8 ) {
+ if (pixelInfo.bitsPerComponent == 8 &&
+ pixelInfo.componentCount == 1)
+ {
pixelInfo.pixelType = kIOFixedCLUTPixels;
}
#endif
@@ -574,7 +576,7 @@ Bool DarwinModeAddScreen(
* XFIOKitShadowUpdate
* Update the damaged regions of the shadow framebuffer on the screen.
*/
-static void XFIOKitShadowUpdate(ScreenPtr pScreen,
+static void XFIOKitShadowUpdate(ScreenPtr pScreen,
shadowBufPtr pBuf)
{
DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
diff --git a/hw/darwin/quartz/Preferences.h b/hw/darwin/quartz/Preferences.h
index feecf24d6..d8c3c2ea2 100644
--- a/hw/darwin/quartz/Preferences.h
+++ b/hw/darwin/quartz/Preferences.h
@@ -84,6 +84,7 @@
+ (void)setModeWindow:(BOOL)newModeWindow;
+ (void)setStartupHelp:(BOOL)newStartupHelp;
+ (void)setSystemBeep:(BOOL)newSystemBeep;
++ (void)setEnableKeyEquivalents:(BOOL)newKeyEquivs;
+ (void)setXinerama:(BOOL)newXinerama;
+ (void)setAddToPath:(BOOL)newAddToPath;
+ (void)setAddToPathString:(NSString *)newAddToPathString;
@@ -110,6 +111,7 @@
+ (BOOL)modeWindow;
+ (BOOL)startupHelp;
+ (BOOL)systemBeep;
++ (BOOL)enableKeyEquivalents;
+ (BOOL)xinerama;
+ (BOOL)addToPath;
+ (NSString *)addToPathString;
diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m
index cca2f695d..6c14f4982 100644
--- a/hw/darwin/quartz/Preferences.m
+++ b/hw/darwin/quartz/Preferences.m
@@ -4,7 +4,7 @@
// This class keeps track of the user preferences.
//
/*
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
+ * Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@
* sale, use or other dealings in this Software without prior written
* authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.3 2003/05/14 05:27:56 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */
#import "quartzCommon.h"
@@ -49,6 +49,9 @@
#define STR(s) #s
#define XSTRPATH(s) STR(s)
+// Keys for user defaults dictionary
+static NSString *X11EnableKeyEquivalentsKey = @"EnableKeyEquivalents";
+
@implementation Preferences
@@ -70,6 +73,7 @@
[NSNumber numberWithInt:0], @"SwitchKeyCode",
[NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)],
@"SwitchModifiers", @"NO", @"UseSystemBeep",
+ @"YES", X11EnableKeyEquivalentsKey,
@"YES", @"DockSwitch",
@"NO", @"AllowMouseAccelChange",
[NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor",
@@ -391,6 +395,14 @@
quartzUseSysBeep = newSystemBeep;
}
++ (void)setEnableKeyEquivalents:(BOOL)newKeyEquivs
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newKeyEquivs
+ forKey:X11EnableKeyEquivalentsKey];
+ // Update the setting used by the X server thread
+ quartzEnableKeyEquivalents = newKeyEquivs;
+}
+
+ (void)setXinerama:(BOOL)newXinerama
{
[[NSUserDefaults standardUserDefaults] setBool:newXinerama
@@ -537,6 +549,11 @@
return [[NSUserDefaults standardUserDefaults] boolForKey:@"UseSystemBeep"];
}
++ (BOOL)enableKeyEquivalents
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:X11EnableKeyEquivalentsKey];
+}
+
+ (BOOL)xinerama
{
return [[NSUserDefaults standardUserDefaults] boolForKey:@"Xinerama"];
diff --git a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
index 9dc2bb92c..109e313f3 100644
--- a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
+++ b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
@@ -334,7 +334,7 @@
<key>CFBundleExecutable</key>
<string>XDarwin</string>
<key>CFBundleGetInfoString</key>
- <string>XDarwin 1.3.0, X.Org Foundation</string>
+ <string>XDarwin 1.4.0, X.Org Foundation</string>
<key>CFBundleIconFile</key>
<string>XDarwin.icns</string>
<key>CFBundleIdentifier</key>
@@ -346,7 +346,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>XDarwin 1.3.0</string>
+ <string>XDarwin 1.4.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
diff --git a/hw/darwin/quartz/XServer.h b/hw/darwin/quartz/XServer.h
index 5fef683a8..dc6701b22 100644
--- a/hw/darwin/quartz/XServer.h
+++ b/hw/darwin/quartz/XServer.h
@@ -29,7 +29,7 @@
* sale, use or other dealings in this Software without prior written
* authorization.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.1.4.2.4.2 2004/03/04 20:16:11 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.3 2004/07/30 19:12:17 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.16 2003/11/23 06:04:01 torrey Exp $ */
#define BOOL xBOOL
@@ -39,7 +39,7 @@
#import <Cocoa/Cocoa.h>
@interface XServer : NSObject {
- // server state
+ // Server state
int serverState;
NSRecursiveLock *serverLock;
NSMutableArray *pendingClients;
@@ -49,6 +49,7 @@
BOOL quitWithoutQuery;
BOOL pendingAppQuitReply;
UInt32 mouseState;
+ unsigned short swallowedKey;
BOOL sendServerEvents;
BOOL x11Active;
@@ -73,7 +74,7 @@
- (BOOL)translateEvent:(NSEvent *)anEvent;
- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent;
-+ (void)append:(NSString *)value toEnv:(NSString *)name;
+- (NSString *)makeSafePath:(NSString *)path;
- (BOOL)loadDisplayBundle;
- (void)startX;
diff --git a/hw/darwin/quartz/XServer.m b/hw/darwin/quartz/XServer.m
index 58cba6fbc..3b30d1bf3 100644
--- a/hw/darwin/quartz/XServer.m
+++ b/hw/darwin/quartz/XServer.m
@@ -34,7 +34,7 @@
* sale, use or other dealings in this Software without prior written
* authorization.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.1.4.2.4.2 2004/03/04 20:16:11 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.3 2004/07/30 19:12:17 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.19 2003/11/24 05:39:01 torrey Exp $ */
#include "quartzCommon.h"
@@ -83,11 +83,11 @@ typedef struct {
} shellList_t;
static shellList_t const shellList[] = {
- { "csh", shell_C }, // standard C shell
- { "tcsh", shell_C }, // ... needs no introduction
- { "sh", shell_Bourne }, // standard Bourne shell
- { "zsh", shell_Bourne }, // Z shell
- { "bash", shell_Bourne }, // GNU Bourne again shell
+ { "csh", shell_C }, // standard C shell
+ { "tcsh", shell_C }, // ... needs no introduction
+ { "sh", shell_Bourne }, // standard Bourne shell
+ { "zsh", shell_Bourne }, // Z shell
+ { "bash", shell_Bourne }, // GNU Bourne again shell
{ NULL, shell_Unknown }
};
@@ -267,6 +267,7 @@ static io_connect_t root_port;
xe.u.u.type = ButtonRelease;
xe.u.u.detail = 1;
break;
+
case NSLeftMouseDown:
[self getMousePosition:&xe fromEvent:anEvent];
if (quartzRootless) {
@@ -286,6 +287,7 @@ static io_connect_t root_port;
xe.u.u.type = ButtonPress;
xe.u.u.detail = 1;
break;
+
case NSMouseMoved:
case NSLeftMouseDragged:
case NSRightMouseDragged:
@@ -293,6 +295,7 @@ static io_connect_t root_port;
[self getMousePosition:&xe fromEvent:anEvent];
xe.u.u.type = MotionNotify;
break;
+
case NSSystemDefined:
{
long hwButtons = [anEvent data2];
@@ -309,36 +312,56 @@ static io_connect_t root_port;
xe.u.clientMessage.u.l.longs1 =[anEvent data2];
break;
}
+
case NSScrollWheel:
[self getMousePosition:&xe fromEvent:anEvent];
xe.u.u.type = kXDarwinScrollWheel;
- xe.u.clientMessage.u.s.shorts0 = [anEvent deltaY];
+ xe.u.clientMessage.u.s.shorts0 = [anEvent deltaX] +
+ [anEvent deltaY];
break;
+
case NSKeyDown:
case NSKeyUp:
- if (!x11Active)
+ if (!x11Active) {
+ swallowedKey = 0;
return NO;
- // If the mouse is not on the valid X display area,
- // we don't send the X server key events.
- if (![self getMousePosition:&xe fromEvent:nil])
- return NO;
- if (type == NSKeyDown)
- xe.u.u.type = KeyPress;
- else
- xe.u.u.type = KeyRelease;
+ }
+
+ if (type == NSKeyDown) {
+ // If the mouse is not on the valid X display area,
+ // don't send the X server key events.
+ if (![self getMousePosition:&xe fromEvent:nil]) {
+ swallowedKey = [anEvent keyCode];
+ return NO;
+ }
+
+ // See if there are any global shortcuts for this key combo.
+ if (quartzEnableKeyEquivalents
+ && [[NSApp mainMenu] performKeyEquivalent:anEvent])
+ {
+ swallowedKey = [anEvent keyCode];
+ return YES;
+ }
+ } else {
+ // If the down key event was a valid key combo,
+ // don't pass the up event to X11.
+ if (swallowedKey != 0 && [anEvent keyCode] == swallowedKey) {
+ swallowedKey = 0;
+ return NO;
+ }
+ }
+
+ xe.u.u.type = (type == NSKeyDown) ? KeyPress : KeyRelease;
xe.u.u.detail = [anEvent keyCode];
break;
+
case NSFlagsChanged:
if (!x11Active)
return NO;
- [self getMousePosition:&xe fromEvent:nil];
xe.u.u.type = kXDarwinUpdateModifiers;
xe.u.clientMessage.u.l.longs0 = flags;
break;
- case NSOtherMouseDown: // undocumented MouseDown
- case NSOtherMouseUp: // undocumented MouseUp
- // Hide these from AppKit to avoid its log messages
- return YES;
+
default:
return NO;
}
@@ -395,14 +418,33 @@ static io_connect_t root_port;
}
}
-// Append a string to the given enviroment variable
-+ (void)append:(NSString*)value toEnv:(NSString*)name
+
+// Make a safe path
+//
+// Return the path in single quotes in case there are problematic characters in it.
+// We still have to worry about there being single quotes in the path. So, replace
+// all instances of the ' character in the path with '\''.
+- (NSString *)makeSafePath:(NSString *)path
{
- setenv([name cString],
- [[[NSString stringWithCString:getenv([name cString])]
- stringByAppendingString:value] cString],1);
+ NSMutableString *safePath = [NSMutableString stringWithString:path];
+ NSRange aRange = NSMakeRange(0, [safePath length]);
+
+ while (aRange.length) {
+ aRange = [safePath rangeOfString:@"'" options:0 range:aRange];
+ if (!aRange.length)
+ break;
+ [safePath replaceCharactersInRange:aRange
+ withString:@"\'\\'\'"];
+ aRange.location += 4;
+ aRange.length = [safePath length] - aRange.location;
+ }
+
+ safePath = [NSMutableString stringWithFormat:@"'%@'", safePath];
+
+ return safePath;
}
+
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Block SIGPIPE
@@ -488,13 +530,21 @@ static io_connect_t root_port;
if (![self loadDisplayBundle])
[NSApp terminate:nil];
- // In rootless mode register to receive notification of key window changes
if (quartzRootless) {
+ // We need to track whether the key window is an X11 window
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(windowBecameKey:)
name:NSWindowDidBecomeKeyNotification
object:nil];
+
+ // Request notification of screen layout changes even when this
+ // is not the active application
+ [[NSDistributedNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(applicationDidChangeScreenParameters:)
+ name:NSApplicationDidChangeScreenParametersNotification
+ object:nil];
}
// Start the X server thread
@@ -581,8 +631,7 @@ static io_connect_t root_port;
{
struct passwd *passwdUser;
NSString *shellPath, *dashShellName, *commandStr, *startXPath;
- NSMutableString *safeStartXPath;
- NSRange aRange;
+ NSString *safeStartXPath;
NSBundle *thisBundle;
const char *shellPathStr, *newargv[3], *shellNameStr;
int fd[2], outFD, length, shellType, i;
@@ -645,11 +694,11 @@ static io_connect_t root_port;
// Inside the new process:
if (fd[0] != STDIN_FILENO) {
- dup2(fd[0], STDIN_FILENO); // Take stdin from pipe
+ dup2(fd[0], STDIN_FILENO); // Take stdin from pipe
close(fd[0]);
}
- close(fd[1]); // Close write end of pipe
- if (outFD == STDOUT_FILENO) { // Setup stdout and stderr
+ close(fd[1]); // Close write end of pipe
+ if (outFD == STDOUT_FILENO) { // Setup stdout and stderr
dup2(outFD, STDERR_FILENO);
} else if (outFD == STDERR_FILENO) {
dup2(outFD, STDOUT_FILENO);
@@ -685,28 +734,14 @@ static io_connect_t root_port;
return NO;
}
- // We will run the startXClients script with the path in single quotes
- // in case there are problematic characters in the path. We still have
- // to worry about there being single quotes in the path. So, replace
- // all instances of the ' character in startXPath with '\''.
- safeStartXPath = [NSMutableString stringWithString:startXPath];
- aRange = NSMakeRange(0, [safeStartXPath length]);
- while (aRange.length) {
- aRange = [safeStartXPath rangeOfString:@"'" options:0 range:aRange];
- if (!aRange.length)
- break;
- [safeStartXPath replaceCharactersInRange:aRange
- withString:@"\'\\'\'"];
- aRange.location += 4;
- aRange.length = [safeStartXPath length] - aRange.location;
- }
+ safeStartXPath = [self makeSafePath:startXPath];
if ([Preferences addToPath]) {
- commandStr = [NSString stringWithFormat:@"'%@' :%d %@\n",
+ commandStr = [NSString stringWithFormat:@"%@ :%d %@\n",
safeStartXPath, [Preferences display],
[Preferences addToPathString]];
} else {
- commandStr = [NSString stringWithFormat:@"'%@' :%d\n",
+ commandStr = [NSString stringWithFormat:@"%@ :%d\n",
safeStartXPath, [Preferences display]];
}
@@ -726,7 +761,7 @@ static io_connect_t root_port;
// FIXME: This should be unified with startXClients
- (void)runClient:(NSString *)filename
{
- const char *command = [filename UTF8String];
+ const char *command = [[self makeSafePath:filename] UTF8String];
const char *shell;
const char *argv[5];
int child1, child2 = 0;
@@ -1177,10 +1212,10 @@ static io_connect_t root_port;
- (void)activateX11:(BOOL)state
{
if (state) {
- QuartzMessageServerThread(kXDarwinActivate, 0);
+ QuartzMessageServerThread(kXDarwinActivate, 0);
}
else {
- QuartzMessageServerThread(kXDarwinDeactivate, 0);
+ QuartzMessageServerThread(kXDarwinDeactivate, 0);
}
x11Active = state;
@@ -1311,6 +1346,12 @@ static io_connect_t root_port;
* Application Delegate Methods
*/
+- (void)applicationDidChangeScreenParameters:(NSNotification *)aNotification
+{
+ if (quartzProcs->ScreenChanged)
+ quartzProcs->ScreenChanged();
+}
+
- (void)applicationDidHide:(NSNotification *)aNotification
{
if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
diff --git a/hw/darwin/quartz/cr/crFrame.m b/hw/darwin/quartz/cr/crFrame.m
index 1ea40f0aa..81ec3688f 100644
--- a/hw/darwin/quartz/cr/crFrame.m
+++ b/hw/darwin/quartz/cr/crFrame.m
@@ -27,6 +27,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.2 2004/04/23 19:15:51 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.9 2004/03/19 02:05:29 torrey Exp $ */
#include "quartzCommon.h"
diff --git a/hw/darwin/quartz/cr/crScreen.m b/hw/darwin/quartz/cr/crScreen.m
index 6b5a2c8cf..1006e0adc 100644
--- a/hw/darwin/quartz/cr/crScreen.m
+++ b/hw/darwin/quartz/cr/crScreen.m
@@ -1,10 +1,10 @@
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.1.4.2.4.2 2004/03/04 17:47:30 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.4 2004/08/12 20:24:36 torrey Exp $ */
/*
* Cocoa rootless implementation initialization
*/
/*
* Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
+ * Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -47,6 +47,9 @@
#include "scrnintstr.h"
#include "picturestr.h"
#include "globals.h"
+#ifdef DAMAGE
+# include "damage.h"
+#endif
#undef BOOL
// Name of GLX bundle using AGL framework
@@ -79,6 +82,79 @@ CRDisplayInit(void)
/*
+ * CRAddPseudoramiXScreens
+ * Add a single virtual screen encompassing all the physical screens
+ * with PseudoramiX.
+ */
+static void
+CRAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
+{
+ int i;
+ NSRect unionRect = NSMakeRect(0, 0, 0, 0);
+ NSArray *screens = [NSScreen screens];
+
+ // Get the union of all screens (minus the menu bar on main screen)
+ for (i = 0; i < [screens count]; i++) {
+ NSScreen *screen = [screens objectAtIndex:i];
+ NSRect frame = [screen frame];
+ frame.origin.y = [[NSScreen mainScreen] frame].size.height -
+ frame.size.height - frame.origin.y;
+ if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
+ frame.origin.y += aquaMenuBarHeight;
+ frame.size.height -= aquaMenuBarHeight;
+ }
+ unionRect = NSUnionRect(unionRect, frame);
+ }
+
+ // Use unionRect as the screen size for the X server.
+ *x = unionRect.origin.x;
+ *y = unionRect.origin.y;
+ *width = unionRect.size.width;
+ *height = unionRect.size.height;
+
+ // Tell PseudoramiX about the real screens.
+ // InitOutput() will move the big screen to (0,0),
+ // so compensate for that here.
+ for (i = 0; i < [screens count]; i++) {
+ NSScreen *screen = [screens objectAtIndex:i];
+ NSRect frame = [screen frame];
+ int j;
+
+ // Skip this screen if it's a mirrored copy of an earlier screen.
+ for (j = 0; j < i; j++) {
+ if (NSEqualRects(frame, [[screens objectAtIndex:j] frame])) {
+ ErrorF("PseudoramiX screen %d is a mirror of screen %d.\n",
+ i, j);
+ break;
+ }
+ }
+ if (j < i) continue; // this screen is a mirrored copy
+
+ frame.origin.y = [[NSScreen mainScreen] frame].size.height -
+ frame.size.height - frame.origin.y;
+
+ if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
+ frame.origin.y += aquaMenuBarHeight;
+ frame.size.height -= aquaMenuBarHeight;
+ }
+
+ ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i,
+ (int)frame.size.width, (int)frame.size.height,
+ (int)frame.origin.x, (int)frame.origin.y);
+
+ frame.origin.x -= unionRect.origin.x;
+ frame.origin.y -= unionRect.origin.y;
+
+ ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n",
+ i, (int)frame.origin.x, (int)frame.origin.y);
+
+ PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
+ frame.size.width, frame.size.height);
+ }
+}
+
+
+/*
* CRScreenParams
* Set the basic screen parameters.
*/
@@ -100,7 +176,6 @@ CRScreenParams(int index, DarwinFramebufferPtr dfb)
dfb->width = NSWidth(frame);
dfb->height = NSHeight(frame);
- dfb->pitch = (dfb->width) * (dfb->bitsPerPixel) / 8;
// Shift the usable part of main screen down to avoid the menu bar.
if (NSEqualRects(frame, [[NSScreen mainScreen] frame])) {
@@ -109,69 +184,7 @@ CRScreenParams(int index, DarwinFramebufferPtr dfb)
}
} else {
- int i;
- NSRect unionRect = NSMakeRect(0, 0, 0, 0);
- NSArray *screens = [NSScreen screens];
-
- // Get the union of all screens (minus the menu bar on main screen)
- for (i = 0; i < [screens count]; i++) {
- NSScreen *screen = [screens objectAtIndex:i];
- NSRect frame = [screen frame];
- frame.origin.y = [[NSScreen mainScreen] frame].size.height -
- frame.size.height - frame.origin.y;
- if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
- frame.origin.y += aquaMenuBarHeight;
- frame.size.height -= aquaMenuBarHeight;
- }
- unionRect = NSUnionRect(unionRect, frame);
- }
-
- // Use unionRect as the screen size for the X server.
- dfb->x = unionRect.origin.x;
- dfb->y = unionRect.origin.y;
- dfb->width = unionRect.size.width;
- dfb->height = unionRect.size.height;
- dfb->pitch = (dfb->width) * (dfb->bitsPerPixel) / 8;
-
- // Tell PseudoramiX about the real screens.
- // InitOutput() will move the big screen to (0,0),
- // so compensate for that here.
- for (i = 0; i < [screens count]; i++) {
- NSScreen *screen = [screens objectAtIndex:i];
- NSRect frame = [screen frame];
- int j;
-
- // Skip this screen if it's a mirrored copy of an earlier screen.
- for (j = 0; j < i; j++) {
- if (NSEqualRects(frame, [[screens objectAtIndex:j] frame])) {
- ErrorF("PseudoramiX screen %d is a mirror of screen %d.\n",
- i, j);
- break;
- }
- }
- if (j < i) continue; // this screen is a mirrored copy
-
- frame.origin.y = [[NSScreen mainScreen] frame].size.height -
- frame.size.height - frame.origin.y;
-
- if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
- frame.origin.y += aquaMenuBarHeight;
- frame.size.height -= aquaMenuBarHeight;
- }
-
- ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i,
- (int)frame.size.width, (int)frame.size.height,
- (int)frame.origin.x, (int)frame.origin.y);
-
- frame.origin.x -= unionRect.origin.x;
- frame.origin.y -= unionRect.origin.y;
-
- ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n",
- i, (int)frame.origin.x, (int)frame.origin.y);
-
- PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
- frame.size.width, frame.size.height);
- }
+ CRAddPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height);
}
}
@@ -195,8 +208,11 @@ CRAddScreen(int index, ScreenPtr pScreen)
dfb->colorType = TrueColor;
- // No frame buffer - it's all in window pixmaps.
- dfb->framebuffer = NULL; // malloc(dfb.pitch * dfb.height);
+ /* Passing zero width (pitch) makes miCreateScreenResources set the
+ screen pixmap to the framebuffer pointer, i.e. NULL. The generic
+ rootless code takes care of making this work. */
+ dfb->pitch = 0;
+ dfb->framebuffer = NULL;
// Get all CoreGraphics displays covered by this X11 display.
cgRect = CGRectMake(dfb->x, dfb->y, dfb->width, dfb->height);
@@ -245,12 +261,47 @@ CRSetupScreen(int index, ScreenPtr pScreen)
}
#endif /* RENDER */
+#ifdef DAMAGE
+ // The Damage extension needs to wrap underneath the
+ // generic rootless layer, so do it now.
+ if (!DamageSetup(pScreen))
+ return FALSE;
+#endif
+
// Initialize generic rootless code
return CRInit(pScreen);
}
/*
+ * CRScreenChanged
+ * Configuration of displays has changed.
+ */
+static void
+CRScreenChanged(void)
+{
+ QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
+}
+
+
+/*
+ * CRUpdateScreen
+ * Update screen after configuation change.
+ */
+static void
+CRUpdateScreen(ScreenPtr pScreen)
+{
+ rootlessGlobalOffsetX = darwinMainScreenX;
+ rootlessGlobalOffsetY = darwinMainScreenY;
+
+ AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]);
+
+ RootlessRepositionWindows(pScreen);
+ RootlessUpdateScreenPixmap(pScreen);
+}
+
+
+/*
* CRInitInput
* Finalize CR specific setup.
*/
@@ -300,11 +351,14 @@ static QuartzModeProcsRec crModeProcs = {
QuartzResumeXCursor,
NULL, // No capture or release in rootless mode
NULL,
+ CRScreenChanged,
+ CRAddPseudoramiXScreens,
+ CRUpdateScreen,
CRIsX11Window,
NULL, // Cocoa NSWindows hide themselves
RootlessFrameForWindow,
TopLevelParent,
- NULL, // No support for DRI surfaces
+ NULL, // No support for DRI surfaces
NULL
};
diff --git a/hw/darwin/quartz/fullscreen/fullscreen.c b/hw/darwin/quartz/fullscreen/fullscreen.c
index 54223e85e..05542eafe 100644
--- a/hw/darwin/quartz/fullscreen/fullscreen.c
+++ b/hw/darwin/quartz/fullscreen/fullscreen.c
@@ -25,7 +25,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c,v 1.1.4.2.4.2 2004/03/04 20:16:14 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c,v 1.3 2004/07/30 19:12:18 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c,v 1.3 2003/11/27 01:59:53 torrey Exp $ */
#include "quartzCommon.h"
@@ -261,7 +261,7 @@ static void FSSuspendScreen(
*/
static void FSResumeScreen(
ScreenPtr pScreen,
- int x, // cursor location
+ int x, // cursor location
int y )
{
QuartzResumeXCursor(pScreen, x, y);
@@ -537,18 +537,21 @@ static QuartzModeProcsRec fsModeProcs = {
FSDisplayInit,
FSAddScreen,
FSSetupScreen,
- NULL, // Not needed
+ NULL, // Not needed
QuartzInitCursor,
QuartzReallySetCursor,
FSSuspendScreen,
FSResumeScreen,
FSCapture,
FSRelease,
- NULL, // No rootless code in fullscreen
+ NULL, // No dynamic screen change support
NULL,
NULL,
+ NULL, // No rootless code in fullscreen
NULL,
- NULL, // No support for DRI surfaces
+ NULL,
+ NULL,
+ NULL, // No support for DRI surfaces
NULL
};
@@ -561,6 +564,6 @@ Bool
QuartzModeBundleInit(void)
{
quartzProcs = &fsModeProcs;
- quartzOpenGLBundle = NULL; // Only Mesa support for now
+ quartzOpenGLBundle = NULL; // Only Mesa support for now
return TRUE;
}
diff --git a/hw/darwin/quartz/pseudoramiX.c b/hw/darwin/quartz/pseudoramiX.c
index 2dd7c3ae5..9f71eae89 100644
--- a/hw/darwin/quartz/pseudoramiX.c
+++ b/hw/darwin/quartz/pseudoramiX.c
@@ -32,7 +32,7 @@ shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from Digital
Equipment Corporation.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.3 2003/04/30 23:15:39 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.4 2004/07/02 01:30:33 torrey Exp $ */
#include "pseudoramiX.h"
@@ -111,11 +111,15 @@ void PseudoramiXExtensionInit(int argc, char *argv[])
if (noPseudoramiXExtension) return;
+ /* Even with only one screen we need to enable PseudoramiX to allow
+ dynamic screen configuration changes. */
+#if 0
if (pseudoramiXNumScreens == 1) {
// Only one screen - disable Xinerama extension.
noPseudoramiXExtension = TRUE;
return;
}
+#endif
// The server must not run the PanoramiX operations.
noPanoramiXExtension = TRUE;
@@ -142,12 +146,18 @@ void PseudoramiXExtensionInit(int argc, char *argv[])
}
-static void PseudoramiXResetProc(ExtensionEntry *extEntry)
+void PseudoramiXResetScreens(void)
{
pseudoramiXNumScreens = 0;
}
+static void PseudoramiXResetProc(ExtensionEntry *extEntry)
+{
+ PseudoramiXResetScreens();
+}
+
+
// was PanoramiX
static int ProcPseudoramiXQueryVersion(ClientPtr client)
{
diff --git a/hw/darwin/quartz/pseudoramiX.h b/hw/darwin/quartz/pseudoramiX.h
index 23738cfb3..c2943369d 100644
--- a/hw/darwin/quartz/pseudoramiX.h
+++ b/hw/darwin/quartz/pseudoramiX.h
@@ -1,9 +1,10 @@
/*
* Minimal implementation of PanoramiX/Xinerama
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h,v 1.2 2003/04/30 23:15:39 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h,v 1.3 2004/07/02 01:30:33 torrey Exp $ */
extern int noPseudoramiXExtension;
void PseudoramiXAddScreen(int x, int y, int w, int h);
void PseudoramiXExtensionInit(int argc, char *argv[]);
+void PseudoramiXResetScreens(void);
diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c
index e7bdb0049..22151198a 100644
--- a/hw/darwin/quartz/quartz.c
+++ b/hw/darwin/quartz/quartz.c
@@ -1,11 +1,11 @@
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.1.4.3.4.2 2004/03/04 17:47:30 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.3 2004/07/30 19:12:17 torrey Exp $ */
/**************************************************************
*
* Quartz-specific support for the Darwin X Server
*
**************************************************************/
/*
- * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
+ * Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -30,7 +30,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.13 2003/11/12 20:21:51 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.16 2004/07/02 01:30:33 torrey Exp $ */
#include "quartzCommon.h"
#include "quartz.h"
@@ -43,7 +43,9 @@
// X headers
#include "scrnintstr.h"
+#include "windowstr.h"
#include "colormapst.h"
+#include "globals.h"
// System headers
#include <sys/types.h>
@@ -57,6 +59,7 @@ int quartzStartClients = 1;
int quartzRootless = -1;
int quartzUseSysBeep = 0;
int quartzUseAGL = 1;
+int quartzEnableKeyEquivalents = 1;
int quartzServerVisible = TRUE;
int quartzServerQuitting = FALSE;
int quartzScreenIndex = 0;
@@ -166,13 +169,78 @@ void DarwinModeInitInput(
/*
+ * QuartzUpdateScreens
+ * Adjust for screen arrangement changes.
+ */
+static void QuartzUpdateScreens(void)
+{
+ ScreenPtr pScreen;
+ WindowPtr pRoot;
+ int x, y, width, height, sx, sy;
+ xEvent e;
+
+ if (noPseudoramiXExtension || screenInfo.numScreens != 1)
+ {
+ /* FIXME: if not using Xinerama, we have multiple screens, and
+ to do this properly may need to add or remove screens. Which
+ isn't possible. So don't do anything. Another reason why
+ we default to running with Xinerama. */
+
+ return;
+ }
+
+ pScreen = screenInfo.screens[0];
+
+ PseudoramiXResetScreens();
+ quartzProcs->AddPseudoramiXScreens(&x, &y, &width, &height);
+
+ dixScreenOrigins[pScreen->myNum].x = x;
+ dixScreenOrigins[pScreen->myNum].y = y;
+ pScreen->mmWidth = pScreen->mmWidth * ((double) width / pScreen->width);
+ pScreen->mmHeight = pScreen->mmHeight * ((double) height / pScreen->height);
+ pScreen->width = width;
+ pScreen->height = height;
+
+ /* FIXME: should probably do something with RandR here. */
+
+ DarwinAdjustScreenOrigins(&screenInfo);
+ quartzProcs->UpdateScreen(pScreen);
+
+ sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
+ sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
+
+ /* Adjust the root window. */
+ pRoot = WindowTable[pScreen->myNum];
+ AppleWMSetScreenOrigin(pRoot);
+ pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL);
+ pScreen->PaintWindowBackground(pRoot, &pRoot->borderClip, PW_BACKGROUND);
+// QuartzIgnoreNextWarpCursor();
+ DefineInitialRootWindow(pRoot);
+
+ /* Send an event for the root reconfigure */
+ e.u.u.type = ConfigureNotify;
+ e.u.configureNotify.window = pRoot->drawable.id;
+ e.u.configureNotify.aboveSibling = None;
+ e.u.configureNotify.x = x - sx;
+ e.u.configureNotify.y = y - sy;
+ e.u.configureNotify.width = width;
+ e.u.configureNotify.height = height;
+ e.u.configureNotify.borderWidth = wBorderWidth(pRoot);
+ e.u.configureNotify.override = pRoot->overrideRedirect;
+ DeliverEvents(pRoot, &e, 1, NullWindow);
+
+ /* FIXME: Should we use RREditConnectionInfo(pScreen)? */
+}
+
+
+/*
* QuartzShow
* Show the X server on screen. Does nothing if already shown.
* Calls mode specific screen resume to restore the X clip regions
* (if needed) and the X server cursor state.
*/
static void QuartzShow(
- int x, // cursor location
+ int x, // cursor location
int y )
{
int i;
@@ -252,10 +320,10 @@ QuartzMessageServerThread(
max_args = 4;
if (argc > 0 && argc <= max_args) {
- va_start (args, argc);
- for (i = 0; i < argc; i++)
- argv[i] = (int) va_arg (args, int);
- va_end (args);
+ va_start (args, argc);
+ for (i = 0; i < argc; i++)
+ argv[i] = (int) va_arg (args, int);
+ va_end (args);
}
DarwinEQEnqueue(&xe);
@@ -308,8 +376,8 @@ void DarwinModeProcessEvent(
case kXDarwinControllerNotify:
AppleWMSendEvent(AppleWMControllerNotify,
AppleWMControllerNotifyMask,
- xe->u.clientMessage.u.l.longs0,
- xe->u.clientMessage.u.l.longs1);
+ xe->u.clientMessage.u.l.longs0,
+ xe->u.clientMessage.u.l.longs1);
break;
case kXDarwinPasteboardNotify:
@@ -320,6 +388,9 @@ void DarwinModeProcessEvent(
break;
case kXDarwinDisplayChanged:
+ QuartzUpdateScreens();
+ break;
+
case kXDarwinWindowState:
case kXDarwinWindowMoved:
// FIXME: Not implemented yet
diff --git a/hw/darwin/quartz/quartz.h b/hw/darwin/quartz/quartz.h
index 3961fe031..cee43325d 100644
--- a/hw/darwin/quartz/quartz.h
+++ b/hw/darwin/quartz/quartz.h
@@ -30,7 +30,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.1.4.2.4.2 2004/03/04 20:16:11 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.3 2004/07/30 19:12:17 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.7 2003/11/12 20:21:51 torrey Exp $ */
#ifndef _QUARTZ_H
@@ -68,6 +68,13 @@ typedef void (*CaptureScreensProc)(void);
typedef void (*ReleaseScreensProc)(void);
/*
+ * Screen state change support
+ */
+typedef void (*ScreenChangedProc)(void);
+typedef void (*AddPseudoramiXScreensProc)(int *x, int *y, int *width, int *height);
+typedef void (*UpdateScreenProc)(ScreenPtr pScreen);
+
+/*
* Rootless helper functions
*/
typedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber);
@@ -104,6 +111,10 @@ typedef struct _QuartzModeProcs {
CaptureScreensProc CaptureScreens; // Only called in fullscreen
ReleaseScreensProc ReleaseScreens; // Only called in fullscreen
+ ScreenChangedProc ScreenChanged;
+ AddPseudoramiXScreensProc AddPseudoramiXScreens;
+ UpdateScreenProc UpdateScreen;
+
IsX11WindowProc IsX11Window;
HideWindowsProc HideWindows;
diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m
index 6adbaafba..52832ccd6 100644
--- a/hw/darwin/quartz/quartzCocoa.m
+++ b/hw/darwin/quartz/quartzCocoa.m
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.1.4.3.2.2 2004/03/04 17:47:30 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.3 2004/07/30 19:12:17 torrey Exp $ */
/**************************************************************
*
* Quartz-specific support for the Darwin X Server
@@ -9,7 +9,7 @@
*
**************************************************************/
/*
- * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
+ * Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -34,7 +34,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.3 2003/01/19 06:52:54 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */
#include "quartzCommon.h"
@@ -65,6 +65,7 @@ void QuartzReadPreferences(void)
darwinFakeMouse3Mask = [Preferences button3Mask];
darwinMouseAccelChange = [Preferences mouseAccelChange];
quartzUseSysBeep = [Preferences systemBeep];
+ quartzEnableKeyEquivalents = [Preferences enableKeyEquivalents];
// quartzRootless has already been set
if (quartzRootless) {
diff --git a/hw/darwin/quartz/quartzCommon.h b/hw/darwin/quartz/quartzCommon.h
index a09475d31..949f724c1 100644
--- a/hw/darwin/quartz/quartzCommon.h
+++ b/hw/darwin/quartz/quartzCommon.h
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.1.4.2.4.2 2004/03/04 17:47:30 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.3 2004/07/30 19:12:17 torrey Exp $ */
/*
* quartzCommon.h
*
@@ -7,7 +7,7 @@
* This file should be included before any X11 or IOKit headers
* so that it can avoid symbol conflicts.
*
- * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
+ * Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -32,7 +32,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.13 2003/10/16 23:50:10 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.15 2004/06/08 22:58:10 torrey Exp $ */
#ifndef _QUARTZCOMMON_H
#define _QUARTZCOMMON_H
@@ -70,6 +70,7 @@ extern int quartzStartClients;
extern int quartzRootless;
extern int quartzUseSysBeep;
extern int quartzUseAGL;
+extern int quartzEnableKeyEquivalents;
// Other shared data
extern int quartzServerVisible;
@@ -104,4 +105,4 @@ enum {
kQuartzSetCanQuit
};
-#endif /* _QUARTZCOMMON_H */
+#endif /* _QUARTZCOMMON_H */
diff --git a/hw/darwin/quartz/xpr/xpr.h b/hw/darwin/quartz/xpr/xpr.h
index ab9b9fd42..5b881c725 100644
--- a/hw/darwin/quartz/xpr/xpr.h
+++ b/hw/darwin/quartz/xpr/xpr.h
@@ -26,7 +26,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h,v 1.1.4.1.4.2 2004/03/04 20:16:15 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h,v 1.2 2004/04/23 19:16:52 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h,v 1.4 2003/11/12 20:21:52 torrey Exp $ */
#ifndef XPR_H
diff --git a/hw/darwin/quartz/xpr/xprFrame.c b/hw/darwin/quartz/xpr/xprFrame.c
index 0bf104a09..089f18c71 100644
--- a/hw/darwin/quartz/xpr/xprFrame.c
+++ b/hw/darwin/quartz/xpr/xprFrame.c
@@ -27,7 +27,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.1.4.1.4.2 2004/03/04 20:16:15 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.2 2004/04/23 19:16:52 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.4 2003/11/12 20:21:52 torrey Exp $ */
#include "xpr.h"
diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/darwin/quartz/xpr/xprScreen.c
index 3adb62a63..5c77756fd 100644
--- a/hw/darwin/quartz/xpr/xprScreen.c
+++ b/hw/darwin/quartz/xpr/xprScreen.c
@@ -1,10 +1,10 @@
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c,v 1.1.4.2.4.2 2004/03/04 17:47:30 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c,v 1.4 2004/08/12 20:24:36 torrey Exp $ */
/*
* Xplugin rootless implementation screen functions
*/
/*
* Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
+ * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -28,7 +28,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c,v 1.8 2003/11/12 20:21:52 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c,v 1.11 2004/07/15 18:53:25 torrey Exp $ */
#include "quartzCommon.h"
#include "quartz.h"
@@ -42,6 +42,10 @@
#include "Xplugin.h"
#include "applewmExt.h"
+#ifdef DAMAGE
+# include "damage.h"
+#endif
+
// Name of GLX bundle for native OpenGL
static const char *xprOpenGLBundle = "glxCGL.bundle";
@@ -57,41 +61,42 @@ eventHandler(unsigned int type, const void *arg,
switch (type)
{
case XP_EVENT_DISPLAY_CHANGED:
- QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
- break;
+ QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
+ break;
case XP_EVENT_WINDOW_STATE_CHANGED:
- if (arg_size >= sizeof(xp_window_state_event))
+ if (arg_size >= sizeof(xp_window_state_event))
{
- const xp_window_state_event *ws_arg = arg;
- QuartzMessageServerThread(kXDarwinWindowState, 2,
+ const xp_window_state_event *ws_arg = arg;
+
+ QuartzMessageServerThread(kXDarwinWindowState, 2,
ws_arg->id, ws_arg->state);
- }
- break;
+ }
+ break;
case XP_EVENT_WINDOW_MOVED:
- if (arg_size == sizeof(xp_window_id))
- {
- xp_window_id id = * (xp_window_id *) arg;
+ if (arg_size == sizeof(xp_window_id))
+ {
+ xp_window_id id = * (xp_window_id *) arg;
- QuartzMessageServerThread(kXDarwinWindowMoved, 1, id);
- }
- break;
+ QuartzMessageServerThread(kXDarwinWindowMoved, 1, id);
+ }
+ break;
case XP_EVENT_SURFACE_DESTROYED:
case XP_EVENT_SURFACE_CHANGED:
- if (arg_size == sizeof(xp_surface_id))
- {
- int kind;
-
- if (type == XP_EVENT_SURFACE_DESTROYED)
- kind = AppleDRISurfaceNotifyDestroyed;
- else
- kind = AppleDRISurfaceNotifyChanged;
-
- DRISurfaceNotify(*(xp_surface_id *) arg, kind);
- }
- break;
+ if (arg_size == sizeof(xp_surface_id))
+ {
+ int kind;
+
+ if (type == XP_EVENT_SURFACE_DESTROYED)
+ kind = AppleDRISurfaceNotifyDestroyed;
+ else
+ kind = AppleDRISurfaceNotifyChanged;
+
+ DRISurfaceNotify(*(xp_surface_id *) arg, kind);
+ }
+ break;
}
}
@@ -139,11 +144,12 @@ displayScreenBounds(CGDirectDisplayID id)
/*
- * addPseudoramiXScreens
- * Add a physical screen with PseudoramiX.
+ * xprAddPseudoramiXScreens
+ * Add a single virtual screen encompassing all the physical screens
+ * with PseudoramiX.
*/
static void
-addPseudoramiXScreens(int *x, int *y, int *width, int *height)
+xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
{
CGDisplayCount i, displayCount;
CGDirectDisplayID *displayList = NULL;
@@ -286,7 +292,7 @@ xprAddScreen(int index, ScreenPtr pScreen)
}
else
{
- addPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height);
+ xprAddPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height);
}
/* Passing zero width (pitch) makes miCreateScreenResources set the
@@ -319,6 +325,13 @@ xprSetupScreen(int index, ScreenPtr pScreen)
}
#endif /* RENDER */
+#ifdef DAMAGE
+ // The Damage extension needs to wrap underneath the
+ // generic rootless layer, so do it now.
+ if (!DamageSetup(pScreen))
+ return FALSE;
+#endif
+
// Initialize generic rootless code
if (!xprInit(pScreen))
return FALSE;
@@ -328,6 +341,23 @@ xprSetupScreen(int index, ScreenPtr pScreen)
/*
+ * xprUpdateScreen
+ * Update screen after configuation change.
+ */
+static void
+xprUpdateScreen(ScreenPtr pScreen)
+{
+ rootlessGlobalOffsetX = darwinMainScreenX;
+ rootlessGlobalOffsetY = darwinMainScreenY;
+
+ AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]);
+
+ RootlessRepositionWindows(pScreen);
+ RootlessUpdateScreenPixmap(pScreen);
+}
+
+
+/*
* xprInitInput
* Finalize xpr specific setup.
*/
@@ -358,6 +388,9 @@ static QuartzModeProcsRec xprModeProcs = {
QuartzResumeXCursor,
NULL, // No capture or release in rootless mode
NULL,
+ NULL, // Xplugin sends screen change events directly
+ xprAddPseudoramiXScreens,
+ xprUpdateScreen,
xprIsX11Window,
xprHideWindows,
RootlessFrameForWindow,
diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c
new file mode 100644
index 000000000..14b7d9858
--- /dev/null
+++ b/hw/dmx/dmx.c
@@ -0,0 +1,1129 @@
+/* $XFree86$ */
+/*
+ * Copyright 2002-2004 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>
+ *
+ */
+
+/** \file
+ * This file implements the server-side part of the DMX protocol. A
+ * vector of fucntions is provided at extension initialization time, so
+ * most all of the useful functions in this file are declared static and
+ * do not appear in the doxygen documentation.
+ *
+ * Much of the low-level work is done by functions in #dmxextension.c
+ *
+ * Please see the Client-to-Server DMX Extension to the X Protocol
+ * document for details about the protocol. */
+
+#include "X.h"
+#include "Xproto.h"
+#include "misc.h"
+#include "os.h"
+#include "dixstruct.h"
+#define EXTENSION_PROC_ARGS void *
+#include "extnsionst.h"
+#include "opaque.h"
+
+#include "dmxextension.h"
+#include "dmxproto.h"
+
+#define _DMX_SERVER_
+#include "dmxext.h"
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+extern unsigned long XRT_WINDOW;
+extern int PanoramiXNumScreens;
+#endif
+
+extern void DMXExtensionInit(void);
+
+static unsigned char DMXCode;
+
+static DISPATCH_PROC(ProcDMXDispatch);
+static DISPATCH_PROC(ProcDMXQueryVersion);
+static DISPATCH_PROC(ProcDMXSync);
+static DISPATCH_PROC(ProcDMXForceWindowCreation);
+static DISPATCH_PROC(ProcDMXGetScreenCount);
+static DISPATCH_PROC(ProcDMXGetScreenAttributes);
+static DISPATCH_PROC(ProcDMXChangeScreensAttributes);
+static DISPATCH_PROC(ProcDMXAddScreen);
+static DISPATCH_PROC(ProcDMXRemoveScreen);
+static DISPATCH_PROC(ProcDMXGetWindowAttributes);
+static DISPATCH_PROC(ProcDMXGetDesktopAttributes);
+static DISPATCH_PROC(ProcDMXChangeDesktopAttributes);
+static DISPATCH_PROC(ProcDMXGetInputCount);
+static DISPATCH_PROC(ProcDMXGetInputAttributes);
+static DISPATCH_PROC(ProcDMXAddInput);
+static DISPATCH_PROC(ProcDMXRemoveInput);
+
+static DISPATCH_PROC(SProcDMXDispatch);
+static DISPATCH_PROC(SProcDMXQueryVersion);
+static DISPATCH_PROC(SProcDMXSync);
+static DISPATCH_PROC(SProcDMXForceWindowCreation);
+static DISPATCH_PROC(SProcDMXGetScreenCount);
+static DISPATCH_PROC(SProcDMXGetScreenAttributes);
+static DISPATCH_PROC(SProcDMXChangeScreensAttributes);
+static DISPATCH_PROC(SProcDMXAddScreen);
+static DISPATCH_PROC(SProcDMXRemoveScreen);
+static DISPATCH_PROC(SProcDMXGetWindowAttributes);
+static DISPATCH_PROC(SProcDMXGetDesktopAttributes);
+static DISPATCH_PROC(SProcDMXChangeDesktopAttributes);
+static DISPATCH_PROC(SProcDMXGetInputCount);
+static DISPATCH_PROC(SProcDMXGetInputAttributes);
+static DISPATCH_PROC(SProcDMXAddInput);
+static DISPATCH_PROC(SProcDMXRemoveInput);
+
+static int _DMXXineramaActive(void)
+{
+#ifdef PANORAMIX
+ return !noPanoramiXExtension;
+#endif
+ return 0;
+}
+
+static void DMXResetProc(ExtensionEntry *extEntry)
+{
+}
+
+/** Initialize the extension. */
+void DMXExtensionInit(void)
+{
+ ExtensionEntry *extEntry;
+
+ if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
+ ProcDMXDispatch, SProcDMXDispatch,
+ DMXResetProc, StandardMinorOpcode)))
+ DMXCode = extEntry->base;
+}
+
+static void dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr,
+ CARD32 value)
+{
+ switch (1 << bit) {
+ case DMXScreenWindowWidth: attr->screenWindowWidth = value; break;
+ case DMXScreenWindowHeight: attr->screenWindowHeight = value; break;
+ case DMXScreenWindowXoffset: attr->screenWindowXoffset = value; break;
+ case DMXScreenWindowYoffset: attr->screenWindowYoffset = value; break;
+ case DMXRootWindowWidth: attr->rootWindowWidth = value; break;
+ case DMXRootWindowHeight: attr->rootWindowHeight = value; break;
+ case DMXRootWindowXoffset: attr->rootWindowXoffset = value; break;
+ case DMXRootWindowYoffset: attr->rootWindowYoffset = value; break;
+ case DMXRootWindowXorigin: attr->rootWindowXorigin = value; break;
+ case DMXRootWindowYorigin: attr->rootWindowYorigin = value; break;
+ }
+}
+
+static int dmxFetchScreenAttributes(unsigned int mask,
+ DMXScreenAttributesPtr attr,
+ CARD32 *value_list)
+{
+ int i;
+ CARD32 *value = value_list;
+ int count = 0;
+
+ for (i = 0; i < 32; i++) {
+ if (mask & (1 << i)) {
+ dmxSetScreenAttribute(i, attr, *value);
+ ++value;
+ ++count;
+ }
+ }
+ return count;
+}
+
+static void dmxSetDesktopAttribute(int bit, DMXDesktopAttributesPtr attr,
+ CARD32 value)
+{
+ switch (1 << bit) {
+ case DMXDesktopWidth: attr->width = value; break;
+ case DMXDesktopHeight: attr->height = value; break;
+ case DMXDesktopShiftX: attr->shiftX = value; break;
+ case DMXDesktopShiftY: attr->shiftY = value; break;
+ }
+}
+
+static int dmxFetchDesktopAttributes(unsigned int mask,
+ DMXDesktopAttributesPtr attr,
+ CARD32 *value_list)
+{
+ int i;
+ CARD32 *value = value_list;
+ int count = 0;
+
+ for (i = 0; i < 32; i++) {
+ if (mask & (1 << i)) {
+ dmxSetDesktopAttribute(i, attr, *value);
+ ++value;
+ ++count;
+ }
+ }
+ return count;
+}
+
+static void dmxSetInputAttribute(int bit, DMXInputAttributesPtr attr,
+ CARD32 value)
+{
+ switch (1 << bit) {
+ case DMXInputType: attr->inputType = value; break;
+ case DMXInputPhysicalScreen: attr->physicalScreen = value; break;
+ case DMXInputSendsCore: attr->sendsCore = !!value; break;
+ }
+}
+
+static int dmxFetchInputAttributes(unsigned int mask,
+ DMXInputAttributesPtr attr,
+ CARD32 *value_list)
+{
+ int i;
+ CARD32 *value = value_list;
+ int count = 0;
+
+ for (i = 0; i < 32; i++) {
+ if (mask & (1 << i)) {
+ dmxSetInputAttribute(i, attr, *value);
+ ++value;
+ ++count;
+ }
+ }
+ return count;
+}
+
+static int ProcDMXQueryVersion(ClientPtr client)
+{
+ xDMXQueryVersionReply rep;
+ int n;
+
+ REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.majorVersion = DMX_EXTENSION_MAJOR;
+ rep.minorVersion = DMX_EXTENSION_MINOR;
+ rep.patchVersion = DMX_EXTENSION_PATCH;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.majorVersion, n);
+ swapl(&rep.minorVersion, n);
+ swapl(&rep.patchVersion, n);
+ }
+ WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *)&rep);
+ return client->noClientException;
+}
+
+static int ProcDMXSync(ClientPtr client)
+{
+ xDMXSyncReply rep;
+ int n;
+
+ REQUEST_SIZE_MATCH(xDMXSyncReq);
+
+ dmxFlushPendingSyncs();
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = 0;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.status, n);
+ }
+ WriteToClient(client, sizeof(xDMXSyncReply), (char *)&rep);
+ return client->noClientException;
+}
+
+static int ProcDMXForceWindowCreation(ClientPtr client)
+{
+ xDMXForceWindowCreationReply rep;
+ REQUEST(xDMXForceWindowCreationReq);
+ WindowPtr pWin;
+ int n;
+
+ REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
+
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension) {
+ PanoramiXRes *win;
+ int i;
+
+ if (!(win = SecurityLookupIDByType(client, stuff->window, XRT_WINDOW,
+ SecurityReadAccess)))
+ return -1; /* BadWindow */
+
+ FOR_NSCREENS(i) {
+ if (!(pWin = SecurityLookupWindow(win->info[i].id, client,
+ SecurityReadAccess)))
+ return -1; /* BadWindow */
+
+ dmxForceWindowCreation(pWin);
+ }
+ goto doreply;
+ }
+#endif
+
+ if (!(pWin = SecurityLookupWindow(stuff->window, client,
+ SecurityReadAccess)))
+ return -1; /* BadWindow */
+
+ dmxForceWindowCreation(pWin);
+ doreply:
+ dmxFlushPendingSyncs();
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = 0;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.status, n);
+ }
+ WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXGetScreenCount(ClientPtr client)
+{
+ xDMXGetScreenCountReply rep;
+ int n;
+
+ REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.screenCount = dmxGetNumScreens();
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.screenCount, n);
+ }
+ WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *)&rep);
+ return client->noClientException;
+}
+
+static int ProcDMXGetScreenAttributes(ClientPtr client)
+{
+ REQUEST(xDMXGetScreenAttributesReq);
+ xDMXGetScreenAttributesReply rep;
+ int n;
+ int length;
+ int paddedLength;
+ DMXScreenAttributesRec attr;
+
+ REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
+
+ if (stuff->physicalScreen < 0
+ || stuff->physicalScreen >= dmxGetNumScreens()) return BadValue;
+
+ 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 = (length + 3) & ~3;
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = paddedLength >> 2;
+ rep.displayNameLength = length;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.displayNameLength, n);
+ swapl(&rep.logicalScreen, n);
+ swaps(&rep.screenWindowWidth, n);
+ swaps(&rep.screenWindowHeight, n);
+ swaps(&rep.screenWindowXoffset, n);
+ swaps(&rep.screenWindowYoffset, n);
+ swaps(&rep.rootWindowWidth, n);
+ swaps(&rep.rootWindowHeight, n);
+ swaps(&rep.rootWindowXoffset, n);
+ swaps(&rep.rootWindowYoffset, n);
+ swaps(&rep.rootWindowXorigin, n);
+ swaps(&rep.rootWindowYorigin, n);
+ }
+ WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *)&rep);
+ if (length) WriteToClient(client, length, (char *)attr.displayName);
+ return client->noClientException;
+}
+
+static int ProcDMXChangeScreensAttributes(ClientPtr client)
+{
+ REQUEST(xDMXChangeScreensAttributesReq);
+ xDMXChangeScreensAttributesReply rep;
+ int n;
+ int status = DMX_BAD_XINERAMA;
+ unsigned int mask = 0;
+ unsigned int i;
+ CARD32 *screen_list;
+ CARD32 *mask_list;
+ CARD32 *value_list;
+ DMXScreenAttributesPtr attribs;
+ int errorScreen = 0;
+ unsigned int len;
+ int ones = 0;
+
+
+ REQUEST_AT_LEAST_SIZE(xDMXChangeScreensAttributesReq);
+ len = client->req_len - (sizeof(xDMXChangeScreensAttributesReq) >> 2);
+ if (len < stuff->screenCount + stuff->maskCount)
+ return BadLength;
+
+ screen_list = (CARD32 *)(stuff + 1);
+ mask_list = &screen_list[stuff->screenCount];
+ value_list = &mask_list[stuff->maskCount];
+
+ for (i = 0; i < stuff->maskCount; i++) ones += Ones(mask_list[i]);
+ if (len != stuff->screenCount + stuff->maskCount + ones)
+ return BadLength;
+
+ if (!_DMXXineramaActive()) goto noxinerama;
+
+ if (!(attribs = ALLOCATE_LOCAL(stuff->screenCount * sizeof(*attribs))))
+ return BadAlloc;
+
+ for (i = 0; i < stuff->screenCount; i++) {
+ int count;
+
+ if (i < stuff->maskCount) mask = mask_list[i];
+ dmxGetScreenAttributes(screen_list[i], &attribs[i]);
+ count = dmxFetchScreenAttributes(mask, &attribs[i], value_list);
+ value_list += count;
+ }
+
+#if PANORAMIX
+ status = dmxConfigureScreenWindows(stuff->screenCount,
+ screen_list,
+ attribs,
+ &errorScreen);
+#endif
+
+ DEALLOCATE_LOCAL(attribs);
+
+ if (status == BadValue) return status;
+
+ noxinerama:
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ rep.errorScreen = errorScreen;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.status, n);
+ swapl(&rep.errorScreen, n);
+ }
+ WriteToClient(client,
+ sizeof(xDMXChangeScreensAttributesReply),
+ (char *)&rep);
+ return client->noClientException;
+}
+
+static int ProcDMXAddScreen(ClientPtr client)
+{
+ REQUEST(xDMXAddScreenReq);
+ xDMXAddScreenReply rep;
+ int n;
+ int status = 0;
+ CARD32 *value_list;
+ DMXScreenAttributesRec attr;
+ int count;
+ char *name;
+ int len;
+ int paddedLength;
+
+ REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
+ paddedLength = (stuff->displayNameLength + 3) & ~3;
+ len = client->req_len - (sizeof(xDMXAddScreenReq) >> 2);
+ if (len != Ones(stuff->valueMask) + paddedLength/4)
+ return BadLength;
+
+ memset(&attr, 0, sizeof(attr));
+ dmxGetScreenAttributes(stuff->physicalScreen, &attr);
+ value_list = (CARD32 *)(stuff + 1);
+ count = dmxFetchScreenAttributes(stuff->valueMask, &attr, value_list);
+
+ if (!(name = ALLOCATE_LOCAL(stuff->displayNameLength + 1 + 4)))
+ return BadAlloc;
+ memcpy(name, &value_list[count], stuff->displayNameLength);
+ name[stuff->displayNameLength] = '\0';
+ attr.displayName = name;
+
+ status = dmxAttachScreen(stuff->physicalScreen, &attr);
+
+ DEALLOCATE_LOCAL(name);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ rep.physicalScreen = stuff->physicalScreen;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.status, n);
+ swapl(&rep.physicalScreen, n);
+ }
+ WriteToClient(client,
+ sizeof(xDMXAddScreenReply),
+ (char *)&rep);
+ return client->noClientException;
+}
+
+static int ProcDMXRemoveScreen(ClientPtr client)
+{
+ REQUEST(xDMXRemoveScreenReq);
+ xDMXRemoveScreenReply rep;
+ int n;
+ int status = 0;
+
+ REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
+
+ status = dmxDetachScreen(stuff->physicalScreen);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.status, n);
+ }
+ WriteToClient(client,
+ sizeof(xDMXRemoveScreenReply),
+ (char *)&rep);
+ return client->noClientException;
+}
+
+
+#ifdef PANORAMIX
+static int dmxPopulatePanoramiX(ClientPtr client, Window window,
+ CARD32 *screens, CARD32 *windows,
+ xRectangle *pos, xRectangle *vis)
+{
+ WindowPtr pWin;
+ PanoramiXRes *win;
+ int i;
+ int count = 0;
+ DMXWindowAttributesRec attr;
+
+ if (!(win = SecurityLookupIDByType(client, window, XRT_WINDOW,
+ SecurityReadAccess)))
+ return -1; /* BadWindow */
+
+ FOR_NSCREENS(i) {
+ if (!(pWin = SecurityLookupWindow(win->info[i].id, client,
+ SecurityReadAccess)))
+ return -1; /* BadWindow */
+ if (dmxGetWindowAttributes(pWin, &attr)) {
+ screens[count] = attr.screen;
+ windows[count] = attr.window;
+ pos[count] = attr.pos;
+ vis[count] = attr.vis;
+ ++count; /* Only count existing windows */
+ }
+ }
+ return count;
+}
+#endif
+
+static int dmxPopulate(ClientPtr client, Window window, CARD32 *screens,
+ CARD32 *windows, xRectangle *pos, xRectangle *vis)
+{
+ WindowPtr pWin;
+ DMXWindowAttributesRec attr;
+
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension)
+ return dmxPopulatePanoramiX(client, window, screens, windows,
+ pos, vis);
+#endif
+
+ if (!(pWin = SecurityLookupWindow(window, client, SecurityReadAccess)))
+ return -1; /* BadWindow */
+
+ dmxGetWindowAttributes(pWin, &attr);
+ *screens = attr.screen;
+ *windows = attr.window;
+ *pos = attr.pos;
+ *vis = attr.vis;
+ return 1;
+}
+
+static int dmxMaxNumScreens(void)
+{
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension) return PanoramiXNumScreens;
+#endif
+ return 1;
+}
+
+static int ProcDMXGetWindowAttributes(ClientPtr client)
+{
+ REQUEST(xDMXGetWindowAttributesReq);
+ xDMXGetWindowAttributesReply rep;
+ int i, n;
+ CARD32 *screens;
+ CARD32 *windows;
+ xRectangle *pos, *vis;
+ int count = dmxMaxNumScreens();
+
+ REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
+
+ if (!(screens = ALLOCATE_LOCAL(count * sizeof(*screens))))
+ return BadAlloc;
+ if (!(windows = ALLOCATE_LOCAL(count * sizeof(*windows)))) {
+ DEALLOCATE_LOCAL(screens);
+ return BadAlloc;
+ }
+ if (!(pos = ALLOCATE_LOCAL(count * sizeof(*pos)))) {
+ DEALLOCATE_LOCAL(windows);
+ DEALLOCATE_LOCAL(screens);
+ return BadAlloc;
+ }
+ if (!(vis = ALLOCATE_LOCAL(count * sizeof(*vis)))) {
+ DEALLOCATE_LOCAL(pos);
+ DEALLOCATE_LOCAL(windows);
+ DEALLOCATE_LOCAL(screens);
+ return BadAlloc;
+ }
+
+ if ((count = dmxPopulate(client, stuff->window, screens, windows,
+ pos, vis)) < 0) {
+ DEALLOCATE_LOCAL(vis);
+ DEALLOCATE_LOCAL(pos);
+ DEALLOCATE_LOCAL(windows);
+ DEALLOCATE_LOCAL(screens);
+ return BadWindow;
+ }
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = count * 6;
+ rep.screenCount = count;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.screenCount, n);
+ for (i = 0; i < count; i++) {
+ swapl(&screens[i], n);
+ swapl(&windows[i], n);
+
+ swaps(&pos[i].x, n);
+ swaps(&pos[i].y, n);
+ swaps(&pos[i].width, n);
+ swaps(&pos[i].height, n);
+
+ swaps(&vis[i].x, n);
+ swaps(&vis[i].y, n);
+ swaps(&vis[i].width, n);
+ swaps(&vis[i].height, n);
+ }
+ }
+
+ dmxFlushPendingSyncs();
+
+ WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), (char *)&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);
+ }
+
+ DEALLOCATE_LOCAL(vis);
+ DEALLOCATE_LOCAL(pos);
+ DEALLOCATE_LOCAL(windows);
+ DEALLOCATE_LOCAL(screens);
+
+ return client->noClientException;
+}
+
+static int ProcDMXGetDesktopAttributes(ClientPtr client)
+{
+ xDMXGetDesktopAttributesReply rep;
+ int n;
+ DMXDesktopAttributesRec attr;
+
+ REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
+
+ 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;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.width, n);
+ swapl(&rep.height, n);
+ swapl(&rep.shiftX, n);
+ swapl(&rep.shiftY, n);
+ }
+ WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep);
+ return client->noClientException;
+}
+
+static int ProcDMXChangeDesktopAttributes(ClientPtr client)
+{
+ REQUEST(xDMXChangeDesktopAttributesReq);
+ xDMXChangeDesktopAttributesReply rep;
+ int n;
+ int status = DMX_BAD_XINERAMA;
+ CARD32 *value_list;
+ DMXDesktopAttributesRec attr;
+ int len;
+
+ REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
+ len = client->req_len - (sizeof(xDMXChangeDesktopAttributesReq) >> 2);
+ if (len != Ones(stuff->valueMask))
+ return BadLength;
+
+ if (!_DMXXineramaActive()) goto noxinerama;
+
+ value_list = (CARD32 *)(stuff + 1);
+
+ dmxGetDesktopAttributes(&attr);
+ dmxFetchDesktopAttributes(stuff->valueMask, &attr, value_list);
+
+#if PANORAMIX
+ status = dmxConfigureDesktop(&attr);
+#endif
+ if (status == BadValue) return status;
+
+ noxinerama:
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.status, n);
+ }
+ WriteToClient(client,
+ sizeof(xDMXChangeDesktopAttributesReply),
+ (char *)&rep);
+ return client->noClientException;
+}
+
+static int ProcDMXGetInputCount(ClientPtr client)
+{
+ xDMXGetInputCountReply rep;
+ int n;
+
+ REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.inputCount = dmxGetInputCount();
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.inputCount, n);
+ }
+ WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *)&rep);
+ return client->noClientException;
+}
+
+static int ProcDMXGetInputAttributes(ClientPtr client)
+{
+ REQUEST(xDMXGetInputAttributesReq);
+ xDMXGetInputAttributesReply rep;
+ int n;
+ int length;
+ int paddedLength;
+ DMXInputAttributesRec attr;
+
+ REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
+
+ 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 = (length + 3) & ~3;
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = paddedLength >> 2;
+ rep.nameLength = length;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.inputType, n);
+ swapl(&rep.physicalScreen, n);
+ swapl(&rep.physicalId, n);
+ swapl(&rep.nameLength, n);
+ }
+ WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *)&rep);
+ if (length) WriteToClient(client, length, (char *)attr.name);
+ return client->noClientException;
+}
+
+static int ProcDMXAddInput(ClientPtr client)
+{
+ REQUEST(xDMXAddInputReq);
+ xDMXAddInputReply rep;
+ int n;
+ int status = 0;
+ CARD32 *value_list;
+ DMXInputAttributesRec attr;
+ int count;
+ char *name;
+ int len;
+ int paddedLength;
+ int id = -1;
+
+ REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
+ paddedLength = (stuff->displayNameLength + 3) & ~3;
+ len = client->req_len - (sizeof(xDMXAddInputReq) >> 2);
+ if (len != Ones(stuff->valueMask) + paddedLength/4)
+ return BadLength;
+
+ memset(&attr, 0, sizeof(attr));
+ value_list = (CARD32 *)(stuff + 1);
+ count = dmxFetchInputAttributes(stuff->valueMask, &attr, value_list);
+
+ if (!(name = ALLOCATE_LOCAL(stuff->displayNameLength + 1 + 4)))
+ return BadAlloc;
+ memcpy(name, &value_list[count], stuff->displayNameLength);
+ name[stuff->displayNameLength] = '\0';
+ attr.name = name;
+
+ status = dmxAddInput(&attr, &id);
+
+ DEALLOCATE_LOCAL(name);
+
+ if (status) return status;
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ rep.physicalId = id;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.status, n);
+ swapl(&rep.physicalId, n);
+ }
+ WriteToClient(client, sizeof(xDMXAddInputReply), (char *)&rep);
+ return client->noClientException;
+}
+
+static int ProcDMXRemoveInput(ClientPtr client)
+{
+ REQUEST(xDMXRemoveInputReq);
+ xDMXRemoveInputReply rep;
+ int n;
+ int status = 0;
+
+ REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
+
+ status = dmxRemoveInput(stuff->physicalId);
+
+ if (status) return status;
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.status, n);
+ }
+ WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *)&rep);
+ return client->noClientException;
+}
+
+static int ProcDMXDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data) {
+ case X_DMXQueryVersion: return ProcDMXQueryVersion(client);
+ case X_DMXSync: return ProcDMXSync(client);
+ case X_DMXForceWindowCreation: return ProcDMXForceWindowCreation(client);
+ case X_DMXGetScreenCount: return ProcDMXGetScreenCount(client);
+ case X_DMXGetScreenAttributes: return ProcDMXGetScreenAttributes(client);
+ case X_DMXChangeScreensAttributes:
+ return ProcDMXChangeScreensAttributes(client);
+ case X_DMXAddScreen: return ProcDMXAddScreen(client);
+ case X_DMXRemoveScreen: return ProcDMXRemoveScreen(client);
+ case X_DMXGetWindowAttributes: return ProcDMXGetWindowAttributes(client);
+ case X_DMXGetDesktopAttributes: return ProcDMXGetDesktopAttributes(client);
+ case X_DMXChangeDesktopAttributes:
+ return ProcDMXChangeDesktopAttributes(client);
+ case X_DMXGetInputCount: return ProcDMXGetInputCount(client);
+ case X_DMXGetInputAttributes: return ProcDMXGetInputAttributes(client);
+ case X_DMXAddInput: return ProcDMXAddInput(client);
+ case X_DMXRemoveInput: return ProcDMXRemoveInput(client);
+
+ case X_DMXGetScreenInformationDEPRECATED:
+ case X_DMXForceWindowCreationDEPRECATED:
+ case X_DMXReconfigureScreenDEPRECATED:
+ return BadImplementation;
+
+ default: return BadRequest;
+ }
+}
+
+static int SProcDMXQueryVersion(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXQueryVersionReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
+ return ProcDMXQueryVersion(client);
+}
+
+static int SProcDMXSync(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXSyncReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXSyncReq);
+ return ProcDMXSync(client);
+}
+
+static int SProcDMXForceWindowCreation(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXForceWindowCreationReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
+ swaps(&stuff->window, n);
+ return ProcDMXForceWindowCreation(client);
+}
+
+static int SProcDMXGetScreenCount(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXGetScreenCountReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
+ return ProcDMXGetScreenCount(client);
+}
+
+static int SProcDMXGetScreenAttributes(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXGetScreenAttributesReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
+ swapl(&stuff->physicalScreen, n);
+ return ProcDMXGetScreenAttributes(client);
+}
+
+static int SProcDMXChangeScreensAttributes(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXChangeScreensAttributesReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_AT_LEAST_SIZE(xDMXGetScreenAttributesReq);
+ swapl(&stuff->screenCount, n);
+ swapl(&stuff->maskCount, n);
+ SwapRestL(stuff);
+ return ProcDMXGetScreenAttributes(client);
+}
+
+static int SProcDMXAddScreen(ClientPtr client)
+{
+ int n;
+ int paddedLength;
+ REQUEST(xDMXAddScreenReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
+ swapl(&stuff->displayNameLength, n);
+ swapl(&stuff->valueMask, n);
+ paddedLength = (stuff->displayNameLength + 3) & ~3;
+ SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
+ return ProcDMXAddScreen(client);
+}
+
+static int SProcDMXRemoveScreen(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXRemoveScreenReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
+ swapl(&stuff->physicalScreen, n);
+ return ProcDMXRemoveScreen(client);
+}
+
+static int SProcDMXGetWindowAttributes(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXGetWindowAttributesReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
+ swapl(&stuff->window, n);
+ return ProcDMXGetWindowAttributes(client);
+}
+
+static int SProcDMXGetDesktopAttributes(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXGetDesktopAttributesReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
+ return ProcDMXGetDesktopAttributes(client);
+}
+
+static int SProcDMXChangeDesktopAttributes(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXChangeDesktopAttributesReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
+ swapl(&stuff->valueMask, n);
+ SwapRestL(stuff);
+ return ProcDMXChangeDesktopAttributes(client);
+}
+
+static int SProcDMXGetInputCount(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXGetInputCountReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
+ return ProcDMXGetInputCount(client);
+}
+
+static int SProcDMXGetInputAttributes(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXGetInputAttributesReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
+ swapl(&stuff->deviceId, n);
+ return ProcDMXGetInputAttributes(client);
+}
+
+static int SProcDMXAddInput(ClientPtr client)
+{
+ int n;
+ int paddedLength;
+ REQUEST(xDMXAddInputReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
+ swapl(&stuff->displayNameLength, n);
+ swapl(&stuff->valueMask, n);
+ paddedLength = (stuff->displayNameLength + 3) & ~3;
+ SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
+ return ProcDMXAddInput(client);
+}
+
+static int SProcDMXRemoveInput(ClientPtr client)
+{
+ int n;
+ REQUEST(xDMXRemoveInputReq);
+
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
+ swapl(&stuff->physicalId, n);
+ return ProcDMXRemoveInput(client);
+}
+
+static int SProcDMXDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data) {
+ case X_DMXQueryVersion: return SProcDMXQueryVersion(client);
+ case X_DMXSync: return SProcDMXSync(client);
+ case X_DMXForceWindowCreation: return SProcDMXForceWindowCreation(client);
+ case X_DMXGetScreenCount: return SProcDMXGetScreenCount(client);
+ case X_DMXGetScreenAttributes: return SProcDMXGetScreenAttributes(client);
+ case X_DMXChangeScreensAttributes:
+ return SProcDMXChangeScreensAttributes(client);
+ case X_DMXAddScreen: return SProcDMXAddScreen(client);
+ case X_DMXRemoveScreen: return SProcDMXRemoveScreen(client);
+ case X_DMXGetWindowAttributes: return SProcDMXGetWindowAttributes(client);
+ case X_DMXGetDesktopAttributes:
+ return SProcDMXGetDesktopAttributes(client);
+ case X_DMXChangeDesktopAttributes:
+ return SProcDMXChangeDesktopAttributes(client);
+ case X_DMXGetInputCount: return SProcDMXGetInputCount(client);
+ case X_DMXGetInputAttributes: return SProcDMXGetInputAttributes(client);
+ case X_DMXAddInput: return SProcDMXAddInput(client);
+ case X_DMXRemoveInput: return SProcDMXRemoveInput(client);
+
+ case X_DMXGetScreenInformationDEPRECATED:
+ case X_DMXForceWindowCreationDEPRECATED:
+ case X_DMXReconfigureScreenDEPRECATED:
+ return BadImplementation;
+
+ default: return BadRequest;
+ }
+}
diff --git a/hw/dmx/dmxdpms.c b/hw/dmx/dmxdpms.c
new file mode 100644
index 000000000..b29e6004a
--- /dev/null
+++ b/hw/dmx/dmxdpms.c
@@ -0,0 +1,209 @@
+/* $XFree86$ */
+/*
+ * Copyright 2003-2004 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.
+ */
+
+/*
+ * Author:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ * Provides DPMS support and unifies all DPMS and other screen-saver
+ * support in one file. If -dpms is given on the command line, or the
+ * Xdmx server is not compiled with DPMS support, then the DPMS extension
+ * does not work for clients, but DPMS on the backends is still disables
+ * (and restored at Xdmx server shutdown time).
+ */
+
+#include "dmx.h"
+#include "dmxdpms.h"
+#include "dmxlog.h"
+#include "dmxsync.h"
+#ifdef DPMSExtension
+#include "dpmsproc.h"
+#endif
+#include "windowstr.h" /* For screenIsSaved */
+#include "X11/extensions/dpms.h"
+
+static unsigned long dpmsGeneration = 0;
+static Bool dpmsSupported = TRUE;
+
+static void _dmxDPMSInit(DMXScreenInfo *dmxScreen)
+{
+ int event_base, error_base;
+ int major, minor;
+ CARD16 level, standby, suspend, off;
+ BOOL state;
+ const char *monitor;
+
+ if (dpmsGeneration != serverGeneration) {
+ dpmsSupported = TRUE; /* On unless a backend doesn't support it */
+ dpmsGeneration = serverGeneration;
+ }
+
+#ifdef DPMSExtension
+ if (DPMSDisabledSwitch) dpmsSupported = FALSE; /* -dpms turns off */
+#endif
+
+ dmxScreen->dpmsCapable = 0;
+
+ if (!dmxScreen->beDisplay) {
+ dmxLogOutput(dmxScreen,
+ "Cannot determine if DPMS supported (detached screen)\n");
+ dpmsSupported = FALSE;
+ return;
+ }
+
+ if (!DPMSQueryExtension(dmxScreen->beDisplay,
+ &event_base, &error_base)) {
+ dmxLogOutput(dmxScreen, "DPMS not supported\n");
+ dpmsSupported = FALSE;
+ return;
+ }
+ if (!DPMSGetVersion(dmxScreen->beDisplay, &major, &minor)) {
+ dmxLogOutput(dmxScreen, "DPMS not supported\n");
+ dpmsSupported = FALSE;
+ return;
+ }
+ if (!DPMSCapable(dmxScreen->beDisplay)) {
+ dmxLogOutput(dmxScreen, "DPMS %d.%d (not DPMS capable)\n",
+ major, minor);
+ dpmsSupported = FALSE;
+ return;
+ }
+
+ DPMSInfo(dmxScreen->beDisplay, &level, &state);
+ DPMSGetTimeouts(dmxScreen->beDisplay, &standby, &suspend, &off);
+ DPMSSetTimeouts(dmxScreen->beDisplay, 0, 0, 0);
+ DPMSEnable(dmxScreen->beDisplay);
+ DPMSForceLevel(dmxScreen->beDisplay, DPMSModeOn);
+ dmxScreen->dpmsCapable = 1;
+ dmxScreen->dpmsEnabled = !!state;
+ dmxScreen->dpmsStandby = standby;
+ dmxScreen->dpmsSuspend = suspend;
+ dmxScreen->dpmsOff = off;
+
+ switch (level) {
+ case DPMSModeOn: monitor = "on"; break;
+ case DPMSModeStandby: monitor = "standby"; break;
+ case DPMSModeSuspend: monitor = "suspend"; break;
+ case DPMSModeOff: monitor = "off"; break;
+ default: monitor = "unknown"; break;
+ }
+
+ dmxLogOutput(dmxScreen,
+ "DPMS %d.%d (%s, %s, %d %d %d)\n",
+ major, minor, monitor, state ? "enabled" : "disabled",
+ standby, suspend, off);
+}
+
+/** Initialize DPMS support. We save the current settings and turn off
+ * DPMS. The settings are restored in #dmxDPMSTerm. */
+void dmxDPMSInit(DMXScreenInfo *dmxScreen)
+{
+ int interval, preferBlanking, allowExposures;
+
+ /* Turn off DPMS */
+ _dmxDPMSInit(dmxScreen);
+
+ if (!dmxScreen->beDisplay)
+ return;
+
+ /* Turn off screen saver */
+ XGetScreenSaver(dmxScreen->beDisplay, &dmxScreen->savedTimeout, &interval,
+ &preferBlanking, &allowExposures);
+ XSetScreenSaver(dmxScreen->beDisplay, 0, interval,
+ preferBlanking, allowExposures);
+ XResetScreenSaver(dmxScreen->beDisplay);
+ dmxSync(dmxScreen, FALSE);
+}
+
+/** Terminate DPMS support on \a dmxScreen. We restore the settings
+ * saved in #dmxDPMSInit. */
+void dmxDPMSTerm(DMXScreenInfo *dmxScreen)
+{
+ int timeout, interval, preferBlanking, allowExposures;
+
+ if (!dmxScreen->beDisplay)
+ return;
+
+ XGetScreenSaver(dmxScreen->beDisplay, &timeout, &interval,
+ &preferBlanking, &allowExposures);
+ XSetScreenSaver(dmxScreen->beDisplay, dmxScreen->savedTimeout, interval,
+ preferBlanking, allowExposures);
+ if (dmxScreen->dpmsCapable) {
+ /* Restore saved state */
+ DPMSForceLevel(dmxScreen->beDisplay, DPMSModeOn);
+ DPMSSetTimeouts(dmxScreen->beDisplay, dmxScreen->dpmsStandby,
+ dmxScreen->dpmsSuspend, dmxScreen->dpmsOff);
+ if (dmxScreen->dpmsEnabled) DPMSEnable(dmxScreen->beDisplay);
+ else DPMSDisable(dmxScreen->beDisplay);
+ }
+ dmxSync(dmxScreen, FALSE);
+}
+
+/** Called when activity is detected so that DPMS power-saving mode can
+ * be deactivated. */
+void dmxDPMSWakeup(void)
+{
+ if (screenIsSaved == SCREEN_SAVER_ON)
+ SaveScreens(SCREEN_SAVER_OFF, ScreenSaverReset);
+#ifdef DPMSExtension
+ if (DPMSPowerLevel) DPMSSet(0);
+#endif
+}
+
+#ifdef DPMSExtension
+/** This is called on each server generation. It should determine if
+ * DPMS is supported on all of the backends and, if so, return TRUE. */
+Bool DPMSSupported(void)
+{
+ return dpmsSupported;
+}
+
+/** This is used by clients (e.g., xset) to set the DPMS level. */
+void DPMSSet(int level)
+{
+ int i;
+
+ if (!dpmsSupported) return;
+
+ if (level < 0) level = DPMSModeOn;
+ if (level > 3) level = DPMSModeOff;
+
+ DPMSPowerLevel = level;
+
+ for (i = 0; i < dmxNumScreens; i++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+ if (dmxScreen->beDisplay) {
+ DPMSForceLevel(dmxScreen->beDisplay, level);
+ dmxSync(dmxScreen, FALSE);
+ }
+ }
+}
+#endif
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index b0418508c..0fbf014d6 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -45,6 +45,7 @@ from The Open Group.
#include "gcstruct.h"
#include "input.h"
#include "mipointer.h"
+#include "micmap.h"
#include <sys/types.h>
#ifdef HAS_MMAP
#include <sys/mman.h>
@@ -64,13 +65,12 @@ from The Open Group.
#endif /* HAS_SHM */
#include "dix.h"
#include "miline.h"
-#include "mfb.h"
#define VFB_DEFAULT_WIDTH 1280
#define VFB_DEFAULT_HEIGHT 1024
#define VFB_DEFAULT_DEPTH 8
-#define VFB_DEFAULT_WHITEPIXEL 0
-#define VFB_DEFAULT_BLACKPIXEL 1
+#define VFB_DEFAULT_WHITEPIXEL 1
+#define VFB_DEFAULT_BLACKPIXEL 0
#define VFB_DEFAULT_LINEBIAS 0
#define XWD_WINDOW_NAME_LEN 60
@@ -278,6 +278,11 @@ ddxUseMsg()
#endif
}
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+}
+
int
ddxProcessArgument(int argc, char *argv[], int i)
{
@@ -437,60 +442,6 @@ GetTimeInMillis()
}
#endif
-
-static Bool
-vfbMultiDepthCreateGC(GCPtr pGC)
-{
- switch (vfbBitsPerPixel(pGC->depth))
- {
- case 1: return mfbCreateGC (pGC);
- case 8:
- case 16:
- case 32: return fbCreateGC (pGC);
- default: return FALSE;
- }
-}
-
-static void
-vfbMultiDepthGetSpans(
- DrawablePtr pDrawable, /* drawable from which to get bits */
- int wMax, /* largest value of all *pwidths */
- register DDXPointPtr ppt, /* points to start copying from */
- int *pwidth, /* list of number of bits to copy */
- int nspans, /* number of scanlines to copy */
- char *pdstStart) /* where to put the bits */
-{
- switch (pDrawable->bitsPerPixel) {
- case 1:
- mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
- case 8:
- case 16:
- case 32:
- fbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
- }
- return;
-}
-
-static void
-vfbMultiDepthGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planeMask,
- char *pdstLine)
-{
- switch (pDrawable->bitsPerPixel)
- {
- case 1:
- mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
- case 8:
- case 16:
- case 32:
- fbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
- }
-}
-
static ColormapPtr InstalledMaps[MAXSCREENS];
static int
@@ -917,39 +868,54 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
pbits = vfbAllocateFramebufferMemory(pvfb);
if (!pbits) return FALSE;
- /* miSetPixmapDepths ();*/
+ miSetPixmapDepths ();
- switch (pvfb->bitsPerPixel)
- {
- case 1:
- ret = mfbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
- dpix, dpiy, pvfb->paddedWidth);
- break;
+ switch (pvfb->depth) {
case 8:
+ miSetVisualTypesAndMasks (8,
+ ((1 << StaticGray) |
+ (1 << GrayScale) |
+ (1 << StaticColor) |
+ (1 << PseudoColor) |
+ (1 << TrueColor) |
+ (1 << DirectColor)),
+ 8, PseudoColor, 0x07, 0x38, 0xc0);
+ break;
+ case 15:
+ miSetVisualTypesAndMasks (15,
+ ((1 << TrueColor) |
+ (1 << DirectColor)),
+ 8, TrueColor, 0x7c00, 0x03e0, 0x001f);
+ break;
case 16:
- case 32:
- ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
- dpix, dpiy, pvfb->paddedWidth,pvfb->bitsPerPixel);
-#ifdef RENDER
- if (ret && Render)
- fbPictureInit (pScreen, 0, 0);
-#endif
+ miSetVisualTypesAndMasks (16,
+ ((1 << TrueColor) |
+ (1 << DirectColor)),
+ 8, TrueColor, 0xf800, 0x07e0, 0x001f);
+ break;
+ case 24:
+ miSetVisualTypesAndMasks (24,
+ ((1 << TrueColor) |
+ (1 << DirectColor)),
+ 8, TrueColor, 0xff0000, 0x00ff00, 0x0000ff);
break;
- default:
- return FALSE;
}
+
+ ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
+ dpix, dpiy, pvfb->paddedWidth,pvfb->bitsPerPixel);
+#ifdef RENDER
+ if (ret && Render)
+ fbPictureInit (pScreen, 0, 0);
+#endif
if (!ret) return FALSE;
- miInitializeBackingStore(pScreen);
+ /* miInitializeBackingStore(pScreen); */
/*
* Circumvent the backing store that was just initialised. This amounts
* to a truely bizarre way of initialising SaveDoomedAreas and friends.
*/
- pScreen->CreateGC = vfbMultiDepthCreateGC;
- pScreen->GetImage = vfbMultiDepthGetImage;
- pScreen->GetSpans = vfbMultiDepthGetSpans;
pScreen->InstallColormap = vfbInstallColormap;
pScreen->UninstallColormap = vfbUninstallColormap;
@@ -965,14 +931,7 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
pScreen->blackPixel = pvfb->blackPixel;
pScreen->whitePixel = pvfb->whitePixel;
- if (pvfb->bitsPerPixel == 1)
- {
- ret = mfbCreateDefColormap(pScreen);
- }
- else
- {
- ret = fbCreateDefColormap(pScreen);
- }
+ ret = fbCreateDefColormap(pScreen);
miSetZeroLineBias(pScreen, pvfb->lineBias);
@@ -1003,7 +962,7 @@ InitOutput(ScreenInfo *screenInfo, int argc, char **argv)
vfbPixmapDepths[1] = TRUE;
vfbPixmapDepths[4] = TRUE;
vfbPixmapDepths[8] = TRUE;
- vfbPixmapDepths[15] = TRUE;
+/* vfbPixmapDepths[15] = TRUE; */
vfbPixmapDepths[16] = TRUE;
vfbPixmapDepths[24] = TRUE;
vfbPixmapDepths[32] = TRUE;
diff --git a/hw/vfb/Xvfb.man.pre b/hw/vfb/Xvfb.man.pre
index dd03a3a4b..95efc4f61 100644
--- a/hw/vfb/Xvfb.man.pre
+++ b/hw/vfb/Xvfb.man.pre
@@ -1,4 +1,4 @@
-.\" $XdotOrg: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.1.4.2.4.1 2004/03/04 17:47:33 eich Exp $
+.\" $XdotOrg: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.2 2004/04/23 19:19:32 eich Exp $
.\" $Xorg: Xvfb.man,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $
.\" Copyright 1993, 1998 The Open Group
.\"
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index f888eb0f6..269b8bfb4 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -122,7 +122,8 @@ extern int ffs(unsigned long);
# if defined(NO_INLINE) || defined(DO_PROTOTYPES)
-# if !defined(__sparc__) && !defined(__arm32__) \
+# if !defined(__arm__)
+# if !defined(__sparc__) && !defined(__arm32__) \
&& !(defined(__alpha__) && defined(linux))
extern void outb(unsigned short, unsigned char);
@@ -132,7 +133,7 @@ extern unsigned int inb(unsigned short);
extern unsigned int inw(unsigned short);
extern unsigned int inl(unsigned short);
-# else /* __sparc__, __arm32__, __alpha__*/
+# else /* __sparc__, __arm32__, __alpha__*/
extern void outb(unsigned long, unsigned char);
extern void outw(unsigned long, unsigned short);
@@ -141,7 +142,8 @@ extern unsigned int inb(unsigned long);
extern unsigned int inw(unsigned long);
extern unsigned int inl(unsigned long);
-# endif /* __sparc__, __arm32__, __alpha__ */
+# endif /* __sparc__, __arm32__, __alpha__ */
+# endif /* __arm__ */
extern unsigned long ldq_u(unsigned long *);
extern unsigned long ldl_u(unsigned int *);
@@ -897,12 +899,12 @@ static __inline__ void stw_u(unsigned long val, unsigned short *p)
# define mem_barrier() /* XXX: nop for now */
# define write_mem_barrier() /* XXX: nop for now */
-# elif defined(__mips__) || defined(__arm32__)
-#ifdef __arm32__
-#define PORT_SIZE long
-#else
-#define PORT_SIZE short
-#endif
+# elif defined(__mips__) || (defined(__arm32__) && !defined(__linux__))
+# ifdef __arm32__
+# define PORT_SIZE long
+# else
+# define PORT_SIZE short
+# endif
unsigned int IOPortBase; /* Memory mapped I/O port area */
@@ -1293,6 +1295,55 @@ inl(unsigned short port)
# define mem_barrier() eieio()
# define write_mem_barrier() eieio()
+#elif defined(__arm__) && defined(__linux__)
+
+#define ldq_u(p) (*((unsigned long *)(p)))
+#define ldl_u(p) (*((unsigned int *)(p)))
+#define ldw_u(p) (*((unsigned short *)(p)))
+#define stq_u(v,p) (*(unsigned long *)(p)) = (v)
+#define stl_u(v,p) (*(unsigned int *)(p)) = (v)
+#define stw_u(v,p) (*(unsigned short *)(p)) = (v)
+#define mem_barrier() /* NOP */
+#define write_mem_barrier() /* NOP */
+
+/* for Linux on ARM, we use the LIBC inx/outx routines */
+/* note that the appropriate setup via "ioperm" needs to be done */
+/* *before* any inx/outx is done. */
+
+#include <sys/io.h>
+
+static __inline__ void
+xf_outb(unsigned short port, unsigned char val)
+{
+ outb(val, port);
+}
+
+static __inline__ void
+xf_outw(unsigned short port, unsigned short val)
+{
+ outw(val, port);
+}
+
+static __inline__ void
+xf_outl(unsigned short port, unsigned int val)
+{
+ outl(val, port);
+}
+
+#define outb xf_outb
+#define outw xf_outw
+#define outl xf_outl
+
+#define arm_flush_cache(addr) \
+do { \
+ register unsigned long _beg __asm ("a1") = (unsigned long) (addr); \
+ register unsigned long _end __asm ("a2") = (unsigned long) (addr) + 4;\
+ register unsigned long _flg __asm ("a3") = 0; \
+ __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \
+ : "=r" (_beg) \
+ : "0" (_beg), "r" (_end), "r" (_flg)); \
+} while (0)
+
# else /* ix86 */
# define ldq_u(p) (*((unsigned long *)(p)))
@@ -1732,7 +1783,7 @@ static __inline__ void ppc_flush_icache(char *addr)
: : "r"(addr) : "memory");
}
-# elif defined(__sparc__)
+# elif defined(__sparc__) || defined(sparc)
/*
* Like powerpc, we provide byteswapping and no byteswapping functions
* here with byteswapping as default, drivers that don't need byteswapping
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 5e002c8db..255e65674 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -2988,7 +2988,7 @@ static void
CheckGenericGA()
{
/* This needs to be changed for multiple domains */
-#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__)
+#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__)
IOADDRESS GenericIOBase = VGAHW_GET_IOBASE();
CARD8 CurrentValue, TestValue;
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 66a6268ab..54c92ff8f 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 1.1.4.4.2.3 2004/03/04 20:16:17 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 1.5 2004/08/16 20:17:51 kem Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.276 2003/10/08 14:58:26 dawes Exp $ */
@@ -128,6 +128,7 @@ static Bool addDefaultModes(MonPtr monitorp);
#ifdef XF86DRI
static Bool configDRI(XF86ConfDRIPtr drip);
#endif
+static Bool configExtensions(XF86ConfExtensionsPtr conf_ext);
/*
* xf86GetPathElem --
@@ -373,13 +374,14 @@ xf86DriverlistFromConfig()
Bool
xf86BuiltinInputDriver(const char *name)
{
+#ifdef USE_DEPRECATED_KEYBOARD_DRIVER
if (xf86NameCmp(name, "keyboard") == 0)
return TRUE;
else
+#endif
return FALSE;
}
-
char **
xf86InputDriverlistFromConfig()
{
@@ -2396,6 +2398,62 @@ configDRI(XF86ConfDRIPtr drip)
#endif
static Bool
+configExtensions(XF86ConfExtensionsPtr conf_ext)
+{
+ XF86OptionPtr o;
+
+ /* Extension enable/disable in miinitext.c */
+ extern Bool EnableDisableExtension(char *name, Bool enable);
+
+ if (conf_ext && conf_ext->ext_option_lst) {
+ for (o = conf_ext->ext_option_lst; o; o = xf86NextOption(o)) {
+ char *name = xf86OptionName(o);
+ char *val = xf86OptionValue(o);
+ char *n;
+ Bool enable = TRUE;
+
+ /* Handle "No<ExtensionName>" */
+ n = xf86NormalizeName(name);
+ if (strncmp(n, "no", 2) == 0) {
+ name += 2;
+ enable = FALSE;
+ }
+
+ if (!val ||
+ xf86NameCmp(val, "enable") == 0 ||
+ xf86NameCmp(val, "on") == 0 ||
+ xf86NameCmp(val, "1") == 0 ||
+ xf86NameCmp(val, "yes") == 0 ||
+ xf86NameCmp(val, "true") == 0) {
+ /* NOTHING NEEDED -- enabling is handled below */
+ } else if (xf86NameCmp(val, "disable") == 0 ||
+ xf86NameCmp(val, "off") == 0 ||
+ xf86NameCmp(val, "0") == 0 ||
+ xf86NameCmp(val, "no") == 0 ||
+ xf86NameCmp(val, "false") == 0) {
+ enable = !enable;
+ } else {
+ xf86Msg(X_ERROR,
+ "%s is not a valid value for the Extension option\n",
+ val);
+ return FALSE;
+ }
+
+ if (EnableDisableExtension(name, enable)) {
+ xf86Msg(X_CONFIG, "Extension \"%s\" is %s\n",
+ name, enable ? "enabled" : "disabled");
+ } else {
+ xf86Msg(X_ERROR,
+ "Extension \"%s\" is unrecognized\n", name);
+ return FALSE;
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+static Bool
configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
{
xf86Msg(from, "|-->Input Device \"%s\"\n", conf_input->inp_identifier);
@@ -2551,7 +2609,8 @@ xf86HandleConfigFile(Bool autoconfig)
if (!configFiles(xf86configptr->conf_files) ||
!configServerFlags(xf86configptr->conf_flags,
- xf86ConfigLayout.options)
+ xf86ConfigLayout.options) ||
+ !configExtensions(xf86configptr->conf_extensions)
#ifdef XF86DRI
|| !configDRI(xf86configptr->conf_dri)
#endif
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 4e1473ef7..be37f53be 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -1,5 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.80 2003/10/08 14:58:27 dawes Exp $ */
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 1.1.4.1.2.1 2004/03/17 20:30:26 ago Exp $ */
/*
* Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales.
*
@@ -258,7 +257,11 @@ configureInputSection (void)
parsePrologue (XF86ConfInputPtr, XF86ConfInputRec)
ptr->inp_identifier = "Keyboard0";
+#ifdef USE_DEPRECATED_KEYBOARD_DRIVER
ptr->inp_driver = "keyboard";
+#else
+ ptr->inp_driver = "kbd";
+#endif
ptr->list.next = NULL;
/* Crude mechanism to auto-detect mouse (os dependent) */
@@ -750,8 +753,8 @@ configureDDCMonitorSection (int screennum)
ptr->mon_vrefresh[ptr->mon_n_hsync].lo =
ConfiguredMonitor->det_mon[i].section.ranges.min_v;
ptr->mon_vrefresh[ptr->mon_n_hsync].hi =
+ ConfiguredMonitor->det_mon[i].section.ranges.max_v;
ptr->mon_n_hsync++;
- ConfiguredMonitor->det_mon[i].section.ranges.max_v;
default:
break;
}
@@ -1004,7 +1007,7 @@ DoConfigure()
}
ErrorF("\nYour %s file is %s\n\n", XF86CONFIGFILE ,filename);
- ErrorF("To test the server, run 'X -xf86config %s'\n\n", filename);
+ ErrorF("To test the server, run 'X -config %s'\n\n", filename);
bail:
OsCleanup(TRUE);
diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
index 22b7b00e6..51015e1f4 100644
--- a/hw/xfree86/common/xf86Cursor.c
+++ b/hw/xfree86/common/xf86Cursor.c
@@ -222,7 +222,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
if (mode == pScr->currentMode)
return TRUE;
- if (mode->HDisplay > pScreen->width || mode->VDisplay > pScreen->height)
+ if (mode->HDisplay > pScr->virtualX || mode->VDisplay > pScr->virtualY)
return FALSE;
pCursorScreen = miPointerCurrentScreen();
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index ac57935e0..d57eab6e5 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.1.4.3.2.3 2004/03/04 20:16:18 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.2 2004/04/23 19:20:32 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.46 2002/12/03 18:17:40 tsi Exp $ */
/*
* Copyright (c) 1998-2002 by The XFree86 Project, Inc.
diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
index df968797c..82004b953 100644
--- a/hw/xfree86/common/xf86DPMS.c
+++ b/hw/xfree86/common/xf86DPMS.c
@@ -118,6 +118,16 @@ DPMSClose(int i, ScreenPtr pScreen)
pScreen->CloseScreen = pDPMS->CloseScreen;
+ /*
+ * 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);
+ }
+
xfree((pointer)pDPMS);
pScreen->devPrivates[DPMSIndex].ptr = NULL;
if (--DPMSCount == 0)
diff --git a/hw/xfree86/common/xf86Date.h b/hw/xfree86/common/xf86Date.h
index 7d37ac7ef..15aafb817 100644
--- a/hw/xfree86/common/xf86Date.h
+++ b/hw/xfree86/common/xf86Date.h
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.1.4.3 2003/12/20 00:28:26 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.4 2004/08/16 22:48:50 kem Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.54 2003/12/19 04:52:10 dawes Exp $ */
/*
* Copyright (c) 2003 by The XFree86 Project, Inc.
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 791fd2673..d61d4d67a 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -49,7 +49,7 @@
*/
/* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 1.1.4.3 2003/12/06 13:24:24 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 1.3 2004/07/30 20:56:53 eich Exp $ */
/* [JCH-96/01/21] Extended std reverse map to four buttons. */
@@ -95,6 +95,12 @@
extern Bool noXkbExtension;
#endif
+#ifdef DPMSExtension
+#define DPMS_SERVER
+#include "extensions/dpms.h"
+#include "dpmsproc.h"
+#endif
+
#define XE_POINTER 1
#define XE_KEYBOARD 2
@@ -403,7 +409,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
/* */
/* otherwise fallback to sending a key event message to */
/* the current screen's driver: */
- if (*pScr->HandleMessage) {
+ if (*pScr->HandleMessage != NULL) {
(void) (*pScr->HandleMessage)(pScr->scrnIndex,
"KeyEventMessage", message, &retstr);
}
@@ -1348,7 +1354,11 @@ xf86VTSwitch()
#endif /* !__UNIXOS2__ */
xf86EnterServerState(SETUP);
for (i = 0; i < xf86NumScreens; i++) {
- xf86Screens[i]->LeaveVT(i, 0);
+#ifdef DPMSExtension
+ if (xf86Screens[i]->DPMSSet)
+ xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0);
+#endif
+ xf86Screens[i]->LeaveVT(i, 0);
}
for (ih = InputHandlers; ih; ih = ih->next)
xf86DisableInputHandler(ih);
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index a2bb3f504..6f2e9135a 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -157,7 +157,7 @@ xf86InfoRec xf86Info = {
FALSE, /* vidModeAllowNonLocal */
TRUE, /* miscModInDevEnabled */
FALSE, /* miscModInDevAllowNonLocal */
- PCIProbe1, /* pciFlags */
+ PCIOsConfig, /* pciFlags */
Pix24DontCare, /* pixmap24 */
X_DEFAULT, /* pix24From */
#if defined(i386) || defined(__i386__)
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 076a97f16..822cdfd8b 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -873,7 +873,6 @@ Bool
xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual)
{
MessageType visualFrom = X_DEFAULT;
- Bool bad = FALSE;
if (defaultColorVisualClass >= 0) {
scrp->defaultVisual = defaultColorVisualClass;
@@ -902,25 +901,6 @@ xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual)
case DirectColor:
xf86DrvMsg(scrp->scrnIndex, visualFrom, "Default visual is %s\n",
xf86VisualNames[scrp->defaultVisual]);
- /* Check if the visual is valid for the depth */
- if (scrp->depth == 1 && scrp->defaultVisual != StaticGray)
- bad = TRUE;
-#if 0
- else if (scrp->depth == 4 &&
- (scrp->defaultVisual == TrueColor ||
- scrp->defaultVisual == DirectColor))
- bad = TRUE;
-#endif
- else if (scrp->depth > MAX_PSEUDO_DEPTH &&
- scrp->defaultVisual != TrueColor &&
- scrp->defaultVisual != DirectColor)
- bad = TRUE;
- if (bad) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Selected default "
- "visual (%s) is not valid for depth %d\n",
- xf86VisualNames[scrp->defaultVisual], scrp->depth);
- return FALSE;
- } else
return TRUE;
default:
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index c1918c6ef..f507753fe 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -93,6 +93,11 @@
extern int xtest_command_key;
#endif /* XTESTEXT1 */
+#ifdef DPMSExtension
+#define DPMS_SERVER
+#include "extensions/dpms.h"
+#endif
+
/* forward declarations */
@@ -139,7 +144,7 @@ static int numFormats = 6;
#endif
static Bool formatsDone = FALSE;
-InputDriverRec xf86KEYBOARD = {
+InputDriverRec XF86KEYBOARD = {
1,
"keyboard",
NULL,
@@ -418,8 +423,10 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
xfree(modulelist);
}
+#ifdef USE_DEPRECATED_KEYBOARD_DRIVER
/* Setup the builtin input drivers */
- xf86AddInputDriver(&xf86KEYBOARD, NULL, 0);
+ xf86AddInputDriver(&XF86KEYBOARD, NULL, 0);
+#endif
/* Load all input driver modules specified in the config file. */
if ((modulelist = xf86InputDriverlistFromConfig())) {
xf86LoadModules(modulelist, NULL);
@@ -897,6 +904,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
xf86Screens[i]->DPMSSet = NULL;
xf86Screens[i]->LoadPalette = NULL;
xf86Screens[i]->SetOverscan = NULL;
+ xf86Screens[i]->RRFunc = NULL;
+ xf86Screens[i]->pScreen = NULL;
scr_index = AddScreen(xf86Screens[i]->ScreenInit, argc, argv);
if (scr_index == i) {
/*
@@ -1008,12 +1017,18 @@ InitInput(argc, argv)
if (serverGeneration == 1) {
/* Call the PreInit function for each input device instance. */
for (pDev = xf86ConfigLayout.inputs; pDev && pDev->identifier; pDev++) {
+#ifdef USE_DEPRECATED_KEYBOARD_DRIVER
/* XXX The keyboard driver is a special case for now. */
if (!xf86NameCmp(pDev->driver, "keyboard")) {
- xf86Msg(X_INFO, "Keyboard \"%s\" handled by legacy driver\n",
+ xf86MsgVerb(X_WARNING, 0, "*** WARNING the legacy keyboard driver \"keyboard\" is deprecated\n");
+ xf86MsgVerb(X_WARNING, 0, "*** and will be removed in the next release of the Xorg server.\n");
+ xf86MsgVerb(X_WARNING, 0, "*** Please consider using the the new \"kbd\" driver for \"%s\".\n",
pDev->identifier);
+
continue;
}
+#endif
+
if ((pDrv = MatchInput(pDev)) == NULL) {
xf86Msg(X_ERROR, "No Input driver matching `%s'\n", pDev->driver);
/* XXX For now, just continue. */
@@ -1093,11 +1108,15 @@ InitInput(argc, argv)
xf86Info.kbdEvents = NULL; /* to prevent the internal keybord driver usage*/
}
else {
+#ifdef USE_DEPRECATED_KEYBOARD_DRIVER
+ /* Only set this if we're allowing the old driver. */
xf86Info.pKeyboard = AddInputDevice(xf86Info.kbdProc, TRUE);
+#endif
}
if (corePointer)
xf86Info.pMouse = corePointer->dev;
- RegisterKeyboardDevice(xf86Info.pKeyboard);
+ if (xf86Info.pKeyboard)
+ RegisterKeyboardDevice(xf86Info.pKeyboard);
miRegisterPointerDevice(screenInfo.screens[0], xf86Info.pMouse);
#ifdef XINPUT
@@ -1246,6 +1265,10 @@ AbortDDX()
* screen explicitely.
*/
xf86EnableAccess(xf86Screens[i]);
+#ifdef DPMSExtension
+ if (xf86Screens[i]->DPMSSet)
+ xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0);
+#endif
(xf86Screens[i]->LeaveVT)(i, 0);
}
}
@@ -1344,15 +1367,15 @@ ddxProcessArgument(int argc, char **argv, int i)
return 2;
}
}
- if (!strcmp(argv[i], "-xf86config"))
+ if (!strcmp(argv[i], "-config") || !strcmp(argv[i], "-xf86config"))
{
if (!argv[i + 1])
return 0;
if (getuid() != 0 && !xf86PathIsSafe(argv[i + 1])) {
- FatalError("\nInvalid argument for -xf86config\n"
- "\tFor non-root users, the file specified with -xf86config must be\n"
+ FatalError("\nInvalid argument for -config\n"
+ "\tFor non-root users, the file specified with -config must be\n"
"\ta relative path and must not contain any \"..\" elements.\n"
- "\tUsing default XF86Config search path.\n\n");
+ "\tUsing default "__XCONFIGFILE__" search path.\n\n");
}
xf86ConfigFile = argv[i + 1];
return 2;
@@ -1641,6 +1664,11 @@ ddxProcessArgument(int argc, char **argv, int i)
return xf86ProcessArgument(argc, argv, i);
}
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+}
+
/*
* ddxUseMsg --
* Print out correct use of device dependent commandline options.
@@ -1655,15 +1683,14 @@ ddxUseMsg()
ErrorF("Device Dependent Usage\n");
if (getuid() == 0)
{
- ErrorF("-xf86config file specify a configuration file\n");
ErrorF("-modulepath paths specify the module search path\n");
ErrorF("-logfile file specify a log file name\n");
- ErrorF("-configure probe for devices and write an XF86Config\n");
+ ErrorF("-configure probe for devices and write an "__XCONFIGFILE__"\n");
}
else
{
- ErrorF("-xf86config file specify a configuration file, relative to the\n");
- ErrorF(" XF86Config search path, only root can use absolute\n");
+ ErrorF("-config file specify a configuration file, relative to the\n");
+ ErrorF(" "__XCONFIGFILE__" search path, only root can use absolute\n");
}
ErrorF("-probeonly probe for devices, then exit\n");
ErrorF("-scanpci execute the scanpci module and exit\n");
@@ -1720,16 +1747,19 @@ xf86PrintBanner()
#if PRE_RELEASE
ErrorF("\n"
"This is a pre-release version of the " XVENDORNAME " X11.\n"
- "Portions of this release are based on XFree86 4.4RC2 and selected\n"
- "files from XFree86 4.4RC3. It is not supported in any way.\n"
+ "It is not supported in any way.\n"
"Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n"
"Select the \"xorg\" product for bugs you find in this release.\n"
"Before reporting bugs in pre-release versions please check the\n"
"latest version in the " XVENDORNAME " \"monolithic tree\" CVS\n"
"repository hosted at http://www.freedesktop.org/Software/xorg/");
#endif
+ ErrorF("\nX Window System Version %d.%d.%d",
+ XORG_VERSION_MAJOR,
+ XORG_VERSION_MINOR,
+ XORG_VERSION_PATCH);
#if XORG_VERSION_SNAP > 0
- ErrorF(".%d", XF86_VERSION_SNAP);
+ ErrorF(".%d", XORG_VERSION_SNAP);
#endif
#if XORG_VERSION_SNAP >= 900
@@ -1738,9 +1768,12 @@ xf86PrintBanner()
#endif
#ifdef XORG_CUSTOM_VERSION
- ErrorF(" (%s)", XF86_CUSTOM_VERSION);
+ ErrorF(" (%s)", XORG_CUSTOM_VERSION);
+#endif
+#ifndef XORG_DATE
+#define XORG_DATE XF86_DATE
#endif
- ErrorF("\nRelease Date: %s\n", XF86_DATE);
+ ErrorF("\nRelease Date: %s\n", XORG_DATE);
ErrorF("X Protocol Version %d, Revision %d, %s\n",
X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE );
ErrorF("Build Operating System:%s%s\n", OSNAME, OSVENDOR);
diff --git a/hw/xfree86/common/xf86Io.c b/hw/xfree86/common/xf86Io.c
index bd44bdeb5..7f9ba6f0e 100644
--- a/hw/xfree86/common/xf86Io.c
+++ b/hw/xfree86/common/xf86Io.c
@@ -49,6 +49,7 @@
*/
/* $XConsortium: xf86Io.c /main/27 1996/10/19 17:58:55 kaleb $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 1.2 2004/07/28 03:57:19 alanc Exp $ */
#define NEED_EVENTS
#include "X.h"
@@ -148,6 +149,10 @@ xf86KbdLeds ()
if (leds & XLED4) real_leds |= LED_SCR;
#endif
#endif
+#ifdef sun
+ /* Pass through any additional LEDs, such as Kana LED on Sun Japanese kbd */
+ real_leds |= (leds & 0xFFFFFFF0);
+#endif
xf86SetKbdLeds(real_leds);
(void)leds;
}
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index ec83f514b..4462322d9 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.1.4.3.2.1 2004/02/27 21:30:59 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.2 2004/04/23 19:20:32 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.69 2003/10/08 14:58:28 dawes Exp $ */
/*
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
diff --git a/hw/xfree86/common/xf86PciInfo.h b/hw/xfree86/common/xf86PciInfo.h
index 19cc009dd..a14ad1897 100644
--- a/hw/xfree86/common/xf86PciInfo.h
+++ b/hw/xfree86/common/xf86PciInfo.h
@@ -113,6 +113,18 @@
#define PCI_CHIP_QV1280 0x3033
/* ATI */
+#define PCI_CHIP_RV380_3150 0x3150
+#define PCI_CHIP_RV380_3151 0x3151
+#define PCI_CHIP_RV380_3152 0x3152
+#define PCI_CHIP_RV380_3153 0x3153
+#define PCI_CHIP_RV380_3154 0x3154
+#define PCI_CHIP_RV380_3156 0x3156
+#define PCI_CHIP_RV380_3E50 0x3E50
+#define PCI_CHIP_RV380_3E51 0x3E51
+#define PCI_CHIP_RV380_3E52 0x3E52
+#define PCI_CHIP_RV380_3E53 0x3E53
+#define PCI_CHIP_RV380_3E54 0x3E54
+#define PCI_CHIP_RV380_3E56 0x3E56
#define PCI_CHIP_RS100_4136 0x4136
#define PCI_CHIP_RS200_4137 0x4137
#define PCI_CHIP_R300_AD 0x4144
@@ -161,6 +173,14 @@
#define PCI_CHIP_RV250_Ie 0x4965
#define PCI_CHIP_RV250_If 0x4966
#define PCI_CHIP_RV250_Ig 0x4967
+#define PCI_CHIP_R420_JH 0x4A48
+#define PCI_CHIP_R420_JI 0x4A49
+#define PCI_CHIP_R420_JJ 0x4A4A
+#define PCI_CHIP_R420_JK 0x4A4B
+#define PCI_CHIP_R420_JL 0x4A4C
+#define PCI_CHIP_R420_JM 0x4A4D
+#define PCI_CHIP_R420_JN 0x4A4E
+#define PCI_CHIP_R420_JP 0x4A50
#define PCI_CHIP_MACH64LB 0x4C42
#define PCI_CHIP_MACH64LD 0x4C44
#define PCI_CHIP_RAGE128LE 0x4C45
@@ -257,6 +277,21 @@
#define PCI_CHIP_RAGE128TS 0x5453
#define PCI_CHIP_RAGE128TT 0x5454
#define PCI_CHIP_RAGE128TU 0x5455
+#define PCI_CHIP_RV370_5460 0x5460
+#define PCI_CHIP_RV370_5461 0x5461
+#define PCI_CHIP_RV370_5462 0x5462
+#define PCI_CHIP_RV370_5463 0x5463
+#define PCI_CHIP_RV370_5464 0x5464
+#define PCI_CHIP_RV370_5465 0x5465
+#define PCI_CHIP_RV370_5466 0x5466
+#define PCI_CHIP_RV370_5467 0x5467
+#define PCI_CHIP_R423_UH 0x5548
+#define PCI_CHIP_R423_UI 0x5549
+#define PCI_CHIP_R423_UJ 0x554A
+#define PCI_CHIP_R423_UK 0x554B
+#define PCI_CHIP_R423_UQ 0x5551
+#define PCI_CHIP_R423_UR 0x5552
+#define PCI_CHIP_R423_UT 0x5554
#define PCI_CHIP_MACH64VT 0x5654
#define PCI_CHIP_MACH64VU 0x5655
#define PCI_CHIP_MACH64VV 0x5656
@@ -264,12 +299,23 @@
#define PCI_CHIP_RS300_5835 0x5835
#define PCI_CHIP_RS300_5836 0x5836
#define PCI_CHIP_RS300_5837 0x5837
+#define PCI_CHIP_RV370_5B60 0x5B60
+#define PCI_CHIP_RV370_5B61 0x5B61
+#define PCI_CHIP_RV370_5B62 0x5B62
+#define PCI_CHIP_RV370_5B63 0x5B63
+#define PCI_CHIP_RV370_5B64 0x5B64
+#define PCI_CHIP_RV370_5B65 0x5B65
+#define PCI_CHIP_RV370_5B66 0x5B66
+#define PCI_CHIP_RV370_5B67 0x5B67
#define PCI_CHIP_RV280_5960 0x5960
#define PCI_CHIP_RV280_5961 0x5961
#define PCI_CHIP_RV280_5962 0x5962
#define PCI_CHIP_RV280_5964 0x5964
#define PCI_CHIP_RV280_5C61 0x5C61
#define PCI_CHIP_RV280_5C63 0x5C63
+#define PCI_CHIP_R423_5D57 0x5D57
+#define PCI_CHIP_RS350_7834 0x7834
+#define PCI_CHIP_RS350_7835 0x7835
/* Avance Logic */
#define PCI_CHIP_ALG2064 0x2064
diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
index 6f7fac3d3..457793efc 100644
--- a/hw/xfree86/common/xf86RandR.c
+++ b/hw/xfree86/common/xf86RandR.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.1.4.3.2.2 2004/03/04 17:47:34 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.5 2004/08/13 18:24:07 sandmann Exp $ */
/*
* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.7tsi Exp $
*
@@ -38,6 +38,9 @@ typedef struct _xf86RandRInfo {
CloseScreenProcPtr CloseScreen;
int virtualX;
int virtualY;
+ int mmWidth;
+ int mmHeight;
+ Rotation rotation;
} XF86RandRInfoRec, *XF86RandRInfoPtr;
static int xf86RandRIndex;
@@ -72,13 +75,13 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
refresh0 = refresh;
pSize = RRRegisterSize (pScreen,
mode->HDisplay, mode->VDisplay,
- pScreen->mmWidth, pScreen->mmHeight);
+ randrp->mmWidth, randrp->mmHeight);
if (!pSize)
return FALSE;
RRRegisterRate (pScreen, pSize, refresh);
if (mode == scrp->currentMode &&
- mode->HDisplay == pScreen->width && mode->VDisplay == pScreen->height)
- RRSetCurrentConfig (pScreen, RR_Rotate_0, refresh, pSize);
+ mode->HDisplay == scrp->virtualX && mode->VDisplay == scrp->virtualY)
+ RRSetCurrentConfig (pScreen, randrp->rotation, refresh, pSize);
if (mode->next == scrp->modes)
break;
}
@@ -88,33 +91,48 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
mode = scrp->modes;
pSize = RRRegisterSize (pScreen,
randrp->virtualX, randrp->virtualY,
- pScreen->mmWidth * randrp->virtualX / scrp->currentMode->HDisplay,
- pScreen->mmHeight * randrp->virtualY / scrp->currentMode->VDisplay);
+ randrp->mmWidth,
+ randrp->mmHeight);
if (!pSize)
return FALSE;
RRRegisterRate (pScreen, pSize, refresh0);
- if (pScreen->width == randrp->virtualX &&
- pScreen->height == randrp->virtualY)
+ if (scrp->virtualX == randrp->virtualX &&
+ scrp->virtualY == randrp->virtualY)
{
- RRSetCurrentConfig (pScreen, RR_Rotate_0, refresh0, pSize);
+ RRSetCurrentConfig (pScreen, randrp->rotation, refresh0, pSize);
}
}
+
+ /* If there is driver support for randr, let it set our supported rotations */
+ if(scrp->RRFunc) {
+ xorgRRRotation RRRotation;
+
+ RRRotation.RRRotations = *rotations;
+ if (!(*scrp->RRFunc)(scrp, RR_GET_INFO, &RRRotation))
+ return FALSE;
+ *rotations = RRRotation.RRRotations;
+ }
+
return TRUE;
}
static Bool
xf86RandRSetMode (ScreenPtr pScreen,
DisplayModePtr mode,
- Bool useVirtual)
+ Bool useVirtual,
+ int mmWidth,
+ int mmHeight)
{
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
int oldWidth = pScreen->width;
int oldHeight = pScreen->height;
+ int oldmmWidth = pScreen->mmWidth;
+ int oldmmHeight = pScreen->mmHeight;
WindowPtr pRoot = WindowTable[pScreen->myNum];
if (pRoot)
- xf86EnableDisableFBAccess (pScreen->myNum, FALSE);
+ (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE);
if (useVirtual)
{
scrp->virtualX = randrp->virtualX;
@@ -125,12 +143,27 @@ xf86RandRSetMode (ScreenPtr pScreen,
scrp->virtualX = mode->HDisplay;
scrp->virtualY = mode->VDisplay;
}
- pScreen->width = scrp->virtualX;
- pScreen->height = scrp->virtualY;
+ if(randrp->rotation & (RR_Rotate_90 | RR_Rotate_270))
+ {
+ /* If the screen is rotated 90 or 270 degrees, swap the sizes. */
+ pScreen->width = scrp->virtualY;
+ pScreen->height = scrp->virtualX;
+ pScreen->mmWidth = mmHeight;
+ pScreen->mmHeight = mmWidth;
+ }
+ else
+ {
+ pScreen->width = scrp->virtualX;
+ pScreen->height = scrp->virtualY;
+ pScreen->mmWidth = mmWidth;
+ pScreen->mmHeight = mmHeight;
+ }
if (!xf86SwitchMode (pScreen, mode))
{
scrp->virtualX = pScreen->width = oldWidth;
scrp->virtualY = pScreen->height = oldHeight;
+ pScreen->mmWidth = oldmmWidth;
+ pScreen->mmHeight = oldmmHeight;
return FALSE;
}
/*
@@ -144,7 +177,7 @@ xf86RandRSetMode (ScreenPtr pScreen,
xf86SetViewport (pScreen, pScreen->width, pScreen->height);
xf86SetViewport (pScreen, 0, 0);
if (pRoot)
- xf86EnableDisableFBAccess (pScreen->myNum, TRUE);
+ (*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE);
return TRUE;
}
@@ -160,6 +193,8 @@ xf86RandRSetConfig (ScreenPtr pScreen,
int px, py;
Bool useVirtual = FALSE;
+ randrp->rotation = rotation;
+
miPointerPosition (&px, &py);
for (mode = scrp->modes; ; mode = mode->next)
{
@@ -179,7 +214,20 @@ xf86RandRSetConfig (ScreenPtr pScreen,
return FALSE;
}
}
- if (!xf86RandRSetMode (pScreen, mode, useVirtual))
+
+ /* Have the driver do its thing. */
+ if (scrp->RRFunc) {
+ xorgRRRotation RRRotation;
+ RRRotation.RRConfig.rotation = rotation;
+ RRRotation.RRConfig.rate = rate;
+ RRRotation.RRConfig.width = pSize->width;
+ RRRotation.RRConfig.height = pSize->height;
+
+ if (!(*scrp->RRFunc)(scrp, RR_SET_CONFIG, &RRRotation))
+ return FALSE;
+ }
+
+ if (!xf86RandRSetMode (pScreen, mode, useVirtual, pSize->mmWidth, pSize->mmHeight))
return FALSE;
/*
* Move the cursor back where it belongs; SwitchMode repositions it
@@ -189,6 +237,7 @@ xf86RandRSetConfig (ScreenPtr pScreen,
if (px < pSize->width && py < pSize->height)
(*pScreen->SetCursorPosition) (pScreen, px, py, FALSE);
}
+
return TRUE;
}
@@ -270,6 +319,8 @@ xf86RandRInit (ScreenPtr pScreen)
randrp->virtualX = scrp->virtualX;
randrp->virtualY = scrp->virtualY;
+ randrp->mmWidth = pScreen->mmWidth;
+ randrp->mmHeight = pScreen->mmHeight;
randrp->CreateScreenResources = pScreen->CreateScreenResources;
pScreen->CreateScreenResources = xf86RandRCreateScreenResources;
@@ -277,6 +328,8 @@ xf86RandRInit (ScreenPtr pScreen)
randrp->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = xf86RandRCloseScreen;
+ randrp->rotation = RR_Rotate_0;
+
pScreen->devPrivates[xf86RandRIndex].ptr = randrp;
return TRUE;
}
diff --git a/hw/xfree86/common/xf86Version.h b/hw/xfree86/common/xf86Version.h
index a044230ed..45746bc90 100644
--- a/hw/xfree86/common/xf86Version.h
+++ b/hw/xfree86/common/xf86Version.h
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 1.1.4.4 2003/12/20 00:28:26 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 1.2 2004/04/23 19:20:02 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.566 2003/12/19 04:52:11 dawes Exp $ */
/*
@@ -59,4 +59,4 @@
#endif
/* $XConsortium: xf86Version.h /main/78 1996/10/28 05:42:10 kaleb $ */
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 1.1.4.4 2003/12/20 00:28:26 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 1.2 2004/04/23 19:20:02 eich Exp $ */
diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
index c3b09e361..77d2ed174 100644
--- a/hw/xfree86/common/xf86cmap.c
+++ b/hw/xfree86/common/xf86cmap.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.1.4.2 2004/02/16 20:19:59 alanc Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.3 2004/07/30 21:10:46 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.25 2003/10/17 20:02:12 alanh Exp $ */
/*
* Copyright (c) 1998-2001 by The XFree86 Project, Inc.
@@ -117,7 +117,7 @@ static int CMapChangeGamma(int, Gamma);
static void ComputeGamma(CMapScreenPtr);
static Bool CMapAllocateColormapPrivate(ColormapPtr);
-static Bool CMapInitDefMap(ColormapPtr);
+static Bool CMapInitDefMap(ColormapPtr,int);
static void CMapRefreshColors(ColormapPtr, int, int*);
static void CMapSetOverscan(ColormapPtr, int, int *);
static void CMapReinstallMap(ColormapPtr);
@@ -211,7 +211,7 @@ Bool xf86HandleColormaps(
/* get the default map */
pDefMap = (ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP);
-
+
if(!CMapAllocateColormapPrivate(pDefMap)) {
CMapUnwrapScreen(pScreen);
return FALSE;
@@ -224,7 +224,7 @@ Bool xf86HandleColormaps(
}
static Bool
-CMapInitDefMap(ColormapPtr cmap)
+CMapInitDefMap(ColormapPtr cmap, int index)
{
return TRUE;
}
@@ -433,7 +433,8 @@ CMapInstallColormap(ColormapPtr pmap)
/* Important. We let the lower layers, namely DGA,
overwrite the choice of Colormap to install */
- pmap = miInstalledMaps[index];
+ if (miInstalledMaps[index])
+ pmap = miInstalledMaps[index];
if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
(pmap->pVisual->class == TrueColor) &&
diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
index b7c4afa1c..ee286d172 100644
--- a/hw/xfree86/common/xf86fbman.c
+++ b/hw/xfree86/common/xf86fbman.c
@@ -1095,12 +1095,10 @@ localQueryLargestOffscreenLinear(
*size = 0;
- if (!offman->LinearAreas) return FALSE;
-
pLink = offman->LinearAreas;
- pLinkRet = pLink;
- if (!pLink->area) {
+ if (pLink && !pLink->area) {
+ pLinkRet = pLink;
while (pLink) {
if (pLink->free) {
if (pLink->linear.size > pLinkRet->linear.size)
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 790bf7409..c5a022bf9 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -424,7 +424,7 @@ FindPCIVideoInfo(void)
if ((pcrp->pci_command & PCI_CMD_MEM_ENABLE) &&
(num == 1 ||
((info->class == PCI_CLASS_DISPLAY) &&
- (info->subclass == PCI_SUBCLASS_DISPLAY_MISC)))) {
+ (info->subclass == PCI_SUBCLASS_DISPLAY_VGA)))) {
if (primaryBus.type == BUS_NONE) {
primaryBus.type = BUS_PCI;
primaryBus.id.pci.bus = pcrp->busnum;
@@ -3230,10 +3230,14 @@ pciVideoPtr
xf86GetPciInfoForEntity(int entityIndex)
{
pciVideoPtr *ppPci;
- EntityPtr p = xf86Entities[entityIndex];
+ EntityPtr p;
- if (entityIndex >= xf86NumEntities
- || p->busType != BUS_PCI) return NULL;
+ if (entityIndex >= xf86NumEntities)
+ return NULL;
+
+ p = xf86Entities[entityIndex];
+ if (p->busType != BUS_PCI)
+ return NULL;
for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) {
if (p->pciBusId.bus == (*ppPci)->bus &&
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 367cb19a9..770233033 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -476,7 +476,7 @@ typedef struct _confdrirec {
/* These values should be adjusted when new fields are added to ScrnInfoRec */
#define NUM_RESERVED_INTS 16
#define NUM_RESERVED_POINTERS 15
-#define NUM_RESERVED_FUNCS 12
+#define NUM_RESERVED_FUNCS 11
typedef pointer (*funcPointer)(void);
@@ -737,6 +737,24 @@ typedef struct {
PixmapPtr pPix;
} DGADeviceRec, *DGADevicePtr;
+typedef enum {
+ RR_GET_INFO,
+ RR_SET_CONFIG
+} xorgRRFuncFlags;
+
+typedef struct {
+ int rotation;
+ int rate;
+ int width;
+ int height;
+} xorgRRConfig;
+
+typedef union {
+ short RRRotations;
+ xorgRRConfig RRConfig;
+} xorgRRRotation, *xorgRRRotationPtr;
+
+
/*
* Flags for driver Probe() functions.
*/
@@ -767,6 +785,9 @@ typedef int xf86HandleMessageProc (int, const char*, const char*, char**);
typedef void xf86DPMSSetProc (ScrnInfoPtr, int, int);
typedef void xf86LoadPaletteProc (ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
typedef void xf86SetOverscanProc (ScrnInfoPtr, int);
+typedef Bool xorgRRFuncProc (ScrnInfoPtr, xorgRRFuncFlags,
+ xorgRRRotationPtr);
+
/*
* ScrnInfoRec
@@ -921,6 +942,7 @@ typedef struct _ScrnInfoRec {
xf86DPMSSetProc *DPMSSet;
xf86LoadPaletteProc *LoadPalette;
xf86SetOverscanProc *SetOverscan;
+ xorgRRFuncProc *RRFunc;
/*
* This can be used when the minor ABI version is incremented.
diff --git a/hw/xfree86/common/xorgHelper.c b/hw/xfree86/common/xorgHelper.c
index c6364f19e..4b904dc06 100644
--- a/hw/xfree86/common/xorgHelper.c
+++ b/hw/xfree86/common/xorgHelper.c
@@ -1,4 +1,4 @@
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xorgHelper.c,v 1.2 2004/04/23 19:20:32 eich Exp $ */
#include "X.h"
#include "os.h"
diff --git a/hw/xfree86/common/xorgVersion.h b/hw/xfree86/common/xorgVersion.h
index bfc66a59c..47005320a 100644
--- a/hw/xfree86/common/xorgVersion.h
+++ b/hw/xfree86/common/xorgVersion.h
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 1.1.4.3 2003/12/06 13:24:23 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xorgVersion.h,v 1.3 2004/08/16 02:07:53 kem Exp $ */
/*
* Copyright (c) 2004, X.Org Foundation
@@ -45,7 +45,7 @@
# define XORG_VERSION_MAJOR XORG_GET_MAJOR_VERSION(XORG_VERSION_CURRENT)
# define XORG_VERSION_MINOR XORG_GET_MINOR_VERSION(XORG_VERSION_CURRENT)
# define XORG_VERSION_PATCH XORG_GET_PATCH_VERSION(XORG_VERSION_CURRENT)
-# define XORG_VERSION_SNAP XORG_GET_PATCH_VERSION(XORG_VERSION_CURRENT)
+# define XORG_VERSION_SNAP XORG_GET_SNAP_VERSION(XORG_VERSION_CURRENT)
#endif
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 1.1.4.3 2003/12/06 13:24:23 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xorgVersion.h,v 1.3 2004/08/16 02:07:53 kem Exp $ */
diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c
index bf2509c95..d5a791570 100644
--- a/hw/xfree86/ddc/interpret_edid.c
+++ b/hw/xfree86/ddc/interpret_edid.c
@@ -185,7 +185,9 @@ get_monitor_ranges(Uchar *c, struct monitor_ranges *r)
r->max_v = MAX_V;
r->min_h = MIN_H;
r->max_h = MAX_H;
- r->max_clock = MAX_CLOCK * 10;
+ r->max_clock = 0;
+ if(MAX_CLOCK != 0xff) /* is specified? */
+ r->max_clock = MAX_CLOCK * 10;
}
static void
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
index 123bb492e..2cdeacab5 100644
--- a/hw/xfree86/ddc/xf86DDC.c
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -34,7 +34,7 @@ static XF86ModuleVersionInfo ddcVersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
ABI_VIDEODRV_VERSION,
@@ -83,7 +83,7 @@ ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin)
static unsigned char *EDIDRead_DDC1(
ScrnInfoPtr pScrn,
- void (*)(ScrnInfoPtr,xf86ddcSpeed),
+ DDC1SetSpeedProc,
unsigned int (*)(ScrnInfoPtr)
);
@@ -139,7 +139,7 @@ DDCAvailableOptions(void *unused)
xf86MonPtr
xf86DoEDID_DDC1(
- int scrnIndex, void (*DDC1SetSpeed)(ScrnInfoPtr, xf86ddcSpeed),
+ int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed,
unsigned int (*DDC1Read)(ScrnInfoPtr)
)
{
@@ -227,7 +227,7 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
* function; it will also decide if we need to reread it
*/
static unsigned char *
-EDIDRead_DDC1(ScrnInfoPtr pScrn, void (*DDCSpeed)(ScrnInfoPtr,xf86ddcSpeed),
+EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed,
unsigned int (*read_DDC)(ScrnInfoPtr))
{
unsigned char *EDID_block = NULL;
diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h
index ae2e26641..3d94fd976 100644
--- a/hw/xfree86/ddc/xf86DDC.h
+++ b/hw/xfree86/ddc/xf86DDC.h
@@ -24,9 +24,11 @@ typedef enum {
DDC_FAST
} xf86ddcSpeed;
+typedef void (* DDC1SetSpeedProc)(ScrnInfoPtr, xf86ddcSpeed);
+
extern xf86MonPtr xf86DoEDID_DDC1(
int scrnIndex,
- void (*DDC1SetSpeed)(ScrnInfoPtr, xf86ddcSpeed),
+ DDC1SetSpeedProc DDC1SetSpeed,
unsigned int (*DDC1Read)(ScrnInfoPtr)
);
diff --git a/hw/xfree86/dixmods/GLcoremodule.c b/hw/xfree86/dixmods/GLcoremodule.c
index 422da4820..a62b33ce4 100644
--- a/hw/xfree86/dixmods/GLcoremodule.c
+++ b/hw/xfree86/dixmods/GLcoremodule.c
@@ -42,7 +42,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_EXTENSION,
ABI_EXTENSION_VERSION,
diff --git a/hw/xfree86/dixmods/afbmodule.c b/hw/xfree86/dixmods/afbmodule.c
index 19f196ad8..ac7049c10 100644
--- a/hw/xfree86/dixmods/afbmodule.c
+++ b/hw/xfree86/dixmods/afbmodule.c
@@ -36,7 +36,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/dixmods/bitmapmod.c b/hw/xfree86/dixmods/bitmapmod.c
index 27fc23d32..458cc62c9 100644
--- a/hw/xfree86/dixmods/bitmapmod.c
+++ b/hw/xfree86/dixmods/bitmapmod.c
@@ -43,7 +43,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_FONT, /* Font module */
ABI_FONT_VERSION,
diff --git a/hw/xfree86/dixmods/cfb16module.c b/hw/xfree86/dixmods/cfb16module.c
index c8c79b545..ef5c79459 100644
--- a/hw/xfree86/dixmods/cfb16module.c
+++ b/hw/xfree86/dixmods/cfb16module.c
@@ -38,7 +38,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/dixmods/cfb24module.c b/hw/xfree86/dixmods/cfb24module.c
index cf363f3c7..e7e683ae0 100644
--- a/hw/xfree86/dixmods/cfb24module.c
+++ b/hw/xfree86/dixmods/cfb24module.c
@@ -38,7 +38,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/dixmods/cfb32module.c b/hw/xfree86/dixmods/cfb32module.c
index 791b64285..2d75763b0 100644
--- a/hw/xfree86/dixmods/cfb32module.c
+++ b/hw/xfree86/dixmods/cfb32module.c
@@ -38,7 +38,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/dixmods/cfbmodule.c b/hw/xfree86/dixmods/cfbmodule.c
index 87af699db..142442adb 100644
--- a/hw/xfree86/dixmods/cfbmodule.c
+++ b/hw/xfree86/dixmods/cfbmodule.c
@@ -38,7 +38,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/dixmods/dbemodule.c b/hw/xfree86/dixmods/dbemodule.c
index 914678b71..ff2b7ffbc 100644
--- a/hw/xfree86/dixmods/dbemodule.c
+++ b/hw/xfree86/dixmods/dbemodule.c
@@ -20,7 +20,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_EXTENSION,
ABI_EXTENSION_VERSION,
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
index a27fa5994..56776accf 100644
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -213,7 +213,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_EXTENSION,
ABI_EXTENSION_VERSION,
diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h
index 71b54866d..73f4d1b14 100644
--- a/hw/xfree86/dixmods/extmod/modinit.h
+++ b/hw/xfree86/dixmods/extmod/modinit.h
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/Xext/extmod/modinit.h,v 1.1.4.2.2.2 2004/03/04 20:16:03 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/Xext/extmod/modinit.h,v 1.2 2004/04/23 18:44:43 eich Exp $ */
/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.h,v 1.1 2003/07/16 01:38:33 dawes Exp $ */
#ifndef INITARGS
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 74119e4a1..8060aec52 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -29,7 +29,7 @@ or other dealings in this Software without prior written authorization
from Kaleb S. KEITHLEY
*/
-/* $XdotOrg: xc/programs/Xserver/Xext/xf86vmode.c,v 1.1.4.3.4.1 2004/03/04 17:47:20 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/Xext/xf86vmode.c,v 1.2 2004/04/23 18:44:41 eich Exp $ */
/* $Xorg: xf86vmode.c,v 1.3 2000/08/17 19:47:59 cpqbld Exp $ */
/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
diff --git a/hw/xfree86/dixmods/fbmodule.c b/hw/xfree86/dixmods/fbmodule.c
index 2b9c50408..1b9b665dd 100644
--- a/hw/xfree86/dixmods/fbmodule.c
+++ b/hw/xfree86/dixmods/fbmodule.c
@@ -36,7 +36,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/dixmods/ftmodule.c b/hw/xfree86/dixmods/ftmodule.c
index ceb5485c0..1f65cefbe 100644
--- a/hw/xfree86/dixmods/ftmodule.c
+++ b/hw/xfree86/dixmods/ftmodule.c
@@ -43,7 +43,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING " & the After X-TT Project",
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
2, 1, 0,
ABI_CLASS_FONT, /* Font module */
ABI_FONT_VERSION,
diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c
index eb8e54f26..853d49b0f 100644
--- a/hw/xfree86/dixmods/glxmodule.c
+++ b/hw/xfree86/dixmods/glxmodule.c
@@ -113,6 +113,8 @@ static const char *glcoreSymbols[] = {
"__glTexGeniv_size",
"__glTexParameterfv_size",
"__glTexParameteriv_size",
+ "__glXglDDXExtensionInfo",
+ "__glXglDDXScreenInfo",
"__glXActiveScreens",
"__glXAssociateContext",
"__glXBadContext",
@@ -776,7 +778,6 @@ static const char *glcoreSymbols[] = {
"__glXFogfvReqSize",
"__glXFogivReqSize",
"__glXForceCurrent",
- "__glXFormatGLModes",
"__glXFree",
"__glXFreeBuffers",
"__glXFreeContext",
@@ -1222,7 +1223,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_EXTENSION,
ABI_EXTENSION_VERSION,
diff --git a/hw/xfree86/dixmods/laymodule.c b/hw/xfree86/dixmods/laymodule.c
index 274e68b2e..6d7c4e280 100644
--- a/hw/xfree86/dixmods/laymodule.c
+++ b/hw/xfree86/dixmods/laymodule.c
@@ -43,7 +43,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/dixmods/mfbmodule.c b/hw/xfree86/dixmods/mfbmodule.c
index 0617226d0..40d884c9e 100644
--- a/hw/xfree86/dixmods/mfbmodule.c
+++ b/hw/xfree86/dixmods/mfbmodule.c
@@ -35,7 +35,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/dixmods/recordmod.c b/hw/xfree86/dixmods/recordmod.c
index bd1022193..4eebf0ee6 100644
--- a/hw/xfree86/dixmods/recordmod.c
+++ b/hw/xfree86/dixmods/recordmod.c
@@ -21,7 +21,7 @@ static XF86ModuleVersionInfo VersRec = {
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 13, 0,
ABI_CLASS_EXTENSION,
ABI_EXTENSION_VERSION,
diff --git a/hw/xfree86/dixmods/shmodule.c b/hw/xfree86/dixmods/shmodule.c
index d24f8a823..f47b03aa9 100644
--- a/hw/xfree86/dixmods/shmodule.c
+++ b/hw/xfree86/dixmods/shmodule.c
@@ -43,7 +43,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/dixmods/type1mod.c b/hw/xfree86/dixmods/type1mod.c
index 9c25f4c0b..868de3de4 100644
--- a/hw/xfree86/dixmods/type1mod.c
+++ b/hw/xfree86/dixmods/type1mod.c
@@ -43,7 +43,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 2,
ABI_CLASS_FONT, /* Font module */
ABI_FONT_VERSION,
diff --git a/hw/xfree86/dixmods/xf86XTrapModule.c b/hw/xfree86/dixmods/xf86XTrapModule.c
index 65062108e..f6e37b54e 100644
--- a/hw/xfree86/dixmods/xf86XTrapModule.c
+++ b/hw/xfree86/dixmods/xf86XTrapModule.c
@@ -27,7 +27,7 @@ static XF86ModuleVersionInfo xtrapVersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_EXTENSION, /* needs the server extension ABI */
ABI_EXTENSION_VERSION,
diff --git a/hw/xfree86/doc/README.DRI b/hw/xfree86/doc/README.DRI
index 3962a0686..7fc52eb32 100644
--- a/hw/xfree86/doc/README.DRI
+++ b/hw/xfree86/doc/README.DRI
@@ -1253,3 +1253,4 @@ demo programs is available from http://dri.sourceforge.net/res.phtml
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.28 dawes Exp $
+
diff --git a/hw/xfree86/doc/README.fonts b/hw/xfree86/doc/README.fonts
index 26b92cd01..87f264f14 100644
--- a/hw/xfree86/doc/README.fonts
+++ b/hw/xfree86/doc/README.fonts
@@ -1,4 +1,4 @@
- Fonts in X11R6.7
+ Fonts in X11R6.8
Juliusz Chroboczek, <jch@pps.jussieu.fr>
@@ -6,10 +6,9 @@
1. Introduction
-This document describes the support for fonts in X11R6.7. Installing fonts
+This document describes the support for fonts in X11R6.8. Installing fonts
(section 2., page 1) is aimed at the casual user wishing to install fonts in
-X11R6.7 or XFree86; the rest of the document describes the font support in
-more detail.
+X11R6.8 the rest of the document describes the font support in more detail.
We assume some familiarity with digital fonts. If anything is not clear to
you, please consult Appendix: Background (section 5., page 1) at the end of
@@ -19,7 +18,7 @@ this document for background information.
X includes two font systems: the original core X11 fonts system, which is
present in all implementations of X11, and the Xft fonts system, which may
-not be distributed with implementations of X11 that are not based on X116.7.0
+not be distributed with implementations of X11 that are not based on X11R6.8
but will hopefully be included by them in the future
The core X11 fonts system is directly derived from the fonts system included
@@ -49,13 +48,13 @@ access newly-installed fonts.
Xft has no configuration mechanism itself, rather it relies upon the fontcon-
fig library to configure and customize fonts. That library is not specific
-to X11R6.7.0 or indeed on any particular font output mechanism. This discus-
+to X11R6.8 or indeed on any particular font output mechanism. This discus-
sion describes how fontconfig, rather than Xft, works.
2.1.1 Installing fonts in Xft
Fontconfig looks for fonts in a set of well-known directories that include
-all of X11R6.7's standard font directories (`/usr/X11R6/lib/X11/lib/fonts/*')
+all of X11R6.8's standard font directories (`/usr/X11R6/lib/X11/lib/fonts/*')
by default) as well as a directory called `.fonts/' in the user's home direc-
tory. Installing a font for use by Xft applications is as simple as copying
a font file into one of these directories.
@@ -115,9 +114,9 @@ Anti-aliasing can be disabled for all fonts by the following incantation:
</edit>
</match>
-Xft supports sub-pixel rasterisation on LCD displays. X11R67 should automat-
-ically enable this feature on laptops and when using an LCD monitor connected
-with a DVI cable; you can check whether this was done by typing
+Xft supports sub-pixel rasterisation on LCD displays. X11R6.8 should auto-
+matically enable this feature on laptops and when using an LCD monitor con-
+nected with a DVI cable; you can check whether this was done by typing
$ xdpyinfo -ext RENDER | grep sub-pixel
@@ -186,8 +185,8 @@ of this new directory by including it in the font path.
2.2.1 Installing bitmap fonts
-The X11R6.7 server can use bitmap fonts in both the cross-platform BDF format
-and the somewhat more efficient binary PCF format. (X11R6.7 also supports
+The X11R6.8 server can use bitmap fonts in both the cross-platform BDF format
+and the somewhat more efficient binary PCF format. (X11R6.8 also supports
the obsolete SNF format.)
Bitmap fonts are normally distributed in the BDF format. Before installing
@@ -216,7 +215,7 @@ directory; see Setting the server font path (section 2.2.4, page 1) below.
2.2.2 Installing scalable fonts
-The X11R6.7 server supports scalable fonts in four formats: Type 1, Speedo,
+The X11R6.8 server supports scalable fonts in four formats: Type 1, Speedo,
TrueType and CIDFont. This section only applies to the former three; for
information on CIDFonts, please see Installing CIDFonts (section 2.2.3, page
1) later in this document.
@@ -252,7 +251,7 @@ CMap `UniKS-UCS2-H' is called
Munhwa-Regular--UniKS-UCS2-H
-The CIDFont code in X11R6.7 requires a very rigid directory structure. The
+The CIDFont code in X11R6.8 requires a very rigid directory structure. The
main directory must be called `CID' (its location defaults to
`/usr/X11R6/lib/X11/fonts/CID' but it may be located anywhere), and it should
contain a subdirectory for every CID collection. Every subdirectory must
@@ -311,7 +310,7 @@ For best results, scalable fonts should appear in the font path before the
bitmap fonts; this way, the server will prefer bitmap fonts to scalable fonts
when an exact match is possible, but will avoid scaling bitmap fonts when a
scalable font can be used. (The `:unscaled' hack, while still supported,
-should no longer be necessary in X11R6.7.0.)
+should no longer be necessary in X11R6.8.)
You may check the font path of the running server by typing the command
@@ -354,11 +353,11 @@ mounted font directories). If this doesn't help, it is quite possible that
you are trying to use a font in a format that is not supported by your
server.
-X11R6.7 supports the BDF, PCF, SNF, Type 1, Speedo, TrueType, OpenType and
-CIDFont font formats. However, not all X11R6.7 or XFree86 servers come with
-all the font backends configured in.
+X11R6.8 supports the BDF, PCF, SNF, Type 1, Speedo, TrueType, OpenType and
+CIDFont font formats. However, not all X11R6.8 servers come with all the
+font backends configured in.
-On most platforms, the X11R6.7 servers are modular: the font backends are
+On most platforms, the X11R6.8 servers are modular: the font backends are
included in modules that are loaded at runtime. The modules to be loaded are
specified in the `xorg.conf' file using the `Load' directive:
@@ -366,7 +365,7 @@ specified in the `xorg.conf' file using the `Load' directive:
If you have trouble installing fonts in a specific format, you may want to
check the server's log file in order to see whether the relevant modules are
-properly loaded. The list of font modules distributed with X11R6.7 is as
+properly loaded. The list of font modules distributed with X11R6.8 is as
follows:
o "bitmap": bitmap fonts (`*.bdf', `*.pcf' and `*.snf');
@@ -383,7 +382,7 @@ follows:
Please note that the argument of the `Load' directive is case-sensitive.
-3. Fonts included with X11R6.7
+3. Fonts included with X11R6.8
3.1 Standard bitmap fonts
@@ -392,7 +391,7 @@ fonts, including the `fixed' family, and bitmap versions of Courier, Times,
Helvetica and some members of the Lucida family. In the SI, these fonts are
provided in the ISO 8859-1 encoding (ISO Latin Western-European).
-In X11R6.7, a number of these fonts are provided in Unicode-encoded font
+In X11R6.8, a number of these fonts are provided in Unicode-encoded font
files instead. At build time, these fonts are split into font files encoded
according to legacy encodings, a process which allows us to provide the stan-
dard fonts in a number of regional encodings with no duplication of work.
@@ -470,7 +469,7 @@ for improved presentation of text.
3.3 Standard scalable fonts
-X11R6.7 includes all the scalable fonts distributed with X11R6.
+X11R6.8 includes all the scalable fonts distributed with X11R6.
3.3.1 Standard Type 1 fonts
@@ -492,7 +491,7 @@ and reside in the font files
/usr/X11R6/lib/X11/fonts/Type1/UT*.pfa
-Finally, X11R6.7 also comes with Type 1 versions of Bitstream Courier and
+Finally, X11R6.8 also comes with Type 1 versions of Bitstream Courier and
Charter. These fonts have XLFD
-bitstream-courier-*-*-normal--0-0-0-0-m-0-iso8859-1
@@ -504,7 +503,7 @@ and reside in the font files
3.3.2 Standard Speedo fonts
-X11R6.7 includes Speedo versions of the Bitstream Courier and Charter fonts.
+X11R6.8 includes Speedo versions of the Bitstream Courier and Charter fonts.
In order to use these fonts, you should ensure that your X server is loading
the `Speedo' font backend; see Troubleshooting (section 2.2.5, page 1).
@@ -520,7 +519,7 @@ and reside in the font files
3.4 The Bigelow & Holmes Luxi family
-X11R6.7 includes the Luxi family of scalable fonts, in both TrueType and
+X11R6.8 includes the Luxi family of scalable fonts, in both TrueType and
Type 1 format. This family consists of the fonts Luxi Serif, with XLFD
-b&h-luxi serif-medium-*-normal--*-*-*-*-p-*-*-*
@@ -566,11 +565,11 @@ For more information, please contact <design@bigelowandholmes.com> or
An earlier version of the Luxi fonts was made available under the name
Lucidux. This name should no longer be used due to trademark uncertainties,
-and all traces of the Lucidux name have been removed from X11R6.7.
+and all traces of the Lucidux name have been removed from X11R6.8.
4. More about core fonts
-This section describes X11R6.7-specific enhancements to the core X11 fonts
+This section describes X11R6.8-specific enhancements to the core X11 fonts
system.
4.1 Core fonts and internationalisation
@@ -593,11 +592,8 @@ backend) use a common fontenc layer for font re-encoding. This allows these
backends to share their encoding data, and allows simple configuration of new
locales independently of font type.
-Please note: the X-TrueType (X-TT) backend does not use the fontenc layer,
-but instead uses its own method for font reencoding. If you are only inter-
-ested in X-TT you may want to skip to Using Symbol Fonts (section 4.1.5, page
-1), as the intervening information does not apply to X-TT. X-TT itself is
-described in more detail in X-TrueType (section 4.2.2, page 1).
+Please note: the X-TrueType (X-TT) backend is not included in X11R6.8. That
+functionality has been merged into the FreeType backend.>
In the fontenc layer, an encoding is defined by a name (such as iso8859-1),
possibly a number of aliases (alternate names), and an ordered collection of
@@ -656,7 +652,7 @@ option followed by the name of a directory containing encoding files, can be
used to automatically build `encodings.dir' files. Please see the mkfont-
dir(1) manual page for more details.
-A number of encoding files for common encodings are included with X11R6.7.
+A number of encoding files for common encodings are included with X11R6.8.
Information on writing new encoding files can be found in Format of encodings
directory files (section 4.1.3, page 1) and Format of encoding files (section
4.1.4, page 1) later in this document.
@@ -976,8 +972,8 @@ options are indispensable in CJKV. For example,
bw=0.5:ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0201.1976-0
setup the complete combination of jisx0208 and jisx0201 using mincho.ttc
-only. More information on the TTCap syntax is found on the After X-TT
-Project page <URL:http://x-tt.sourceforge.jp/>.
+only. More information on the TTCap syntax is found on the After X-TT Pro-
+ject page <URL:http://x-tt.sourceforge.jp/>.
The FreeType backend uses the fontenc layer in order to support recoding of
fonts; this was described in The fontenc layer (section 4.1.1, page 1) and
@@ -992,7 +988,7 @@ ings, but instead uses its own database of encodings.
Since the functionalities for CJKV support introduced by X-TT have been
merged into the new FreeType backend, the X-TT backend will be removed from
-X11R6.7's tree near the future. Therefore, the use of FreeType backend is
+X11R6.8's tree near the future. Therefore, the use of FreeType backend is
preferred over the X-TT backend.
General information on X-TrueType may be found at the After X-TT Project page
@@ -1120,10 +1116,10 @@ and `cursor' aliases are defined in
5.3 Unicode
-Unicode (<URL:http://www.unicode.org>) is a coded character set with the goal
-of uniquely identifying all characters for all scripts, current and histori-
-cal. While Unicode was explicitly not designed as a glyph encoding scheme,
-it is often possible to use it as such.
+Unicode (urlnam <URL:http://www.unicode.org>) is a coded character set with
+the goal of uniquely identifying all characters for all scripts, current and
+historical. While Unicode was explicitly not designed as a glyph encoding
+scheme, it is often possible to use it as such.
Unicode is an open character set, meaning that codepoint assignments may be
added to Unicode at any time (once specified, though, an assignment can never
@@ -1139,15 +1135,15 @@ last two fields of their XLFD set to `iso10646-1'.
6. References
-X11R6.7 comes with extensive documentation in the form of manual pages and
+X11R6.8 comes with extensive documentation in the form of manual pages and
typeset documents. Before installing fonts, you really should read the font-
config(3) and mkfontdir(1) manual pages; other manual pages of interest
include X(7), Xserver(1), xset(1), Xft(3), xlsfonts(1) and showfont(1). In
addition, you may want to read the X Logical Font Description document, by
Jim Flowers, which is provided in the file `xc/doc/xlfd.PS.Z'.
-The latest released version of the X11R6.7 documentation (including this doc-
-ument and all manual pages) can be found from current X11R6.7 documentation
+The latest released version of the X11R6.8 documentation (including this doc-
+ument and all manual pages) can be found from current X11R6.8 documentation
<URL:http://wiki.x.org/>.
The comp.fonts FAQ <URL:http://www.netmeg.net/faq/computers/fonts/>, which is
@@ -1182,5 +1178,5 @@ The IANA RFC documents, available from a number of sites throughout the
world, often provide interesting information about character set issues; see
for example RFC 373.
- $Id$
+$XdotOrg: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.3 2004/09/03 23:41:21 kem Exp $
diff --git a/hw/xfree86/doc/devel/README.DRIcomp b/hw/xfree86/doc/devel/README.DRIcomp
index aafbd4237..89f40a759 100644
--- a/hw/xfree86/doc/devel/README.DRIcomp
+++ b/hw/xfree86/doc/devel/README.DRIcomp
@@ -553,3 +553,4 @@ trouble shooting and how to use the DRI-enabled X server for 3D applications.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.19 dawes Exp $
+
diff --git a/hw/xfree86/doc/man/Xorg.man.pre b/hw/xfree86/doc/man/Xorg.man.pre
index d4bb08bc4..3d9466775 100644
--- a/hw/xfree86/doc/man/Xorg.man.pre
+++ b/hw/xfree86/doc/man/Xorg.man.pre
@@ -1,4 +1,4 @@
-.\" $XdotOrg: $
+.\" $XdotOrg: xc/programs/Xserver/hw/xfree86/Xorg.man,v 1.2 2004/04/23 19:20:02 eich Exp $
.TH __xservername__ __appmansuffix__ __vendorversion__
.SH NAME
__xservername__ - X11R6 X server
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index e530991e8..a785c29ae 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -1,4 +1,4 @@
-.\" $XdotOrg: xc/programs/Xserver/hw/xfree86/xorg.conf.man,v 1.1.2.1 2004/03/27 17:01:11 keithp Exp $
+.\" $XdotOrg: xc/programs/Xserver/hw/xfree86/xorg.conf.man,v 1.2 2004/04/23 19:20:02 eich Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH __xconfigfile__ __filemansuffix__ __vendorversion__
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index acef4c54b..4748f17df 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -34,8 +34,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-#ifdef XFree86LOADER
#include "xf86.h"
+#ifdef XFree86LOADER
#include "xf86_ansic.h"
#else
#include <sys/time.h>
@@ -57,6 +57,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define _XF86DRI_SERVER_
#include "xf86dristr.h"
#include "swaprep.h"
+#include "xf86str.h"
#include "dri.h"
#include "sarea.h"
#include "dristruct.h"
@@ -113,11 +114,14 @@ Bool
DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
{
DRIScreenPrivPtr pDRIPriv;
- drmContextPtr reserved;
+ drm_context_t * reserved;
int reserved_count;
int i, fd, drmWasAvailable;
Bool xineramaInCore = FALSE;
int err = 0;
+ char *openbusid;
+ drmVersionPtr drmlibv;
+ int drmlibmajor, drmlibminor, drmdimajor, drmdiminor;
if (DRIGeneration != serverGeneration) {
if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
@@ -148,8 +152,31 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
drmWasAvailable = drmAvailable();
+ /* Check the DRM lib version.
+ * drmGetLibVersion was not supported in version 1.0, so check for
+ * symbol first to avoid possible crash or hang.
+ */
+ drmlibmajor = 1;
+ drmlibminor = 0;
+ if (xf86LoaderCheckSymbol("drmGetLibVersion")) {
+ drmlibv = drmGetLibVersion(-1);
+ if (drmlibv != NULL) {
+ drmlibmajor = drmlibv->version_major;
+ drmlibminor = drmlibv->version_minor;
+ drmFreeVersion(drmlibv);
+ }
+ }
+
+ /* Check if the libdrm can handle falling back to loading based on name
+ * if a busid string is passed.
+ */
+ if (drmlibmajor == 1 && drmlibminor >= 2)
+ openbusid = pDRIInfo->busIdString;
+ else
+ openbusid = NULL;
+
/* Note that drmOpen will try to load the kernel module, if needed. */
- fd = drmOpen(pDRIInfo->drmDriverName, NULL );
+ fd = drmOpen(pDRIInfo->drmDriverName, openbusid);
if (fd < 0) {
/* failed to open DRM */
pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
@@ -184,7 +211,40 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
pDRIPriv->grabbedDRILock = FALSE;
pDRIPriv->drmSIGIOHandlerInstalled = FALSE;
- if ((err = drmSetBusid(pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString)) < 0) {
+ if (drmlibmajor == 1 && drmlibminor >= 2) {
+ drmSetVersion sv;
+
+ /* Get the interface version, asking for 1.1. */
+ sv.drm_di_major = 1;
+ sv.drm_di_minor = 1;
+ sv.drm_dd_major = -1;
+ err = drmSetInterfaceVersion(pDRIPriv->drmFD, &sv);
+ if (err == 0) {
+ drmdimajor = sv.drm_di_major;
+ drmdiminor = sv.drm_di_minor;
+ } else {
+ /* failure, so set it to 1.0.0. */
+ drmdimajor = 1;
+ drmdiminor = 0;
+ }
+ }
+ else {
+ /* We can't check the DI DRM interface version, so set it to 1.0.0. */
+ drmdimajor = 1;
+ drmdiminor = 0;
+ }
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] DRM interface version %d.%d\n", drmdimajor, drmdiminor);
+
+ /* If the interface minor number is 1.1, then we've opened a DRM device
+ * that already had the busid set through drmOpen.
+ */
+ if (drmdimajor == 1 && drmdiminor >= 1)
+ err = 0;
+ else
+ err = drmSetBusid(pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString);
+
+ if (err < 0) {
pDRIPriv->directRenderingSupport = FALSE;
pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
drmClose(pDRIPriv->drmFD);
@@ -235,7 +295,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
pDRIPriv->hSAREA, pDRIPriv->pSAREA);
if (drmAddMap( pDRIPriv->drmFD,
- (drmHandle)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress,
+ (drm_handle_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress,
pDRIPriv->pDriverInfo->frameBufferSize,
DRM_FRAME_BUFFER,
0,
@@ -424,7 +484,7 @@ DRICloseScreen(ScreenPtr pScreen)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
DRIInfoPtr pDRIInfo;
- drmContextPtr reserved;
+ drm_context_t * reserved;
int reserved_count;
if (pDRIPriv && pDRIPriv->directRenderingSupport) {
@@ -575,7 +635,7 @@ DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable)
}
Bool
-DRIOpenConnection(ScreenPtr pScreen, drmHandlePtr hSAREA, char **busIdString)
+DRIOpenConnection(ScreenPtr pScreen, drm_handle_t * hSAREA, char **busIdString)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
@@ -586,7 +646,7 @@ DRIOpenConnection(ScreenPtr pScreen, drmHandlePtr hSAREA, char **busIdString)
}
Bool
-DRIAuthConnection(ScreenPtr pScreen, drmMagic magic)
+DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
@@ -620,18 +680,18 @@ DRIGetClientDriverName(ScreenPtr pScreen,
/* DRICreateContextPriv and DRICreateContextPrivFromHandle are helper
functions that layer on drmCreateContext and drmAddContextTag.
- DRICreateContextPriv always creates a kernel drmContext and then calls
+ DRICreateContextPriv always creates a kernel drm_context_t and then calls
DRICreateContextPrivFromHandle to create a DRIContextPriv structure for
- DRI tracking. For the SIGIO handler, the drmContext is associated with
+ DRI tracking. For the SIGIO handler, the drm_context_t is associated with
DRIContextPrivPtr. Any special flags are stored in the DRIContextPriv
area and are passed to the kernel (if necessary).
DRICreateContextPriv returns a pointer to newly allocated
- DRIContextPriv, and returns the kernel drmContext in pHWContext. */
+ DRIContextPriv, and returns the kernel drm_context_t in pHWContext. */
DRIContextPrivPtr
DRICreateContextPriv(ScreenPtr pScreen,
- drmContextPtr pHWContext,
+ drm_context_t * pHWContext,
DRIContextFlags flags)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
@@ -645,7 +705,7 @@ DRICreateContextPriv(ScreenPtr pScreen,
DRIContextPrivPtr
DRICreateContextPrivFromHandle(ScreenPtr pScreen,
- drmContext hHWContext,
+ drm_context_t hHWContext,
DRIContextFlags flags)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
@@ -720,8 +780,8 @@ static Bool
DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- __GLXscreenInfo *pGLXScreen = &__glXActiveScreens[pScreen->myNum];
- __GLXvisualConfig *pGLXVis = pGLXScreen->pGlxVisual;
+ __GLXscreenInfo *pGLXScreen = __glXgetActiveScreen(pScreen->myNum);
+ __GLcontextModes *modes = pGLXScreen->modes;
void **pVisualConfigPriv = pGLXScreen->pVisualPriv;
DRIContextPrivPtr pDRIContextPriv;
void *contextStore;
@@ -734,7 +794,7 @@ DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv)
for (visNum = 0;
visNum < pScreen->numVisuals;
visNum++, visual++) {
- if (pGLXVis->vid == visual->vid)
+ if (modes->visualID == visual->vid)
break;
}
if (visNum == pScreen->numVisuals) return FALSE;
@@ -781,15 +841,14 @@ DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv)
Bool
DRICreateContext(ScreenPtr pScreen, VisualPtr visual,
- XID context, drmContextPtr pHWContext)
+ XID context, drm_context_t * pHWContext)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- __GLXscreenInfo *pGLXScreen = &__glXActiveScreens[pScreen->myNum];
- __GLXvisualConfig *pGLXVis = pGLXScreen->pGlxVisual;
+ __GLXscreenInfo *pGLXScreen = __glXgetActiveScreen(pScreen->myNum);
+ __GLcontextModes *modes = pGLXScreen->modes;
void **pVisualConfigPriv = pGLXScreen->pVisualPriv;
DRIContextPrivPtr pDRIContextPriv;
void *contextStore;
- int visNum;
if (pDRIPriv->createDummyCtx && !pDRIPriv->dummyCtxPriv) {
if (!DRICreateDummyContext(pScreen, pDRIPriv->createDummyCtxPriv)) {
@@ -800,12 +859,13 @@ DRICreateContext(ScreenPtr pScreen, VisualPtr visual,
}
/* Find the GLX visual associated with the one requested */
- for (visNum = 0;
- visNum < pGLXScreen->numVisuals;
- visNum++, pGLXVis++, pVisualConfigPriv++)
- if (pGLXVis->vid == visual->vid)
+ for (modes = pGLXScreen->modes; modes != NULL; modes = modes->next) {
+ if (modes->visualID == visual->vid)
break;
- if (visNum == pGLXScreen->numVisuals) {
+ pVisualConfigPriv++;
+ }
+
+ if (modes == NULL) {
/* No matching GLX visual found */
return FALSE;
}
@@ -928,7 +988,7 @@ DRITransitionTo2d(ScreenPtr pScreen)
Bool
DRICreateDrawable(ScreenPtr pScreen, Drawable id,
- DrawablePtr pDrawable, drmDrawablePtr hHWDrawable)
+ DrawablePtr pDrawable, drm_drawable_t * hHWDrawable)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
DRIDrawablePrivPtr pDRIDrawablePriv;
@@ -945,7 +1005,7 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id,
return FALSE;
}
- /* Only create a drmDrawable once */
+ /* Only create a drm_drawable_t once */
if (drmCreateDrawable(pDRIPriv->drmFD, hHWDrawable)) {
xfree(pDRIDrawablePriv);
return FALSE;
@@ -1065,11 +1125,11 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
int* W,
int* H,
int* numClipRects,
- XF86DRIClipRectPtr* pClipRects,
+ drm_clip_rect_t ** pClipRects,
int* backX,
int* backY,
int* numBackClipRects,
- XF86DRIClipRectPtr* pBackClipRects)
+ drm_clip_rect_t ** pBackClipRects)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
DRIDrawablePrivPtr pDRIDrawablePriv, pOldDrawPriv;
@@ -1165,7 +1225,7 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
*W = (int)(pWin->drawable.width);
*H = (int)(pWin->drawable.height);
*numClipRects = REGION_NUM_RECTS(&pWin->clipList);
- *pClipRects = (XF86DRIClipRectPtr)REGION_RECTS(&pWin->clipList);
+ *pClipRects = (drm_clip_rect_t *)REGION_RECTS(&pWin->clipList);
if (!*numClipRects && pDRIPriv->fullscreen) {
/* use fake full-screen clip rect */
@@ -1222,7 +1282,7 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
Bool
DRIGetDeviceInfo(ScreenPtr pScreen,
- drmHandlePtr hFrameBuffer,
+ drm_handle_t * hFrameBuffer,
int* fbOrigin,
int* fbSize,
int* fbStride,
@@ -1870,7 +1930,7 @@ DRIGetSAREAPrivate(ScreenPtr pScreen)
return (void *)(((char*)pDRIPriv->pSAREA)+sizeof(XF86DRISAREARec));
}
-drmContext
+drm_context_t
DRIGetContext(ScreenPtr pScreen)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
@@ -1967,7 +2027,7 @@ DRIOpenFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable)
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
WindowPtr pWin = (WindowPtr)pDrawable;
- XF86DRIClipRectPtr pClipRects = (void *)REGION_RECTS(&pWin->clipList);
+ drm_clip_rect_t * pClipRects = (void *)REGION_RECTS(&pWin->clipList);
_DRIAdjustFrame(pScrn, pDRIPriv, pScrn->frameX0, pScrn->frameY0);
@@ -2115,3 +2175,21 @@ DRIMoveBuffersHelper(
} else *xdir = 1;
}
+
+char *
+DRICreatePCIBusID(pciVideoPtr PciInfo)
+{
+ char *busID;
+ int domain;
+ PCITAG tag;
+
+ busID = xalloc(20);
+ if (busID == NULL)
+ return NULL;
+
+ tag = pciTag(PciInfo->bus, PciInfo->device, PciInfo->func);
+ domain = xf86GetPciDomain(tag);
+ snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, PciInfo->bus,
+ PciInfo->device, PciInfo->func);
+ return busID;
+}
diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h
index 149534417..f556d261e 100644
--- a/hw/xfree86/dri/dri.h
+++ b/hw/xfree86/dri/dri.h
@@ -105,11 +105,11 @@ typedef struct {
*/
Bool (*CreateContext)(ScreenPtr pScreen,
VisualPtr visual,
- drmContext hHWContext,
+ drm_context_t hHWContext,
void* pVisualConfigPriv,
DRIContextType context);
void (*DestroyContext)(ScreenPtr pScreen,
- drmContext hHWContext,
+ drm_context_t hHWContext,
DRIContextType context);
void (*SwapContext)(ScreenPtr pScreen,
DRISyncType syncType,
@@ -175,10 +175,10 @@ extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
Bool *isCapable);
extern Bool DRIOpenConnection(ScreenPtr pScreen,
- drmHandlePtr hSAREA,
+ drm_handle_t * hSAREA,
char **busIdString);
-extern Bool DRIAuthConnection(ScreenPtr pScreen, drmMagic magic);
+extern Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic);
extern Bool DRICloseConnection(ScreenPtr pScreen);
@@ -191,7 +191,7 @@ extern Bool DRIGetClientDriverName(ScreenPtr pScreen,
extern Bool DRICreateContext(ScreenPtr pScreen,
VisualPtr visual,
XID context,
- drmContextPtr pHWContext);
+ drm_context_t * pHWContext);
extern Bool DRIDestroyContext(ScreenPtr pScreen, XID context);
@@ -200,7 +200,7 @@ extern Bool DRIContextPrivDelete(pointer pResource, XID id);
extern Bool DRICreateDrawable(ScreenPtr pScreen,
Drawable id,
DrawablePtr pDrawable,
- drmDrawablePtr hHWDrawable);
+ drm_drawable_t * hHWDrawable);
extern Bool DRIDestroyDrawable(ScreenPtr pScreen,
Drawable id,
@@ -218,14 +218,14 @@ extern Bool DRIGetDrawableInfo(ScreenPtr pScreen,
int* W,
int* H,
int* numClipRects,
- XF86DRIClipRectPtr* pClipRects,
+ drm_clip_rect_t ** pClipRects,
int* backX,
int* backY,
int* numBackClipRects,
- XF86DRIClipRectPtr* pBackClipRects);
+ drm_clip_rect_t ** pBackClipRects);
extern Bool DRIGetDeviceInfo(ScreenPtr pScreen,
- drmHandlePtr hFrameBuffer,
+ drm_handle_t * hFrameBuffer,
int* fbOrigin,
int* fbSize,
int* fbStride,
@@ -298,16 +298,16 @@ extern unsigned int DRIGetDrawableStamp(ScreenPtr pScreen,
CARD32 drawable_index);
extern DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen,
- drmContextPtr pHWContext,
+ drm_context_t * pHWContext,
DRIContextFlags flags);
extern DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr pScreen,
- drmContext hHWContext,
+ drm_context_t hHWContext,
DRIContextFlags flags);
extern Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv);
-extern drmContext DRIGetContext(ScreenPtr pScreen);
+extern drm_context_t DRIGetContext(ScreenPtr pScreen);
extern void DRIQueryVersion(int *majorVersion,
int *minorVersion,
@@ -325,6 +325,8 @@ extern void DRIMoveBuffersHelper(ScreenPtr pScreen,
int *ydir,
RegionPtr reg);
+extern char *DRICreatePCIBusID(pciVideoPtr PciInfo);
+
#define _DRI_H_
#endif
diff --git a/hw/xfree86/dri/drimodule.c b/hw/xfree86/dri/drimodule.c
index 1a6a4c696..1fa7a8edc 100644
--- a/hw/xfree86/dri/drimodule.c
+++ b/hw/xfree86/dri/drimodule.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/GL/dri/drimodule.c,v 1.1.4.1.4.2 2004/03/04 17:47:18 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/GL/dri/drimodule.c,v 1.2 2004/04/23 18:44:36 eich Exp $ */
/**************************************************************************
Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -44,7 +44,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_EXTENSION,
ABI_EXTENSION_VERSION,
diff --git a/hw/xfree86/dri/dristruct.h b/hw/xfree86/dri/dristruct.h
index 6d90d770a..cf1b1eacf 100644
--- a/hw/xfree86/dri/dristruct.h
+++ b/hw/xfree86/dri/dristruct.h
@@ -50,7 +50,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
typedef struct _DRIDrawablePrivRec
{
- drmDrawable hwDrawable;
+ drm_drawable_t hwDrawable;
int drawableIndex;
ScreenPtr pScreen;
int refCount;
@@ -58,7 +58,7 @@ typedef struct _DRIDrawablePrivRec
struct _DRIContextPrivRec
{
- drmContext hwContext;
+ drm_context_t hwContext;
ScreenPtr pScreen;
Bool valid3D;
DRIContextFlags flags;
@@ -78,19 +78,19 @@ typedef struct _DRIScreenPrivRec
{
Bool directRenderingSupport;
int drmFD; /* File descriptor for /dev/video/? */
- drmHandle hSAREA; /* Handle to SAREA, for mapping */
+ drm_handle_t hSAREA; /* Handle to SAREA, for mapping */
XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */
- drmHandle hFrameBuffer; /* Handle to framebuffer, for mapping */
- drmContext myContext; /* DDX Driver's context */
+ drm_handle_t hFrameBuffer; /* Handle to framebuffer, for mapping */
+ drm_context_t myContext; /* DDX Driver's context */
DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */
DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */
void** hiddenContextStore; /* hidden X context */
void** partial3DContextStore; /* parital 3D context */
DRIInfoPtr pDriverInfo;
int nrWindows;
- XF86DRIClipRectRec private_buffer_rect; /* management of private buffers */
+ drm_clip_rect_t private_buffer_rect; /* management of private buffers */
DrawablePtr fullscreen; /* pointer to fullscreen drawable */
- XF86DRIClipRectRec fullscreen_rect; /* fake rect for fullscreen mode */
+ drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */
DRIWrappedFuncsRec wrap;
DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES];
DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */
diff --git a/hw/xfree86/dri/sarea.h b/hw/xfree86/dri/sarea.h
index d4d83df93..77c16e0ef 100644
--- a/hw/xfree86/dri/sarea.h
+++ b/hw/xfree86/dri/sarea.h
@@ -88,7 +88,7 @@ typedef struct _XF86DRISAREA {
drmLock drawable_lock;
XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
XF86DRISAREAFrameRec frame;
- drmContext dummy_context;
+ drm_context_t dummy_context;
} XF86DRISAREARec, *XF86DRISAREAPtr;
#endif
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
index bc8a17ad2..ae5a6d608 100644
--- a/hw/xfree86/dri/xf86dri.c
+++ b/hw/xfree86/dri/xf86dri.c
@@ -35,8 +35,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-#ifdef XFree86LOADER
#include "xf86.h"
+#ifdef XFree86LOADER
#include "xf86_ansic.h"
#endif
@@ -54,6 +54,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define _XF86DRI_SERVER_
#include "xf86dristr.h"
#include "swaprep.h"
+#include "xf86str.h"
#include "dri.h"
#include "sarea.h"
#include "dristruct.h"
@@ -184,7 +185,7 @@ ProcXF86DRIOpenConnection(
)
{
xXF86DRIOpenConnectionReply rep;
- drmHandle hSAREA;
+ drm_handle_t hSAREA;
char* busIdString;
REQUEST(xXF86DRIOpenConnectionReq);
@@ -340,7 +341,7 @@ ProcXF86DRICreateContext(
if (!DRICreateContext( pScreen,
visual,
stuff->context,
- (drmContextPtr)&rep.hHWContext)) {
+ (drm_context_t *)&rep.hHWContext)) {
return BadValue;
}
@@ -397,7 +398,7 @@ ProcXF86DRICreateDrawable(
if (!DRICreateDrawable( screenInfo.screens[stuff->screen],
(Drawable)stuff->drawable,
pDrawable,
- (drmDrawablePtr)&rep.hHWDrawable)) {
+ (drm_drawable_t *)&rep.hHWDrawable)) {
return BadValue;
}
@@ -442,8 +443,8 @@ ProcXF86DRIGetDrawableInfo(
xXF86DRIGetDrawableInfoReply rep;
DrawablePtr pDrawable;
int X, Y, W, H;
- XF86DRIClipRectPtr pClipRects;
- XF86DRIClipRectPtr pBackClipRects;
+ drm_clip_rect_t * pClipRects;
+ drm_clip_rect_t * pBackClipRects;
int backX, backY;
REQUEST(xXF86DRIGetDrawableInfoReq);
@@ -492,10 +493,10 @@ ProcXF86DRIGetDrawableInfo(
rep.backY = backY;
if (rep.numBackClipRects)
- rep.length += sizeof(XF86DRIClipRectRec) * rep.numBackClipRects;
+ rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects;
if (rep.numClipRects)
- rep.length += sizeof(XF86DRIClipRectRec) * rep.numClipRects;
+ rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects;
rep.length = ((rep.length + 3) & ~3) >> 2;
@@ -503,13 +504,13 @@ ProcXF86DRIGetDrawableInfo(
if (rep.numClipRects) {
WriteToClient(client,
- sizeof(XF86DRIClipRectRec) * rep.numClipRects,
+ sizeof(drm_clip_rect_t) * rep.numClipRects,
(char *)pClipRects);
}
if (rep.numBackClipRects) {
WriteToClient(client,
- sizeof(XF86DRIClipRectRec) * rep.numBackClipRects,
+ sizeof(drm_clip_rect_t) * rep.numBackClipRects,
(char *)pBackClipRects);
}
@@ -522,7 +523,7 @@ ProcXF86DRIGetDeviceInfo(
)
{
xXF86DRIGetDeviceInfoReply rep;
- drmHandle hFrameBuffer;
+ drm_handle_t hFrameBuffer;
void *pDevPrivate;
REQUEST(xXF86DRIGetDeviceInfoReq);
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index 0345aa41f..0ca3c93ef 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -14,7 +14,12 @@
#include "fbdevhw.h"
#include "fbpriv.h"
-#include "asm/page.h" /* #define for PAGE_* */
+#if 0
+/* kernel header doesn't work with -ansi */
+# include "asm/page.h" /* #define for PAGE_* */
+#else
+# define PAGE_MASK (~(getpagesize() - 1))
+#endif
#include "globals.h"
#define DPMS_SERVER
@@ -22,6 +27,8 @@
#define DEBUG 0
+#define PAGE_MASK (~(getpagesize() - 1))
+
#if DEBUG
# define TRACE_ENTER(str) ErrorF("fbdevHW: " str " %d\n",pScrn->scrnIndex)
#else
@@ -40,7 +47,7 @@ static XF86ModuleVersionInfo fbdevHWVersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
0, 0, 2,
ABI_CLASS_VIDEODRV,
ABI_VIDEODRV_VERSION,
@@ -724,7 +731,7 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
unsigned short red,green,blue;
int i;
- TRACE_ENTER("ModeInit");
+ TRACE_ENTER("LoadPalette");
cmap.len = 1;
cmap.red = &red;
cmap.green = &green;
@@ -789,7 +796,6 @@ fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
TRACE_ENTER("AdjustFrame");
-
if ( x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual ||
y < 0 || y + fPtr->var.yres > fPtr->var.yres_virtual )
return;
@@ -828,6 +834,7 @@ fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
unsigned long fbmode;
+ TRACE_ENTER("DPMSSet");
if (!pScrn->vtSema)
return;
@@ -860,6 +867,7 @@ fbdevHWSaveScreen(ScreenPtr pScreen, int mode)
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
unsigned long unblank;
+ TRACE_ENTER("HWSaveScreen");
if (!pScrn->vtSema)
return TRUE;
@@ -873,3 +881,27 @@ fbdevHWSaveScreen(ScreenPtr pScreen, int mode)
return TRUE;
}
+
+xf86SwitchModeProc *
+fbdevHWSwitchModeWeak(void) { return fbdevHWSwitchMode; }
+
+xf86AdjustFrameProc *
+fbdevHWAdjustFrameWeak(void) { return fbdevHWAdjustFrame; }
+
+xf86EnterVTProc *
+fbdevHWEnterVTWeak(void) { return fbdevHWEnterVT; }
+
+xf86LeaveVTProc *
+fbdevHWLeaveVTWeak(void) { return fbdevHWLeaveVT; }
+
+xf86ValidModeProc *
+fbdevHWValidModeWeak(void) { return fbdevHWValidMode; }
+
+xf86DPMSSetProc *
+fbdevHWDPMSSetWeak(void) { return fbdevHWDPMSSet; }
+
+xf86LoadPaletteProc *
+fbdevHWLoadPaletteWeak(void) { return fbdevHWLoadPalette; }
+
+SaveScreenProcPtr
+fbdevHWSaveScreenWeak(void) { return fbdevHWSaveScreen; }
diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h
index 219ca07d3..cfc3fcdb6 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.h
+++ b/hw/xfree86/fbdevhw/fbdevhw.h
@@ -49,4 +49,13 @@ void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags);
Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode);
+xf86SwitchModeProc *fbdevHWSwitchModeWeak(void);
+xf86AdjustFrameProc *fbdevHWAdjustFrameWeak(void);
+xf86EnterVTProc *fbdevHWEnterVTWeak(void);
+xf86LeaveVTProc *fbdevHWLeaveVTWeak(void);
+xf86ValidModeProc *fbdevHWValidModeWeak(void);
+xf86DPMSSetProc *fbdevHWDPMSSetWeak(void);
+xf86LoadPaletteProc *fbdevHWLoadPaletteWeak(void);
+SaveScreenProcPtr fbdevHWSaveScreenWeak(void);
+
#endif
diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c
index dc1169362..7869bb31d 100644
--- a/hw/xfree86/fbdevhw/fbdevhwstub.c
+++ b/hw/xfree86/fbdevhw/fbdevhwstub.c
@@ -168,3 +168,27 @@ fbdevHWSaveScreen(ScreenPtr pScreen, int mode)
{
return FALSE;
}
+
+xf86SwitchModeProc *
+fbdevHWSwitchModeWeak(void) { return fbdevHWSwitchMode; }
+
+xf86AdjustFrameProc *
+fbdevHWAdjustFrameWeak(void) { return fbdevHWAdjustFrame; }
+
+xf86EnterVTProc *
+fbdevHWEnterVTWeak(void) { return fbdevHWEnterVT; }
+
+xf86LeaveVTProc *
+fbdevHWLeaveVTWeak(void) { return fbdevHWLeaveVT; }
+
+xf86ValidModeProc *
+fbdevHWValidModeWeak(void) { return fbdevHWValidMode; }
+
+xf86DPMSSetProc *
+fbdevHWDPMSSetWeak(void) { return fbdevHWDPMSSet; }
+
+xf86LoadPaletteProc *
+fbdevHWLoadPaletteWeak(void) { return fbdevHWLoadPalette; }
+
+SaveScreenProcPtr
+fbdevHWSaveScreenWeak(void) { return fbdevHWSaveScreen; }
diff --git a/hw/xfree86/getconfig/cfg.sample b/hw/xfree86/getconfig/cfg.sample
index 8e26fd2e3..93c98e4e2 100644
--- a/hw/xfree86/getconfig/cfg.sample
+++ b/hw/xfree86/getconfig/cfg.sample
@@ -1,4 +1,4 @@
-# $XdotOrg$
+# $DHD: xc/programs/Xserver/hw/xfree86/getconfig/cfg.sample,v 1.2 2003/09/23 05:12:07 dawes Exp $
# Some sample Xorg getconfig rules file.
diff --git a/hw/xfree86/getconfig/getconfig b/hw/xfree86/getconfig/getconfig
index a9e2b3ef2..531125a7f 100644
--- a/hw/xfree86/getconfig/getconfig
+++ b/hw/xfree86/getconfig/getconfig
@@ -1,6 +1,6 @@
#!/bin/sh
-# $XdotOrg$
+# $XdotOrg: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.sh,v 1.2 2004/04/23 19:54:01 eich Exp $
#
# Copyright 2003 by David H. Dawes.
diff --git a/hw/xfree86/getconfig/xorg.cfg b/hw/xfree86/getconfig/xorg.cfg
index 848d5eb90..c164bf77c 100644
--- a/hw/xfree86/getconfig/xorg.cfg
+++ b/hw/xfree86/getconfig/xorg.cfg
@@ -1,4 +1,4 @@
-# $XdotOrg$
+# $XdotOrg: xc/programs/Xserver/hw/xfree86/getconfig/xorg.cfg,v 1.3 2004/05/25 20:33:46 alanc Exp $
# Base Xorg getconfig rules file.
@@ -7,7 +7,7 @@
# first non-blank, non-comment line.
#
-Xorg Project getconfig rules file. Version: 1.0
+Xorg Foundation getconfig rules file. Version: 1.0
#
# Set the weight for the following rules. This should be set, otherwise
diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c
index 55a6cb059..77e3c2634 100644
--- a/hw/xfree86/i2c/xf86i2c.c
+++ b/hw/xfree86/i2c/xf86i2c.c
@@ -818,6 +818,7 @@ xf86I2CBusInit(I2CBusPtr b)
if (b->I2CPutByte == NULL ||
b->I2CGetByte == NULL ||
b->I2CAddress == NULL ||
+ b->I2CStart == NULL ||
b->I2CStop == NULL)
return FALSE;
} else {
@@ -825,6 +826,7 @@ xf86I2CBusInit(I2CBusPtr b)
b->I2CGetByte = I2CGetByte;
b->I2CAddress = I2CAddress;
b->I2CStop = I2CStop;
+ b->I2CStart = I2CStart;
}
}
diff --git a/hw/xfree86/i2c/xf86i2c.h b/hw/xfree86/i2c/xf86i2c.h
index b6ef41feb..099406e8f 100644
--- a/hw/xfree86/i2c/xf86i2c.h
+++ b/hw/xfree86/i2c/xf86i2c.h
@@ -27,6 +27,7 @@ typedef struct _I2CBusRec {
/* Look at the generic routines to see how these functions should behave. */
+ Bool (*I2CStart) (I2CBusPtr b, int timeout);
Bool (*I2CAddress)(I2CDevPtr d, I2CSlaveAddr);
void (*I2CStop) (I2CDevPtr d);
Bool (*I2CPutByte)(I2CDevPtr d, I2CByte data);
diff --git a/hw/xfree86/i2c/xf86i2cmodule.c b/hw/xfree86/i2c/xf86i2cmodule.c
index 8f0c56f59..0058795f0 100644
--- a/hw/xfree86/i2c/xf86i2cmodule.c
+++ b/hw/xfree86/i2c/xf86i2cmodule.c
@@ -17,7 +17,7 @@ static XF86ModuleVersionInfo i2cVersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 2, 0,
ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
ABI_VIDEODRV_VERSION,
diff --git a/hw/xfree86/int10/xf86int10module.c b/hw/xfree86/int10/xf86int10module.c
index 5857d23d2..2bb49cb0c 100644
--- a/hw/xfree86/int10/xf86int10module.c
+++ b/hw/xfree86/int10/xf86int10module.c
@@ -31,7 +31,7 @@ static XF86ModuleVersionInfo NAME(VersRec) =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
ABI_VIDEODRV_VERSION,
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index fda75b89d..96fed9bbc 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.1.4.4.4.2 2004/03/04 17:48:07 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.5 2004/08/19 04:08:40 kem Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.63 2003/12/03
* 17:11:29 tsi Exp $ */
@@ -81,6 +81,7 @@
#include "dgaproc.h"
#ifdef RENDER
#include "mipict.h"
+#include "renderedge.h"
#endif
#include "selection.h"
#ifdef XKB
@@ -198,6 +199,7 @@ LOOKUP dixLookupTab[] = {
SYMFUNC(VerifyRectOrder)
SYMFUNC(SetDashes)
/* globals.c */
+#ifdef DPMSExtension
SYMVAR(DPMSEnabled)
SYMVAR(DPMSCapableFlag)
SYMVAR(DPMSOffTime)
@@ -207,6 +209,7 @@ LOOKUP dixLookupTab[] = {
SYMVAR(DPMSEnabledSwitch)
SYMVAR(DPMSDisabledSwitch)
SYMVAR(defaultDPMSEnabled)
+#endif
/* bigreq */
SYMVAR(maxBigRequestSize)
#ifdef XV
@@ -322,6 +325,16 @@ LOOKUP dixLookupTab[] = {
SYMFUNC(AdjustWaitForDelay)
SYMVAR(noTestExtensions)
SYMFUNC(GiveUp)
+#ifdef COMPOSITE
+ SYMVAR(noCompositeExtension)
+#endif
+#ifdef RENDER
+ SYMVAR(noRenderExtension)
+#endif
+#ifdef XEVIE
+ SYMVAR(noXevieExtension)
+#endif
+
/* log.c */
SYMFUNC(LogVWrite)
SYMFUNC(LogWrite)
@@ -345,7 +358,9 @@ LOOKUP dixLookupTab[] = {
SYMFUNC(TimerFree)
SYMFUNC(TimerSet)
SYMFUNC(TimerCancel)
+#ifdef DPMSExtension
SYMFUNC(SetDPMSTimers)
+#endif
/* io.c */
SYMFUNC(WriteToClient)
SYMFUNC(SetCriticalOutputPending)
@@ -400,6 +415,11 @@ LOOKUP dixLookupTab[] = {
SYMFUNC(PictureSetFilterAlias)
SYMFUNC(PictureGetSubpixelOrder)
SYMFUNC(PictureSetSubpixelOrder)
+ SYMFUNC(RenderSampleCeilY)
+ SYMFUNC(RenderSampleFloorY)
+ SYMFUNC(RenderEdgeStep)
+ SYMFUNC(RenderEdgeInit)
+ SYMFUNC(RenderLineFixedEdgeInit)
#endif
{0, 0}
diff --git a/hw/xfree86/loader/elfloader.c b/hw/xfree86/loader/elfloader.c
index 933df1e61..98c51bb44 100644
--- a/hw/xfree86/loader/elfloader.c
+++ b/hw/xfree86/loader/elfloader.c
@@ -1,5 +1,6 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.1.4.1.6.4 2004/03/18 02:18:27 alanc Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.2 2004/04/23 19:54:06 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.61tsi Exp $ */
+
/*
*
* Copyright 1995-1998 by Metro Link, Inc.
diff --git a/hw/xfree86/loader/extsym.c b/hw/xfree86/loader/extsym.c
index bc51e2e0d..bbae6775f 100644
--- a/hw/xfree86/loader/extsym.c
+++ b/hw/xfree86/loader/extsym.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.1.4.3.2.1 2004/02/27 21:31:00 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.4 2004/08/09 03:40:50 krh Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.9 2003/10/15 16:29:03 dawes Exp $ */
/*
diff --git a/hw/xfree86/loader/hash.c b/hw/xfree86/loader/hash.c
index f96bc55b2..559c0d8f3 100644
--- a/hw/xfree86/loader/hash.c
+++ b/hw/xfree86/loader/hash.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/hash.c,v 1.1.4.2.4.2 2004/03/04 20:16:43 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/hash.c,v 1.2 2004/04/23 19:54:06 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/hash.c,v 1.24 2003/11/17 22:20:40 dawes Exp $ */
/*
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index efa60f20a..14c9a320d 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -331,6 +331,13 @@ LoaderInit(void)
{
const char *osname = NULL;
+#ifdef DLOPEN_SUPPORT
+ char *ld_bind_now = getenv("LD_BIND_NOW");
+ if (ld_bind_now && *ld_bind_now) {
+ xf86Msg(X_ERROR, "LD_BIND_NOW is set, dlloader will NOT work!\n");
+ }
+#endif
+
LoaderAddSymbols(-1, -1, miLookupTab);
LoaderAddSymbols(-1, -1, xfree86LookupTab);
LoaderAddSymbols(-1, -1, dixLookupTab);
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 733f6feb1..4bf36a38a 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -86,7 +86,7 @@ static char *LoaderGetCanonicalName(const char *, PatternPtr);
static void RemoveChild(ModuleDescPtr);
ModuleVersions LoaderVersionInfo = {
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
ABI_ANSIC_VERSION,
ABI_VIDEODRV_VERSION,
ABI_XINPUT_VERSION,
diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c
index 5f2e858e8..048f8996a 100644
--- a/hw/xfree86/loader/misym.c
+++ b/hw/xfree86/loader/misym.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/misym.c,v 1.1.4.2.4.1 2004/02/27 21:31:00 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/misym.c,v 1.2 2004/04/23 19:54:06 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/misym.c,v 1.38 2003/10/15 16:29:04 dawes Exp $ */
/*
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index b2823c2e5..a622b505e 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -75,7 +75,9 @@
#include "xf86cmap.h"
#include "xf86fbman.h"
#include "dgaproc.h"
+#ifdef DPMSExtension
#include "dpmsproc.h"
+#endif
#include "vidmodeproc.h"
#include "xf86miscproc.h"
#include "loader.h"
@@ -233,6 +235,12 @@ extern unsigned long ldl_brx(volatile unsigned char *, int);
extern unsigned short ldw_brx(volatile unsigned char *, int);
#endif
+#ifdef __SSP__
+/* Propolice! */
+extern long __guard[];
+extern void __stack_smash_handler(char [], int);
+#endif
+
/* XFree86 things */
LOOKUP xfree86LookupTab[] = {
@@ -695,9 +703,11 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86XInputSetSendCoreEvents)
/* End merged segment */
#endif
+#ifdef DPMSExtension
SYMFUNC(DPMSGet)
SYMFUNC(DPMSSet)
SYMFUNC(DPMSSupported)
+#endif
/* xf86Debug.c */
#ifdef BUILDDEBUG
SYMFUNC(xf86Break1)
@@ -1045,27 +1055,39 @@ LOOKUP xfree86LookupTab[] = {
# endif
#endif
#if defined(__GNUC__)
-#ifndef __UNIXOS2__
+#if !defined(__UNIXOS2__) && !defined(Lynx)
SYMFUNC(__div64)
#endif
+#if !defined(Lynx) /* FIXME: test on others than x86 and !3.1.0a/x86 */
SYMFUNC(__divdf3)
+#endif
SYMFUNC(__divdi3)
+#if !defined(Lynx)
SYMFUNC(__divsf3)
SYMFUNC(__divsi3)
+#endif
SYMFUNC(__moddi3)
+#if !defined(Lynx)
SYMFUNC(__modsi3)
-#ifndef __UNIXOS2__
+#endif
+#if !defined(__UNIXOS2__) && !defined(Lynx)
SYMFUNC(__mul64)
#endif
+#if !defined(Lynx)
SYMFUNC(__muldf3)
+#endif
SYMFUNC(__muldi3)
+#if !defined(Lynx)
SYMFUNC(__mulsf3)
SYMFUNC(__mulsi3)
SYMFUNC(__udivdi3)
SYMFUNC(__udivsi3)
+#endif
SYMFUNC(__umoddi3)
+#if !defined(Lynx)
SYMFUNC(__umodsi3)
#endif
+#endif
#if defined(__ia64__)
SYMFUNC(_outw)
SYMFUNC(_outb)
@@ -1093,6 +1115,12 @@ LOOKUP xfree86LookupTab[] = {
#endif
#endif
+#ifdef __SSP__
+ /* propolice */
+ SYMFUNC(__stack_smash_handler)
+ SYMVAR(__guard)
+#endif
+
/* Some variables. */
SYMVAR(xf86stdin)
diff --git a/hw/xfree86/os-support/bsd/bsd_mouse.c b/hw/xfree86/os-support/bsd/bsd_mouse.c
index bb5936a1e..679f3099a 100644
--- a/hw/xfree86/os-support/bsd/bsd_mouse.c
+++ b/hw/xfree86/os-support/bsd/bsd_mouse.c
@@ -430,6 +430,7 @@ wsconsReadInput(InputInfoPtr pInfo)
default:
xf86Msg(X_WARNING, "%s: bad wsmouse event type=%d\n", pInfo->name,
event->type);
+ ++event;
continue;
}
@@ -472,6 +473,7 @@ wsconsPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
/* Setup the local input proc. */
pInfo->read_input = wsconsReadInput;
+ pMse->xisbscale = sizeof(struct wscons_event);
pInfo->flags |= XI86_CONFIGURED;
return TRUE;
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 3c55ee72f..62d063655 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -46,6 +46,11 @@
#include <sys/queue.h>
#endif
+#if defined(__OpenBSD__) && defined(__amd64__)
+#include <machine/mtrr.h>
+#include <machine/sysarch.h>
+#endif
+
#include "xf86_OSlib.h"
#include "xf86OSpriv.h"
@@ -94,7 +99,11 @@ static pointer NetBSDsetWC(int, unsigned long, unsigned long, Bool,
MessageType);
static void NetBSDundoWC(int, pointer);
#endif
-
+#if defined(__amd64__) && defined(__OpenBSD__)
+static pointer amd64setWC(int, unsigned long, unsigned long, Bool,
+ MessageType);
+static void amd64undoWC(int, pointer);
+#endif
/*
* Check if /dev/mem can be mmap'd. If it can't print a warning when
@@ -206,6 +215,10 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
pVidMem->setWC = NetBSDsetWC;
pVidMem->undoWC = NetBSDundoWC;
#endif
+#if defined(__amd64__) && defined(__OpenBSD__)
+ pVidMem->setWC = amd64setWC;
+ pVidMem->undoWC = amd64undoWC;
+#endif
pVidMem->initialised = TRUE;
}
@@ -311,7 +324,6 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
return(Len);
}
-
#ifdef USE_I386_IOPL
/***************************************************************************/
/* I/O Permissions section */
@@ -354,6 +366,51 @@ xf86DisableIO()
#endif /* USE_I386_IOPL */
+#ifdef USE_AMD64_IOPL
+/***************************************************************************/
+/* I/O Permissions section */
+/***************************************************************************/
+
+static Bool ExtendedEnabled = FALSE;
+
+void
+xf86EnableIO()
+{
+ if (ExtendedEnabled)
+ return;
+
+ if (amd64_iopl(TRUE) < 0)
+ {
+#ifndef __OpenBSD__
+ FatalError("%s: Failed to set IOPL for extended I/O",
+ "xf86EnableIO");
+#else
+ FatalError("%s: Failed to set IOPL for extended I/O\n%s",
+ "xf86EnableIO", SYSCTL_MSG);
+#endif
+ }
+ ExtendedEnabled = TRUE;
+
+ return;
+}
+
+void
+xf86DisableIO()
+{
+ if (!ExtendedEnabled)
+ return;
+
+ if (amd64_iopl(FALSE) == 0) {
+ ExtendedEnabled = FALSE;
+ }
+ /* Otherwise, the X server has revoqued its root uid,
+ and thus cannot give up IO privileges any more */
+
+ return;
+}
+
+#endif /* USE_AMD64_IOPL */
+
#ifdef USE_DEV_IO
static int IoFd = -1;
@@ -471,7 +528,6 @@ xf86SetRGBOut()
}
#endif
-
#ifdef HAS_MTRR_SUPPORT
/* memory range (MTRR) support for FreeBSD */
@@ -879,3 +935,55 @@ NetBSDundoWC(int screenNum, pointer list)
xfree(mtrrp);
}
#endif
+
+#if defined(__OpenBSD__) && defined(__amd64__)
+static pointer
+amd64setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
+ MessageType from)
+{
+ struct mtrr *mtrrp;
+ int n;
+
+ xf86DrvMsg(screenNum, X_WARNING,
+ "%s MTRR %lx - %lx\n", enable ? "set" : "remove",
+ base, (base + size));
+
+ mtrrp = xnfalloc(sizeof (struct mtrr));
+ mtrrp->base = base;
+ mtrrp->len = size;
+ mtrrp->type = MTRR_TYPE_WC;
+
+ /*
+ * MTRR_PRIVATE will make this MTRR get reset automatically
+ * if this process exits, so we have no need for an explicit
+ * cleanup operation when starting a new server.
+ */
+
+ if (enable)
+ mtrrp->flags = MTRR_VALID | MTRR_PRIVATE;
+ else
+ mtrrp->flags = 0;
+ n = 1;
+
+ if (amd64_set_mtrr(mtrrp, &n) < 0) {
+ xfree(mtrrp);
+ return NULL;
+ }
+ return mtrrp;
+}
+
+static void
+amd64undoWC(int screenNum, pointer list)
+{
+ struct mtrr *mtrrp = (struct mtrr *)list;
+ int n;
+
+ if (mtrrp == NULL)
+ return;
+ n = 1;
+ mtrrp->flags &= ~MTRR_VALID;
+ amd64_set_mtrr(mtrrp, &n);
+ xfree(mtrrp);
+}
+#endif /* OpenBSD/amd64 */
+
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 6b36fdaf2..ffa906505 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -1203,7 +1203,8 @@ handlePciBIOS(PCITAG Tag, int basereg,
if ((xf86ReadDomainMemory(Tag, hostbase, sizeof(tmp), tmp) !=
sizeof(tmp)) ||
(tmp[0] != 0x55) || (tmp[1] != 0xaa) || !tmp[2] ) {
- /* Restore the base register if it was changed. */
+ /* Restore the base registers if they were changed. */
+ pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave);
if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
(CARD32) savebase);
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
index b0c767d5c..3e965265b 100644
--- a/hw/xfree86/os-support/bus/Pci.h
+++ b/hw/xfree86/os-support/bus/Pci.h
@@ -112,7 +112,7 @@
/*
* Global Definitions
*/
-#define MAX_PCI_DEVICES 64 /* Max number of devices accomodated */
+#define MAX_PCI_DEVICES 128 /* Max number of devices accomodated */
/* by xf86scanpci */
#if defined(sun) && defined(SVR4) && defined(sparc)
# define MAX_PCI_BUSES 4096 /* Max number of PCI buses */
@@ -280,7 +280,7 @@
# define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN
# endif
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) || defined(__powerpc64__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
@@ -312,7 +312,7 @@
# define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN
# endif
-#elif defined(__sparc__)
+#elif defined(__sparc__) || defined(sparc)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
diff --git a/hw/xfree86/os-support/bus/ix86Pci.c b/hw/xfree86/os-support/bus/ix86Pci.c
index b135d0b73..da1aa7d2f 100644
--- a/hw/xfree86/os-support/bus/ix86Pci.c
+++ b/hw/xfree86/os-support/bus/ix86Pci.c
@@ -272,10 +272,16 @@ void ix86PciSelectCfgmech(void)
*/
switch (xf86Info.pciFlags) {
- case PCIProbe1: /* { */
+ case PCIOsConfig:
+#if ARCH_PCI_OS_INIT
+ return;
+#endif
+
+ case PCIProbe1:
- xf86MsgVerb(X_INFO, 2, "PCI: Probing config type using method 1\n");
- oldVal1 = inl(PCI_CFGMECH1_ADDRESS_REG);
+ xf86MsgVerb(X_INFO, 2,
+ "PCI: Probing config type using method 1\n");
+ oldVal1 = inl(PCI_CFGMECH1_ADDRESS_REG);
#ifdef DEBUGPCI
if (xf86Verbose > 2) {
@@ -492,9 +498,6 @@ void ix86PciSelectCfgmech(void)
ix86Pci0.funcs = &ix86Funcs2;
return;
- case PCIOsConfig:
- return;
-
case PCIForceNone:
break;
}
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index 4846ee0ed..6e33c2550 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -104,6 +104,7 @@ linuxPciOpenFile(PCITAG tag)
static int lbus,ldev,lfunc,fd = -1;
int bus, dev, func;
char file[32];
+ struct stat ignored;
bus = PCI_BUS_FROM_TAG(tag);
dev = PCI_DEV_FROM_TAG(tag);
@@ -111,12 +112,21 @@ linuxPciOpenFile(PCITAG tag)
if (fd == -1 || bus != lbus || dev != ldev || func != lfunc) {
if (fd != -1)
close(fd);
- if (bus < 256)
- sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
- bus, dev, func);
- else
- sprintf(file, "/proc/bus/pci/%04x/%02x.%1x",
- bus, dev, func);
+ if (bus < 256) {
+ if (stat("/proc/bus/pci/00", &ignored) < 0)
+ sprintf(file, "/proc/bus/pci/0000:%02x/%02x.%1x",
+ bus, dev, func);
+ else
+ sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
+ bus, dev, func);
+ } else {
+ if (stat("/proc/bus/pci/00", &ignored) < 0)
+ sprintf(file, "/proc/bus/pci/0000:%04x/%02x.%1x",
+ bus, dev, func);
+ else
+ sprintf(file, "/proc/bus/pci/%04x/%02x.%1x",
+ bus, dev, func);
+ }
fd = open(file,O_RDWR);
lbus = bus;
ldev = dev;
diff --git a/hw/xfree86/os-support/drm/drmmodule.c b/hw/xfree86/os-support/drm/drmmodule.c
index 8192e97eb..2fb082c36 100644
--- a/hw/xfree86/os-support/drm/drmmodule.c
+++ b/hw/xfree86/os-support/drm/drmmodule.c
@@ -39,7 +39,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_EXTENSION,
ABI_EXTENSION_VERSION,
diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c
index 984c79122..b01004931 100644
--- a/hw/xfree86/os-support/linux/int10/linux.c
+++ b/hw/xfree86/os-support/linux/int10/linux.c
@@ -172,6 +172,9 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
if (errno == ENOSYS)
xf86DrvMsg(screen, X_ERROR, "shmget error\n Please reconfigure"
" your kernel to include System V IPC support\n");
+ else
+ xf86DrvMsg(screen, X_ERROR,
+ "shmget(highmem) error: %s\n",strerror(errno));
goto error1;
}
} else {
@@ -198,16 +201,27 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
ErrorF("Mapping 640kB area\n");
#endif
if ((low_mem = shmget(counter++, V_RAM,
- IPC_CREAT | SHM_R | SHM_W)) == -1)
+ IPC_CREAT | SHM_R | SHM_W)) == -1) {
+ xf86DrvMsg(screen, X_ERROR,
+ "shmget(lowmem) error: %s\n",strerror(errno));
goto error2;
+ }
((linuxInt10Priv*)pInt->private)->lowMem = low_mem;
base = shmat(low_mem, 0, 0);
- if (base == SHMERRORPTR) goto error4;
+ if (base == SHMERRORPTR) {
+ xf86DrvMsg(screen, X_ERROR,
+ "shmat(low_mem) error: %s\n",strerror(errno));
+ goto error3;
+ }
((linuxInt10Priv *)pInt->private)->base = base;
if (high_mem > -1) {
base_high = shmat(high_mem, 0, 0);
- if (base_high == SHMERRORPTR) goto error4;
+ if (base_high == SHMERRORPTR) {
+ xf86DrvMsg(screen, X_ERROR,
+ "shmat(high_mem) error: %s\n",strerror(errno));
+ goto error3;
+ }
((linuxInt10Priv*)pInt->private)->base_high = base_high;
} else
((linuxInt10Priv*)pInt->private)->base_high = NULL;
@@ -388,8 +402,6 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
xfree(options);
return pInt;
-error4:
- xf86DrvMsg(screen, X_ERROR, "shmat() call returned errno %d\n", errno);
error3:
if (base_high)
shmdt(base_high);
@@ -429,6 +441,8 @@ 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,
+ "shmat(low_mem) error: %s\n",strerror(errno));
return FALSE;
}
@@ -438,6 +452,8 @@ MapCurrentInt10(xf86Int10InfoPtr pInt)
if (addr == SHMERRORPTR) {
xf86DrvMsg(pInt->scrnIndex, X_ERROR,
"Cannot shmat() high memory\n");
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+ "shmget error: %s\n",strerror(errno));
return FALSE;
}
} else {
diff --git a/hw/xfree86/os-support/linux/lnx_ia64.c b/hw/xfree86/os-support/linux/lnx_ia64.c
new file mode 100644
index 000000000..8d0976a36
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_ia64.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2004, Egbert Eich
+ *
+ * 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
+ * EGBERT EICH 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 Egbert Eich 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 Egbert Eich.
+ *
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "ia64Pci.h"
+#include "Pci.h"
+
+#if defined OS_PROBE_PCI_CHIPSET
+IA64Chipset OS_PROBE_PCI_CHIPSET(scanpciWrapperOpt flags)
+{
+ struct stat unused;
+
+ if (!stat("/proc/bus/mckinley/zx1",&unused)
+ || !stat("/proc/bus/mckinley/zx2",&unused))
+ return ZX1_CHIPSET;
+
+ return NONE_CHIPSET;
+}
+#endif
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
index 5564f5ab9..da7c0a043 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c,v 1.1.4.2.4.2 2004/03/04 20:16:46 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c,v 1.2 2004/04/23 19:54:08 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c,v 3.14 2001/10/31 22:50:30 tsi Exp $ */
/*
* Copyright 1992 by Orest Zborowski <obz@Kodak.com>
diff --git a/hw/xfree86/os-support/linux/lnx_io.c b/hw/xfree86/os-support/linux/lnx_io.c
index 89afc8d64..dda1ff8ef 100644
--- a/hw/xfree86/os-support/linux/lnx_io.c
+++ b/hw/xfree86/os-support/linux/lnx_io.c
@@ -1,5 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c,v 3.25 2003/08/19 17:32:34 tsi Exp $ */
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c,v 1.1.4.2.6.2 2004/03/04 17:48:09 eich Exp $ */
/*
* Copyright 1992 by Orest Zborowski <obz@Kodak.com>
* Copyright 1993 by David Dawes <dawes@xfree86.org>
diff --git a/hw/xfree86/os-support/linux/lnx_kbd.c b/hw/xfree86/os-support/linux/lnx_kbd.c
index ab75fce09..68f3af38b 100644
--- a/hw/xfree86/os-support/linux/lnx_kbd.c
+++ b/hw/xfree86/os-support/linux/lnx_kbd.c
@@ -1,5 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c,v 1.4 2003/11/03 05:11:52 tsi Exp $ */
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c,v 1.1.4.1.6.2 2004/03/04 17:48:09 eich Exp $ */
/*
* Copyright (c) 2002 by The XFree86 Project, Inc.
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index 5144cdf3e..4cd8152df 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -450,7 +450,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
/* This requires linux-0.99.pl10 or above */
base = mmap((caddr_t)0, Size + alignOff, prot, mapflags, fd,
- (off_t)(off_t)realBase + BUS_BASE);
+ (off_t)realBase + BUS_BASE);
close(fd);
if (base == MAP_FAILED) {
FatalError("xf86MapVidMem: Could not mmap framebuffer"
diff --git a/hw/xfree86/os-support/shared/ia64Pci.c b/hw/xfree86/os-support/shared/ia64Pci.c
new file mode 100644
index 000000000..d0046a7f2
--- /dev/null
+++ b/hw/xfree86/os-support/shared/ia64Pci.c
@@ -0,0 +1,81 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ia64Pci.c,v 1.3 2003/02/23 20:26:49 tsi Exp $ */
+/*
+ * Copyright (C) 2002-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,
+ * 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.
+ */
+
+/*
+ * This file contains the glue needed to support various IA-64 chipsets.
+ */
+
+#include "460gxPCI.h"
+#include "e8870PCI.h"
+#include "zx1PCI.h"
+#include "Pci.h"
+#include "ia64Pci.h"
+
+void
+ia64ScanPCIWrapper(scanpciWrapperOpt flags)
+{
+ static IA64Chipset chipset = NONE_CHIPSET;
+
+ if (flags == SCANPCI_INIT) {
+
+ /* PCI configuration space probes should be done first */
+ if (xorgProbe460GX(flags)) {
+ chipset = I460GX_CHIPSET;
+ xf86PreScan460GX();
+ return;
+ } else if (xorgProbeE8870(flags)) {
+ chipset = E8870_CHIPSET;
+ xf86PreScanE8870();
+ return;
+ }
+#ifdef OS_PROBE_PCI_CHIPSET
+ chipset = OS_PROBE_PCI_CHIPSET(flags);
+ switch (chipset) {
+ case ZX1_CHIPSET:
+ xf86PreScanZX1();
+ return;
+ default:
+ return;
+ }
+#endif
+ } else /* if (flags == SCANPCI_TERM) */ {
+
+ switch (chipset) {
+ case I460GX_CHIPSET:
+ xf86PostScan460GX();
+ return;
+ case E8870_CHIPSET:
+ xf86PostScanE8870();
+ return;
+ case ZX1_CHIPSET:
+ xf86PostScanZX1();
+ return;
+ default:
+ return;
+ }
+ }
+}
diff --git a/hw/xfree86/os-support/shared/ia64Pci.h b/hw/xfree86/os-support/shared/ia64Pci.h
new file mode 100644
index 000000000..1ee2fc091
--- /dev/null
+++ b/hw/xfree86/os-support/shared/ia64Pci.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004, Egbert Eich
+ *
+ * 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
+ * EGBERT EICH 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 Egbert Eich 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 Egbert Eich.
+ *
+ */
+#ifndef _IA64_PCI_H
+# define _IA64_PCI_H
+
+#include "Pci.h"
+
+typedef enum {
+ NONE_CHIPSET,
+ I460GX_CHIPSET,
+ E8870_CHIPSET,
+ ZX1_CHIPSET
+} IA64Chipset;
+
+# ifdef OS_PROBE_PCI_CHIPSET
+extern IA64Chipset OS_PROBE_PCI_CHIPSET(scanpciWrapperOpt flags);
+# endif
+#endif
diff --git a/hw/xfree86/os-support/shared/libc_wrapper.c b/hw/xfree86/os-support/shared/libc_wrapper.c
index 34f375f6c..59c08d85a 100644
--- a/hw/xfree86/os-support/shared/libc_wrapper.c
+++ b/hw/xfree86/os-support/shared/libc_wrapper.c
@@ -1884,7 +1884,8 @@ int
xf86shmget(xf86key_t key, int size, int xf86shmflg)
{
int shmflg;
-
+ int ret;
+
/* This copies the permissions (SHM_R, SHM_W for u, g, o). */
shmflg = xf86shmflg & 0777;
@@ -1893,14 +1894,20 @@ xf86shmget(xf86key_t key, int size, int xf86shmflg)
if (xf86shmflg & XF86IPC_CREAT) shmflg |= IPC_CREAT;
if (xf86shmflg & XF86IPC_EXCL) shmflg |= IPC_EXCL;
if (xf86shmflg & XF86IPC_NOWAIT) shmflg |= IPC_NOWAIT;
- return shmget((key_t) key, size, shmflg);
+ ret = shmget((key_t) key, size, shmflg);
+
+ if (ret == -1)
+ xf86errno = xf86GetErrno();
+
+ return ret;
}
char *
xf86shmat(int id, char *addr, int xf86shmflg)
{
int shmflg = 0;
-
+ pointer ret;
+
#ifdef SHM_RDONLY
if (xf86shmflg & XF86SHM_RDONLY) shmflg |= SHM_RDONLY;
#endif
@@ -1911,13 +1918,25 @@ xf86shmat(int id, char *addr, int xf86shmflg)
if (xf86shmflg & XF86SHM_REMAP) shmflg |= SHM_REMAP;
#endif
- return shmat(id,addr,shmflg);
+ ret = shmat(id,addr,shmflg);
+
+ if (ret == (pointer) -1)
+ xf86errno = xf86GetErrno();
+
+ return ret;
}
int
xf86shmdt(char *addr)
{
- return shmdt(addr);
+ int ret;
+
+ ret = shmdt(addr);
+
+ if (ret == -1)
+ xf86errno = xf86GetErrno();
+
+ return ret;
}
/*
@@ -1927,7 +1946,8 @@ int
xf86shmctl(int id, int xf86cmd, pointer buf)
{
int cmd;
-
+ int ret;
+
switch (xf86cmd) {
case XF86IPC_RMID:
cmd = IPC_RMID;
@@ -1936,32 +1956,44 @@ xf86shmctl(int id, int xf86cmd, pointer buf)
return 0;
}
- return shmctl(id, cmd, buf);
+ ret = shmctl(id, cmd, buf);
+
+ if (ret == -1)
+ xf86errno = xf86GetErrno();
+
+ return ret;
}
#else
int
xf86shmget(xf86key_t key, int size, int xf86shmflg)
{
- return -1;
+ xf86errno = ENOSYS;
+ return -1;
}
char *
xf86shmat(int id, char *addr, int xf86shmflg)
{
+ xf86errno = ENOSYS;
+
return (char *)-1;
}
int
xf86shmctl(int id, int xf86cmd, pointer buf)
{
+ xf86errno = ENOSYS;
+
return -1;
}
int
xf86shmdt(char *addr)
{
+ xf86errno = ENOSYS;
+
return -1;
}
#endif /* HAVE_SYSV_IPC */
diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
index fbab2a517..7bcb93a0b 100644
--- a/hw/xfree86/os-support/shared/sigio.c
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -259,17 +259,25 @@ int
xf86BlockSIGIO (void)
{
sigset_t set, old;
-
+ int ret;
+
sigemptyset (&set);
sigaddset (&set, SIGIO);
sigprocmask (SIG_BLOCK, &set, &old);
- return sigismember (&old, SIGIO);
+ ret = sigismember (&old, SIGIO);
+#ifdef DEBUG
+ ErrorF("%i = xf86BlockSIGIO()\n",ret);
+#endif
+ return ret;
}
void
xf86UnblockSIGIO (int wasset)
{
sigset_t set;
+#ifdef DEBUG
+ ErrorF("xf86UnblockSIGIO(%i)\n",wasset);
+#endif
if (!wasset)
{
diff --git a/hw/xfree86/os-support/shared/sigiostubs.c b/hw/xfree86/os-support/shared/sigiostubs.c
index 51f98f2a4..5e08d4fbe 100644
--- a/hw/xfree86/os-support/shared/sigiostubs.c
+++ b/hw/xfree86/os-support/shared/sigiostubs.c
@@ -25,6 +25,7 @@
* the sale, use or other dealings in this Software without prior written
* authorization from the copyright holder(s) and author(s).
*/
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/shared/sigiostubs.c,v 1.2 2004/06/28 18:08:26 alanc Exp $ */
#ifdef XFree86Server
#ifdef __UNIXOS2__
@@ -32,10 +33,8 @@
#endif
# include "X.h"
# include "xf86.h"
-# include "xf86drm.h"
# include "xf86Priv.h"
# include "xf86_OSlib.h"
-# include "xf86drm.h"
#else
# include <unistd.h>
# include <signal.h>
diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
index fe8205e13..c7382e0e1 100644
--- a/hw/xfree86/os-support/solaris/sun_init.c
+++ b/hw/xfree86/os-support/solaris/sun_init.c
@@ -26,6 +26,9 @@
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
+#ifdef __i386
+# include <sys/kd.h>
+#endif
static Bool KeepTty = FALSE;
static Bool Protect0 = FALSE;
@@ -34,7 +37,11 @@ static int VTnum = -1;
static int xf86StartVT = -1;
#endif
+#if defined(__SOL8__) || !defined(__i386)
+static char fb_dev[PATH_MAX] = "/dev/fb";
+#else
static char fb_dev[PATH_MAX] = "/dev/console";
+#endif
void
xf86OpenConsole(void)
@@ -162,12 +169,15 @@ xf86OpenConsole(void)
if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
-
+#endif
+#ifdef __i386
if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n");
+#endif
}
else /* serverGeneration != 1 */
{
+#ifdef HAS_USL_VTS
/*
* Now re-get the VT
*/
@@ -245,6 +255,11 @@ xf86CloseConsole(void)
#endif
+#ifdef __i386
+ /* Reset the display back to text mode */
+ ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT);
+#endif
+
#ifdef HAS_USL_VTS
/*
@@ -261,8 +276,6 @@ xf86CloseConsole(void)
* Did the whole thing similarly to the way linux does it
*/
- /* Reset the display back to text mode */
- ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT);
if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
{
VT.mode = VT_AUTO; /* Set default vt handling */
diff --git a/hw/xfree86/os-support/solaris/sun_kbd.c b/hw/xfree86/os-support/solaris/sun_kbd.c
index 0213a0732..56929d69b 100644
--- a/hw/xfree86/os-support/solaris/sun_kbd.c
+++ b/hw/xfree86/os-support/solaris/sun_kbd.c
@@ -23,7 +23,9 @@
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbd.c,v 1.3 2004/06/13 04:50:21 alanc Exp $ */
+#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
@@ -55,6 +57,7 @@ void
xf86KbdInit()
{
int klayout;
+ const char *ktype_name;
if (xf86Info.kbdFd < 0) {
xf86Info.kbdFd = open("/dev/kbd", O_RDWR|O_NONBLOCK);
@@ -63,7 +66,7 @@ xf86KbdInit()
}
/*
- * None of the followin should ever fail. If it does, something is
+ * None of the following should ever fail. If it does, something is
* broken (IMO) - DWH 8/21/99
*/
@@ -78,6 +81,21 @@ xf86KbdInit()
if (ioctl(xf86Info.kbdFd, KIOCGDIRECT, &sun_odirect) < 0)
FatalError("Unable to determine keyboard direct setting\n");
+
+ switch (sun_ktype) {
+ case KB_SUN3:
+ ktype_name = "Sun Type 3"; break;
+ case KB_SUN4:
+ ktype_name = "Sun Type 4/5/6"; break;
+ case KB_USB:
+ ktype_name = "USB"; break;
+ case KB_PC:
+ ktype_name = "PC"; break;
+ default:
+ ktype_name = "Unknown"; break;
+ }
+ xf86Msg(X_PROBED, "Keyboard type: %s (%d)\n", ktype_name, sun_ktype);
+ xf86Msg(X_PROBED, "Keyboard layout: %d\n", klayout);
}
int
diff --git a/hw/xfree86/os-support/solaris/sun_kbdEv.c b/hw/xfree86/os-support/solaris/sun_kbdEv.c
index 30cf288ca..c8626a285 100644
--- a/hw/xfree86/os-support/solaris/sun_kbdEv.c
+++ b/hw/xfree86/os-support/solaris/sun_kbdEv.c
@@ -23,6 +23,7 @@
*/
/* [JCH-96/01/21] Extended std reverse map to four buttons. */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbdEv.c,v 1.3 2004/07/28 03:57:19 alanc Exp $ */
#include "xf86.h"
#include "xf86Priv.h"
@@ -107,6 +108,11 @@ static OsTimerPtr sunTimer = NULL;
* This doesn't seem right. It probably needs to be dependent on a keyboard
* type.
*/
+
+/* Additional Sun Japanese Keyboard Keys not defined in common/atKeynames.h */
+#define KEY_Kanji 0x82
+#define KEY_Execute 0x83
+
static unsigned char map[256] = {
#if defined(i386) || defined(__i386) || defined(__i386__)
KEY_NOTUSED, /* 0 */
@@ -519,11 +525,11 @@ static unsigned char usbmap[256] = {
/* 132 */ KEY_NOTUSED,
/* 133 */ KEY_NOTUSED,
/* 134 */ KEY_NOTUSED,
- /* 135 */ KEY_NOTUSED,
- /* 136 */ KEY_NOTUSED,
- /* 137 */ KEY_NOTUSED,
- /* 138 */ KEY_NOTUSED,
- /* 139 */ KEY_NOTUSED,
+ /* 135 */ KEY_BSlash2, /* Sun Japanese Kbd: Backslash / Underscore */
+ /* 136 */ KEY_XFER, /* Sun Japanese Kbd: Henkan Mode */
+ /* 137 */ KEY_Yen, /* Sun Japanese Kbd: Yen / Brokenbar */
+ /* 138 */ KEY_Kanji, /* Sun Japanese Kbd: Kanji */
+ /* 139 */ KEY_Execute, /* Sun Japanese Kbd: Execute */
/* 140 */ KEY_NOTUSED,
/* 141 */ KEY_NOTUSED,
/* 142 */ KEY_NOTUSED,
diff --git a/hw/xfree86/os-support/solaris/sun_mouse.c b/hw/xfree86/os-support/solaris/sun_mouse.c
index 2e9cee2b1..4cbd1cd5e 100644
--- a/hw/xfree86/os-support/solaris/sun_mouse.c
+++ b/hw/xfree86/os-support/solaris/sun_mouse.c
@@ -1,4 +1,5 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_mouse.c,v 1.4 2002/01/25 21:56:21 tsi Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_mouse.c,v 1.2 2004/04/23 19:54:13 eich Exp $ */
/*
* Copyright 1999-2001 The XFree86 Project, Inc. All Rights Reserved.
*
@@ -24,16 +25,53 @@
* dealings in this Software without prior written authorization from the
* XFree86 Project.
*/
+/* Copyright 2004 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * 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
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
#include "xf86.h"
#include "xf86_OSlib.h"
#include "xf86OSmouse.h"
-#if defined(__SOL8__) || !defined(i386)
+#if defined(__SOL8__) || !defined(__i386)
#include "xisb.h"
#include "mipointer.h"
+#include <sys/stropts.h>
#include <sys/vuid_event.h>
+#include <sys/msio.h>
+
+/* Wheel mouse support in VUID drivers in Solaris 9 updates & Solaris 10 */
+#ifdef WHEEL_DEVID /* Defined in vuid_event.h if VUID wheel support present */
+# define HAVE_VUID_WHEEL
+#endif
+#ifdef HAVE_VUID_WHEEL
+# include <sys/vuid_wheel.h>
+#endif
/* Names of protocols that are handled internally here. */
@@ -42,21 +80,71 @@ static const char *internalNames[] = {
NULL
};
+static const char *solarisMouseDevs[] = {
+ /* Device file: Protocol: */
+ "/dev/mouse", "VUID", /* USB or SPARC */
+#ifdef __i386
+ "/dev/kdmouse", "PS/2", /* PS/2 */
+#endif
+ NULL
+};
+
typedef struct _VuidMseRec {
Firm_event event;
unsigned char *buffer;
+ char *strmod;
} VuidMseRec, *VuidMsePtr;
static int vuidMouseProc(DeviceIntPtr pPointer, int what);
static void vuidReadInput(InputInfoPtr pInfo);
+/*
+ * Initialize and enable the mouse wheel, if present.
+ *
+ * Returns 1 if mouse wheel was successfully enabled.
+ * Returns 0 if an error occurred or if there is no mouse wheel.
+ */
+static int
+vuidMouseWheelInit(InputInfoPtr pInfo)
+{
+#ifdef HAVE_VUID_WHEEL
+ wheel_state wstate;
+ int nwheel = -1;
+
+ wstate.vers = VUID_WHEEL_STATE_VERS;
+ wstate.id = 0;
+ wstate.stateflags = -1;
+
+ if (ioctl(pInfo->fd, VUIDGWHEELCOUNT, &nwheel) != 0)
+ return (0);
+
+ if (ioctl(pInfo->fd, VUIDGWHEELSTATE, &wstate) != 0) {
+ xf86Msg(X_WARNING, "%s: couldn't get wheel state\n", pInfo->name);
+ return (0);
+ }
+
+ wstate.stateflags |= VUID_WHEEL_STATE_ENABLED;
+
+ if (ioctl(pInfo->fd, VUIDSWHEELSTATE, &wstate) != 0) {
+ xf86Msg(X_WARNING, "%s: couldn't enable wheel\n", pInfo->name);
+ return (0);
+ }
+
+ return (1);
+#else
+ return (0);
+#endif
+}
+
+
/* This function is called when the protocol is "VUID". */
static Bool
vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
{
MouseDevPtr pMse = pInfo->private;
VuidMsePtr pVuidMse;
+ int buttons;
pVuidMse = xalloc(sizeof(VuidMseRec));
if (pVuidMse == NULL) {
@@ -84,7 +172,40 @@ vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
return FALSE;
}
}
+
pVuidMse->buffer = (unsigned char *)&pVuidMse->event;
+
+ pVuidMse->strmod = xf86SetStrOption(pInfo->options, "StreamsModule", NULL);
+ if (pVuidMse->strmod &&
+ (ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod) == -1)) {
+ xf86Msg(X_ERROR,
+ "%s: cannot push module '%s' onto mouse device: %s\n",
+ pInfo->name, pVuidMse->strmod, strerror(errno));
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ xfree(pVuidMse);
+ xfree(pMse);
+ return FALSE;
+ }
+
+ buttons = xf86SetIntOption(pInfo->options, "Buttons", 0);
+ if (buttons == 0) {
+ if(ioctl(pInfo->fd, MSIOBUTTONS, &buttons) == 0) {
+ pInfo->conf_idev->commonOptions =
+ xf86ReplaceIntOption(pInfo->conf_idev->commonOptions,
+ "Buttons", buttons);
+ xf86Msg(X_INFO, "%s: Setting Buttons option to \"%d\"\n",
+ pInfo->name, buttons);
+ }
+ }
+
+ if (pVuidMse->strmod &&
+ (ioctl(pInfo->fd, I_POP, pVuidMse->strmod) == -1)) {
+ xf86Msg(X_WARNING,
+ "%s: cannot pop module '%s' off mouse device: %s\n",
+ pInfo->name, pVuidMse->strmod, strerror(errno));
+ }
+
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
@@ -112,6 +233,7 @@ vuidReadInput(InputInfoPtr pInfo)
unsigned int n;
int c;
unsigned char *pBuf;
+ int wmask;
pMse = pInfo->private;
pVuidMse = pMse->mousePriv;
@@ -154,7 +276,15 @@ vuidReadInput(InputInfoPtr pInfo)
dy -= delta;
break;
}
+ }
+#ifdef HAVE_VUID_WHEEL
+ else if (vuid_in_range(VUID_WHEEL, pVuidMse->event.id)) {
+ if (vuid_id_offset(pVuidMse->event.id) == 0)
+ dz -= VUID_WHEEL_GETDELTA(pVuidMse->event.value);
+ else
+ dw -= VUID_WHEEL_GETDELTA(pVuidMse->event.value);
}
+#endif
n = 0;
if ((c = XisbRead(pMse->buffer)) >= 0) {
@@ -219,9 +349,20 @@ vuidMouseProc(DeviceIntPtr pPointer, int what)
pInfo->fd = -1;
} else {
int fmt = VUID_FIRM_EVENT;
- ioctl(pInfo->fd, VUIDSFORMAT, &fmt);
- xf86FlushInput(pInfo->fd);
- AddEnabledDevice(pInfo->fd);
+
+ if (pVuidMse->strmod &&
+ (ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod) == -1)) {
+ xf86Msg(X_ERROR,
+ "%s: cannot push module '%s' onto mouse device: %s\n",
+ pInfo->name, pVuidMse->strmod, strerror(errno));
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ } else {
+ ioctl(pInfo->fd, VUIDSFORMAT, &fmt);
+ vuidMouseWheelInit(pInfo);
+ xf86FlushInput(pInfo->fd);
+ AddEnabledDevice(pInfo->fd);
+ }
}
}
pMse->lastButtons = 0;
@@ -237,6 +378,12 @@ vuidMouseProc(DeviceIntPtr pPointer, int what)
XisbFree(pMse->buffer);
pMse->buffer = NULL;
}
+ if (pVuidMse->strmod &&
+ (ioctl(pInfo->fd, I_POP, pVuidMse->strmod) == -1)) {
+ xf86Msg(X_WARNING,
+ "%s: cannot pop module '%s' off mouse device: %s\n",
+ pInfo->name, pVuidMse->strmod, strerror(errno));
+ }
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
}
@@ -278,21 +425,98 @@ CheckProtocol(const char *protocol)
static const char *
DefaultProtocol(void)
{
- return "VUID";
+ return "Auto";
+}
+
+static Bool
+solarisMouseAutoProbe(InputInfoPtr pInfo, const char **protocol,
+ const char **device)
+{
+ const char **pdev, **pproto, *dev = NULL;
+ int fd = -1;
+ Bool found;
+
+ for (pdev = solarisMouseDevs; *pdev; pdev += 2) {
+ pproto = pdev + 1;
+ if ((*protocol != NULL) && (strcmp(*protocol, "Auto") != 0) &&
+ (*pproto != NULL) && (strcmp(*pproto, *protocol) != 0)) {
+ continue;
+ }
+ if ((*device != NULL) && (strcmp(*device, *pdev) != 0)) {
+ continue;
+ }
+ SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
+ if (fd == -1) {
+#ifdef DEBUG
+ ErrorF("Cannot open %s (%s)\n", pdev, strerror(errno));
+#endif
+ } else {
+ found = TRUE;
+ if ((*pproto != NULL) && (strcmp(*pproto, "VUID") == 0)) {
+ int i;
+ if (ioctl(fd, VUIDGFORMAT, &i) < 0) {
+ found = FALSE;
+ }
+ }
+ close(fd);
+ if (found == TRUE) {
+ if (*pproto != NULL) {
+ *protocol = *pproto;
+ }
+ *device = *pdev;
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
}
static const char *
SetupAuto(InputInfoPtr pInfo, int *protoPara)
{
- return DefaultProtocol();
+ const char *pdev = NULL;
+ const char *pproto = NULL;
+ MouseDevPtr pMse = pInfo->private;
+
+ if (pInfo->fd == -1) {
+ /* probe to find device/protocol to use */
+ if (solarisMouseAutoProbe(pInfo, &pproto, &pdev) != FALSE) {
+ /* Set the Device option. */
+ pInfo->conf_idev->commonOptions =
+ xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", pdev);
+ xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
+ pInfo->name, pdev);
+ }
+ } else if (pMse->protocolID == PROT_AUTO) {
+ pdev = xf86CheckStrOption(pInfo->conf_idev->commonOptions,
+ "Device", NULL);
+ solarisMouseAutoProbe(pInfo, &pproto, &pdev);
+ }
+ return pproto;
+}
+
+static const char *
+FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ const char *pdev = NULL;
+ const char *pproto = protocol;
+
+ if (solarisMouseAutoProbe(pInfo, &pproto, &pdev) != FALSE) {
+ /* Set the Device option. */
+ pInfo->conf_idev->commonOptions =
+ xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", pdev);
+ xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
+ pInfo->name, pdev);
+ }
+ return pdev;
}
-#else /* __SOL8__ || !i386 */
+#else /* __SOL8__ || !__i386 */
#undef MSE_MISC
#define MSE_MISC 0
-#endif /* !__SOL8__ && i386 */
+#endif /* !__SOL8__ && __i386 */
static int
SupportedInterfaces(void)
@@ -310,12 +534,13 @@ xf86OSMouseInit(int flags)
if (!p)
return NULL;
p->SupportedInterfaces = SupportedInterfaces;
-#if defined(__SOL8__) || !defined(i386)
+#if defined(__SOL8__) || !defined(__i386)
p->BuiltinNames = BuiltinNames;
p->CheckProtocol = CheckProtocol;
p->PreInit = sunMousePreInit;
p->DefaultProtocol = DefaultProtocol;
p->SetupAuto = SetupAuto;
+ p->FindDevice = FindDevice;
#endif
return p;
}
diff --git a/hw/xfree86/os-support/xf86OSmouse.h b/hw/xfree86/os-support/xf86OSmouse.h
index ee6313a3b..87d742d5e 100644
--- a/hw/xfree86/os-support/xf86OSmouse.h
+++ b/hw/xfree86/os-support/xf86OSmouse.h
@@ -169,11 +169,12 @@ extern OSMouseInfoPtr xf86OSMouseInit(int flags);
*
* 1.0.0 - Everything up to when versioning was started.
* 1.1.0 - FindDevice and GuessProtocol added to OSMouseInfoRec
+ * 1.2.0 - xisbscale added to MouseDevRec
*
*/
#define OS_MOUSE_VERSION_MAJOR 1
-#define OS_MOUSE_VERSION_MINOR 1
+#define OS_MOUSE_VERSION_MINOR 2
#define OS_MOUSE_VERSION_PATCH 0
#define OS_MOUSE_VERSION_CURRENT \
@@ -267,6 +268,7 @@ typedef struct _MouseDevRec {
dataGoodProc dataGood;
int angleOffset;
pointer pDragLock; /* drag lock area */
+ int xisbscale; /* buffer size for 1 event */
} MouseDevRec, *MouseDevPtr;
/* Z axis mapping */
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index 4df2d502a..5a9c9b1ff 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -67,6 +67,7 @@
*/
/* $XConsortium: xf86_OSlib.h /main/22 1996/10/27 11:06:31 kaleb $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 1.4 2004/07/28 03:57:19 alanc Exp $ */
/*
* This is private, and should not be included by any drivers. Drivers
@@ -260,6 +261,7 @@ typedef signed long xf86ssize_t;
# define LED_CAP LED_CAPS_LOCK
# define LED_NUM LED_NUM_LOCK
# define LED_SCR LED_SCROLL_LOCK
+# define LED_COMP LED_COMPOSE
# include <signal.h>
@@ -532,7 +534,7 @@ extern int errno;
# endif
# endif /* __bsdi__ */
-#ifdef USE_I386_IOPL
+#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
#include <machine/sysarch.h>
#endif
diff --git a/hw/xfree86/os-support/xf86_libc.h b/hw/xfree86/os-support/xf86_libc.h
index ca54e480e..9579a6611 100644
--- a/hw/xfree86/os-support/xf86_libc.h
+++ b/hw/xfree86/os-support/xf86_libc.h
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 1.1.4.3 2003/12/20 00:28:30 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 1.2 2004/04/23 19:54:07 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.63 2003/12/08 21:46:55 alanh Exp $ */
/*
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
index 522cf5c2f..cc694666f 100644
--- a/hw/xfree86/parser/configProcs.h
+++ b/hw/xfree86/parser/configProcs.h
@@ -116,6 +116,10 @@ void xf86freeBuffersList (XF86ConfBuffersPtr ptr);
XF86ConfDRIPtr xf86parseDRISection (void);
void xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr);
void xf86freeDRI (XF86ConfDRIPtr ptr);
+/* Extensions.c */
+XF86ConfExtensionsPtr xf86parseExtensionsSection (void);
+void xf86printExtensionsSection (FILE * cf, XF86ConfExtensionsPtr ptr);
+void xf86freeExtensions (XF86ConfExtensionsPtr ptr);
#ifndef IN_XSERVER
/* Externally provided functions */
diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
index 2a5afeb27..2946dc8b1 100644
--- a/hw/xfree86/parser/read.c
+++ b/hw/xfree86/parser/read.c
@@ -191,6 +191,12 @@ xf86readConfigFile (void)
val.str = NULL;
HANDLE_RETURN (conf_dri, xf86parseDRISection ());
}
+ else if (xf86nameCompare (val.str, "extensions") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_RETURN (conf_extensions, xf86parseExtensionsSection ());
+ }
else
{
Error (INVALID_SECTION_MSG, xf86tokenString ());
@@ -304,6 +310,7 @@ xf86freeConfig (XF86ConfigPtr p)
xf86freeInputList (p->conf_input_lst);
xf86freeVendorList (p->conf_vendor_lst);
xf86freeDRI (p->conf_dri);
+ xf86freeExtensions (p->conf_extensions);
TestFree(p->conf_comment);
xf86conffree (p);
diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c
index e096c6247..499b6a11e 100644
--- a/hw/xfree86/parser/write.c
+++ b/hw/xfree86/parser/write.c
@@ -130,6 +130,8 @@ doWriteConfigFile (const char *filename, XF86ConfigPtr cptr)
xf86printDRISection (cf, cptr->conf_dri);
+ xf86printExtensionsSection (cf, cptr->conf_extensions);
+
fclose(cf);
return 1;
}
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
index 1a30d17a8..b6a974d3c 100644
--- a/hw/xfree86/parser/xf86Parser.h
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -416,6 +416,13 @@ XF86ConfDRIRec, *XF86ConfDRIPtr;
typedef struct
{
+ XF86OptionPtr ext_option_lst;
+ char *extensions_comment;
+}
+XF86ConfExtensionsRec, *XF86ConfExtensionsPtr;
+
+typedef struct
+{
XF86ConfFilesPtr conf_files;
XF86ConfModulePtr conf_modules;
XF86ConfFlagsPtr conf_flags;
@@ -428,6 +435,7 @@ typedef struct
XF86ConfLayoutPtr conf_layout_lst;
XF86ConfVendorPtr conf_vendor_lst;
XF86ConfDRIPtr conf_dri;
+ XF86ConfExtensionsPtr conf_extensions;
char *conf_comment;
}
XF86ConfigRec, *XF86ConfigPtr;
diff --git a/hw/xfree86/rac/xf86RACmodule.c b/hw/xfree86/rac/xf86RACmodule.c
index fd436ef85..83c60e3fd 100644
--- a/hw/xfree86/rac/xf86RACmodule.c
+++ b/hw/xfree86/rac/xf86RACmodule.c
@@ -8,7 +8,7 @@ static XF86ModuleVersionInfo racVersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
ABI_VIDEODRV_VERSION,
diff --git a/hw/xfree86/ramdac/IBM.c b/hw/xfree86/ramdac/IBM.c
index 69207c2e2..4fede5720 100644
--- a/hw/xfree86/ramdac/IBM.c
+++ b/hw/xfree86/ramdac/IBM.c
@@ -374,6 +374,10 @@ IBMramdac526SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
}
}
+IBMramdac526SetBppProc *IBMramdac526SetBppWeak(void) {
+ return IBMramdac526SetBpp;
+}
+
void
IBMramdac640SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
{
diff --git a/hw/xfree86/ramdac/IBM.h b/hw/xfree86/ramdac/IBM.h
index 00d039031..eb211883c 100644
--- a/hw/xfree86/ramdac/IBM.h
+++ b/hw/xfree86/ramdac/IBM.h
@@ -18,6 +18,9 @@ unsigned long IBMramdac640CalculateMNPCForClock(unsigned long RefClock,
void IBMramdac526HWCursorInit(xf86CursorInfoPtr infoPtr);
void IBMramdac640HWCursorInit(xf86CursorInfoPtr infoPtr);
+typedef void IBMramdac526SetBppProc(ScrnInfoPtr, RamDacRegRecPtr);
+IBMramdac526SetBppProc *IBMramdac526SetBppWeak(void);
+
#define IBM524_RAMDAC ((VENDOR_IBM << 16) | 0x00)
#define IBM524A_RAMDAC ((VENDOR_IBM << 16) | 0x01)
#define IBM525_RAMDAC ((VENDOR_IBM << 16) | 0x02)
diff --git a/hw/xfree86/ramdac/TI.c b/hw/xfree86/ramdac/TI.c
index ce6dd9a04..024cb49eb 100644
--- a/hw/xfree86/ramdac/TI.c
+++ b/hw/xfree86/ramdac/TI.c
@@ -711,3 +711,7 @@ void TIramdacLoadPalette(
}
}
}
+
+TIramdacLoadPaletteProc *TIramdacLoadPaletteWeak(void) {
+ return TIramdacLoadPalette;
+}
diff --git a/hw/xfree86/ramdac/TI.h b/hw/xfree86/ramdac/TI.h
index f87ebd13f..f33247cfc 100644
--- a/hw/xfree86/ramdac/TI.h
+++ b/hw/xfree86/ramdac/TI.h
@@ -19,6 +19,9 @@ void TIramdacHWCursorInit(xf86CursorInfoPtr infoPtr);
void TIramdacLoadPalette( ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual);
+typedef void TIramdacLoadPaletteProc(ScrnInfoPtr, int, int *, LOCO *,
+ VisualPtr);
+TIramdacLoadPaletteProc *TIramdacLoadPaletteWeak(void);
#define TI3030_RAMDAC (VENDOR_TI << 16) | 0x00
#define TI3026_RAMDAC (VENDOR_TI << 16) | 0x01
diff --git a/hw/xfree86/ramdac/xf86RamDacMod.c b/hw/xfree86/ramdac/xf86RamDacMod.c
index cb100d7bb..0fe5ce6aa 100644
--- a/hw/xfree86/ramdac/xf86RamDacMod.c
+++ b/hw/xfree86/ramdac/xf86RamDacMod.c
@@ -33,7 +33,7 @@ static XF86ModuleVersionInfo VersRec = {
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
0, 1, 0,
ABI_CLASS_VIDEODRV,
ABI_VIDEODRV_VERSION,
diff --git a/hw/xfree86/scanpci/extrapci.ids b/hw/xfree86/scanpci/extrapci.ids
index a65732072..71664cbee 100644
--- a/hw/xfree86/scanpci/extrapci.ids
+++ b/hw/xfree86/scanpci/extrapci.ids
@@ -14,7 +14,7 @@
# changes/additions that aren't XFree86-specific to the pciids
# project (http://pciids.sf.net/).
#
-# $XdotOrg: xc/programs/Xserver/hw/xfree86/etc/extrapci.ids,v 1.1.4.2.4.2 2004/03/04 20:16:34 kaleb Exp $
+# $XdotOrg: xc/programs/Xserver/hw/xfree86/etc/extrapci.ids,v 1.2 2004/04/23 19:53:57 eich Exp $
# $XFree86: xc/programs/Xserver/hw/xfree86/etc/extrapci.ids,v 1.11 2003/12/18 16:22:27 dawes Exp $
#
diff --git a/hw/xfree86/scanpci/xf86ScanPci.c b/hw/xfree86/scanpci/xf86ScanPci.c
index cf12c42cc..8231ea05a 100644
--- a/hw/xfree86/scanpci/xf86ScanPci.c
+++ b/hw/xfree86/scanpci/xf86ScanPci.c
@@ -96,7 +96,7 @@ static XF86ModuleVersionInfo pciDataVersRec = {
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_VIDEODRV,
ABI_VIDEODRV_VERSION,
@@ -113,7 +113,7 @@ static XF86ModuleVersionInfo scanPciVersRec = {
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_VIDEODRV,
ABI_VIDEODRV_VERSION,
diff --git a/hw/xfree86/shadowfb/sfbmodule.c b/hw/xfree86/shadowfb/sfbmodule.c
index ad090d43c..6793c8f95 100644
--- a/hw/xfree86/shadowfb/sfbmodule.c
+++ b/hw/xfree86/shadowfb/sfbmodule.c
@@ -11,7 +11,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/utils/gtf/gtf.c b/hw/xfree86/utils/gtf/gtf.c
index 3535300fc..fbc620709 100644
--- a/hw/xfree86/utils/gtf/gtf.c
+++ b/hw/xfree86/utils/gtf/gtf.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/etc/gtf.c,v 1.1.10.1.4.1 2004/03/19 17:09:00 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/etc/gtf.c,v 1.2 2004/04/23 19:53:57 eich Exp $ */
/* gtf.c Generate mode timings using the GTF Timing Standard
*
* gcc gtf.c -o gtf -lm -Wall
diff --git a/hw/xfree86/utils/gtf/gtf.man.pre b/hw/xfree86/utils/gtf/gtf.man.pre
index 4dc228d2c..fd0c406d3 100644
--- a/hw/xfree86/utils/gtf/gtf.man.pre
+++ b/hw/xfree86/utils/gtf/gtf.man.pre
@@ -1,5 +1,4 @@
.\" $XFree86$
-.\" $XdotOrg: xc/programs/Xserver/hw/xfree86/etc/gtf.man,v 1.1.10.1.4.2 2004/03/27 16:56:43 keithp Exp $
.TH GTF 1 __vendorversion__
.SH NAME
gtf - calculate VESA GTF mode lines
diff --git a/hw/xfree86/utils/xorgcfg/loader.c b/hw/xfree86/utils/xorgcfg/loader.c
index 138b77778..ad928c4d8 100644
--- a/hw/xfree86/utils/xorgcfg/loader.c
+++ b/hw/xfree86/utils/xorgcfg/loader.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.1.4.1.4.2.4.1 2004/03/23 13:54:01 eich Exp $
+ * $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.2 2004/04/23 19:54:18 eich Exp $
* $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.19 2002/06/06 21:03:32 paulo Exp $
*/
diff --git a/hw/xfree86/utils/xorgconfig/cards.c b/hw/xfree86/utils/xorgconfig/cards.c
index d5f405f4a..29c1c0e2b 100644
--- a/hw/xfree86/utils/xorgconfig/cards.c
+++ b/hw/xfree86/utils/xorgconfig/cards.c
@@ -1,3 +1,4 @@
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86config/cards.c,v 1.3 2004/08/13 23:57:38 alanc Exp $ */
/* $XConsortium: cards.c /main/9 1996/10/19 18:15:32 kaleb $ */
@@ -16,6 +17,19 @@
#include "cards.h"
+/* Some vars to make path names in texts more flexible. */
+#ifndef PROJECTROOT
+# define PROJECTROOT "/usr/X11R6"
+#endif
+#define TREEROOT PROJECTROOT
+#define TREEROOTLX TREEROOT "/lib/X11"
+#define TREEROOTCFG TREEROOT "/etc/X11"
+#ifdef XDOCDIR
+# define TREEROOTDOC XDOCDIR
+#else
+# define TREEROOTDOC TREEROOTLX "/doc"
+#endif
+
/*
* Database format:
*
@@ -92,12 +106,12 @@ static char *s3_comment =
"# (this avoids the linear framebuffer probe). If that fails try\n"
"# option \"nomemaccess\".\n"
"#\n"
-"# Refer to /usr/X11R6/lib/doc/README.S3, and the XF86_S3 man page.\n";
+"# Refer to " TREEROOTDOC "/README.S3, and the XF86_S3 man page.\n";
static char *cirrus_comment =
"# Use Option \"no_bitblt\" if you have graphics problems. If that fails\n"
"# try Option \"noaccel\".\n"
-"# Refer to /usr/X11R6/lib/doc/README.cirrus.\n"
+"# Refer to " TREEROOTDOC "/README.cirrus.\n"
"# To allow linear addressing, uncomment the Option line and the\n"
"# address that the card maps the framebuffer to.\n";
diff --git a/hw/xfree86/utils/xorgconfig/xorgconfig.c b/hw/xfree86/utils/xorgconfig/xorgconfig.c
index 7f4c18d6a..a8fef000b 100644
--- a/hw/xfree86/utils/xorgconfig/xorgconfig.c
+++ b/hw/xfree86/utils/xorgconfig/xorgconfig.c
@@ -94,6 +94,7 @@
* Chisato Yamauchi(cyamauch@phyas.aichi-edu.ac.jp)
*/
/* $XConsortium: xf86config.c /main/21 1996/10/28 05:43:57 kaleb $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86config/xorgconfig.c,v 1.6 2004/08/13 23:57:38 alanc Exp $ */
#include <stdlib.h>
#include <stdio.h>
@@ -169,6 +170,11 @@ static int getuid() { return 0; }
#define TREEROOT PROJECTROOT
#define TREEROOTLX TREEROOT "/lib/X11"
#define TREEROOTCFG TREEROOT "/etc/X11"
+#ifdef XDOCDIR
+# define TREEROOTDOC XDOCDIR
+#else
+# define TREEROOTDOC TREEROOTLX "/doc"
+#endif
#define MODULEPATH TREEROOT "/lib/modules"
#ifndef XCONFIGFILE
@@ -256,7 +262,7 @@ CONFIGNAME " file is supplied with "__XSERVERNAME__"; it is configured for a sta
"configuration, or let this program produce a base " CONFIGNAME " file for your\n"
"configuration and fine-tune it.\n"
#if 0
-" Refer to " TREEROOTLX "/doc/README.Config\n"
+" Refer to " TREEROOTDOC "/README.Config\n"
"for a detailed overview of the configuration process.\n"
"\n"
"(what should we change this section to?)\n"
@@ -372,7 +378,7 @@ int M_OSMOUSE, M_WSMOUSE, M_AUTO,
M_NETMOUSE_PS2, M_NETSCROLL_PS2, M_THINKINGMOUSE_PS2,
M_ACECAD, M_GLIDEPOINT, M_INTELLIMOUSE,
M_LOGITECH, M_MMHITTAB, M_MMSERIES,
- M_MOUSEMAN, M_THINKINGMOUSE;
+ M_MOUSEMAN, M_THINKINGMOUSE, M_VUID;
struct {
char *name;
@@ -398,6 +404,11 @@ struct {
{"Auto", &M_AUTO,
"Auto detect"
},
+#ifdef sun
+ {"VUID", &M_VUID,
+ "Solaris VUID"
+ },
+#endif
{"SysMouse", &M_SYSMOUSE,
"SysMouse"
},
@@ -464,6 +475,14 @@ struct {
},
};
+#ifdef WSCONS_SUPPORT
+# define DEF_MOUSEDEV "/dev/wsmouse";
+#elif defined(__FreeBSD__)
+# define DEF_MOUSEDEV "/dev/sysmouse";
+#else
+# define DEF_MOUSEDEV "/dev/mouse";
+#endif
+
#ifndef __UNIXOS2__
static char *mouseintro_text =
"First specify a mouse protocol type. Choose one from the following list:\n"
@@ -471,13 +490,7 @@ static char *mouseintro_text =
static char *mousedev_text =
"Now give the full device name that the mouse is connected to, for example\n"
-"/dev/tty00. Just pressing enter will use the default, /dev/mouse.\n"
-#ifdef WSCONS_SUPPORT
-"On systems with wscons, the default is /dev/wsmouse.\n"
-#endif
-#ifdef __FreeBSD__
-"On FreeBSD, the default is /dev/sysmouse.\n"
-#endif
+"/dev/tty00. Just pressing enter will use the default, %s.\n"
"\n";
static char *mousecomment_text =
@@ -529,6 +542,7 @@ mouse_configuration(void) {
#if !defined(__UNIXOS2__) && !defined(QNX4)
int i, j;
char s[80];
+ char *def_mousedev = DEF_MOUSEDEV;
#define MOUSETYPE_COUNT sizeof(mouse_info)/sizeof(mouse_info[0])
for (i = 0; i < MOUSETYPE_COUNT; i++)
@@ -621,22 +635,24 @@ mouse_configuration(void) {
config_emulate3buttons = 0;
printf("\n");
- printf("%s", mousedev_text);
+#if (defined(sun) && defined(__i386))
+ /* SPARC & USB mice (VUID or AUTO protocols) default to /dev/mouse,
+ but PS/2 mice default to /dev/kdmouse */
+ if ((config_mousetype != M_AUTO) && (config_mousetype != M_VUID)) {
+ def_mousedev = "/dev/kdmouse";
+ }
+#endif
+
+ printf(mousedev_text, def_mousedev);
printf("Mouse device: ");
getstring(s);
- if (strlen(s) == 0)
-#ifdef WSCONS_SUPPORT
- config_pointerdevice = "/dev/wsmouse";
-#elif defined(__FreeBSD__)
- config_pointerdevice = "/dev/sysmouse";
-#else
- config_pointerdevice = "/dev/mouse";
-#endif
- else {
+ if (strlen(s) == 0) {
+ config_pointerdevice = def_mousedev;
+ } else {
config_pointerdevice = Malloc(strlen(s) + 1);
strcpy(config_pointerdevice, s);
- }
- printf("\n");
+ }
+ printf("\n");
#else /* __UNIXOS2__ */
/* set some reasonable defaults for OS/2 */
@@ -706,7 +722,7 @@ keyboard_configuration(void)
rulesfile = XKB_RULES_DIR "/xfree98";
#else
config_xkbrules = __XKBDEFRULES__; /* static */
- rulesfile = XKB_RULES_DIR "/";
+ rulesfile = XKB_RULES_DIR "/" __XKBDEFRULES__;
#endif
rules = XkbRF_Load(rulesfile, "", True, False);
@@ -839,7 +855,7 @@ static char *monitorintro_text =
"\n"
"The valid range for horizontal sync and vertical sync should be documented\n"
"in the manual of your monitor. If in doubt, check the monitor database\n"
-TREEROOTLX "/doc/Monitors to see if your monitor is there.\n"
+TREEROOTDOC "/Monitors to see if your monitor is there.\n"
"\n";
static char *hsyncintro_text =
@@ -1852,10 +1868,10 @@ depth_configuration(void)
*/
static char *XF86Config_firstchunk_text =
-"# File generated by xf86config.\n"
+"# File generated by xorgconfig.\n"
"\n"
"#\n"
-"# Copyright (c) 2004, by the "XVENDORNAMESHORT"\n"
+"# Copyright 2004 "XVENDORNAME"\n"
"#\n"
"# Permission is hereby granted, free of charge, to any person obtaining a\n"
"# copy of this software and associated documentation files (the \"Software\"),\n"
@@ -1870,19 +1886,19 @@ static char *XF86Config_firstchunk_text =
"# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n"
"# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n"
"# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n"
-"# THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n"
+"# "XVENDORNAME" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n"
"# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF\n"
"# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n"
"# SOFTWARE.\n"
"# \n"
-"# Except as contained in this notice, the name of "XVENDORNAMESHORT" shall\n"
+"# Except as contained in this notice, the name of "XVENDORNAME" shall\n"
"# not be used in advertising or otherwise to promote the sale, use or other\n"
-"# dealings in this Software without prior written authorization from the\n"
-"# "XVENDORNAMESHORT".\n"
+"# dealings in this Software without prior written authorization from\n"
+"# "XVENDORNAME".\n"
"#\n"
"\n"
"# **********************************************************************\n"
-"# Refer to the XF86Config(4/5) man page for details about the format of \n"
+"# Refer to the " CONFIGNAME "(" FILEMANSUFFIX ") man page for details about the format of \n"
"# this file.\n"
"# **********************************************************************\n"
"\n"
@@ -1903,9 +1919,17 @@ static char *XF86Config_firstchunk_text =
" Option \"omit xfree86-dga\" # don't initialise the DGA extension\n"
" EndSubSection\n"
"\n"
-"# This loads the Type1 and FreeType font modules\n"
+"# This loads the font modules\n"
+#ifdef HAS_TYPE1
" Load \"type1\"\n"
+#else
+"# Load \"type1\"\n"
+#endif
+#ifdef HAS_SPEEDO
" Load \"speedo\"\n"
+#else
+"# Load \"speedo\"\n"
+#endif
" Load \"freetype\"\n"
"# Load \"xtt\"\n"
"\n"
@@ -1932,9 +1956,11 @@ static char *XF86Config_firstchunk_text =
"# as well as specifying multiple comma-separated entries in one FontPath\n"
"# command (or a combination of both methods)\n"
"# \n"
+#if 0
"# If you don't have a floating point coprocessor and emacs, Mosaic or other\n"
"# programs take long to start up, try moving the Type1 and Speedo directory\n"
"# to the end of this list (or comment them out).\n"
+#endif
"# \n"
"\n";
@@ -2025,7 +2051,11 @@ static char *XF86Config_fontpathchunk_text =
"Section \"InputDevice\"\n"
"\n"
" Identifier \"Keyboard1\"\n"
+#ifdef USE_DEPRECATED_KEYBOARD_DRIVER
" Driver \"Keyboard\"\n"
+#else
+" Driver \"kbd\"\n"
+#endif
"\n"
"# For most OSs the protocol can be omitted (it defaults to \"Standard\").\n"
"# When using XQUEUE (only for SVR3 and SVR4, but not Solaris),\n"
@@ -2061,8 +2091,8 @@ static char *keyboardchunk3_text =
"# control keys, use:\n"
"# Option \"XkbOptions\" \"ctrl:swapcaps\"\n"
"\n"
-"# These are the default XKB settings for "XVENDORNAMESHORT"\n"
-"# Option \"XkbRules\" \"__XKBDEFRULES__\"\n"
+"# These are the default XKB settings for "__XSERVERNAME__"\n"
+"# Option \"XkbRules\" \""__XKBDEFRULES__"\"\n"
"# Option \"XkbModel\" \"pc101\"\n"
"# Option \"XkbLayout\" \"us\"\n"
"# Option \"XkbVariant\" \"\"\n"
@@ -2114,7 +2144,7 @@ static char *xinputsection_text =
"# Other input device sections \n"
"# this is optional and is required only if you\n"
"# are using extended input devices. This is for example only. Refer\n"
-"# to the XF86Config man page for a description of the options.\n"
+"# to the " CONFIGNAME " man page for a description of the options.\n"
"# **********************************************************************\n"
"#\n"
"# Section \"InputDevice\" \n"
@@ -2384,7 +2414,7 @@ static char *devicesection_text =
"\n"
"EndSection\n"
"\n"
-"# Device configured by xf86config:\n"
+"# Device configured by xorgconfig:\n"
"\n";
static char *screensection_text1 =
@@ -2448,12 +2478,43 @@ write_fontpath_section(FILE *f)
int i;
char cur[256+20],*colon, *hash;
+#ifdef COMPILEDDEFAULTFONTPATH
+ static const char dfp[] = COMPILEDDEFAULTFONTPATH;
+ const char *thisdir;
+ const char *nextdir;
+ int len;
+
+ for (thisdir = dfp; thisdir != NULL; thisdir = nextdir) {
+ nextdir = strchr(thisdir, ',');
+ if (nextdir == NULL) {
+ len = strlen(thisdir);
+ } else {
+ len = nextdir - thisdir;
+ nextdir++;
+ }
+ if (len > sizeof(cur))
+ continue;
+ strncpy(cur, thisdir, len);
+ cur[len] = '\0';
+ colon = strchr(cur+2,':'); /* OS/2: C:/...:scaled */
+ if (colon) *colon = 0;
+ hash = exists_dir(cur) ? "" : "#";
+ if (colon) *colon = ':';
+ fprintf(f,"%s FontPath \"%s\"\n", hash, cur);
+ }
+#endif
+
for (i=0; XF86Config_fontpaths[i]; i++) {
strcpy(cur,TREEROOTLX);
strcat(cur,XF86Config_fontpaths[i]);
/* remove a ':' */
colon = strchr(cur+2,':'); /* OS/2: C:/...:scaled */
if (colon) *colon = 0;
+#ifdef COMPILEDDEFAULTFONTPATH
+ /* skip if we already added it as part of the default font path */
+ if (strstr(dfp, cur) != NULL)
+ continue;
+#endif
hash = exists_dir(cur) ? "" : "#";
fprintf(f,"%s FontPath \"%s%s\"\n",
hash,
@@ -2701,7 +2762,7 @@ ask_XF86Config_location(void) {
char *filename = NULL;
printf(
-"I am going to write the XF86Config file now. Make sure you don't accidently\n"
+"I am going to write the " CONFIGNAME " file now. Make sure you don't accidently\n"
"overwrite a previously configured one.\n\n");
#ifndef __EMX__
@@ -2778,22 +2839,23 @@ ask_XF86Config_location(void) {
static char *notinstalled_text =
"The directory " TREEROOT " does not exist. This probably means that you have\n"
-"not yet installed an X11R6-based version of "__XSERVERNAME__". Please install\n"
-"XFree86 3.1+ before running this program, following the instructions in\n"
-"the INSTALL or README that comes with the "__XSERVERNAME__" distribution for your OS.\n"
+"not yet installed the version of "__XSERVERNAME__" that this program was built\n"
+"to configure. Please install "__XSERVERNAME__" "XVERSIONSTRING" before running this program,\n"
+"following the instructions in the INSTALL or README that comes with the\n"
+__XSERVERNAME__" distribution for your OS.\n"
"For a minimal installation it is sufficient to only install base binaries,\n"
"libraries, configuration files and a server that you want to use.\n"
"\n";
#ifndef __UNIXOS2__
static char *oldxfree86_text =
-"The directory '/usr/X386/bin' exists. You probably have an old version of\n"
-"__XSERVERNAME__ installed (XFree86 3.1 installs in '" TREEROOT "' instead of\n"
-"'/usr/X386').\n"
+"The directory '/usr/X386/bin' exists. You probably have a very old version of\n"
+"XFree86 installed, but this program was built to configure "__XSERVERNAME__" "XVERSIONSTRING"\n"
+"installed in '" TREEROOT "' instead of '/usr/X386'.\n"
"\n"
"It is important that the directory '" TREEROOT "' is present in your\n"
"search path, *before* any occurrence of '/usr/X386/bin'. If you have installed\n"
-"X program binaries that are not in the base __XSERVERNAME__ distribution in\n"
+"X program binaries that are not in the base "__XSERVERNAME__" distribution in\n"
"'/usr/X386/bin', you can keep the directory in your path as long as it is\n"
"after '" TREEROOT "'.\n"
"\n";
diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
index 9cc8be74d..0513b8758 100644
--- a/hw/xfree86/vbe/vbe.c
+++ b/hw/xfree86/vbe/vbe.c
@@ -57,14 +57,17 @@ VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags)
vbeControllerInfoPtr vbe = NULL;
Bool init_int10 = FALSE;
vbeInfoPtr vip = NULL;
- int screen = pScrn->scrnIndex;
+ int screen;
+ if (!pScrn) return NULL;
+ screen = pScrn->scrnIndex;
+
if (!pInt) {
if (!xf86LoadSubModule(pScrn, "int10"))
goto error;
xf86DrvMsg(screen,X_INFO,"initializing int10\n");
- pInt = xf86InitInt10(entityIndex);
+ pInt = xf86ExtendedInitInt10(entityIndex,Flags);
if (!pInt)
goto error;
init_int10 = TRUE;
@@ -336,6 +339,8 @@ vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule)
return pMonitor;
}
+#define GET_UNALIGNED2(x) \
+ ((*(CARD16*)(x)) | (*(((CARD16*)(x) + 1))) << 16)
VbeInfoBlock *
VBEGetVBEInfo(vbeInfoPtr pVbe)
@@ -381,7 +386,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe)
block->VESAVersion = *(CARD16*)(((char*)pVbe->memory) + 4);
major = (unsigned)block->VESAVersion >> 8;
- pStr = *(CARD32*)(((char*)pVbe->memory) + 6);
+ pStr = GET_UNALIGNED2((((char*)pVbe->memory) + 6));
str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
block->OEMStringPtr = strdup(str);
@@ -390,7 +395,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe)
block->Capabilities[2] = ((char*)pVbe->memory)[12];
block->Capabilities[3] = ((char*)pVbe->memory)[13];
- pModes = *(CARD32*)(((char*)pVbe->memory) + 14);
+ pModes = GET_UNALIGNED2((((char*)pVbe->memory) + 14));
modes = xf86int10Addr(pVbe->pInt10, FARP(pModes));
i = 0;
while (modes[i] != 0xffff)
@@ -405,13 +410,13 @@ VBEGetVBEInfo(vbeInfoPtr pVbe)
memcpy(&block->OemSoftwareRev, ((char*)pVbe->memory) + 20, 236);
else {
block->OemSoftwareRev = *(CARD16*)(((char*)pVbe->memory) + 20);
- pStr = *(CARD32*)(((char*)pVbe->memory) + 22);
+ pStr = GET_UNALIGNED2((((char*)pVbe->memory) + 22));
str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
block->OemVendorNamePtr = strdup(str);
- pStr = *(CARD32*)(((char*)pVbe->memory) + 26);
+ pStr = GET_UNALIGNED2((((char*)pVbe->memory) + 26));
str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
block->OemProductNamePtr = strdup(str);
- pStr = *(CARD32*)(((char*)pVbe->memory) + 30);
+ pStr = GET_UNALIGNED2((((char*)pVbe->memory) + 30));
str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
block->OemProductRevPtr = strdup(str);
memcpy(&block->Reserved, ((char*)pVbe->memory) + 34, 222);
diff --git a/hw/xfree86/vbe/vbe_module.c b/hw/xfree86/vbe/vbe_module.c
index 0347f7fb7..d6f49a5c8 100644
--- a/hw/xfree86/vbe/vbe_module.c
+++ b/hw/xfree86/vbe/vbe_module.c
@@ -16,7 +16,7 @@ static XF86ModuleVersionInfo vbeVersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 1, 0,
ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
ABI_VIDEODRV_VERSION,
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index b8bcbdba9..2e12f00ac 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -596,6 +596,9 @@ vgaHWProtect(ScrnInfoPtr pScrn, Bool on)
}
}
+vgaHWProtectProc *vgaHWProtectWeak(void) {
+ return vgaHWProtect;
+}
/*
* vgaHWBlankScreen -- blank the screen.
@@ -620,6 +623,9 @@ vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on)
vgaHWSeqReset(hwp, FALSE);
}
+vgaHWBlankScreenProc *vgaHWBlankScreenWeak(void) {
+ return vgaHWBlankScreen;
+}
/*
* vgaHWSaveScreen -- blank the screen.
@@ -1988,3 +1994,7 @@ vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed)
break;
}
}
+
+DDC1SetSpeedProc vgaHWddc1SetSpeedWeak(void) { return vgaHWddc1SetSpeed; }
+
+SaveScreenProcPtr vgaHWSaveScreenWeak(void) { return vgaHWSaveScreen; }
diff --git a/hw/xfree86/vgahw/vgaHW.h b/hw/xfree86/vgahw/vgaHW.h
index 9a51f1046..2874c2cfb 100644
--- a/hw/xfree86/vgahw/vgaHW.h
+++ b/hw/xfree86/vgahw/vgaHW.h
@@ -190,11 +190,16 @@ typedef struct _vgaHWRec {
/* vgaHW.c */
+typedef void vgaHWProtectProc(ScrnInfoPtr, Bool);
+typedef void vgaHWBlankScreenProc(ScrnInfoPtr, Bool);
+
void vgaHWSetStdFuncs(vgaHWPtr hwp);
void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset);
void vgaHWProtect(ScrnInfoPtr pScrn, Bool on);
+vgaHWProtectProc *vgaHWProtectWeak(void);
Bool vgaHWSaveScreen(ScreenPtr pScreen, int mode);
void vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on);
+vgaHWBlankScreenProc *vgaHWBlankScreenWeak(void);
void vgaHWSeqReset(vgaHWPtr hwp, Bool start);
void vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore);
void vgaHWRestoreMode(ScrnInfoPtr scrninfp, vgaRegPtr restore);
@@ -225,4 +230,8 @@ CARD32 vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
CARD32 vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
unsigned int Flags);
Bool vgaHWAllocDefaultRegs(vgaRegPtr regp);
+
+DDC1SetSpeedProc vgaHWddc1SetSpeedWeak(void);
+SaveScreenProcPtr vgaHWSaveScreenWeak(void);
+
#endif /* _VGAHW_H */
diff --git a/hw/xfree86/vgahw/vgaHWmodule.c b/hw/xfree86/vgahw/vgaHWmodule.c
index 409e7b511..d6044bbb7 100644
--- a/hw/xfree86/vgahw/vgaHWmodule.c
+++ b/hw/xfree86/vgahw/vgaHWmodule.c
@@ -14,7 +14,7 @@ static XF86ModuleVersionInfo VersRec = {
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
0, 1, 0,
ABI_CLASS_VIDEODRV,
ABI_VIDEODRV_VERSION,
diff --git a/hw/xfree86/x86emu/debug.c b/hw/xfree86/x86emu/debug.c
index 481374d53..6fd7f11cf 100644
--- a/hw/xfree86/x86emu/debug.c
+++ b/hw/xfree86/x86emu/debug.c
@@ -36,12 +36,9 @@
* emulator.
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/debug.c,v 1.2 2000/04/05 18:13:14 dawes Exp $ */
#include "x86emu/x86emui.h"
-#ifdef IN_MODULE
-#include "xf86_ansic.h"
-#else
+#ifndef NO_SYS_HEADERS
#include <stdarg.h>
#include <stdlib.h>
#endif
@@ -307,7 +304,8 @@ void x86emu_single_step (void)
}
break;
case 'q':
- exit(1);
+ M.x86.debug |= DEBUG_EXIT;
+ return;
case 'P':
noDecode = (noDecode)?0:1;
printk("Toggled decoding to %s\n",(noDecode)?"FALSE":"TRUE");
diff --git a/hw/xfree86/x86emu/decode.c b/hw/xfree86/x86emu/decode.c
index 1294640df..25415d9fa 100644
--- a/hw/xfree86/x86emu/decode.c
+++ b/hw/xfree86/x86emu/decode.c
@@ -37,8 +37,6 @@
*
****************************************************************************/
-/* $XdotOrg: xc/extras/x86emu/src/x86emu/decode.c,v 1.1.4.1.4.2 2004/03/05 12:46:30 eich Exp $ */
-/* $XFree86: xc/extras/x86emu/src/x86emu/decode.c,v 1.11 2002/07/23 20:20:43 tsi Exp $ */
#include "x86emu/x86emui.h"
@@ -105,8 +103,14 @@ DB( if (CHECK_IP_FETCH())
INC_DECODED_INST_LEN(1);
if (M.x86.intr) {
if (M.x86.intr & INTR_HALTED) {
-DB( printk("halted\n");
- X86EMU_trace_regs();)
+DB( if (M.x86.R_SP != 0) {
+ printk("halted\n");
+ X86EMU_trace_regs();
+ }
+ else {
+ if (M.x86.debug)
+ printk("Service completed successfully\n");
+ })
return;
}
if (((M.x86.intr & INTR_SYNCH) && (M.x86.intno == 0 || M.x86.intno == 2)) ||
@@ -116,6 +120,10 @@ DB( printk("halted\n");
}
op1 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
(*x86emu_optab[op1])(op1);
+ if (M.x86.debug & DEBUG_EXIT) {
+ M.x86.debug &= ~DEBUG_EXIT;
+ return;
+ }
}
}
@@ -834,6 +842,7 @@ u32 decode_rm00_address(
int sib;
if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ /* 32-bit addressing */
switch (rm) {
case 0:
DECODE_PRINTF("[EAX]");
@@ -863,21 +872,22 @@ u32 decode_rm00_address(
}
HALT_SYS();
} else {
+ /* 16-bit addressing */
switch (rm) {
case 0:
DECODE_PRINTF("[BX+SI]");
- return M.x86.R_BX + M.x86.R_SI;
+ return (M.x86.R_BX + M.x86.R_SI) & 0xffff;
case 1:
DECODE_PRINTF("[BX+DI]");
- return M.x86.R_BX + M.x86.R_DI;
+ return (M.x86.R_BX + M.x86.R_DI) & 0xffff;
case 2:
DECODE_PRINTF("[BP+SI]");
M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_SI;
+ return (M.x86.R_BP + M.x86.R_SI) & 0xffff;
case 3:
DECODE_PRINTF("[BP+DI]");
M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_DI;
+ return (M.x86.R_BP + M.x86.R_DI) & 0xffff;
case 4:
DECODE_PRINTF("[SI]");
return M.x86.R_SI;
@@ -919,6 +929,7 @@ u32 decode_rm01_address(
displacement = (s8)fetch_byte_imm();
if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ /* 32-bit addressing */
switch (rm) {
case 0:
DECODE_PRINTF2("%d[EAX]", displacement);
@@ -949,34 +960,35 @@ u32 decode_rm01_address(
}
HALT_SYS();
} else {
+ /* 16-bit addressing */
switch (rm) {
case 0:
DECODE_PRINTF2("%d[BX+SI]", displacement);
- return M.x86.R_BX + M.x86.R_SI + displacement;
+ return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff;
case 1:
DECODE_PRINTF2("%d[BX+DI]", displacement);
- return M.x86.R_BX + M.x86.R_DI + displacement;
+ return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff;
case 2:
DECODE_PRINTF2("%d[BP+SI]", displacement);
M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_SI + displacement;
+ return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff;
case 3:
DECODE_PRINTF2("%d[BP+DI]", displacement);
M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_DI + displacement;
+ return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff;
case 4:
DECODE_PRINTF2("%d[SI]", displacement);
- return M.x86.R_SI + displacement;
+ return (M.x86.R_SI + displacement) & 0xffff;
case 5:
DECODE_PRINTF2("%d[DI]", displacement);
- return M.x86.R_DI + displacement;
+ return (M.x86.R_DI + displacement) & 0xffff;
case 6:
DECODE_PRINTF2("%d[BP]", displacement);
M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + displacement;
+ return (M.x86.R_BP + displacement) & 0xffff;
case 7:
DECODE_PRINTF2("%d[BX]", displacement);
- return M.x86.R_BX + displacement;
+ return (M.x86.R_BX + displacement) & 0xffff;
}
HALT_SYS();
}
@@ -1010,6 +1022,7 @@ u32 decode_rm10_address(
}
if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ /* 32-bit addressing */
switch (rm) {
case 0:
DECODE_PRINTF2("%08x[EAX]", displacement);
@@ -1042,34 +1055,35 @@ u32 decode_rm10_address(
}
HALT_SYS();
} else {
+ /* 16-bit addressing */
switch (rm) {
case 0:
- DECODE_PRINTF2("%04x[BX+SI]", displacement);
- return M.x86.R_BX + M.x86.R_SI + displacement;
+ DECODE_PRINTF2("%04x[BX+SI]", displacement);
+ return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff;
case 1:
- DECODE_PRINTF2("%04x[BX+DI]", displacement);
- return M.x86.R_BX + M.x86.R_DI + displacement;
+ DECODE_PRINTF2("%04x[BX+DI]", displacement);
+ return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff;
case 2:
DECODE_PRINTF2("%04x[BP+SI]", displacement);
M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_SI + displacement;
+ return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff;
case 3:
DECODE_PRINTF2("%04x[BP+DI]", displacement);
M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_DI + displacement;
+ return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff;
case 4:
- DECODE_PRINTF2("%04x[SI]", displacement);
- return M.x86.R_SI + displacement;
+ DECODE_PRINTF2("%04x[SI]", displacement);
+ return (M.x86.R_SI + displacement) & 0xffff;
case 5:
- DECODE_PRINTF2("%04x[DI]", displacement);
- return M.x86.R_DI + displacement;
+ DECODE_PRINTF2("%04x[DI]", displacement);
+ return (M.x86.R_DI + displacement) & 0xffff;
case 6:
DECODE_PRINTF2("%04x[BP]", displacement);
M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + displacement;
+ return (M.x86.R_BP + displacement) & 0xffff;
case 7:
- DECODE_PRINTF2("%04x[BX]", displacement);
- return M.x86.R_BX + displacement;
+ DECODE_PRINTF2("%04x[BX]", displacement);
+ return (M.x86.R_BX + displacement) & 0xffff;
}
HALT_SYS();
}
diff --git a/hw/xfree86/x86emu/fpu.c b/hw/xfree86/x86emu/fpu.c
index 4b801dc94..b72de1ee5 100644
--- a/hw/xfree86/x86emu/fpu.c
+++ b/hw/xfree86/x86emu/fpu.c
@@ -36,7 +36,6 @@
* emulation of the FPU instructions.
*
****************************************************************************/
-/* $XFree86$ */
#include "x86emu/x86emui.h"
diff --git a/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c
index 88ee7e108..37ae2c9c9 100644
--- a/hw/xfree86/x86emu/ops.c
+++ b/hw/xfree86/x86emu/ops.c
@@ -70,8 +70,6 @@
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/ops.c,v 1.8tsi Exp $ */
-
#include "x86emu/x86emui.h"
/*----------------------------- Implementation ----------------------------*/
@@ -87,11 +85,22 @@ static void x86emuOp_illegal_op(
u8 op1)
{
START_OF_INSTR();
+ if (M.x86.R_SP != 0) {
DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
TRACE_REGS();
- printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
- M.x86.R_CS, M.x86.R_IP-1,op1);
+ DB( printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
+ M.x86.R_CS, M.x86.R_IP-1,op1));
HALT_SYS();
+ }
+ else {
+ /* If we get here, it means the stack pointer is back to zero
+ * so we are just returning from an emulator service call
+ * so therte is no need to display an error message. We trap
+ * the emulator with an 0xF1 opcode to finish the service
+ * call.
+ */
+ X86EMU_halt_sys();
+ }
END_OF_INSTR();
}
@@ -9404,6 +9413,8 @@ static void x86emuOp_aam(u8 X86EMU_UNUSED(op1))
DECODE_PRINTF("AAM\n");
a = fetch_byte_imm(); /* this is a stupid encoding. */
if (a != 10) {
+ /* fix: add base decoding
+ aam_word(u8 val, int base a) */
DECODE_PRINTF("ERROR DECODING AAM\n");
TRACE_REGS();
HALT_SYS();
@@ -9421,9 +9432,18 @@ Handles opcode 0xd5
****************************************************************************/
static void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
{
+ u8 a;
+
START_OF_INSTR();
DECODE_PRINTF("AAD\n");
- (void) fetch_byte_imm();
+ a = fetch_byte_imm();
+ if (a != 10) {
+ /* fix: add base decoding
+ aad_word(u16 val, int base a) */
+ DECODE_PRINTF("ERROR DECODING AAM\n");
+ TRACE_REGS();
+ HALT_SYS();
+ }
TRACE_AND_STEP();
M.x86.R_AX = aad_word(M.x86.R_AX);
DECODE_CLEAR_SEGOVR();
diff --git a/hw/xfree86/x86emu/ops2.c b/hw/xfree86/x86emu/ops2.c
index 7cb585bc8..d9e5de9c5 100644
--- a/hw/xfree86/x86emu/ops2.c
+++ b/hw/xfree86/x86emu/ops2.c
@@ -37,7 +37,6 @@
* instructions.
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/ops2.c,v 1.6tsi Exp $ */
#include "x86emu/x86emui.h"
diff --git a/hw/xfree86/x86emu/prim_ops.c b/hw/xfree86/x86emu/prim_ops.c
index ba4ffdeda..56ab8cc9a 100644
--- a/hw/xfree86/x86emu/prim_ops.c
+++ b/hw/xfree86/x86emu/prim_ops.c
@@ -102,8 +102,6 @@
/*------------------------- Global Variables ------------------------------*/
-#ifndef __HAVE_INLINE_ASSEMBLER__
-
static u32 x86emu_parity_tab[8] =
{
0x96696996,
@@ -116,15 +114,11 @@ static u32 x86emu_parity_tab[8] =
0x69969669,
};
-#endif
-
#define PARITY(x) (((x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
#define XOR2(x) (((x) ^ ((x)>>1)) & 0x1)
/*----------------------------- Implementation ----------------------------*/
-#ifndef __HAVE_INLINE_ASSEMBLER__
-
/****************************************************************************
REMARKS:
Implements the AAA instruction and side effects.
@@ -2454,8 +2448,6 @@ void div_long(u32 s)
M.x86.R_EDX = (u32)mod;
}
-#endif /* __HAVE_INLINE_ASSEMBLER__ */
-
/****************************************************************************
REMARKS:
Implements the IN string instruction and side effects.
@@ -2660,255 +2652,3 @@ DB( if (CHECK_SP_ACCESS())
return res;
}
-#ifdef __HAVE_INLINE_ASSEMBLER__
-
-u16 aaa_word (u16 d)
-{ return aaa_word_asm(&M.x86.R_EFLG,d); }
-
-u16 aas_word (u16 d)
-{ return aas_word_asm(&M.x86.R_EFLG,d); }
-
-u16 aad_word (u16 d)
-{ return aad_word_asm(&M.x86.R_EFLG,d); }
-
-u16 aam_word (u8 d)
-{ return aam_word_asm(&M.x86.R_EFLG,d); }
-
-u8 adc_byte (u8 d, u8 s)
-{ return adc_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 adc_word (u16 d, u16 s)
-{ return adc_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 adc_long (u32 d, u32 s)
-{ return adc_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 add_byte (u8 d, u8 s)
-{ return add_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 add_word (u16 d, u16 s)
-{ return add_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 add_long (u32 d, u32 s)
-{ return add_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 and_byte (u8 d, u8 s)
-{ return and_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 and_word (u16 d, u16 s)
-{ return and_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 and_long (u32 d, u32 s)
-{ return and_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 cmp_byte (u8 d, u8 s)
-{ return cmp_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 cmp_word (u16 d, u16 s)
-{ return cmp_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 cmp_long (u32 d, u32 s)
-{ return cmp_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 daa_byte (u8 d)
-{ return daa_byte_asm(&M.x86.R_EFLG,d); }
-
-u8 das_byte (u8 d)
-{ return das_byte_asm(&M.x86.R_EFLG,d); }
-
-u8 dec_byte (u8 d)
-{ return dec_byte_asm(&M.x86.R_EFLG,d); }
-
-u16 dec_word (u16 d)
-{ return dec_word_asm(&M.x86.R_EFLG,d); }
-
-u32 dec_long (u32 d)
-{ return dec_long_asm(&M.x86.R_EFLG,d); }
-
-u8 inc_byte (u8 d)
-{ return inc_byte_asm(&M.x86.R_EFLG,d); }
-
-u16 inc_word (u16 d)
-{ return inc_word_asm(&M.x86.R_EFLG,d); }
-
-u32 inc_long (u32 d)
-{ return inc_long_asm(&M.x86.R_EFLG,d); }
-
-u8 or_byte (u8 d, u8 s)
-{ return or_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 or_word (u16 d, u16 s)
-{ return or_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 or_long (u32 d, u32 s)
-{ return or_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 neg_byte (u8 s)
-{ return neg_byte_asm(&M.x86.R_EFLG,s); }
-
-u16 neg_word (u16 s)
-{ return neg_word_asm(&M.x86.R_EFLG,s); }
-
-u32 neg_long (u32 s)
-{ return neg_long_asm(&M.x86.R_EFLG,s); }
-
-u8 not_byte (u8 s)
-{ return not_byte_asm(&M.x86.R_EFLG,s); }
-
-u16 not_word (u16 s)
-{ return not_word_asm(&M.x86.R_EFLG,s); }
-
-u32 not_long (u32 s)
-{ return not_long_asm(&M.x86.R_EFLG,s); }
-
-u8 rcl_byte (u8 d, u8 s)
-{ return rcl_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 rcl_word (u16 d, u8 s)
-{ return rcl_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 rcl_long (u32 d, u8 s)
-{ return rcl_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 rcr_byte (u8 d, u8 s)
-{ return rcr_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 rcr_word (u16 d, u8 s)
-{ return rcr_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 rcr_long (u32 d, u8 s)
-{ return rcr_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 rol_byte (u8 d, u8 s)
-{ return rol_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 rol_word (u16 d, u8 s)
-{ return rol_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 rol_long (u32 d, u8 s)
-{ return rol_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 ror_byte (u8 d, u8 s)
-{ return ror_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 ror_word (u16 d, u8 s)
-{ return ror_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 ror_long (u32 d, u8 s)
-{ return ror_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 shl_byte (u8 d, u8 s)
-{ return shl_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 shl_word (u16 d, u8 s)
-{ return shl_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 shl_long (u32 d, u8 s)
-{ return shl_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 shr_byte (u8 d, u8 s)
-{ return shr_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 shr_word (u16 d, u8 s)
-{ return shr_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 shr_long (u32 d, u8 s)
-{ return shr_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 sar_byte (u8 d, u8 s)
-{ return sar_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 sar_word (u16 d, u8 s)
-{ return sar_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 sar_long (u32 d, u8 s)
-{ return sar_long_asm(&M.x86.R_EFLG,d,s); }
-
-u16 shld_word (u16 d, u16 fill, u8 s)
-{ return shld_word_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u32 shld_long (u32 d, u32 fill, u8 s)
-{ return shld_long_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u16 shrd_word (u16 d, u16 fill, u8 s)
-{ return shrd_word_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u32 shrd_long (u32 d, u32 fill, u8 s)
-{ return shrd_long_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u8 sbb_byte (u8 d, u8 s)
-{ return sbb_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 sbb_word (u16 d, u16 s)
-{ return sbb_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 sbb_long (u32 d, u32 s)
-{ return sbb_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 sub_byte (u8 d, u8 s)
-{ return sub_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 sub_word (u16 d, u16 s)
-{ return sub_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 sub_long (u32 d, u32 s)
-{ return sub_long_asm(&M.x86.R_EFLG,d,s); }
-
-void test_byte (u8 d, u8 s)
-{ test_byte_asm(&M.x86.R_EFLG,d,s); }
-
-void test_word (u16 d, u16 s)
-{ test_word_asm(&M.x86.R_EFLG,d,s); }
-
-void test_long (u32 d, u32 s)
-{ test_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 xor_byte (u8 d, u8 s)
-{ return xor_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 xor_word (u16 d, u16 s)
-{ return xor_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 xor_long (u32 d, u32 s)
-{ return xor_long_asm(&M.x86.R_EFLG,d,s); }
-
-void imul_byte (u8 s)
-{ imul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s); }
-
-void imul_word (u16 s)
-{ imul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s); }
-
-void imul_long (u32 s)
-{ imul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s); }
-
-void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
-{ imul_long_asm(&M.x86.R_EFLG,res_lo,res_hi,d,s); }
-
-void mul_byte (u8 s)
-{ mul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s); }
-
-void mul_word (u16 s)
-{ mul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s); }
-
-void mul_long (u32 s)
-{ mul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s); }
-
-void idiv_byte (u8 s)
-{ idiv_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s); }
-
-void idiv_word (u16 s)
-{ idiv_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s); }
-
-void idiv_long (u32 s)
-{ idiv_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s); }
-
-void div_byte (u8 s)
-{ div_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s); }
-
-void div_word (u16 s)
-{ div_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s); }
-
-void div_long (u32 s)
-{ div_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s); }
-
-#endif
diff --git a/hw/xfree86/x86emu/sys.c b/hw/xfree86/x86emu/sys.c
index 39941360d..4d90ea315 100644
--- a/hw/xfree86/x86emu/sys.c
+++ b/hw/xfree86/x86emu/sys.c
@@ -39,16 +39,13 @@
* user library.
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/sys.c,v 1.6 2002/09/16 18:05:18 eich Exp $ */
#include "x86emu.h"
#include "x86emu/x86emui.h"
#include "x86emu/regs.h"
#include "x86emu/debug.h"
#include "x86emu/prim_ops.h"
-#ifdef IN_MODULE
-#include "xf86_ansic.h"
-#else
+#ifndef NO_SYS_HEADERS
#include <string.h>
#endif
/*------------------------- Global Variables ------------------------------*/
@@ -60,6 +57,7 @@ X86EMU_intrFuncs _X86EMU_intrTab[256];
#if defined(__alpha__) || defined(__alpha)
/* to cope with broken egcs-1.1.2 :-(((( */
+#define ALPHA_UALOADS
/*
* inline functions to do unaligned accesses
* from linux/include/asm-alpha/unaligned.h
@@ -211,6 +209,60 @@ static __inline__ void stw_u(unsigned long r5, unsigned short * r11)
:"r" (r5), "r" (r11));
#endif
}
+
+#elif defined(__GNUC__) && ((__GNUC__ < 3)) && \
+ (defined (__ia64__) || defined (ia64__))
+#define IA64_UALOADS
+/*
+ * EGCS 1.1 knows about arbitrary unaligned loads. Define some
+ * packed structures to talk about such things with.
+ */
+struct __una_u64 { unsigned long x __attribute__((packed)); };
+struct __una_u32 { unsigned int x __attribute__((packed)); };
+struct __una_u16 { unsigned short x __attribute__((packed)); };
+
+static __inline__ unsigned long
+__uldq (const unsigned long * r11)
+{
+ const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
+ return ptr->x;
+}
+
+static __inline__ unsigned long
+uldl (const unsigned int * r11)
+{
+ const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
+ return ptr->x;
+}
+
+static __inline__ unsigned long
+uldw (const unsigned short * r11)
+{
+ const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
+ return ptr->x;
+}
+
+static __inline__ void
+ustq (unsigned long r5, unsigned long * r11)
+{
+ struct __una_u64 *ptr = (struct __una_u64 *) r11;
+ ptr->x = r5;
+}
+
+static __inline__ void
+ustl (unsigned long r5, unsigned int * r11)
+{
+ struct __una_u32 *ptr = (struct __una_u32 *) r11;
+ ptr->x = r5;
+}
+
+static __inline__ void
+ustw (unsigned long r5, unsigned short * r11)
+{
+ struct __una_u16 *ptr = (struct __una_u16 *) r11;
+ ptr->x = r5;
+}
+
#endif
/****************************************************************************
@@ -264,8 +316,10 @@ u16 X86API rdw(
}
else
#endif
-#if defined(__alpha__) || defined(__alpha)
+#if defined(ALPHA_UALOADS)
val = ldw_u((u16*)(M.mem_base + addr));
+#elif defined(IA64_UALOADS)
+ val = uldw((u16*)(M.mem_base + addr));
#else
val = *(u16*)(M.mem_base + addr);
#endif
@@ -301,8 +355,10 @@ u32 X86API rdl(
}
else
#endif
-#if defined(__alpha__) || defined(__alpha)
+#if defined(ALPHA_UALOADS)
val = ldl_u((u32*)(M.mem_base + addr));
+#elif defined(IA64_UALOADS)
+ val = uldl((u32*)(M.mem_base + addr));
#else
val = *(u32*)(M.mem_base + addr);
#endif
@@ -357,8 +413,10 @@ DB( if (DEBUG_MEM_TRACE())
}
else
#endif
-#if defined(__alpha__) || defined(__alpha)
+#if defined(ALPHA_UALOADS)
stw_u(val,(u16*)(M.mem_base + addr));
+#elif defined(IA64_UALOADS)
+ ustw(val,(u16*)(M.mem_base + addr));
#else
*(u16*)(M.mem_base + addr) = val;
#endif
@@ -391,8 +449,10 @@ DB( if (DEBUG_MEM_TRACE())
}
else
#endif
-#if defined(__alpha__) || defined(__alpha)
+#if defined(ALPHA_UALOADS)
stl_u(val,(u32*)(M.mem_base + addr));
+#elif defined(IA64_UALOADS)
+ ustl(val,(u32*)(M.mem_base + addr));
#else
*(u32*)(M.mem_base + addr) = val;
#endif
diff --git a/hw/xfree86/x86emu/x86emu.h b/hw/xfree86/x86emu/x86emu.h
index 1df9ac50d..795e2d688 100644
--- a/hw/xfree86/x86emu/x86emu.h
+++ b/hw/xfree86/x86emu/x86emu.h
@@ -37,7 +37,6 @@
* include this header
*
****************************************************************************/
-/* $XFree86$ */
#ifndef __X86EMU_X86EMU_H
#define __X86EMU_X86EMU_H
@@ -56,7 +55,9 @@ typedef int X86EMU_pioAddr;
/*---------------------- Macros and type definitions ----------------------*/
-/* #pragma pack(1) */ /* Don't pack structs with function pointers! */
+#ifdef PACK
+# pragma PACK /* Don't pack structs with function pointers! */
+#endif
/****************************************************************************
REMARKS:
@@ -129,8 +130,10 @@ extern u32 X86API rdl(u32 addr);
extern void X86API wrb(u32 addr, u8 val);
extern void X86API wrw(u32 addr, u16 val);
extern void X86API wrl(u32 addr, u32 val);
-
-/* #pragma pack() */
+
+#ifdef END_PACK
+# pragma END_PACK
+#endif
/*--------------------- type definitions -----------------------------------*/
@@ -169,6 +172,7 @@ void X86EMU_halt_sys(void);
#define DEBUG_DISASSEMBLE_F 0x000008
#define DEBUG_BREAK_F 0x000010
#define DEBUG_SVC_F 0x000020
+#define DEBUG_SAVE_IP_CS_F 0x000040
#define DEBUG_FS_F 0x000080
#define DEBUG_PROC_F 0x000100
#define DEBUG_SYSINT_F 0x000200 /* bios system interrupts. */
@@ -178,7 +182,7 @@ void X86EMU_halt_sys(void);
#define DEBUG_IO_TRACE_F 0x002000
#define DEBUG_TRACECALL_REGS_F 0x004000
#define DEBUG_DECODE_NOPRINT_F 0x008000
-#define DEBUG_SAVE_IP_CS_F 0x010000
+#define DEBUG_EXIT 0x010000
#define DEBUG_SYS_F (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F)
void X86EMU_trace_regs(void);
diff --git a/hw/xfree86/x86emu/x86emu/debug.h b/hw/xfree86/x86emu/x86emu/debug.h
index 8abedf616..47aacb6c3 100644
--- a/hw/xfree86/x86emu/x86emu/debug.h
+++ b/hw/xfree86/x86emu/x86emu/debug.h
@@ -35,7 +35,6 @@
* Description: Header file for debug definitions.
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/x86emu/debug.h,v 1.3 2000/04/19 15:48:15 tsi Exp $ */
#ifndef __X86EMU_DEBUG_H
#define __X86EMU_DEBUG_H
diff --git a/hw/xfree86/x86emu/x86emu/decode.h b/hw/xfree86/x86emu/x86emu/decode.h
index bb2bc0bee..61cd4dc10 100644
--- a/hw/xfree86/x86emu/x86emu/decode.h
+++ b/hw/xfree86/x86emu/x86emu/decode.h
@@ -35,7 +35,6 @@
* Description: Header file for instruction decoding logic.
*
****************************************************************************/
-/* $XFree86$ */
#ifndef __X86EMU_DECODE_H
#define __X86EMU_DECODE_H
diff --git a/hw/xfree86/x86emu/x86emu/fpu_regs.h b/hw/xfree86/x86emu/x86emu/fpu_regs.h
index a125075b7..e59b80783 100644
--- a/hw/xfree86/x86emu/x86emu/fpu_regs.h
+++ b/hw/xfree86/x86emu/x86emu/fpu_regs.h
@@ -35,13 +35,16 @@
* Description: Header file for FPU register definitions.
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/include/x86emu/fpu_regs.h,v 1.2 2003/10/22 20:03:05 tsi Exp $ */
#ifndef __X86EMU_FPU_REGS_H
#define __X86EMU_FPU_REGS_H
#ifdef X86_FPU_SUPPORT
+#ifdef PACK
+# pragma PACK
+#endif
+
/* Basic 8087 register can hold any of the following values: */
union x86_fpu_reg_u {
@@ -86,6 +89,10 @@ struct x86_fpu_registers {
short x86_fpu_tos, x86_fpu_bos;
};
+#ifdef END_PACK
+# pragma END_PACK
+#endif
+
/*
* There are two versions of the following macro.
*
diff --git a/hw/xfree86/x86emu/x86emu/prim_asm.h b/hw/xfree86/x86emu/x86emu/prim_asm.h
index 041255f18..e023cf88d 100644
--- a/hw/xfree86/x86emu/x86emu/prim_asm.h
+++ b/hw/xfree86/x86emu/x86emu/prim_asm.h
@@ -39,7 +39,6 @@
* platform.
*
****************************************************************************/
-/* $XFree86$ */
#ifndef __X86EMU_PRIM_ASM_H
#define __X86EMU_PRIM_ASM_H
diff --git a/hw/xfree86/x86emu/x86emu/prim_ops.h b/hw/xfree86/x86emu/x86emu/prim_ops.h
index 1633fe1fa..bea8357e4 100644
--- a/hw/xfree86/x86emu/x86emu/prim_ops.h
+++ b/hw/xfree86/x86emu/x86emu/prim_ops.h
@@ -39,8 +39,6 @@
#ifndef __X86EMU_PRIM_OPS_H
#define __X86EMU_PRIM_OPS_H
-#include "x86emu/prim_asm.h"
-
#ifdef __cplusplus
extern "C" { /* Use "C" linkage when in C++ mode */
#endif
@@ -136,94 +134,6 @@ void push_long (u32 w);
u16 pop_word (void);
u32 pop_long (void);
-#if defined(__HAVE_INLINE_ASSEMBLER__) && !defined(PRIM_OPS_NO_REDEFINE_ASM)
-
-#define aaa_word(d) aaa_word_asm(&M.x86.R_EFLG,d)
-#define aas_word(d) aas_word_asm(&M.x86.R_EFLG,d)
-#define aad_word(d) aad_word_asm(&M.x86.R_EFLG,d)
-#define aam_word(d) aam_word_asm(&M.x86.R_EFLG,d)
-#define adc_byte(d,s) adc_byte_asm(&M.x86.R_EFLG,d,s)
-#define adc_word(d,s) adc_word_asm(&M.x86.R_EFLG,d,s)
-#define adc_long(d,s) adc_long_asm(&M.x86.R_EFLG,d,s)
-#define add_byte(d,s) add_byte_asm(&M.x86.R_EFLG,d,s)
-#define add_word(d,s) add_word_asm(&M.x86.R_EFLG,d,s)
-#define add_long(d,s) add_long_asm(&M.x86.R_EFLG,d,s)
-#define and_byte(d,s) and_byte_asm(&M.x86.R_EFLG,d,s)
-#define and_word(d,s) and_word_asm(&M.x86.R_EFLG,d,s)
-#define and_long(d,s) and_long_asm(&M.x86.R_EFLG,d,s)
-#define cmp_byte(d,s) cmp_byte_asm(&M.x86.R_EFLG,d,s)
-#define cmp_word(d,s) cmp_word_asm(&M.x86.R_EFLG,d,s)
-#define cmp_long(d,s) cmp_long_asm(&M.x86.R_EFLG,d,s)
-#define daa_byte(d) daa_byte_asm(&M.x86.R_EFLG,d)
-#define das_byte(d) das_byte_asm(&M.x86.R_EFLG,d)
-#define dec_byte(d) dec_byte_asm(&M.x86.R_EFLG,d)
-#define dec_word(d) dec_word_asm(&M.x86.R_EFLG,d)
-#define dec_long(d) dec_long_asm(&M.x86.R_EFLG,d)
-#define inc_byte(d) inc_byte_asm(&M.x86.R_EFLG,d)
-#define inc_word(d) inc_word_asm(&M.x86.R_EFLG,d)
-#define inc_long(d) inc_long_asm(&M.x86.R_EFLG,d)
-#define or_byte(d,s) or_byte_asm(&M.x86.R_EFLG,d,s)
-#define or_word(d,s) or_word_asm(&M.x86.R_EFLG,d,s)
-#define or_long(d,s) or_long_asm(&M.x86.R_EFLG,d,s)
-#define neg_byte(s) neg_byte_asm(&M.x86.R_EFLG,s)
-#define neg_word(s) neg_word_asm(&M.x86.R_EFLG,s)
-#define neg_long(s) neg_long_asm(&M.x86.R_EFLG,s)
-#define not_byte(s) not_byte_asm(&M.x86.R_EFLG,s)
-#define not_word(s) not_word_asm(&M.x86.R_EFLG,s)
-#define not_long(s) not_long_asm(&M.x86.R_EFLG,s)
-#define rcl_byte(d,s) rcl_byte_asm(&M.x86.R_EFLG,d,s)
-#define rcl_word(d,s) rcl_word_asm(&M.x86.R_EFLG,d,s)
-#define rcl_long(d,s) rcl_long_asm(&M.x86.R_EFLG,d,s)
-#define rcr_byte(d,s) rcr_byte_asm(&M.x86.R_EFLG,d,s)
-#define rcr_word(d,s) rcr_word_asm(&M.x86.R_EFLG,d,s)
-#define rcr_long(d,s) rcr_long_asm(&M.x86.R_EFLG,d,s)
-#define rol_byte(d,s) rol_byte_asm(&M.x86.R_EFLG,d,s)
-#define rol_word(d,s) rol_word_asm(&M.x86.R_EFLG,d,s)
-#define rol_long(d,s) rol_long_asm(&M.x86.R_EFLG,d,s)
-#define ror_byte(d,s) ror_byte_asm(&M.x86.R_EFLG,d,s)
-#define ror_word(d,s) ror_word_asm(&M.x86.R_EFLG,d,s)
-#define ror_long(d,s) ror_long_asm(&M.x86.R_EFLG,d,s)
-#define shl_byte(d,s) shl_byte_asm(&M.x86.R_EFLG,d,s)
-#define shl_word(d,s) shl_word_asm(&M.x86.R_EFLG,d,s)
-#define shl_long(d,s) shl_long_asm(&M.x86.R_EFLG,d,s)
-#define shr_byte(d,s) shr_byte_asm(&M.x86.R_EFLG,d,s)
-#define shr_word(d,s) shr_word_asm(&M.x86.R_EFLG,d,s)
-#define shr_long(d,s) shr_long_asm(&M.x86.R_EFLG,d,s)
-#define sar_byte(d,s) sar_byte_asm(&M.x86.R_EFLG,d,s)
-#define sar_word(d,s) sar_word_asm(&M.x86.R_EFLG,d,s)
-#define sar_long(d,s) sar_long_asm(&M.x86.R_EFLG,d,s)
-#define shld_word(d,fill,s) shld_word_asm(&M.x86.R_EFLG,d,fill,s)
-#define shld_long(d,fill,s) shld_long_asm(&M.x86.R_EFLG,d,fill,s)
-#define shrd_word(d,fill,s) shrd_word_asm(&M.x86.R_EFLG,d,fill,s)
-#define shrd_long(d,fill,s) shrd_long_asm(&M.x86.R_EFLG,d,fill,s)
-#define sbb_byte(d,s) sbb_byte_asm(&M.x86.R_EFLG,d,s)
-#define sbb_word(d,s) sbb_word_asm(&M.x86.R_EFLG,d,s)
-#define sbb_long(d,s) sbb_long_asm(&M.x86.R_EFLG,d,s)
-#define sub_byte(d,s) sub_byte_asm(&M.x86.R_EFLG,d,s)
-#define sub_word(d,s) sub_word_asm(&M.x86.R_EFLG,d,s)
-#define sub_long(d,s) sub_long_asm(&M.x86.R_EFLG,d,s)
-#define test_byte(d,s) test_byte_asm(&M.x86.R_EFLG,d,s)
-#define test_word(d,s) test_word_asm(&M.x86.R_EFLG,d,s)
-#define test_long(d,s) test_long_asm(&M.x86.R_EFLG,d,s)
-#define xor_byte(d,s) xor_byte_asm(&M.x86.R_EFLG,d,s)
-#define xor_word(d,s) xor_word_asm(&M.x86.R_EFLG,d,s)
-#define xor_long(d,s) xor_long_asm(&M.x86.R_EFLG,d,s)
-#define imul_byte(s) imul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s)
-#define imul_word(s) imul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s)
-#define imul_long(s) imul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s)
-#define imul_long_direct(res_lo,res_hi,d,s) imul_long_asm(&M.x86.R_EFLG,res_lo,res_hi,d,s)
-#define mul_byte(s) mul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s)
-#define mul_word(s) mul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s)
-#define mul_long(s) mul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s)
-#define idiv_byte(s) idiv_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s)
-#define idiv_word(s) idiv_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s)
-#define idiv_long(s) idiv_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s)
-#define div_byte(s) div_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s)
-#define div_word(s) div_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s)
-#define div_long(s) div_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s)
-
-#endif
-
#ifdef __cplusplus
} /* End of "C" linkage for C++ */
#endif
diff --git a/hw/xfree86/x86emu/x86emu/regs.h b/hw/xfree86/x86emu/x86emu/regs.h
index fba2991d4..52cf8e41b 100644
--- a/hw/xfree86/x86emu/x86emu/regs.h
+++ b/hw/xfree86/x86emu/x86emu/regs.h
@@ -35,13 +35,16 @@
* Description: Header file for x86 register definitions.
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/include/x86emu/regs.h,v 1.5 2003/10/22 20:03:05 tsi Exp $ */
#ifndef __X86EMU_REGS_H
#define __X86EMU_REGS_H
/*---------------------- Macros and type definitions ----------------------*/
+#ifdef PACK
+# pragma PACK
+#endif
+
/*
* General EAX, EBX, ECX, EDX type registers. Note that for
* portability, and speed, the issue of byte swapping is not addressed
@@ -303,6 +306,10 @@ typedef struct {
X86EMU_regs x86;
} X86EMU_sysEnv;
+#ifdef END_PACK
+# pragma END_PACK
+#endif
+
/*----------------------------- Global Variables --------------------------*/
#ifdef __cplusplus
diff --git a/hw/xfree86/x86emu/x86emu/types.h b/hw/xfree86/x86emu/x86emu/types.h
index 5232d10ac..c0c09c1b0 100644
--- a/hw/xfree86/x86emu/x86emu/types.h
+++ b/hw/xfree86/x86emu/x86emu/types.h
@@ -36,12 +36,11 @@
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/include/x86emu/types.h,v 1.6 2003/06/12 14:12:26 eich Exp $ */
#ifndef __X86EMU_TYPES_H
#define __X86EMU_TYPES_H
-#ifndef IN_MODULE
+#ifndef NO_SYS_HEADERS
#include <sys/types.h>
#endif
diff --git a/hw/xfree86/x86emu/x86emu/x86emui.h b/hw/xfree86/x86emu/x86emu/x86emui.h
index 3adf61ec6..112ee366f 100644
--- a/hw/xfree86/x86emu/x86emu/x86emui.h
+++ b/hw/xfree86/x86emu/x86emu/x86emui.h
@@ -38,7 +38,6 @@
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/x86emu/x86emui.h,v 1.3 2000/04/17 16:29:47 eich Exp $ */
#ifndef __X86EMU_X86EMUI_H
#define __X86EMU_X86EMUI_H
@@ -71,9 +70,7 @@
#include "x86emu/fpu.h"
#include "x86emu/fpu_regs.h"
-#ifdef IN_MODULE
-#include <xf86_ansic.h>
-#else
+#ifndef NO_SYS_HEADERS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/hw/xfree86/xaa/xaa.h b/hw/xfree86/xaa/xaa.h
index 98db3cf50..d4ff7bbd8 100644
--- a/hw/xfree86/xaa/xaa.h
+++ b/hw/xfree86/xaa/xaa.h
@@ -1278,6 +1278,10 @@ typedef struct _XAAInfoRec {
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,
@@ -1304,6 +1308,10 @@ typedef struct _XAAInfoRec {
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,
@@ -1333,6 +1341,38 @@ typedef struct _XAAInfoRec {
BoxRec SolidLineLimits;
BoxRec DashedLineLimits;
+#ifdef RENDER
+ /* 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;
+#endif /* RENDER */
} XAAInfoRec, *XAAInfoRecPtr;
#define SET_SYNC_FLAG(infoRec) (infoRec)->NeedToSync = TRUE
diff --git a/hw/xfree86/xaa/xaaFallback.c b/hw/xfree86/xaa/xaaFallback.c
index 6bc7bfed3..df67342ff 100644
--- a/hw/xfree86/xaa/xaaFallback.c
+++ b/hw/xfree86/xaa/xaaFallback.c
@@ -347,6 +347,7 @@ GCOps XAAFallbackOps = {
{NULL} /* devPrivate */
};
-
-
-
+GCOps *XAAGetFallbackOps(void)
+{
+ return &XAAFallbackOps;
+}
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index 186711e3f..f6f2d491e 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -40,11 +40,29 @@ static int XAASetDGAMode(int index, int num, DGADevicePtr devRet);
static void XAAEnableDisableFBAccess (int index, Bool enable);
static Bool XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask);
+/*
+ * XXX These three should be static, but that breaks ABI compat with XF4.4
+ * and Xorg 6.7.0 modules. DO NOT use them in new code, you should never
+ * be setting them, and you've got Get functions below.
+ */
int XAAScreenIndex = -1;
int XAAGCIndex = -1;
int XAAPixmapIndex = -1;
+
static unsigned long XAAGeneration = 0;
+int XAAGetScreenIndex(void) {
+ return XAAScreenIndex;
+}
+
+int XAAGetGCIndex(void) {
+ return XAAGCIndex;
+}
+
+int XAAGetPixmapIndex(void) {
+ return XAAPixmapIndex;
+}
+
/* temp kludge */
static Bool SwitchedOut = FALSE;
diff --git a/hw/xfree86/xaa/xaaInitAccel.c b/hw/xfree86/xaa/xaaInitAccel.c
index 7233e215c..9d3764506 100644
--- a/hw/xfree86/xaa/xaaInitAccel.c
+++ b/hw/xfree86/xaa/xaaInitAccel.c
@@ -101,8 +101,8 @@ static XF86ModuleVersionInfo xaaVersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 1, 0,
+ XORG_VERSION_CURRENT,
+ 1, 2, 0,
ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
ABI_VIDEODRV_VERSION,
MOD_CLASS_NONE,
@@ -1269,10 +1269,12 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
#ifdef RENDER
{
Bool haveTexture = infoRec->CPUToScreenTextureFormats &&
- infoRec->SetupForCPUToScreenTexture &&
+ infoRec->CPUToScreenTextureDstFormats &&
+ infoRec->SetupForCPUToScreenTexture2 &&
infoRec->SubsequentCPUToScreenTexture;
Bool haveAlphaTexture = infoRec->CPUToScreenAlphaTextureFormats &&
- infoRec->SetupForCPUToScreenAlphaTexture &&
+ infoRec->CPUToScreenAlphaTextureDstFormats &&
+ infoRec->SetupForCPUToScreenAlphaTexture2 &&
infoRec->SubsequentCPUToScreenAlphaTexture;
if(!infoRec->Composite && (haveTexture || haveAlphaTexture))
diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c
index 42a9428c4..f0505a8b6 100644
--- a/hw/xfree86/xaa/xaaOverlay.c
+++ b/hw/xfree86/xaa/xaaOverlay.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.1.4.3.2.3 2004/03/04 20:16:48 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.2 2004/04/23 19:54:16 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.14tsi Exp $ */
#include "misc.h"
diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c
index 25f8bd486..94790d21c 100644
--- a/hw/xfree86/xaa/xaaPCache.c
+++ b/hw/xfree86/xaa/xaaPCache.c
@@ -1653,7 +1653,8 @@ XAACachePlanarMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
return pCache;
}
-
+XAACachePlanarMonoStippleProc
+XAAGetCachePlanarMonoStipple(void) { return XAACachePlanarMonoStipple; }
XAACacheInfoPtr
XAACacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg)
diff --git a/hw/xfree86/xaa/xaaPaintWin.c b/hw/xfree86/xaa/xaaPaintWin.c
index 1cf6c3422..351d0e85f 100644
--- a/hw/xfree86/xaa/xaaPaintWin.c
+++ b/hw/xfree86/xaa/xaaPaintWin.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xaa/xaaPaintWin.c,v 1.1.4.2.2.3 2004/03/04 20:16:48 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xaa/xaaPaintWin.c,v 1.2 2004/04/23 19:54:16 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPaintWin.c,v 1.10 2001/10/28 03:34:04 tsi Exp $ */
#include "misc.h"
diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c
index af3380231..12523e85f 100644
--- a/hw/xfree86/xaa/xaaPict.c
+++ b/hw/xfree86/xaa/xaaPict.c
@@ -172,6 +172,10 @@ XAA_888_plus_PICT_a8_to_8888 (
}
}
+#define DRAWABLE_IS_ON_CARD(pDraw) \
+ (pDraw->type == DRAWABLE_WINDOW || \
+ (pDraw->type == DRAWABLE_PIXMAP && IS_OFFSCREEN_PIXMAP(pDraw)))
+
Bool
XAADoComposite (
CARD8 op,
@@ -190,7 +194,7 @@ XAADoComposite (
ScreenPtr pScreen = pDst->pDrawable->pScreen;
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
RegionRec region;
- CARD32 *formats;
+ CARD32 *formats, *dstformats;
int flags = 0;
BoxPtr pbox;
int nbox, w, h;
@@ -198,13 +202,10 @@ XAADoComposite (
if(!REGION_NUM_RECTS(pDst->pCompositeClip))
return TRUE;
- if(!infoRec->pScrn->vtSema ||
- ((pDst->pDrawable->type != DRAWABLE_WINDOW) &&
- !IS_OFFSCREEN_PIXMAP(pDst->pDrawable)))
+ if(!infoRec->pScrn->vtSema || !DRAWABLE_IS_ON_CARD(pDst->pDrawable))
return FALSE;
- if((pSrc->pDrawable->type != DRAWABLE_PIXMAP) ||
- IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))
+ if(DRAWABLE_IS_ON_CARD(pSrc->pDrawable))
return FALSE;
if (pSrc->transform || (pMask && pMask->transform))
@@ -279,7 +280,9 @@ XAADoComposite (
return TRUE;
}
- if(!(formats = infoRec->CPUToScreenAlphaTextureFormats))
+ formats = infoRec->CPUToScreenAlphaTextureFormats;
+ dstformats = infoRec->CPUToScreenAlphaTextureDstFormats;
+ if(!formats || !dstformats)
return FALSE;
w = pMask->pDrawable->width;
@@ -304,6 +307,11 @@ XAADoComposite (
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,
@@ -318,8 +326,9 @@ XAADoComposite (
return TRUE;
}
- if(!(infoRec->SetupForCPUToScreenAlphaTexture)(infoRec->pScrn,
- op, red, green, blue, alpha, pMask->format,
+ 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))
@@ -343,8 +352,10 @@ XAADoComposite (
REGION_UNINIT(pScreen, &region);
return TRUE;
}
- } else {
- if(!(formats = infoRec->CPUToScreenTextureFormats))
+ } else {
+ formats = infoRec->CPUToScreenTextureFormats;
+ dstformats = infoRec->CPUToScreenTextureDstFormats;
+ if(!formats || !dstformats)
return FALSE;
w = pSrc->pDrawable->width;
@@ -361,11 +372,15 @@ XAADoComposite (
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,
@@ -380,8 +395,8 @@ XAADoComposite (
return TRUE;
}
- if(!(infoRec->SetupForCPUToScreenTexture)(infoRec->pScrn,
- op, pSrc->format,
+ if(!(infoRec->SetupForCPUToScreenTexture2)(infoRec->pScrn,
+ op, pSrc->format, pDst->format,
((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr,
((PixmapPtr)(pSrc->pDrawable))->devKind,
w, h, flags))
@@ -411,6 +426,63 @@ XAADoComposite (
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 = REGION_NUM_RECTS(&region);
+ pbox = REGION_RECTS(&region);
+
+ if(!nbox) {
+ REGION_UNINIT(pScreen, &region);
+ return;
+ }
+ pptSrc = ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
+ if (!pptSrc) {
+ REGION_UNINIT(pScreen, &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);
+
+ DEALLOCATE_LOCAL(pptSrc);
+ REGION_UNINIT(pScreen, &region);
+ return;
+}
void
XAAComposite (CARD8 op,
@@ -430,7 +502,14 @@ XAAComposite (CARD8 op,
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
XAA_RENDER_PROLOGUE(pScreen, Composite);
- if(!infoRec->Composite ||
+ if((op == PictOpSrc) && !pMask && infoRec->pScrn->vtSema &&
+ infoRec->ScreenToScreenBitBlt &&
+ DRAWABLE_IS_ON_CARD(pSrc->pDrawable) &&
+ DRAWABLE_IS_ON_CARD(pDst->pDrawable) &&
+ !pSrc->transform && !pSrc->repeat && (pSrc->format == pDst->format))
+ {
+ XAACompositeSrcCopy(pSrc, pDst, xSrc, ySrc, xDst, yDst, width, height);
+ } else if(!infoRec->Composite ||
!(*infoRec->Composite)(op, pSrc, pMask, pDst,
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height))
diff --git a/hw/xfree86/xaa/xaaROP.c b/hw/xfree86/xaa/xaaROP.c
index 70a7b1d7d..931740159 100644
--- a/hw/xfree86/xaa/xaaROP.c
+++ b/hw/xfree86/xaa/xaaROP.c
@@ -94,6 +94,25 @@ int XAAPatternROP_PM[16] =
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)
diff --git a/hw/xfree86/xaa/xaaStipple.c b/hw/xfree86/xaa/xaaStipple.c
index 8b111d1cf..66d3a81e3 100644
--- a/hw/xfree86/xaa/xaaStipple.c
+++ b/hw/xfree86/xaa/xaaStipple.c
@@ -15,8 +15,10 @@ 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] = {
@@ -28,6 +30,9 @@ StippleScanlineProcPtr stipple_scanline_func[6] = {
StippleOver32_Inverted
};
+StippleScanlineProcPtr *stipple_get_scanline_func(void) {
+ return stipple_scanline_func;
+}
#ifdef FIXEDBASE
# define DEST(i) *dest
diff --git a/hw/xfree86/xaa/xaaTEGlyph.c b/hw/xfree86/xaa/xaaTEGlyph.c
index 0fd572617..7a699fd1f 100644
--- a/hw/xfree86/xaa/xaaTEGlyph.c
+++ b/hw/xfree86/xaa/xaaTEGlyph.c
@@ -74,7 +74,7 @@ static CARD32 *DrawTETextScanlineWidth9(CARD32 *base, unsigned int **glyphp,
#endif
#define glyph_scanline_func EXPNAME(XAAGlyphScanlineFunc)
-
+#define glyph_get_scanline_func EXPNAME(XAAGetGlyphScanlineFunc)
GlyphScanlineFuncPtr glyph_scanline_func[32] = {
@@ -125,6 +125,10 @@ GlyphScanlineFuncPtr glyph_scanline_func[32] = {
DrawTETextScanlineGeneric, DrawTETextScanlineGeneric
};
+GlyphScanlineFuncPtr *glyph_get_scanline_func(void) {
+ return glyph_scanline_func;
+}
+
/********************************************************************
diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c
index fedd8f44d..cbe5fe70f 100644
--- a/hw/xfree86/xaa/xaaWideLine.c
+++ b/hw/xfree86/xaa/xaaWideLine.c
@@ -1,5 +1,5 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.10 2001/11/16 16:47:56 dawes Exp $ */
-
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.3 2004/08/29 00:48:17 alanc Exp $ */
/*
XAAPolylinesWideSolid does not maintain a span list and subsequently does
@@ -15,7 +15,8 @@ Original mi code written by Keith Packard.
*/
#ifndef XFree86LOADER
-#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__)
+#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__) \
+ || (defined(sun) && defined(__SVR4))
#include <math.h>
#else
#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */
diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h
index 04d8d154a..883e64d5b 100644
--- a/hw/xfree86/xaa/xaalocal.h
+++ b/hw/xfree86/xaa/xaalocal.h
@@ -727,6 +727,11 @@ extern CARD32 *(*XAAGlyphScanlineFuncLSBFirst[32])(
CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
);
+GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncMSBFirstFixedBase(void);
+GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncMSBFirst(void);
+GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncLSBFirstFixedBase(void);
+GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncLSBFirst(void);
+
void
XAAFillColorExpandRectsLSBFirst(
ScrnInfoPtr pScrn,
@@ -1046,6 +1051,11 @@ extern CARD32 *(*XAAStippleScanlineFuncLSBFirst[6])(
CARD32* base, CARD32* src, int offset, int width, int dwords
);
+StippleScanlineProcPtr *XAAGetStippleScanlineFuncMSBFirstFixedBase(void);
+StippleScanlineProcPtr *XAAGetStippleScanlineFuncMSBFirst(void);
+StippleScanlineProcPtr *XAAGetStippleScanlineFuncLSBFirstFixedBase(void);
+StippleScanlineProcPtr *XAAGetStippleScanlineFuncLSBFirst(void);
+
int
XAAPolyText8TEColorExpansion(
DrawablePtr pDraw,
@@ -1506,6 +1516,9 @@ XAACacheMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix);
XAACacheInfoPtr
XAACachePlanarMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix);
+typedef XAACacheInfoPtr (*XAACachePlanarMonoStippleProc)(ScrnInfoPtr, PixmapPtr);
+XAACachePlanarMonoStippleProc XAAGetCachePlanarMonoStipple(void);
+
XAACacheInfoPtr
XAACacheStipple(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg);
@@ -1623,13 +1636,17 @@ XAAGetPixelFromRGBA (
);
#endif
-
+/* XXX should be static */
extern GCOps XAAFallbackOps;
+extern GCOps *XAAGetFallbackOps(void);
extern GCFuncs XAAGCFuncs;
-extern int XAAScreenIndex;
-extern int XAAGCIndex;
-extern int XAAPixmapIndex;
+extern int XAAScreenIndex; /* XXX DONTUSE */
+extern int XAAGCIndex; /* XXX DONTUSE */
+extern int XAAPixmapIndex; /* XXX DONTUSE */
+extern int XAAGetScreenIndex(void);
+extern int XAAGetGCIndex(void);
+extern int XAAGetPixmapIndex(void);
extern unsigned int XAAShiftMasks[32];
@@ -1638,28 +1655,28 @@ extern unsigned int byte_expand3[256], byte_reversed_expand3[256];
CARD32 XAAReverseBitOrder(CARD32 data);
#define GET_XAASCREENPTR_FROM_SCREEN(pScreen)\
- (pScreen)->devPrivates[XAAScreenIndex].ptr
+ (pScreen)->devPrivates[XAAGetScreenIndex()].ptr
#define GET_XAASCREENPTR_FROM_GC(pGC)\
- (pGC)->pScreen->devPrivates[XAAScreenIndex].ptr
+ (pGC)->pScreen->devPrivates[XAAGetScreenIndex()].ptr
#define GET_XAASCREENPTR_FROM_DRAWABLE(pDraw)\
- (pDraw)->pScreen->devPrivates[XAAScreenIndex].ptr
+ (pDraw)->pScreen->devPrivates[XAAGetScreenIndex()].ptr
#define GET_XAAINFORECPTR_FROM_SCREEN(pScreen)\
- ((XAAScreenPtr)((pScreen)->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
+ ((XAAScreenPtr)((pScreen)->devPrivates[XAAGetScreenIndex()].ptr))->AccelInfoRec
#define GET_XAAINFORECPTR_FROM_GC(pGC)\
-((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
+((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAGetScreenIndex()].ptr))->AccelInfoRec
#define GET_XAAINFORECPTR_FROM_DRAWABLE(pDraw)\
-((XAAScreenPtr)((pDraw)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
+((XAAScreenPtr)((pDraw)->pScreen->devPrivates[XAAGetScreenIndex()].ptr))->AccelInfoRec
#define GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn)\
-((XAAScreenPtr)((pScrn)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
+((XAAScreenPtr)((pScrn)->pScreen->devPrivates[XAAGetScreenIndex()].ptr))->AccelInfoRec
#define XAA_GET_PIXMAP_PRIVATE(pix)\
- (XAAPixmapPtr)((pix)->devPrivates[XAAPixmapIndex].ptr)
+ (XAAPixmapPtr)((pix)->devPrivates[XAAGetPixmapIndex()].ptr)
#define CHECK_RGB_EQUAL(c) (!((((c) >> 8) ^ (c)) & 0xffff))
diff --git a/hw/xfree86/xaa/xaarop.h b/hw/xfree86/xaa/xaarop.h
index 048ed00fc..1c95727b3 100644
--- a/hw/xfree86/xaa/xaarop.h
+++ b/hw/xfree86/xaa/xaarop.h
@@ -299,9 +299,15 @@
int XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop);
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 int XAACopyROP[16];
extern int XAACopyROP_PM[16];
extern int XAAPatternROP[16];
extern int XAAPatternROP_PM[16];
+extern int XAAGetCopyROP(int i);
+extern int XAAGetCopyROP_PM(int i);
+extern int XAAGetPatternROP(int i);
+extern int XAAGetPatternROP_PM(int i);
+
#endif /* _XAAROP_H */
diff --git a/hw/xfree86/xaa/xaawrap.h b/hw/xfree86/xaa/xaawrap.h
index 59f0a2cc7..5e3e0e683 100644
--- a/hw/xfree86/xaa/xaawrap.h
+++ b/hw/xfree86/xaa/xaawrap.h
@@ -2,14 +2,14 @@
#define XAA_SCREEN_PROLOGUE(pScreen, field)\
((pScreen)->field = \
- ((XAAScreenPtr) (pScreen)->devPrivates[XAAScreenIndex].ptr)->field)
+ ((XAAScreenPtr) (pScreen)->devPrivates[XAAGetScreenIndex()].ptr)->field)
#define XAA_SCREEN_EPILOGUE(pScreen, field, wrapper)\
((pScreen)->field = wrapper)
#define XAA_GC_FUNC_PROLOGUE(pGC)\
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;\
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;\
(pGC)->funcs = pGCPriv->wrapFuncs;\
if(pGCPriv->flags)\
(pGC)->ops = pGCPriv->wrapOps
@@ -25,13 +25,13 @@
#define XAA_GC_OP_PROLOGUE(pGC)\
- XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\
+ XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGetGCIndex()].ptr);\
GCFuncs *oldFuncs = pGC->funcs;\
pGC->funcs = pGCPriv->wrapFuncs;\
pGC->ops = pGCPriv->wrapOps
#define XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC)\
- XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\
+ XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGetGCIndex()].ptr);\
GCFuncs *oldFuncs = pGC->funcs;\
if(!REGION_NUM_RECTS(pGC->pCompositeClip)) return; \
pGC->funcs = pGCPriv->wrapFuncs;\
@@ -45,7 +45,7 @@
#define XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw)\
- XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\
+ XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGetGCIndex()].ptr);\
XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDraw));\
GCFuncs *oldFuncs = pGC->funcs;\
pGC->funcs = pGCPriv->wrapFuncs;\
@@ -61,7 +61,7 @@
#ifdef RENDER
#define XAA_RENDER_PROLOGUE(pScreen,field)\
(GetPictureScreen(pScreen)->field = \
- ((XAAScreenPtr) (pScreen)->devPrivates[XAAScreenIndex].ptr)->field)
+ ((XAAScreenPtr) (pScreen)->devPrivates[XAAGetScreenIndex()].ptr)->field)
#define XAA_RENDER_EPILOGUE(pScreen, field, wrapper)\
(GetPictureScreen(pScreen)->field = wrapper)
@@ -71,7 +71,7 @@
#define SYNC_CHECK(pGC) {\
XAAInfoRecPtr infoRec =\
-((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec;\
+((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAGetScreenIndex()].ptr))->AccelInfoRec;\
if(infoRec->NeedToSync) {\
(*infoRec->Sync)(infoRec->pScrn);\
infoRec->NeedToSync = FALSE;\
diff --git a/hw/xfree86/xf1bpp/mfbmap.h b/hw/xfree86/xf1bpp/mfbmap.h
index a29332497..bf04b7320 100644
--- a/hw/xfree86/xf1bpp/mfbmap.h
+++ b/hw/xfree86/xf1bpp/mfbmap.h
@@ -34,13 +34,21 @@
#define mfbDoBitbltGeneral xf1bppDoBitbltGeneral
#define mfbDoBitbltOr xf1bppDoBitbltOr
#define mfbDoBitbltXor xf1bppDoBitbltXor
+#define mfbFillInScreen xf1bppFillInScreen
#define mfbFillPolyBlack xf1bppFillPolyBlack
#define mfbFillPolyInvert xf1bppFillPolyInvert
#define mfbFillPolyWhite xf1bppFillPolyWhite
#define mfbGCPrivateIndex xf1bppGCPrivateIndex
+#define mfbGetGCPrivateIndex xf1bppGetGCPrivateIndex
#define mfbGetImage xf1bppGetImage
#define mfbGetSpans xf1bppGetSpans
#define mfbGetWindowPixmap xf1bppGetWindowPixmap
+#define mfbGetWindowPrivateIndex xf1bppGetWindowPrivateIndex
+#define mfbGetmask xf1bppGetmask
+#define mfbGetpartmasks xf1bppGetpartmasks
+#define mfbGetrmask xf1bppGetrmask
+#define mfbGetstarttab xf1bppGetstarttab
+#define mfbGetendtab xf1bppGetendtab
#define mfbHorzS xf1bppHorzS
#define mfbImageGlyphBltBlack xf1bppImageGlyphBltBlack
#define mfbImageGlyphBltWhite xf1bppImageGlyphBltWhite
diff --git a/hw/xfree86/xf1bpp/mfbmodule.c b/hw/xfree86/xf1bpp/mfbmodule.c
index 4fb795152..81baf5d7e 100644
--- a/hw/xfree86/xf1bpp/mfbmodule.c
+++ b/hw/xfree86/xf1bpp/mfbmodule.c
@@ -35,7 +35,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/xf4bpp/mfbbres.c b/hw/xfree86/xf4bpp/mfbbres.c
index 82b17e59e..ae9df6e10 100644
--- a/hw/xfree86/xf4bpp/mfbbres.c
+++ b/hw/xfree86/xf4bpp/mfbbres.c
@@ -79,8 +79,8 @@ int len; /* length of line */
register PixelType *addrl; /* bitmask long pointer
*dont* * cast to char pointer */
register PixelType bit; /* current bit being set/cleared/etc. */
- PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
- PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
+ PixelType leftbit = mfbGetmask(0); /* leftmost bit to process in new word */
+ PixelType rightbit = mfbGetmask(PPW-1); /* rightmost bit to process in new word */
register int e3 = e2-e1;
@@ -88,7 +88,7 @@ int len; /* length of line */
addrl = mfbScanline(addrlbase, x1, y1, nlwidth);
yinc = signdy * nlwidth;
e = e-e1; /* to make looping easier */
- bit = mask[x1 & PIM];
+ bit = mfbGetmask(x1 & PIM);
if (!len)
return;
diff --git a/hw/xfree86/xf4bpp/mfbbresd.c b/hw/xfree86/xf4bpp/mfbbresd.c
index 29b816a3a..0f320ebc6 100644
--- a/hw/xfree86/xf4bpp/mfbbresd.c
+++ b/hw/xfree86/xf4bpp/mfbbresd.c
@@ -102,8 +102,8 @@ int len; /* length of line */
register PixelType *addrl;
register int e3 = e2-e1;
register unsigned long bit;
- PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
- PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
+ PixelType leftbit = mfbGetmask(0); /* leftmost bit to process in new word */
+ PixelType rightbit = mfbGetmask(PPW-1); /* rightmost bit to process in new word */
int dashIndex;
int dashOffset;
int dashRemaining;
@@ -125,7 +125,7 @@ int len; /* length of line */
addrl = mfbScanline(addrlbase, x1, y1, nlwidth);
yinc = signdy * nlwidth;
e = e-e1; /* to make looping easier */
- bit = mask[x1 & PIM];
+ bit = mfbGetmask(x1 & PIM);
if (axis == X_AXIS)
{
if (signdx > 0)
diff --git a/hw/xfree86/xf4bpp/mfbfillarc.c b/hw/xfree86/xf4bpp/mfbfillarc.c
index 5d677174d..c3f62cb64 100644
--- a/hw/xfree86/xf4bpp/mfbfillarc.c
+++ b/hw/xfree86/xf4bpp/mfbfillarc.c
@@ -252,7 +252,7 @@ xf4bppPolyFillArcSolid
mfbPrivGC *priv;
int rop;
- priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr;
+ priv = (mfbPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr;
rop = priv->rop;
if ((rop == RROP_NOP) || !(pGC->planemask & 1))
#else
diff --git a/hw/xfree86/xf4bpp/mfbhrzvert.c b/hw/xfree86/xf4bpp/mfbhrzvert.c
index c53edd19d..0e5594356 100644
--- a/hw/xfree86/xf4bpp/mfbhrzvert.c
+++ b/hw/xfree86/xf4bpp/mfbhrzvert.c
@@ -128,6 +128,6 @@ register int len; /* length of line */
len = -len;
}
- bitmask = mask[x1 & PIM];
+ bitmask = mfbGetmask(x1 & PIM);
Duff(len, UPDRW(addrl,bitmask); addrl += nlwidth);
}
diff --git a/hw/xfree86/xf4bpp/mfbimggblt.c b/hw/xfree86/xf4bpp/mfbimggblt.c
index b4f5bd014..95d7a7fcb 100644
--- a/hw/xfree86/xf4bpp/mfbimggblt.c
+++ b/hw/xfree86/xf4bpp/mfbimggblt.c
@@ -148,7 +148,7 @@ xf4bppImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
- pPrivGC = pGC->devPrivates[mfbGCPrivateIndex].ptr;
+ pPrivGC = pGC->devPrivates[mfbGetGCPrivateIndex()].ptr;
oldfillStyle = pPrivGC->colorRrop.fillStyle; /* GJA */
oldfg = pPrivGC->colorRrop.fgPixel; /* GJA */
oldalu = pPrivGC->colorRrop.alu; /* GJA */
@@ -243,7 +243,7 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop)
/* UNCLEAN CODE
we know the mfbPolyFillRect uses only three fields in
- devPrivate[mfbGCPrivateIndex].ptr, two of which (the rotated
+ devPrivate[mfbGetGCPrivateIndex()].ptr, two of which (the rotated
tile/stipple and the ropFillArea) are
irrelevant for solid filling, so we just poke the FillArea
field. the GC is now in an inconsistent state, but we'll fix
@@ -253,7 +253,7 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop)
NOTE:
if you are not using the standard mfbFillRectangle code, you
need to poke any fields in the GC the rectangle stuff need
- (probably alu, fgPixel, and fillStyle) and in devPrivate[mfbGCPrivateIndex].ptr
+ (probably alu, fgPixel, and fillStyle) and in devPrivate[mfbGetGCPrivateIndex()].ptr
(probably rop or ropFillArea.) You could just call ValidateGC,
but that is usually not a cheap thing to do.
*/
diff --git a/hw/xfree86/xf4bpp/mfbline.c b/hw/xfree86/xf4bpp/mfbline.c
index b200a611e..356028b8c 100644
--- a/hw/xfree86/xf4bpp/mfbline.c
+++ b/hw/xfree86/xf4bpp/mfbline.c
@@ -466,9 +466,9 @@ DoV16LineSS (pDrawable, pGC, mode, npt, pptInit)
PixelType _mask;
if (alu == RROP_BLACK)
- _mask = rmask[x2 & PIM];
+ _mask = mfbGetrmask(x2 & PIM);
else
- _mask = mask[x2 & PIM];
+ _mask = mfbGetmask(x2 & PIM);
nbox = nboxInit;
pbox = pboxInit;
@@ -797,7 +797,7 @@ dontStep: ;
{
unsigned long _mask;
- _mask = mask[x2 & PIM];
+ _mask = mfbGetmask(x2 & PIM);
addrl = mfbScanline(addrl, x2, y2, nlwidth);
UPDRW(addrl,_mask);
break;
diff --git a/hw/xfree86/xf4bpp/mfbzerarc.c b/hw/xfree86/xf4bpp/mfbzerarc.c
index 106fc6ae5..4853f8807 100644
--- a/hw/xfree86/xf4bpp/mfbzerarc.c
+++ b/hw/xfree86/xf4bpp/mfbzerarc.c
@@ -108,7 +108,7 @@ v16ZeroArcSS
int pmask;
register int *paddr;
- if (((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop ==
+ if (((mfbPrivGC *)(pGC->devPrivates[mfbGetGCPrivateIndex()].ptr))->rop ==
RROP_BLACK)
pixel = 0;
else
diff --git a/hw/xfree86/xf4bpp/ppcArea.c b/hw/xfree86/xf4bpp/ppcArea.c
index 0d1a2075b..663672878 100644
--- a/hw/xfree86/xf4bpp/ppcArea.c
+++ b/hw/xfree86/xf4bpp/ppcArea.c
@@ -47,7 +47,7 @@ int alu ;
unsigned long int fg, bg, pm ;
int xSrc, ySrc ;
PixmapPtr pPixmap ;
-ppcPrivGC *pPrivGC = pGC->devPrivates[mfbGCPrivateIndex].ptr;
+ppcPrivGC *pPrivGC = pGC->devPrivates[mfbGetGCPrivateIndex()].ptr;
TRACE( ( "xf4bppFillArea(0x%x,%d,0x%x,0x%x)\n", pWin, nboxes, pBox, pGC ) ) ;
diff --git a/hw/xfree86/xf4bpp/ppcGC.c b/hw/xfree86/xf4bpp/ppcGC.c
index bbc64c97c..881dfbf05 100644
--- a/hw/xfree86/xf4bpp/ppcGC.c
+++ b/hw/xfree86/xf4bpp/ppcGC.c
@@ -184,7 +184,7 @@ register GCPtr pGC ;
* a pointer to a ppcPrivGC in its slot.
*/
*pPriv = vgaPrototypeGCPriv;
- (pGC->devPrivates[mfbGCPrivateIndex].ptr) = (pointer) pPriv;
+ (pGC->devPrivates[mfbGetGCPrivateIndex()].ptr) = (pointer) pPriv;
/* Set the vgaGCOps */
*pOps = vgaGCOps;
@@ -210,7 +210,7 @@ xf4bppDestroyGC( pGC )
if ( pGC->freeCompClip && pGC->pCompositeClip )
REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
if(pGC->ops->devPrivate.val) xfree( pGC->ops );
- xfree( pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
+ xfree( pGC->devPrivates[mfbGetGCPrivateIndex()].ptr ) ;
return ;
}
@@ -221,7 +221,7 @@ ppcChangePixmapGC
register Mask changes
)
{
-register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
+register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGetGCPrivateIndex()].ptr ) ;
register unsigned long int idx ; /* used for stepping through bitfields */
#define LOWBIT( x ) ( x & - x ) /* Two's complement */
@@ -303,7 +303,7 @@ xf4bppValidateGC( pGC, changes, pDrawable )
register ppcPrivGCPtr devPriv ;
WindowPtr pWin ;
- devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
+ devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGetGCPrivateIndex()].ptr ) ;
if ( pDrawable->type != devPriv->lastDrawableType ) {
devPriv->lastDrawableType = pDrawable->type ;
diff --git a/hw/xfree86/xf4bpp/ppcIO.c b/hw/xfree86/xf4bpp/ppcIO.c
index 02019b19a..6b6fb1c09 100644
--- a/hw/xfree86/xf4bpp/ppcIO.c
+++ b/hw/xfree86/xf4bpp/ppcIO.c
@@ -209,22 +209,16 @@ xf4bppScreenInit( pScreen, pbits, virtx, virty, dpix, dpiy, width )
pScreen-> CreateWindow = xf4bppCreateWindowForXYhardware;
pScreen-> DestroyWindow = xf4bppDestroyWindow;
pScreen-> PositionWindow = xf4bppPositionWindow;
- pScreen-> ChangeWindowAttributes = mfbChangeWindowAttributes;
- pScreen-> RealizeWindow = mfbMapWindow;
- pScreen-> UnrealizeWindow = mfbUnmapWindow;
pScreen-> PaintWindowBackground = xf4bppPaintWindow;
pScreen-> PaintWindowBorder = xf4bppPaintWindow;
pScreen-> CopyWindow = xf4bppCopyWindow;
pScreen-> CreatePixmap = xf4bppCreatePixmap;
- pScreen-> DestroyPixmap = mfbDestroyPixmap;
pScreen-> SaveDoomedAreas = (SaveDoomedAreasProcPtr)NoopDDA;
pScreen-> RestoreAreas = (RestoreAreasProcPtr)NoopDDA;
pScreen-> ExposeCopy = (ExposeCopyProcPtr)NoopDDA;
pScreen-> TranslateBackingStore = (TranslateBackingStoreProcPtr)NoopDDA;
pScreen-> ClearBackingStore = (ClearBackingStoreProcPtr)NoopDDA;
pScreen-> DrawGuarantee = (DrawGuaranteeProcPtr)NoopDDA;
- pScreen-> RealizeFont = mfbRealizeFont;
- pScreen-> UnrealizeFont = mfbUnrealizeFont;
pScreen-> CreateGC = xf4bppCreateGC;
pScreen-> CreateColormap = xf4bppInitializeColormap;
pScreen-> DestroyColormap = (DestroyColormapProcPtr)NoopDDA;
@@ -233,7 +227,7 @@ xf4bppScreenInit( pScreen, pbits, virtx, virty, dpix, dpiy, width )
pScreen-> ListInstalledColormaps = miListInstalledColormaps;
pScreen-> StoreColors = (StoreColorsProcPtr)NoopDDA;
pScreen-> ResolveColor = xf4bppResolveColor;
- pScreen-> BitmapToRegion = mfbPixmapToRegion;
+ mfbFillInScreen(pScreen);
if (!mfbAllocatePrivates(pScreen, (int*)NULL, (int*)NULL))
return FALSE;
diff --git a/hw/xfree86/xf4bpp/ppcPixFS.c b/hw/xfree86/xf4bpp/ppcPixFS.c
index 66b547e59..957a88135 100644
--- a/hw/xfree86/xf4bpp/ppcPixFS.c
+++ b/hw/xfree86/xf4bpp/ppcPixFS.c
@@ -122,7 +122,7 @@ xf4bppSolidPixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
return ;
}
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop )
return ;
n = nInit * miFindMaxBand(pGC->pCompositeClip) ;
@@ -140,8 +140,8 @@ xf4bppSolidPixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit,
ppt, pwidth, fSorted ) ;
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ;
npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
for ( ; n-- ; ppt++, pwidth++ ) {
@@ -257,14 +257,14 @@ int fSorted ;
return ;
}
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop )
return ;
SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
pptFree, pwidth, ppt, fSorted ) ;
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ;
pTile = pGC->stipple ;
tlwidth = pTile->devKind ;
@@ -356,15 +356,15 @@ int fSorted ;
return ;
}
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop )
return ;
SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
pptFree, pwidth, ppt, fSorted ) ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
- bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.bgPixel ;
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ;
+ bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.bgPixel ;
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ;
npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
pTile = pGC->stipple ;
@@ -459,14 +459,14 @@ int fSorted ;
return ;
}
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop )
return ;
SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
pptFree, pwidth, ppt, fSorted ) ;
/* the following code is for 8 bits per pixel addressable memory only */
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ;
npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
pTile = pGC->tile.pixmap ;
tileWidth = pTile->drawable.width ;
diff --git a/hw/xfree86/xf4bpp/ppcPntWin.c b/hw/xfree86/xf4bpp/ppcPntWin.c
index 65ff055d2..f68dbdc19 100644
--- a/hw/xfree86/xf4bpp/ppcPntWin.c
+++ b/hw/xfree86/xf4bpp/ppcPntWin.c
@@ -98,7 +98,7 @@ xf4bppPaintWindow(pWin, pRegion, what)
{
register mfbPrivWin *pPrivWin;
- pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
+ pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbGetWindowPrivateIndex()].ptr);
TRACE(("xf4bppPaintWindow( pWin= 0x%x, pRegion= 0x%x, what= %d )\n",
pWin,pRegion,what));
diff --git a/hw/xfree86/xf4bpp/ppcPolyPnt.c b/hw/xfree86/xf4bpp/ppcPolyPnt.c
index 736d128c6..568902925 100644
--- a/hw/xfree86/xf4bpp/ppcPolyPnt.c
+++ b/hw/xfree86/xf4bpp/ppcPolyPnt.c
@@ -100,7 +100,7 @@ if ( pDrawable->type == DRAWABLE_PIXMAP ) {
return ;
}
-devPriv = (ppcPrivGC *) ( pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
+devPriv = (ppcPrivGC *) ( pGC->devPrivates[mfbGetGCPrivateIndex()].ptr ) ;
if ( ( alu = devPriv->colorRrop.alu ) == GXnoop )
return ;
diff --git a/hw/xfree86/xf4bpp/ppcWinFS.c b/hw/xfree86/xf4bpp/ppcWinFS.c
index ff59fccff..d7fd6b790 100644
--- a/hw/xfree86/xf4bpp/ppcWinFS.c
+++ b/hw/xfree86/xf4bpp/ppcWinFS.c
@@ -94,7 +94,7 @@ xf4bppSolidWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
return ;
}
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop )
return ;
n = nInit * miFindMaxBand( pGC->pCompositeClip ) ;
@@ -112,8 +112,8 @@ xf4bppSolidWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit,
ppt, pwidth, fSorted ) ;
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ;
for ( ; n-- ; ppt++, pwidth++ )
if ( *pwidth )
@@ -161,14 +161,14 @@ int fSorted ;
return ;
}
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop )
return ;
SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
pptFree, pwidth, ppt, fSorted ) ;
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ;
xSrc = pGC->patOrg.x + pDrawable->x ;
ySrc = pGC->patOrg.y + pDrawable->y ;
@@ -213,15 +213,15 @@ int fSorted ;
return ;
}
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop )
return ;
SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
pptFree, pwidth, ppt, fSorted ) ;
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
- bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.bgPixel ;
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ;
+ bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.bgPixel ;
xSrc = pGC->patOrg.x + pDrawable->x ;
ySrc = pGC->patOrg.y + pDrawable->y ;
@@ -258,7 +258,7 @@ int fSorted ;
TRACE( ( "xf4bppTileWindowFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop )
return ;
SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
@@ -266,7 +266,7 @@ int fSorted ;
xSrc = pGC->patOrg.x + pDrawable->x ;
ySrc = pGC->patOrg.y + pDrawable->y ;
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ;
for ( ; n-- ; ppt++, pwidth++ )
xf4bppTileRect( (WindowPtr)pDrawable, pGC->tile.pixmap, alu, pm,
diff --git a/hw/xfree86/xf4bpp/ppcWindow.c b/hw/xfree86/xf4bpp/ppcWindow.c
index a1c7afd9d..c15962aaf 100644
--- a/hw/xfree86/xf4bpp/ppcWindow.c
+++ b/hw/xfree86/xf4bpp/ppcWindow.c
@@ -214,7 +214,7 @@ register WindowPtr pWin ;
TRACE(("xf4bppCreateWindowForXYhardware (pWin= 0x%x)\n", pWin));
- pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
+ pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbGetWindowPrivateIndex()].ptr);
pPrivWin->pRotatedBorder = NullPixmap;
pPrivWin->pRotatedBackground = NullPixmap;
pPrivWin->fastBackground = 0;
diff --git a/hw/xfree86/xf4bpp/vgaGC.c b/hw/xfree86/xf4bpp/vgaGC.c
index 39597d268..a1aecafbb 100644
--- a/hw/xfree86/xf4bpp/vgaGC.c
+++ b/hw/xfree86/xf4bpp/vgaGC.c
@@ -106,7 +106,7 @@ xf4bppChangeWindowGC( pGC, changes )
register GC *pGC ;
register Mask changes ;
{
-register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr) ;
+register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGetGCPrivateIndex()].ptr) ;
register unsigned long int idx ; /* used for stepping through bitfields */
#define LOWBIT( x ) ( x & - x ) /* Two's complement */
diff --git a/hw/xfree86/xf4bpp/vgamodule.c b/hw/xfree86/xf4bpp/vgamodule.c
index c7cf1b7d3..828989dd5 100644
--- a/hw/xfree86/xf4bpp/vgamodule.c
+++ b/hw/xfree86/xf4bpp/vgamodule.c
@@ -36,7 +36,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/xf8_16bpp/cfb8_16.h b/hw/xfree86/xf8_16bpp/cfb8_16.h
index a4a3bda22..97586ba01 100644
--- a/hw/xfree86/xf8_16bpp/cfb8_16.h
+++ b/hw/xfree86/xf8_16bpp/cfb8_16.h
@@ -14,7 +14,8 @@ typedef struct {
unsigned char key;
} cfb8_16ScreenRec, *cfb8_16ScreenPtr;
-extern int cfb8_16ScreenPrivateIndex;
+extern int cfb8_16ScreenPrivateIndex; /* XXX */
+extern int cfb8_16GetScreenPrivateIndex(void);
Bool
cfb8_16ScreenInit (
@@ -64,6 +65,6 @@ cfb8_16WindowExposures(
);
#define CFB8_16_GET_SCREEN_PRIVATE(pScreen)\
- (cfb8_16ScreenPtr)((pScreen)->devPrivates[cfb8_16ScreenPrivateIndex].ptr)
+ (cfb8_16ScreenPtr)((pScreen)->devPrivates[cfb8_16GetScreenPrivateIndex()].ptr)
#endif /* _CFB8_16_H */
diff --git a/hw/xfree86/xf8_16bpp/cfb8_16module.c b/hw/xfree86/xf8_16bpp/cfb8_16module.c
index b2b126d95..1a034980a 100644
--- a/hw/xfree86/xf8_16bpp/cfb8_16module.c
+++ b/hw/xfree86/xf8_16bpp/cfb8_16module.c
@@ -12,7 +12,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/xf8_16bpp/cfbscrinit.c b/hw/xfree86/xf8_16bpp/cfbscrinit.c
index cb4b8d726..e8d911db4 100644
--- a/hw/xfree86/xf8_16bpp/cfbscrinit.c
+++ b/hw/xfree86/xf8_16bpp/cfbscrinit.c
@@ -34,6 +34,8 @@
int cfb8_16ScreenPrivateIndex;
+int cfb8_16GetScreenPrivateIndex(void) { return cfb8_16ScreenPrivateIndex; }
+
static unsigned long cfb8_16Generation = 0;
static PixmapPtr cfb8_16GetWindowPixmap(WindowPtr pWin);
diff --git a/hw/xfree86/xf8_32bpp/cfb8_32.h b/hw/xfree86/xf8_32bpp/cfb8_32.h
index 98a50f810..d992b77c5 100644
--- a/hw/xfree86/xf8_32bpp/cfb8_32.h
+++ b/hw/xfree86/xf8_32bpp/cfb8_32.h
@@ -19,8 +19,10 @@ typedef struct {
} cfb8_32ScreenRec, *cfb8_32ScreenPtr;
-extern int cfb8_32GCPrivateIndex;
-extern int cfb8_32ScreenPrivateIndex;
+extern int cfb8_32GCPrivateIndex; /* XXX */
+extern int cfb8_32GetGCPrivateIndex(void);
+extern int cfb8_32ScreenPrivateIndex; /* XXX */
+extern int cfb8_32GetScreenPrivateIndex(void);
void
cfb8_32SaveAreas(
@@ -212,10 +214,10 @@ cfb8_32ChangeWindowAttributes(
#define CFB8_32_GET_GC_PRIVATE(pGC)\
- (cfb8_32GCPtr)((pGC)->devPrivates[cfb8_32GCPrivateIndex].ptr)
+ (cfb8_32GCPtr)((pGC)->devPrivates[cfb8_32GetGCPrivateIndex()].ptr)
#define CFB8_32_GET_SCREEN_PRIVATE(pScreen)\
- (cfb8_32ScreenPtr)((pScreen)->devPrivates[cfb8_32ScreenPrivateIndex].ptr)
+ (cfb8_32ScreenPtr)((pScreen)->devPrivates[cfb8_32GetScreenPrivateIndex()].ptr)
Bool xf86Overlay8Plus32Init (ScreenPtr pScreen);
diff --git a/hw/xfree86/xf8_32bpp/cfb8_32module.c b/hw/xfree86/xf8_32bpp/cfb8_32module.c
index 2c8f203f8..7b27e498a 100644
--- a/hw/xfree86/xf8_32bpp/cfb8_32module.c
+++ b/hw/xfree86/xf8_32bpp/cfb8_32module.c
@@ -13,7 +13,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/xf8_32bpp/cfbpntwin.c b/hw/xfree86/xf8_32bpp/cfbpntwin.c
index 62026768e..31e66ced5 100644
--- a/hw/xfree86/xf8_32bpp/cfbpntwin.c
+++ b/hw/xfree86/xf8_32bpp/cfbpntwin.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbpntwin.c,v 1.1.4.2.2.3 2004/03/04 20:16:51 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbpntwin.c,v 1.2 2004/04/23 19:54:21 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbpntwin.c,v 1.1 1999/01/03 03:58:56 dawes Exp $ */
#include "X.h"
diff --git a/hw/xfree86/xf8_32bpp/cfbscrinit.c b/hw/xfree86/xf8_32bpp/cfbscrinit.c
index 93323d487..dc23d912c 100644
--- a/hw/xfree86/xf8_32bpp/cfbscrinit.c
+++ b/hw/xfree86/xf8_32bpp/cfbscrinit.c
@@ -38,7 +38,9 @@ static BSFuncRec cfb8_32BSFuncRec = {
int cfb8_32GCPrivateIndex;
+int cfb8_32GetGCPrivateIndex(void) { return cfb8_32GCPrivateIndex; }
int cfb8_32ScreenPrivateIndex;
+int cfb8_32GetScreenPrivateIndex(void) { return cfb8_32ScreenPrivateIndex; }
static unsigned long cfb8_32Generation = 0;
static Bool
diff --git a/hw/xfree86/xf8_32wid/cfb8_32wid.h b/hw/xfree86/xf8_32wid/cfb8_32wid.h
index 2168054d9..1d1093e54 100644
--- a/hw/xfree86/xf8_32wid/cfb8_32wid.h
+++ b/hw/xfree86/xf8_32wid/cfb8_32wid.h
@@ -27,7 +27,8 @@ typedef struct {
cfb8_32WidOps *WIDOps;
} cfb8_32WidScreenRec, *cfb8_32WidScreenPtr;
-extern int cfb8_32WidScreenPrivateIndex;
+extern int cfb8_32WidScreenPrivateIndex; /* XXX */
+extern int cfb8_32WidGetScreenPrivateIndex(void);
Bool
cfb8_32WidScreenInit (
@@ -88,6 +89,6 @@ Bool
cfb8_32WidGenericOpsInit(cfb8_32WidScreenPtr pScreenPriv);
#define CFB8_32WID_GET_SCREEN_PRIVATE(pScreen)\
- (cfb8_32WidScreenPtr)((pScreen)->devPrivates[cfb8_32WidScreenPrivateIndex].ptr)
+ (cfb8_32WidScreenPtr)((pScreen)->devPrivates[cfb8_32WidGetScreenPrivateIndex()].ptr)
#endif /* _CFB8_32WID_H */
diff --git a/hw/xfree86/xf8_32wid/cfb8_32widmodule.c b/hw/xfree86/xf8_32wid/cfb8_32widmodule.c
index 83b6118bb..95f8c9d02 100644
--- a/hw/xfree86/xf8_32wid/cfb8_32widmodule.c
+++ b/hw/xfree86/xf8_32wid/cfb8_32widmodule.c
@@ -12,7 +12,7 @@ static XF86ModuleVersionInfo VersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
diff --git a/hw/xfree86/xf8_32wid/cfbscrinit.c b/hw/xfree86/xf8_32wid/cfbscrinit.c
index 8f307034f..02f6cd21f 100644
--- a/hw/xfree86/xf8_32wid/cfbscrinit.c
+++ b/hw/xfree86/xf8_32wid/cfbscrinit.c
@@ -36,6 +36,10 @@
compiled with CFB_NEED_SCREEN_PRIVATE */
int cfb8_32WidScreenPrivateIndex;
+int cfb8_32WidGetScreenPrivateIndex(void)
+{
+ return cfb8_32WidScreenPrivateIndex;
+}
static unsigned long cfb8_32WidGeneration = 0;
extern WindowPtr *WindowTable;
diff --git a/hw/xfree86/xorgconf.cpp b/hw/xfree86/xorgconf.cpp
index c94c1e5a4..71b6dea98 100644
--- a/hw/xfree86/xorgconf.cpp
+++ b/hw/xfree86/xorgconf.cpp
@@ -1,4 +1,4 @@
-XCOMM $XdotOrg$
+XCOMM $XdotOrg: xc/programs/Xserver/hw/xfree86/xorgconf.cpp,v 1.2 2004/04/23 19:20:02 eich Exp $
XCOMM
XCOMM Copyright (c) 1994-1998 by The XFree86 Project, Inc.
XCOMM
diff --git a/hw/xnest/Args.c b/hw/xnest/Args.c
index 0da0d5006..cc9a2707f 100644
--- a/hw/xnest/Args.c
+++ b/hw/xnest/Args.c
@@ -47,6 +47,11 @@ int xnestNumScreens = 0;
Bool xnestDoDirectColormaps = False;
Window xnestParentWindow = 0;
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+}
+
int
ddxProcessArgument (int argc, char *argv[], int i)
{
diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c
index 146e7ebd0..aaab62c23 100644
--- a/hw/xnest/Cursor.c
+++ b/hw/xnest/Cursor.c
@@ -33,59 +33,6 @@ is" without express or implied warranty.
#include "Keyboard.h"
#include "Args.h"
-void
-xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox)
-{
-#ifdef _XSERVER64
- Window64 wroot;
-#else
- Window wroot;
-#endif
-
- int wx, wy;
- unsigned int wwidth, wheight;
- unsigned int wborderwidth;
- unsigned int wdepth;
-
- XGetGeometry(xnestDisplay, xnestDefaultWindows[pScreen->myNum], &wroot,
- &wx, &wy, &wwidth, &wheight, &wborderwidth, &wdepth);
-
- if (pBox->x1 <= 0 && pBox->y1 <= 0 &&
- pBox->x2 >= wwidth && pBox->y2 >= wheight)
- XUngrabPointer(xnestDisplay, CurrentTime);
- else {
- XReparentWindow(xnestDisplay, xnestConfineWindow,
- xnestDefaultWindows[pScreen->myNum],
- pBox->x1, pBox->y1);
- XResizeWindow(xnestDisplay, xnestConfineWindow,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
-
- XGrabPointer(xnestDisplay,
- xnestDefaultWindows[pScreen->myNum],
- True,
- xnestEventMask & (~XNEST_KEYBOARD_EVENT_MASK|KeymapStateMask),
- GrabModeAsync, GrabModeAsync,
- xnestConfineWindow,
- None, CurrentTime);
- }
-}
-
-void
-xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox,
- BoxPtr pTopLeftBox)
-{
- *pTopLeftBox = *pHotBox;
-}
-
-Bool
-xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
-{
- XDefineCursor(xnestDisplay,
- xnestDefaultWindows[pScreen->myNum],
- xnestCursor(pCursor, pScreen));
- return True;
-}
-
Bool
xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
@@ -192,15 +139,17 @@ xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed)
&fg_color, &bg_color);
}
-Bool
-xnestSetCursorPosition(ScreenPtr pScreen, int x, int y, Bool generateEvent)
+void xnestSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
{
- int i;
+ if (pCursor)
+ {
+ XDefineCursor(xnestDisplay,
+ xnestDefaultWindows[pScreen->myNum],
+ xnestCursor(pCursor, pScreen));
+ }
+}
- for (i = 0; i < xnestNumScreens; i++)
- XWarpPointer(xnestDisplay, xnestDefaultWindows[i],
- xnestDefaultWindows[pScreen->myNum],
- 0, 0, 0, 0, x, y);
-
- return True;
+void
+xnestMoveCursor (ScreenPtr pScreen, int x, int y)
+{
}
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c
index a36e0d8e8..69a3c208f 100644
--- a/hw/xnest/Events.c
+++ b/hw/xnest/Events.c
@@ -34,6 +34,7 @@ is" without express or implied warranty.
#include "Screen.h"
#include "XNWindow.h"
#include "Events.h"
+#include "mipointer.h"
CARD32 lastEventTime = 0;
@@ -41,6 +42,7 @@ void
ProcessInputEvents()
{
mieqProcessInputEvents();
+ miPointerUpdate();
}
int
@@ -131,11 +133,15 @@ xnestCollectEvents()
break;
case MotionNotify:
+#if 0
x.u.u.type = MotionNotify;
x.u.keyButtonPointer.rootX = X.xmotion.x;
x.u.keyButtonPointer.rootY = X.xmotion.y;
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
mieqEnqueue(&x);
+#endif
+ miPointerAbsoluteCursor (X.xmotion.x, X.xmotion.y,
+ lastEventTime = GetTimeInMillis());
break;
case FocusIn:
@@ -162,11 +168,15 @@ xnestCollectEvents()
pScreen = xnestScreen(X.xcrossing.window);
if (pScreen) {
NewCurrentScreen(pScreen, X.xcrossing.x, X.xcrossing.y);
+#if 0
x.u.u.type = MotionNotify;
x.u.keyButtonPointer.rootX = X.xcrossing.x;
x.u.keyButtonPointer.rootY = X.xcrossing.y;
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
mieqEnqueue(&x);
+#endif
+ miPointerAbsoluteCursor (X.xcrossing.x, X.xcrossing.y,
+ lastEventTime = GetTimeInMillis());
xnestDirectInstallColormaps(pScreen);
}
}
diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c
index 042a29f6e..4ccc0b916 100644
--- a/hw/xnest/GCOps.c
+++ b/hw/xnest/GCOps.c
@@ -310,5 +310,16 @@ void
xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst,
int width, int height, int x, int y)
{
- ErrorF("xnest warning: function xnestPushPixels not implemented\n");
+ /* only works for solid bitmaps */
+ if (pGC->fillStyle == FillSolid)
+ {
+ XSetStipple (xnestDisplay, xnestGC(pGC), xnestPixmap(pBitmap));
+ XSetTSOrigin (xnestDisplay, xnestGC(pGC), x, y);
+ XSetFillStyle (xnestDisplay, xnestGC(pGC), FillStippled);
+ XFillRectangle (xnestDisplay, xnestDrawable(pDst),
+ xnestGC(pGC), x, y, width, height);
+ XSetFillStyle (xnestDisplay, xnestGC(pGC), FillSolid);
+ }
+ else
+ ErrorF("xnest warning: function xnestPushPixels not implemented\n");
}
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
index 2a4c7d1bb..b7cae839f 100644
--- a/hw/xnest/Keyboard.c
+++ b/hw/xnest/Keyboard.c
@@ -1,5 +1,5 @@
/* $Xorg: Keyboard.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xnest/Keyboard.c,v 1.2 2004/04/23 19:54:21 eich Exp $ */
/*
Copyright 1993 by Davor Matic
@@ -14,6 +14,7 @@ is" without express or implied warranty.
*/
/* $XFree86: xc/programs/Xserver/hw/xnest/Keyboard.c,v 1.9 2003/09/13 21:33:09 dawes Exp $ */
+
#define NEED_EVENTS
#include "X.h"
#include "Xproto.h"
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index 3412edfb8..8490a7995 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -124,6 +124,14 @@ static miPointerScreenFuncRec xnestPointerCursorFuncs =
miPointerWarpCursor
};
+static miPointerSpriteFuncRec xnestPointerSpriteFuncs =
+{
+ xnestRealizeCursor,
+ xnestUnrealizeCursor,
+ xnestSetCursor,
+ xnestMoveCursor,
+};
+
Bool
xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
{
@@ -241,27 +249,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
xnestHeight = gattributes.height;
}
- /* myNum */
- /* id */
- miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth,
- rootDepth,
- numDepths, depths,
- defaultVisual, /* root visual */
- numVisuals, visuals);
-
- miInitializeBackingStore(pScreen);
-
- miDCInitialize(pScreen, &xnestPointerCursorFuncs);
-
- pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay,
- DefaultScreen(xnestDisplay)) /
- DisplayWidth(xnestDisplay,
- DefaultScreen(xnestDisplay));
- pScreen->mmHeight = xnestHeight * DisplayHeightMM(xnestDisplay,
- DefaultScreen(xnestDisplay)) /
- DisplayHeight(xnestDisplay,
- DefaultScreen(xnestDisplay));
-
pScreen->defColormap = (Colormap) FakeClientID(0);
pScreen->minInstalledCmaps = MINCMAPS;
pScreen->maxInstalledCmaps = MAXCMAPS;
@@ -282,7 +269,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
/* Random screen procedures */
- pScreen->CloseScreen = xnestCloseScreen;
pScreen->QueryBestSize = xnestQueryBestSize;
pScreen->SaveScreen = xnestSaveScreen;
pScreen->GetImage = xnestGetImage;
@@ -324,16 +310,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
pScreen->RealizeFont = xnestRealizeFont;
pScreen->UnrealizeFont = xnestUnrealizeFont;
- /* Cursor Procedures */
-
- pScreen->ConstrainCursor = xnestConstrainCursor;
- pScreen->CursorLimits = xnestCursorLimits;
- pScreen->DisplayCursor = xnestDisplayCursor;
- pScreen->RealizeCursor = xnestRealizeCursor;
- pScreen->UnrealizeCursor = xnestUnrealizeCursor;
- pScreen->RecolorCursor = xnestRecolorCursor;
- pScreen->SetCursorPosition = xnestSetCursorPosition;
-
/* GC procedures */
pScreen->CreateGC = xnestCreateGC;
@@ -356,6 +332,31 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA;
pScreen->blockData = NULL;
pScreen->wakeupData = NULL;
+ /* myNum */
+ /* id */
+ miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth,
+ rootDepth,
+ numDepths, depths,
+ defaultVisual, /* root visual */
+ numVisuals, visuals);
+
+/* miInitializeBackingStore(pScreen); */
+
+ miPointerInitialize (pScreen, &xnestPointerSpriteFuncs,
+ &xnestPointerCursorFuncs, True);
+
+ pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay,
+ DefaultScreen(xnestDisplay)) /
+ DisplayWidth(xnestDisplay,
+ DefaultScreen(xnestDisplay));
+ pScreen->mmHeight = xnestHeight * DisplayHeightMM(xnestDisplay,
+ DefaultScreen(xnestDisplay)) /
+ DisplayHeight(xnestDisplay,
+ DefaultScreen(xnestDisplay));
+
+ /* overwrite miCloseScreen with our own */
+ pScreen->CloseScreen = xnestCloseScreen;
+
if (!miScreenDevPrivateInit(pScreen, xnestWidth, NULL))
return FALSE;
diff --git a/hw/xnest/XNCursor.h b/hw/xnest/XNCursor.h
index b396c80b5..8684a5e7f 100644
--- a/hw/xnest/XNCursor.h
+++ b/hw/xnest/XNCursor.h
@@ -27,14 +27,9 @@ typedef struct {
#define xnestCursor(pCursor, pScreen) \
(xnestCursorPriv(pCursor, pScreen)->cursor)
-void xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox);
-void xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox,
- BoxPtr pTopLeftBox);
-Bool xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
Bool xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
-void xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed);
-Bool xnestSetCursorPosition(ScreenPtr pScreen, int x, int y,
- Bool generateEvent);
+void xnestSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y);
+void xnestMoveCursor (ScreenPtr pScreen, int x, int y);
#endif /* XNESTCURSOR_H */
diff --git a/hw/xwin/ChangeLog b/hw/xwin/ChangeLog
index e87adda6c..2f5584cc0 100644
--- a/hw/xwin/ChangeLog
+++ b/hw/xwin/ChangeLog
@@ -7,6 +7,17 @@
fUseUnicode, because it don't mean wheather Windows support
Unicode or not.
+2004-07-31 Alexander Gottwald <ago@freedesktop.org>
+
+ * win.h:
+ adjust prototype for winInitCmapPrivates to match Egberts change.
+
+2004-07-30 Egbert Eich <eich@freedesktop.org>
+
+ * winallpriv.c: (winInitCmapPrivates):
+ test if colormap with index really exists in the list of
+ installed maps before using it.
+
2004-07-09 Alexander Gottwald <ago@freedesktop.org>
* winconfig.c: Add entry for irish layout (ie)
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 63a13be32..673a0aa98 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -375,7 +375,7 @@ OsVendorInit (void)
}
LogSetParameter (XLOG_FLUSH, 1);
LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose);
- LogSetParameter (XLOG_FILE_VERBOSITY, g_iLogVerbose);
+ LogSetParameter (XLOG_FILE_VERBOSITY, 1);
/* Log the version information */
if (serverGeneration == 1)
@@ -578,6 +578,10 @@ ddxUseMsg(void)
MB_ICONINFORMATION);
}
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+}
#ifdef DDXTIME /* from ServerOSDefines */
CARD32
diff --git a/hw/xwin/README b/hw/xwin/README
new file mode 100644
index 000000000..219fd1337
--- /dev/null
+++ b/hw/xwin/README
@@ -0,0 +1,141 @@
+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)
+
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 46ccb7884..3660b9623 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -719,7 +719,7 @@ Bool
winAllocatePrivates (ScreenPtr pScreen);
Bool
-winInitCmapPrivates (ColormapPtr pCmap);
+winInitCmapPrivates (ColormapPtr pCmap, int index);
Bool
winAllocateCmapPrivates (ColormapPtr pCmap);
diff --git a/hw/xwin/winallpriv.c b/hw/xwin/winallpriv.c
index 8fca13926..2c85645c7 100644
--- a/hw/xwin/winallpriv.c
+++ b/hw/xwin/winallpriv.c
@@ -116,7 +116,7 @@ winAllocatePrivates (ScreenPtr pScreen)
*/
Bool
-winInitCmapPrivates (ColormapPtr pcmap)
+winInitCmapPrivates (ColormapPtr pcmap, int index)
{
#if CYGDEBUG
winDebug ("winInitCmapPrivates\n");
@@ -129,7 +129,9 @@ winInitCmapPrivates (ColormapPtr pcmap)
* anything. Perhaps I am misunderstanding the purpose
* of this function.
*/
-
+ /* That's definitely true.
+ * I therefore changed the API and added the index as argument.
+ */
return TRUE;
}